Code: Select all
set badnicks [list "*word1*" "*word2*" "*word3*"]
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 :Bad nick detected."
break
}
}
}
}
Code: Select all
set badnicks [list "*word1*" "*word2*" "*word3*"]
bind join - * ban:bnick
bind nick - * ban:bnick
proc ban:bnick {nick uhost hand chan {nn ""}} {
global badnicks
set bbanmask "*$nick*!*@*"
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 :Bad nick detected."
break
}
}
}
}
Code: Select all
set badnicks [list \
"sex" \
"s3x" \
"{" \
"["
]
set bnduration 1m
set badnickreason "Don't use offensive words in your nick.."
bind join - * filter_bad_nicks
bind nick - * filter_bad_nicks
proc filter_bad_nicks {nick uhost hand channel} {
global badnicks badnickreason banmask botnick bnduration
set handle [nick2hand $nick]
set banmask "*$nick*!*@*"
foreach badnick [string tolower [split $badnicks]] {
if {[string match -nocase *$badnick* $nick]} {
if {[matchattr $handle +f]} {
putlog "-Anti Bad Nick Script- $nick ($handle) with +f joined $channel"
puthelp "PRIVMSG $channel :Ohh, aren't you so cool with that naughty nick, $nick..<eyeroll>"
} elseif {[matchattr $handle +o]} {
putlog "-Anti Bad Nick Script- $nick ($handle) with +o flags joined $channel"
puthelp "PRIVMSG $channel :Ohh, aren't you so cool with that naughty nick, $nick..<eyeroll>"
} else {
putlog "-Anti Bad Nick Script- KICKED $nick on joining $channel"
putquick "KICK $channel $nick :$badnickreason"
newchanban $channel $banmask $botnick $badnickreason $bnduration
}
}
}
}
Code: Select all
set badnicks {
"sex"
"s3x"
"{"
"["
}
Code: Select all
set badnicks {
"sex"
"s3x"
"{"
"["
}
actually it doesn't work on nicks, but on realnames, channels joined, and server nameAlchera wrote:Try examining xchannel.tcl by demond for inspiration.
Code: Select all
tag when posting logs, code
Code: Select all
tag when posting logs, code
Code: Select all
set badnicks "\
sex \
s3x \
\{ \
\\ \
\[ \
\] \
\}
"
set bnduration 1m
### Set Your Ban Reason
set badnickreason "Bad nick."
bind join - * filter_bad_nicks
bind nick - * filter_bad_nicks
proc filter_bad_nicks {nick uhost hand channel {nn ""}} {
global badnicks badnickreason banmask botnick bnduration
if {$nn == ""} { set nn $nick }
set handle [nick2hand $nick]
set banmask "*$nick*!*@*"
if {![isbotnick $nick]} {
foreach badnick [string tolower [split $badnicks]] {
if {[string match -nocase *$badnick* $nn] == 1} {
if {([matchattr $handle +f] == 1) || ([matchattr $handle +o] == 1)} {
puthelp "PRIVMSG $channel :Ohh, aren't you so cool with that naughty nick, $nick..<eyeroll>"
return 0
} else {
putquick "KICK $channel $nick :$badnickreason"
newchanban $channel $banmask $botnick $badnickreason $bnduration
}
}
}
}
}