if the same message delivers to bot's private in 20 seconds three times, i want bot to add the message to spamfilter. This is similar with repeat protection on channel, but
the differnce between them is it doesnt matter the message sender dont have to be same nick.
i worked hard but i was not able to write the code..
Could you please help me?
bind msgm - * repeat:spam
proc repeat:spam {nick uhost hand arg} {
global spamRepeat
set SpamMsg $arg
if {![info exists spamRepeat([set m [md5 [string tolower $arg]]])]} {
set spamRepeat($m) 0
}
if {[incr spamRepeat($m)] >= 3 && [lsearch -exact $SpamMsg [string tolower $arg]] == -1} {
lappend SpamMsg [string tolower $arg]
putserv "SPAMFILTER add cpnNa gzline 30h advertising $arg"
}
utimer 20 [list sr:decr $m]
}
proc sr:decr m {
global spamRepeat
if {[info exists spamRepeat($m)]} {
incr spamRepeat($m) -1
if {$spamRepeat($m) <= 0} {unset spamRepeat($m)}
}
}
i changed code to this type. it worked, but it is working if the message length more than one word. but it must work even the message length one word.. What should i do?