I need help in this small script please.
This tcl script kick/ban a certain nick on changed. I want the script also to kick/ban a same nick on join with ban time, and on specific channels.
such as:
set bandnickchan "#chan1 #chan2"
Thank you.
## code ##
## Badnick scans
set badnicks {
"[censored]"
"bitch"
"asshole"
}
bind nick - * Detected_changebad
proc Detected_changebad {nick uhost hand chan newnick} {
global badnicks botnick
if {(![matchattr $hand b]) && ($nick != $botnick)} {
foreach badchange [string tolower $badnicks] {
if {[string match *$badchange* [string tolower $newnick]]} {
set banmask "*!*[string range $uhost [string first "@" $uhost] end]"
putserv "MODE $chan +b $banmask"
putserv "KICK $chan $newnick :Please do not use Badnick on this channel"
return 0
}
}
}
}