mIRC Homepage
Posted By: gameforce spam again :( - 22/05/06 08:50 PM
Definition:
Spam witch is consisted from mainly same words by spam bots in great numbers with time pause.
Because of that pause regular script cannot detect spam.
Simple solution is:
Detect word(s) from table and moderate channel for period of time(+m for eg 240 sec)
Problem:
How to write that?
Adding new word(s) in table
Executive on selected channels.

Thanks in advance
Posted By: Riamus2 Re: spam again :( - 23/05/06 10:55 PM
Your best option might be to get a script that's already made for handling spam. But, if you want something to handle a particular type of spam message...

Code:
on @*:text:*:#: {
  if (*click here for porn* iswm $1-) { Spammer $nick $chan }
  elseif (*here is sex* iswm $1-) { Spammer $nick $chan }
}
alias Spammer {
  ban $2 $address($1,2)
  kick $2 $1 Spammer!
  mode $2 +m
  .timermoderated.timer 1 240 { mode $2 -m }
}


* Note that you can stick the if/elseif lines together using || (or). I left them separate to make it easier to see and understand.
Posted By: gameforce Re: spam again :( - 25/05/06 11:27 PM
Something like that smile Thanks!
Just instead one word "click here for porn" I need table with pre-definited words and no need for kick-ban (they leave as soon as +m is apply)
Due to many bot flood at the same time in one sec (sometimes as many as 20-30) script reaction is to send 20-30 +m frown
so probably need "halt" at end of line to stop execute ?
Posted By: Riamus2 Re: spam again :( - 26/05/06 05:36 PM
Ok, try this...

Code:
on *:start: {
  LoadBadWords
}

on @*:text:*:#: {
  var %c = 1
  while ($hget(BadWords,%c) != $null) {
    if ($hget(BadWords,%c) isin $1-) { Spammer $nick $chan | return }
    inc %c
  }
}
alias Spammer {
  if (m !isin $chan($2).mode) {
    mode $2 +m
    .timermoderated.timer 1 240 { mode $2 -m }
  }
}

alias LoadBadWords {
  if (!$hget(BadWords,0).item) {
    hmake BadWords 10
    hload BadWords BadWords.txt
  }
}

alias AddWords {
  LoadBadWords
  hadd BadWords $calc($hget(BadWords,0).item + 1) $?="Enter a word or phrase"
  hsave BadWords BadWords.txt
}


To add words, just type /AddWords and then enter the word or phrase. Keep doing this until you have all the words you want to use.

Note that because this is set to load the hash table when you start mIRC, you'll either need to restart mIRC after loading this script, or else use /AddWords as that will also load up the table. Or, you can just type /LoadBadWords ... any of those methods will work. If you just load the script and don't use any of those 3 things, you'll get errors. I could have added it to load in other ways, but it's not really worth it as this is only going need that one time. After that, you'll always be starting mIRC, so it isn't a problem.

Any questions, just ask.

PS> I didn't script anything to delete a word or phrase... to do so, just open BadWords.txt (in your mIRC folder) and remove the word/phrase *AND* the number that is on the line *above* it. If you don't remove the number, it will cause problems.
Posted By: gameforce Re: spam again :( - 26/05/06 11:53 PM
Thanks for the quick reply and help with this issue.
I'll try this code emediatly!

smile smile smile
© mIRC Discussion Forums