### Set Bad Words that you want the Bot to Kick on
set advwords {
blq
blq blq
blq blq blq
}
### Set Words that you want the Bot to EXEMPT (Dont count as spam)
set advexemptwords {
"apniisp"
"#channel"
}
### Set Your Ban Reason
set advreason "Some Reason"
### Set Ban Time
set advduration 24h
### Begin Script:
## (Don't change anything below here... Unless you know tcl)
proc ccodes:filter {str} {
regsub -all -- {\003([0-9]{1,2}(,[0-9]{1,2})?)?|\017|\037|\002|\026|\006|\007} $str "" str
return $str
}
## Binding all Public Messages to our Process
bind pubm - * filter_advertisement
## Starting Process
proc filter_advertisement {nick uhost handle channel args} {
global advwords advreason banmask botnick advduration advexemptwords
set args [ccodes:filter $args]
set handle [nick2hand $nick]
set banmask "*![lindex [split $uhost @] 0]@[lindex [split $uhost @] 1]"
foreach advword [string tolower $advwords] {
if {[string match *$advword* [string tolower $args]]} {
foreach advexemptword [string tolower $advexemptwords] {
if {![string match *$advexemptword* [string tolower $args]]} {
if {[matchattr $handle +f]} {
putlog "Protected: $nick ($handle) "
} elseif {[matchattr $handle +o]} {
putlog "Protected: $nick ($handle) "
} else {
putlog "KICKED $nick matched by $args"
putquick "KICK $nick :$advreason"
}
}
}
}
}
}
bind pubm - * filter_advertisement
The tcl work good.. but he detect the word only when they are public msg. I wanna make the tcl to detect the word in NOTICE, PRIVATE , PART MSG, ACTION. If anyone know how to do this..
thanks in advanced..