Code: Select all
bind join - * bad:whois
bind raw - 319 bad:chan:chk
# Set your Bad channel kicker's CHANNELS here (Type in lower case)
set bchan_chans "#Kickerchan"
# Set your Bad channel kicker's KICK MSG here
set bchan_kmsg "You are on a bad channel"
######### Stop editing here, unless u know how to #####
set badchanwrds "#badchannel1 badchannel2 badchannel3"
proc bad:whois {n h c a} {
global join_ctr
if {[isbotnick $n]} {return 0}
set c [string tolower $c]
if {[matchattr $h f]} {return 0}
putserv "WHOIS $n"
if {![info exists join_ctr($c)]} {set join_ctr($c) 0}
incr join_ctr($c) 1
if {$join_ctr($c) >= "5"} {
set join_ctr($c) 1
if {[catch {unbind join - * bad:whois}]} {}
utimer 2 whois:reset
}
}
proc whois:reset {} {
bind join - * bad:whois
}
set colore {([\002\017\026\037]|[\003]{1}[0-9]{0,2}[\,]{0,1}[0-9]{0,2})}
proc bad:chan:chk {from mask args} {
global badchanwrds colore
set args [split $args]
set nick [lindex $args 1]
set listchans [lrange $args 2 end]
regexp -- {^:?(.*)$} [join $listchans] -> text
set text [split $text]
regsub -all $colore $text {} text
foreach txt $text {
foreach bw $badchanwrds {
if {[string match -nocase "$bw" "$txt"]} {
badchan:kick $nick
break
}
}
}
}
proc badchan:kick {nick} {
global bchan_chans bchan_bantime bchan_kmsg
foreach chan $bchan_chans {
if {[onchan $nick $chan]} {
if {([isop $nick $chan]) || (![botisop $chan])} {return 0}
set bmask [getchanhost $nick $chan] ; set bmask [lindex [split $bmask @] 1]
putquick "MODE $chan +b *!*@$bmask" -next
putquick "KICK $chan $nick : $bchan_kmsg" -next
return 0
}
return 0
}
}
foreach c $bchan_chans {
set join_ctr($c) 0
}
array set join_ctr {}
be listed.
I mean the user should know for which bad channel he got kicked.