Here is the code
Code: Select all
# color.tcl
set color(chan) "#chan"
set color(kickmsg) "NO colors allowed here!"
set color(bantime) "60"
### END CFG ###
bind pubm - * s:color
proc s:color {nick uhost hand chan text} {
global botnick color
if {[matchattr $hand of|of $chan] || [isop $nick $chan] || [isvoice $nick $chan]} { return 0 }
if {(([lsearch -exact [string tolower $color(chan)] [string tolower $chan]] != -1) || ($color(chan) == "*")) && (![matchattr $hand b]) && ($nick != $botnick)} {
if {[string match *\003* $text]} {
if {[regexp {(?i)(http://|www\.|\s#\w|^#\w)} $text]} {
return 1
} else {
ban $nick $uhost $hand $chan $text
}
return 0
}
}
}
proc ban {nick uhost hand chan text} {
global botnick color
set ban "*!*@[lindex [split $uhost @] 1]"
newchanban $chan $ban color $color(kickmsg) $color(bantime)
putquick "KICK $chan $nick :$color(kickmsg)"
return 1
}
putlog "color.tcl loaded!"
Now the problem:
This is not the way I want the code to work!! When the user typed "#test" (with the red color) the reaction should be null ( return 1 )(05:19:29) * Joins: teste1 (~test@127.0.0.1)
(05:19:35) <teste1> #test
(05:19:35) * |EGG sets mode: +b *!*@127.0.0.1
(05:19:35) * teste1 was kicked by |EGG (NO colors allowed here!)
This is the wright way for this code to work
What's the bug ?!(05:29:29) * Joins: teste1 (~test@127.0.0.1)
(05:29:35) <teste1> #test
..... no banning ( the above text normaly will activate the chan/web advertise script )
(05:29:46) <teste1> color test
(05:29:46) * |EGG sets mode: +b *!*@127.0.0.1
(05:29:46) * teste1 was kicked by |EGG (NO colors allowed here!)
..... do the ban ( corect order )
Any ideas how to fix it ? .... ( hope so )