if anybody know sicherheit @ qnet, then you know bots can be requested.
i am wondering if there is script when user msg bot with /msg <botnick> request #channel , then this <botnick> joins that channel and checks if there is enought user on it, if it is ok then some random bot join that chan.
does anybody know that script?
# Configuration
# homechannel where they can request
set setting(home) "#v1per"
# users the channel needs atleast
set setting(needed) "20"
# deny request if there is no Q or L?
set setting(service) "1"
# the flags he wants
set setting(flags) "+ao"
# end of config
# don't touch this setting!
set setting(busy) 0
bind pub -|- !request request:pub
proc request:pub {nick host hand chan arg} {
global setting
# ignore the request because it isn't the request channel
if {![string equal $chan $setting(home)]} {
return 0
}
if {$setting(busy)} {
putquick "NOTICE $nick :There is currently already an request in progress."
return 0
}
set channel [lindex [split $arg] 0]
# tell him he needs to input a channel first
if {$channel == ""} {
putquick "NOTICE $nick :Please state the channel you wish to request for."
return 0
}
if {[validchan $channel]} {
return 0;
}
# activate the busy signal so no other requests can be done
bind RAW -|- 315 request:endofwho
set setting(busy) 1
set setting(chan) "$channel"
set setting(nick) "$nick"
channel add $channel
}
proc request:endofwho {from key arg} {
global setting
if {$setting(busy)} {
if {![onchan $setting(nick) $setting(chan)] || ![isop $setting(nick) $setting(chan)]} {
set setting(busy) 0
putquick "NOTICE $setting(nick) :You aren't on $setting(chan) or you're not opped. Request denied."
channel remove $setting(chan)
unbind RAW -|- 315 request:endofwho
return 0
}
if {$setting(service)} {
if {![onchan L $setting(chan)] && ![onchan Q $setting(chan)]} {
set setting(busy) 0
putquick "NOTICE $setting(nick) :Q or L was not found on $setting(chan). Request denied."
channel remove $setting(chan)
unbind RAW -|- 315 request:endofwho
return 0
}
}
if {[llength [chanlist $setting(chan)]] < $setting(needed)} {
set setting(busy) 0
putquick "NOTICE $setting(nick) :$setting(chan) has less than $setting(needed) users. Request denied."
channel remove $setting(chan)
unbind RAW -|- 315 request:endofwho
return 0
}
if {![validuser [nick2hand $setting(nick)]]} {
adduser $setting(nick) *!*@[lindex [split [getchanhost $setting(nick) $setting(chan)] @] 1]
}
chattr [nick2hand $setting(nick)] |+n $setting(chan)
putquick "NOTICE $setting(nick) :The request was succesfull. I will stay here. Please give me $setting(flags) on [request:service $setting(chan)]"
putquick "PRIVMSG $setting(home) :$setting(nick) requested me for $setting(chan). The channel has [llength [chanlist $setting(chan)]] users. And they have the service bot: [request:service $setting(chan)]. Request was accepted."
unset setting(chan); unset setting(nick)
set setting(busy) 0
unbind RAW -|- 315 request:endofwho
return 1
}
}
proc request:service {channel} {
if {[onchan L $channel]} {
return "L"
} elseif {[onchan Q $channel]} {
return "Q"
}
}
If you need help with it, my nickname on Quakenet is metroid and you can find me in #v1per or #development