i have modified a given script that checks for badrealnames on join, so that the script should check on away messages in whois.
the whois-proc works fine, but it doesn´t set the ban that shall be imposed if the whois-output triggering one of the search-terms.....
Code: Select all
# awaycheckonjoin.tcl
# original code by papillon & caesar
# modified by elgringo
# version 0.1
# Wich Awaymessages should be banned?
set bada(list) {
"*sex*"
"FREE"
}
# wich channels to monitor?
set bada(chan) "#germany"
# how long lasts the ban (in minutes)
set bada(time) 5
# wich banmessage should be set?
set bada(reason) "No Drones!"
##No MODs under this line except u know what you´re doing
bind join - "$bada(chan) *" away:join
bind raw - 301 away:check
#join
proc away:join {nick host hand chan args} {
if {[strlwr $nick] == [strlwr $::botnick] || [matchattr $hand of|fo $chan]} {
return
}
putserv "WHOIS $nick"
}
#check
proc away:check {from key arg} {
set awy [strlwr [ctrl:filter [lindex [lrange [split $arg ":"] 1 end] 9]]]
foreach bla $::bada(list) {
if {![string match -nocase $bla $awy]} {
continue
}
newchanban $::bada(chan) "*!*@[lindex [split $arg] 3]" $::botnick $::bada(reason) $::bada(time)
break
}
}
##
# ppslim's filter
proc ctrl:filter {str} {
regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $str "" str
return $str
}
putlog "badaway.tcl by elgringo loaded."
thank u beforehand

Regards
mesqal