What I am trying to achieve is for incomming msg. I want this script tokenize each word in a msg window to see if any word in the text is in a hash table of spam words. any input as to what I have done wrong or how to correct the problem would be greatly appreciated.
Code:
[color:red]
on *:text:*:?: {
set %a $strip($1-,burc)
set %ac $findtok(%a,0,32)
while %i <= %ac {
if $hfind(spam,%a,1,W).data {
close -cm $nick
}
dec %i
}
}
[/color]
Intelligence: It's better to ask a stupid question, then to prove it by not asking....
You aren't using the W switch like you're supposed to. The purpose of W is exactly to avoid what you have: a while loop. See this for the correct usage. Just replace $hmatch(table,text,1) with $hfind(table,text,1,W).
I was storing the words as data. Spamers are using long messages with control codes and a majority of the spam scripts I have seen do not Pick up on the text
Intelligence: It's better to ask a stupid question, then to prove it by not asking....
My scripts performs that feature and I found it was easier to store the words separately as items or as data with a reference number for the item.
You'll probably want to enclose the bad words/phrases with wildcards (i.e.: *hell* or *check out http* ) else it likely won't be detected unless it is the only word/phrase said to the channel.
Note on above: If you use an mIRC version before 6.03 it won't recognize the difference between 'W' and 'w' which results in a match when somebody types only an asterisk. This doesn't happen in v6.03
Those who live by the sword get shot by those who don't.