Anti-Spam

By X1qu10n3r on Jan 22, 2007

This just basicly blocks spam...you can add or delete words, or edit them too, it comes with a dialog. just copy and paste it in your remotes.

dialog antispam {
  title "Anti-Spam [/aspam]"
  size -1 -1 290 243
  option pixels notheme
  list 1, 2 20 288 100
  button "Add", 2, 2 107 46 20
  button "Edit", 3, 50 107 46 20
  button "Remove", 4, 98 107 46 20
  check "Enable", 5, 192 107 54 18
  text "Words", 7, 2 6 100 12
  box "", 6, 0 126 290 8
  text "Penalty...", 8, 2 138 50 18
  check "Ignore for", 9, 2 161 68 18
  edit "", 10, 72 161 47 20
  text "Second(s)", 11, 122 161 49 17
  check "Kick", 12, 2 183 40 17
  check "Kick + Ban", 13, 2 204 73 17
  check "All above", 14, 2 225 66 17
  button "OK", 15, 237 220 50 20
}

on *:dialog:antispam:*:*: {
  if ($devent == init) {
    if (!$read(awords.txt)) { write awords.txt }
    if ($lines(awords.txt) == 0) { write -l1 awords.txt None | write -l2 awords.txt 60 }
    if ($chr(42) isin $read(awords.txt,1)) { write -l1 awords.txt None }
    if ($chr(42) isin $read(awords.txt,2)) { write -l2 awords.txt 60 }
    if ($group(#antispam) == on) { did -c $dname 5 }
    if ($read(awords.txt,1) == ignore) { did -c $dname 9 }
    if ($read(awords.txt,1) == kick) { did -c $dname 12 }
    if ($read(awords.txt,1) == kickban) { did -c $dname 13 }
    if ($read(awords.txt,1) == all) { did -c $dname 14 }
    did -ra $dname 10 $iif($chr(42) !isin $read(awords.txt,2),$read(awords.txt,2),60)
    aspam.refresh
  }
  if ($devent == sclick) {
    if ($did == 2) {
      var %a $$input(Add a word:,eo,Add)
      write awords.txt %a
      aspam.refresh
    }
    if ($did == 3) {
      if (!$did($dname,1).seltext) { var %a $$input(Please select a word!,o,Error) }
      else {
        var %a $$input(Edit word:,eo,Edit,$remove($did($dname,1).seltext,*))
        write -l $+ $calc($did($dname,1).sel + 2) awords.txt %a
        aspam.refresh
      }
    }
    if ($did == 4) {
      if (!$did($dname,1).seltext) { var %a $$input(Please select a word!,o,Error) }
      else {
        write -dl $+ $calc($did($dname,1).sel + 2) awords.txt
        aspam.refresh
      }
    }
    if ($did == 5) {
      if ($did($dname,5).state == 0) { .disable #antispam }
      if ($did($dname,5).state == 1) { .enable #antispam }
    }
    if ($did == 9) {
      if ($did($dname,9).state == 0) { write -l1 awords.txt none }
      if ($did($dname,9).state == 1) { did -u $dname 12,13,14 | write -l1 awords.txt ignore }
    }
    if ($did == 12) {
      if ($did($dname,12).state == 0) { write -l1 awords.txt none }
      if ($did($dname,12).state == 1) { did -u $dname 9,13,14 | write -l1 awords.txt kick }
    }
    if ($did == 13) {
      if ($did($dname,13).state == 0) { write -l1 awords.txt none }
      if ($did($dname,13).state == 1) { did -u $dname 12,9,14 | write -l1 awords.txt kickban }
    }
    if ($did == 14) {
      if ($did($dname,14).state == 0) { write -l1 awords.txt none }
      if ($did($dname,14).state == 1) { did -u $dname 12,13,9 | write -l1 awords.txt all }
    }
    if ($did == 15) {
      write -l2 awords.txt $did($dname,10).text
      dialog -x antispam antispam
    }
  }
}
#antispam on
on *:text:*:#: {
  var %x 1
  while (%x <= $lines(awords.txt)) {
    if ($read(awords.txt,%x) isin $1-) {
      if ($read(awords.txt,1) == ignore) { ignore -u $+ $read(awords.txt,2) $nick }
      if ($read(awords.txt,1) == kick) { kick # $nick Spamming Deteced }
      if ($read(awords.txt,1) == kickban) { mode # +b $address($nick,4) | kick # $nick Spamming Detected }
      if ($read(awords.txt,1) == all) { ignore -u $+ $read(awords.txt,2) $nick | mode # +b $address($nick,4) | kick # $nick Spamming Detected }
      inc %x
    }
    inc %x
  }
}
#antispam end

alias aspam {
  dialog -m antispam antispam
}

alias aspam.refresh {
  if ($dialog(antispam)) { 
    did -r antispam 1
    var %x 3
    while (%x <= $lines(awords.txt)) {
      did -a antispam 1 $+(*,$read(awords.txt,%x),*)
      inc %x
    }
  }
}

menu * {
  Anti-Spam
  .Add Word: var %a $$input(Add a word to the spam blocker:,eo,Add) | write awords.txt %a | aspam.refresh
  .Anti-Spam:dialog -m antispam antispam
  .-
  . $iif($group(#antispam) == on,$style(1) Enabled,Enabled): enable #antispam
  . $iif($group(#antispam) == off,$style(1) Disabled,Disabled): disable #antispam
}

Comments

Sign in to comment.
Daniel_   -  Jan 28, 2007

good work Dave ;0

 Respond  
F*U*R*B*Y*   -  Jan 24, 2007

it is, its also scary :P

 Respond  
X1qu10n3r   -  Jan 24, 2007

ahh thank you darthreven much appreaciated, will update soon.

and that\'s a weird coincidence FURBY*

 Respond  
F*U*R*B*Y*   -  Jan 23, 2007

no its just that photo looks just like display picture on MSN and i\'ve helped him out with a script like this one..... coincidence :P then :P

 Respond  
X1qu10n3r   -  Jan 23, 2007

No, I don\'t. Does someone there have my nick?

 Respond  
F*U*R*B*Y*   -  Jan 23, 2007

hey you don\'t go on a server called SNM using nickname Prodigy do you?

 Respond  
DarthReven   -  Jan 23, 2007

Well if you not experenced with hash tables instead of looping threw the text file which can lag up your mIRC if it gets pretty big why not loop threw the line of text: ON :TEXT::#: { VAR %TOKENS $NUMTOK($STRIP($1-)) | WHILE (%TOKENS) { IF ($READ(AWORDS.TXT,s,$GETTOK($1-,%TOKENS,32)) { etc....

 Respond  
X1qu10n3r   -  Jan 22, 2007

yea, let\'s just say i\'m not that \"experienced\" with hash tables. :/

 Respond  
xDaeMoN   -  Jan 22, 2007

Try using hash tables for this :)

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.