set badnicks [list "*[censored]*" "*dyn_*" "*dyn_user*"]
bind join - * ban:bnick
bind nick - * ban:bnick
proc ban:bnick {nick uhost hand chan {nn ""}} {
global badnicks
set bbanmask "*!*@[lindex [split $uhost @] 1]"
if {$nn == ""} { set nn $nick }
if {![isbotnick $nick]} {
foreach badnick $badnicks {
if {[string match -nocase $badnick $nn]} {
putserv "MODE $chan +b $bbanmask"
putserv "KICK $chan $nick :Please Identify, before you enter this channel, and or make sure you auto-ident when you disconnect This ban will expire in 15 Minutes ."
break
}
}
}
}
Thats the code, yet, I want this to be for user defined channels such as
if {[lsearch -exact $bnchans $chan] == -1} {return 0}
inside your proc(s). Here ofcourse, bnchans should be globalized inside the proc and you would want to make the channels lower-case since [lsearch] is case-sensitive.
set badnicks [list "*[censored]*" "*dyn_*" "*dyn_user*"]
set bnchans {#aite}
bind join - * ban:bnick
bind nick - * ban:bnick
proc ban:bnick {nick uhost hand chan {nn ""}} {
if {[lsearch -exact $bnchans $chan] == -1} {return 0}
global badnicks
set bbanmask "*!*@[lindex [split $uhost @] 1]"
if {$nn == ""} { set nn $nick }
if {![isbotnick $nick]} {
foreach badnick $badnicks {
if {[string match -nocase $badnick $nn]} {
putserv "MODE $chan +b $bbanmask"
putserv "KICK $chan $nick :Please Identify, before you enter this channel, and or make sure you auto-ident when you disconnect This ban will expire in 15 Minutes ."
break
}
}
}
}