mIRC Home    About    Download    Register    News    Help

Topic Options
#149714 - 22/05/06 09:50 PM spam again :(
gameforce Offline
Self-satisified door

Registered: 22/05/06
Posts: 3
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

Top
#149715 - 23/05/06 11:55 PM Re: spam again :(
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#149716 - 26/05/06 12:27 AM Re: spam again :(
gameforce Offline
Self-satisified door

Registered: 22/05/06
Posts: 3
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 ?

Top
#149717 - 26/05/06 06:36 PM Re: spam again :(
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#149718 - 27/05/06 12:53 AM Re: spam again :(
gameforce Offline
Self-satisified door

Registered: 22/05/06
Posts: 3
Thanks for the quick reply and help with this issue.
I'll try this code emediatly!

smile smile smile

Top