mIRC Home    About    Download    Register    News    Help

Print Thread
#21598 30/04/03 06:05 AM
Joined: Dec 2002
Posts: 417
O
Othello Offline OP
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
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....
#21599 30/04/03 06:34 AM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Code:
on *:text:*:?:{
  var %t = $strip($1-),%w = $0
  while ( %w != 0 ) {
    if ( $hfind(spam,$gettok(%t,%w,32)) ) {
      close -cm $nick
      break
    }
    dec %w
  }
}


That presumes the spam words are stored as items, not as data.

#21600 30/04/03 09:50 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
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).


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#21601 30/04/03 03:51 PM
Joined: Feb 2003
Posts: 67
N
Naz Offline
Babel fish
Offline
Babel fish
N
Joined: Feb 2003
Posts: 67
It should also be noted that there is a difference between a capital 'W' and a lowercase 'w'.

w text is wildcard text
W hash table item/data is wildcard text



Those who live by the sword get shot by those who don't.
#21602 30/04/03 04:19 PM
Joined: Dec 2002
Posts: 417
O
Othello Offline OP
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
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....
#21603 01/05/03 05:03 AM
Joined: Feb 2003
Posts: 67
N
Naz Offline
Babel fish
Offline
Babel fish
N
Joined: Feb 2003
Posts: 67
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.

Link Copied to Clipboard