| View previous topic :: View next topic |
| Author |
Message |
CadeFoster Voice
Joined: 20 Nov 2006 Posts: 5
|
Posted: Mon Nov 20, 2006 8:10 pm Post subject: Need little help |
|
|
Hello. I need little help with this tcl
| Code: | ### 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.. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
| Back to top |
|
 |
CadeFoster Voice
Joined: 20 Nov 2006 Posts: 5
|
Posted: Tue Nov 21, 2006 7:31 am Post subject: |
|
|
| yeah... I know.. but I wanna know if have some way to edit this tcl.. please help... |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Nov 21, 2006 10:39 am Post subject: |
|
|
add these lines to the script:
| Code: | bind notc - * notc:adv
bind ctcp - ACTION act:adv
bind part - * part:adv
bind msgm - * msg:adv
proc notc:adv {n u h a c} {
filter_advertisement $n $u $h $c $a
}
proc act:adv {n u h c kw a} {
filter_advertisement $n $u $h $c $a
}
proc part:adv {n u h c a} {
filter_advertisement $n $u $h $c $a
}
proc msg:adv {n u h a} {
foreach c [channels] {
filter_advertisement $n $u $h $c $a
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
CadeFoster Voice
Joined: 20 Nov 2006 Posts: 5
|
Posted: Tue Nov 21, 2006 7:48 pm Post subject: |
|
|
| Thank You Sir_Fz ... |
|
| Back to top |
|
 |
|