Enigma Bot — File Browser

EnigmaBotv1.4 / EnigmaBotv1.4 / Enigma versione1_4 / Addons / antispam120 / antispam120.mrc

antispam120.mrc — 42.89 KB — Download this file

;#########################################################
;Anti-Spam Dialogs
;#########################################################

Dialog antispam {
  option dbu
  Title "Anti-Spam"
  Size -1 -1 179 139
  ;tab
  tab "main", 100, -18 -18 200 175
  tab "Parole", 101
  tab "Sistema", 102
  tab "Log", 103
  tab "Nick", 104
  tab "Operazione", 105
  tab "About", 106
  tab "Canali", 107
  ;menu
  Box "Setup" , 3 ,3 1 53 112
  Box "" , 10 ,58 1 118 134
  Radio "&Parole" , 4 ,5 9 48 14, push
  Radio "&Nick" , 7 ,5 27 48 14, push
  Radio "&Canali" , 1 ,5 44 48 14, push
  Radio "&Sistema" , 5 ,5 62 48 14, push
  Radio "&Operazione" , 8 ,5 79 48 14, push
  Radio "&Log" , 6 ,5 96 48 14, push
  Button "&Chiudi" , 9 ,4 115 51 20, ok
  ;word
  Edit "" 11 ,100 10 73 11, autohs, multi, tab 101
  Text "Tipologia:" 81,100 23 60 12, tab 101
  Combo 82,100 31 72 65, drop, tab101
  List 12 ,100 45 73 98, autohs, autovs, vsbar, hsbar, tab 101
  Button "&Agg." , 13 ,65 10 30 13, default, tab 101
  Button "&Rimuovi" , 14 ,65 40 30 13, tab 101
  Button "&Edit" , 15 ,65 55 30 13, tab 101
  Button "&Canc.tutto" , 16 ,65 70 30 13, tab 101
  Button "C&ambia",59,65 25 30 13, tab 101
  ;system
  Check "&Abilita Anti-Spam" , 18 ,63 13 60 7, tab 102
  Check "&Auto ON Anti-Spam dopo" , 19 ,63 23 70 7, tab 102
  Check "Abilita check for Nick Amici",84,63 33 90 7, tab 102
  Check "Abilita check for Canali Ignorati",85,63 43 95 7, tab 102
  Edit , 20 ,133 21 13 10, center, tab 102
  Text "minuti(s)" , 21 ,148 23 33 8, tab 102
  Text "Quando trovi una parola spam in query..." ,61,63 55 100 8, tab 102
  Check "&Chiudi query" ,62,63 65 58 8, tab 102
  Check "I&gnora Nick" ,63,63 74 40 8, tab 102
  Check "&Reportalo a tutti gli Op dei chan" ,64,63 83 70 8, tab 102
  Check "&Manda spam to #massads. (Webnet server)" ,65, 63 90 110 13, tab 102
  Check "Manda il messaggio in notice" ,66, 63 100 90 13, tab 102
  Edit ,67,63 115 108 11,autohs multi, tab 102
  ;log
  Check "&Abilita Logging" , 23 ,63 13 60 7, tab 103
  Check "&Resetta log alla connessione" , 26 ,63 23 70 7, tab 103
  Check "&Lancia Spam-Log Window alla connessione." , 70 ,63 33 105 7, tab 103
  ;nick
  List 28 ,100 25 73 108, autohs, autovs, hsbar, vsbar, tab 104
  Button "&Agg." , 29 ,65 10 30 13, default, tab 104
  Button "&Rimuovi" , 30 ,65 40 30 13, tab 104
  Button "&Edita" , 31 ,65 55 30 13, tab 104
  Button "&Canc.Tutto" , 32 ,65 70 30 13, tab 104
  Button "Cambia",60,65 25 30 13, tab 104
  Edit "" 33 ,100 10 73 11, autohs multi, tab 104
  ;operator
  Text "Quando trovi spam:" , 35 ,63 13 110 10, tab 105
  Radio "&Non fare nulla" , 36,68 23 98 6, tab 105
  Radio "&Kick" , 37 ,68 31 58 6, tab 105
  Radio "&Ban" , 38 ,68 39 53 6, tab 105
  Radio "B&an e Kick" , 39 ,68 47 55 6, tab 105
  Check "&Usa la ragione dell' anti-span." 53,63 65 90 7, tab 105
  Check "B&an per:" 86,63 75 30 7, tab 105
  Edit "" 87,93 73 16 10, center,tab 105
  Text "mins." 88,112 75 60 7, tab 105
  Text "Tipo Ban:" 91,127 46 30 7, tab 105
  Combo 89,152 43 20 80, drop,tab 105
  Text "",90,71 56 100 7,right,tab 105
  Text "Edita mess. di Kick",47,63 85 50 8, tab 105
  Edit ,48,63 93 108 11,autohs multi, tab 105
  Button "&Agg." , 49 ,64 105 30 13, default, tab 105
  Button "&Cambia" , 50 ,95 105 30 13, tab 105
  Button "Cancella" , 51 ,126 105 44 13, tab 105
  Combo 52,64 120 108 163,drop vsbar hsbar, tab 105
  ;channel
  Text "Note: solo se sei Op nel canale.",69,62 112 38 50,tab 107
  List 74 ,100 25 73 108, autohs, autovs, hsbar, vsbar, tab 107
  Button "&Agg." , 75 ,65 10 30 13, default, tab 107
  Button "&Rimuovi" , 76 ,65 40 30 13, tab 107
  Button "&Edit" , 77 ,65 55 30 13, tab 107
  Button "&Canc.tutto" , 78 ,65 70 30 13, tab 107
  Button "Cambia",79,65 25 30 13, tab 107
  Edit "" 80 ,100 10 73 11, autohs multi, tab 107
  ;about
  Text "Anti-Spam v12.0" ,40,63 20 50 8, tab 106
  Text "by kidd2k a.k.a BlueDragon" ,41,63 28 67 8, tab 106
  Text "For mIRC 5.91 32bit" ,42,63 36 60 8, tab 106
  Text "Thanks for using this addon." ,43,63 51 110 8, tab 106
  Text "War to end all war..." ,45,63 88 110 8, tab 106
  Text "Visit" ,83,63 120 10 8, tab 106
  Text "For help or bugs report, send e-mail to:" ,44,63 58 110 8, tab 106
  Link "alaigamerz@yahoo.com" , 46,63 65 100 12, tab 106
  Link "http://www.lye-rulz.com" ,73,74 120 70 12, tab 106
  Icon 68,133 7 40 40, $scriptdir $+ bluedragon.jpg, tab 106
}
Dialog input_sw {
  title "Anti-Spam inserimento Parole"
  size -1 -1 227 140
  Text "Inserisci le parole spam e la tipologia." 7,10 10 200 20
  Text "Parole:" 5,20 40 40 20
  Text "Tipo:" 6,20 69 40 20
  Edit "" , 1 , 60 35 145 22
  Combo 2 , 60 65 145 106,drop
  Button "OK" 3,39 100 75 25,default
  Button "Cancel" 4,114 100 75 25,cancel
}

;#########################################################
;Anti-Spam Aliases
;#########################################################

alias antispam if ($dialog(antispam) == $null) { dialog -m antispam antispam | as.showhide }
alias -l as.about { antispam | did -c antispam 106 | did -u antispam 4,5,6,7,8 | did -a antispam 10 About Anti-Spam... }
alias -l as.showhide {
  if (%as.lpush == WORD) { did -a antispam 10 Word manager | as.word.btn }
  elseif (%as.lpush == FRIEND) { did -a antispam 10 Lista Amici | as.nick.btn }
  elseif (%as.lpush == CHANNEL) { did -a antispam 10 Canali Ignorati (disable Anti-Spam actions) | as.chan.btn }
  elseif (%as.lpush == SYSTEM) { did -a antispam 10 Config.Generale | as.sys.btn }
  elseif (%as.lpush == OPERATOR) { did -a antispam 10 Config.Operazioni | as.op.btn }
  elseif (%as.lpush == LOG) { did -a antispam 10 Log Config. | as.log.btn }
  else { did -a antispam 10 About Anti-Spam... | as.about }
}
alias -l as.word.btn {
  if ((%as.start == 1) && (%as.lpush == WORD)) { did -f antispam 11 | %as.start = 0 | return }
  did -c antispam 4,101 | did -f antispam 11 | did -b antispam 14,15,59 | did -at antispam 13 &Add | %as.lpush = WORD
  did -a antispam 10 Word manager
}
alias -l as.sys.btn {
  if ((%as.start == 1) && (%as.lpush == SYSTEM)) { did -f antispam 67 | %as.start = 0 | return }
  did -cm antispam 5,102,67 | if (%as.en.nickcheck == 1) did -c antispam 84 | if (%as.en.igchancheck == 1) did -c antispam 85
  if (%as.sys.1 = 1) did -c antispam 62 | if (%as.sys.2 = 1) did -c antispam 63 | if (%as.sys.3 = 1) did -c antispam 64
  if (%as.sys.4 = 1) did -c antispam 65 | if (%as.sys.5 = 1) did -cn antispam 66,67 | did -raf antispam 67 %as.sys.say
  %as.lpush = SYSTEM | did -a antispam 10 Config.Generale
}
alias -l as.log.btn { if ((%as.start == 1) && (%as.lpush == LOG)) { %as.start = 0 | return } | did -c antispam 6,103 | %as.lpush = LOG | did -a antispam 10 Log Config. }
alias -l as.nick.btn {
  if ((%as.start == 1) && (%as.lpush == FRIEND)) { did -f antispam 33 | %as.start = 0 | return } | did -c antispam 7,104 | did -f antispam 33 | did -b antispam 30,31,60 | did -at antispam 29 &Add
  %as.lpush = FRIEND | did -a antispam 10 Lista Amici 
}
alias -l as.op.btn {
  if ((%as.start == 1) && (%as.lpush == OPERATOR)) {
    if (%as.op.sel == None) did -c antispam 36 | if (%as.op.sel == Kick) did -c antispam 37
    if (%as.op.sel == Ban) did -c antispam 38 | if (%as.op.sel == BanKick) did -c antispam 39
    did -f antispam 48 | %as.start = 0 | return
  }
  as.op.opt | as.quote.list | set %as.q.ledit 0 | did -c antispam 89 $calc(%as.bt.sel + 1)
  did -ra antispam 90 $mask(nick!ident@kbu-124-202.tm.net.my,%as.bt.sel)
  did -c antispam 8,105 | did -f antispam 48 | did -ra antispam 87 %as.unbantime
  if (%as.ownkick == 1) did -c antispam 53 | if (ban !isin %as.op.sel) did -b antispam 86,87,89
  if (%as.doban == 1) did -ec antispam 87,86 | else did -b antispam 87 | %as.lpush = OPERATOR | did -a antispam 10 Config.Operazioni
}
alias -l as.chan.btn {
  if ((%as.start == 1) && (%as.lpush == CHANNEL)) { did -f antispam 80 | %as.start = 0 | return }
  did -c antispam 1,107 | did -f antispam 80 | did -b antispam 76,77,79 | did -t antispam 75 | %as.lpush = CHANNEL
  did -a antispam 10 Canali ignorati (disabilita Anti-Spam)
}
alias -l as.word.add {
  set %as.dont1 0 | if ($dialog(antispam) == $null) { dialog -m input_sw input_sw | return }
  if ($did(antispam,11).text == $null) { did -b antispam 14,15,59 | did -fr antispam 11 | as.word.fresh | return }
  if (%as.word.add == $chr(104) $+ $chr(105)) return | if (($chr(36) isin %as.word.add) || ($chr(61) isin %as.word.add)) { did -f antispam 11 | return }
  set %as.tgtp $did(antispam,82,1).seltext | did -fr antispam 11 | did -e antispam 16 | did -r antispam 12 | did -b antispam 14,15,59
  write %as.spamw.dir $gettok(%as.word.add,1,61) $+ = $+ %as.tgtp | as.word.fresh | unset %as.word.add | return
}
alias -l as.word.chg {
  set %as.tgtp $did(antispam,82,1).seltext | if ($did(antispam,11).text == $null) { as.word.rem | return }
  did -b antispam 14,15,59 | did -o antispam 12 %as.word.sel $gettok(%as.word.add,1,61) $+ = $+ %as.tgtp
  write -l $+ %as.word.sel %as.spamw.dir $gettok(%as.word.add,1,61) $+ = $+ %as.tgtp | did -fr antispam 11 | unset %as.word.edit , %as.w.edit.tmp | %as.edit.w = No
}
alias -l as.word.rem {
  did -b antispam 14,15,59 | %as.rem.sel = $did(antispam,12).sel | if (%as.rem.sel == $null) return
  did -d antispam 12 %as.rem.sel | did -fr antispam 11 | did -at antispam 13 &Add | write -dl $+ %as.rem.sel %as.spamw.dir
  if ($lines(%as.spamw.dir) == 0) did -b antispam 14,15,16 | %as.edit.w = No
}
alias -l as.word.edit {
  did -fr antispam 11 | did -e antispam 59 | %as.word.sel = $did(antispam,12).sel | if (%as.word.sel == $null) return
  %as.word.edit = $read -l $+ %as.word.sel %as.spamw.dir | %as.word.add = $read -l $+ %as.word.sel %as.spamw.dir
  did -a antispam 11 $gettok(%as.word.edit,1,61) | %as.edit.w = Yes
}
alias -l as.word.fresh {
  set -u %_sw 0 | did -r antispam 12
  :loop | inc %_sw | %as.word.tmp = $read -l $+ %_sw %as.spamw.dir | did -a antispam 12 %as.word.tmp
  if (%as.word.tmp != $null) goto loop | if ($lines(%as.spamw.dir) == 0) { did -b antispam 14,15,16 }
  if ($lines(%as.friendn.dir) == 0) { did -b antispam 30,31,32 } | if (%as.dont1 == 1) { did -a antispam 82 Contiene... | did -a antispam 82 Inizia con... | did -a antispam 82 Finisce con... | did -a antispam 82 Altro... | did -c antispam 82 1 }
}
alias -l as.word.clr {
  if ($lines(%as.spamw.dir) == 0) return | set %as.w.clr.conf $input(Really want to clear all word?,128,- Anti-Spam) {
    if (%as.w.clr.conf == $null) { dialog -v antispam | return } | dialog -v antispam | did -r antispam 11 | did -r antispam 12 | did -at antispam 13 &Agg | write -c %as.spamw.dir
    %as.edit.w = No | if ($lines(%as.spamw.dir) == 0) { did -b antispam 14,15,16,59 } | did -f antispam 11
  }
}
alias -l as.log.view {
  if ($file(%as.filelog) == $null) { write %as.filelog Welcome to Anti-Spam v12.0 by kidd2k | write %as.filelog [[ Log file ]] | write %as.filelog $str(-,100) }
  if ($window(@SpamLog) == $null) { %as.en.log = Yes | window -nCk +nxstl @SpamLog 100 100 | loadbuf -p @SpamLog %as.filelog }
  else if ($window(@SpamLog) != $null) window -a @SpamLog
}
alias -l as.ichan.add {
  if ($dialog(antispam) == $null) goto popaddc | if ($did(antispam,80).text == $null) { did -fr antispam 80 | as.ichan.fresh | return }
  did -fr antispam 80 | did -e antispam 78 | did -r antispam 74 | did -b antispam 76,77,79 | if (%as.ichan.add == $null) return
  if ($chr(35) !isin $left(%as.ichan.add,1)) write %as.igchan.dir $chr(35) $+ %as.ichan.add | else write %as.igchan.dir %as.ichan.add
  if (%as.ichan.add != $null) {
    as.ichan.fresh | return | :popaddc | var %_`sw = 0 | %as.ichan.add = $remove($active,Window) | if (%popc == 1) %as.ichan.add = $remove($active,Window)
    if (%popask == 1) set %as.ichan.add $$?="Inserisci canali ignorati. (Solo uno)" | :checkexist1 | inc %_`sw | %as.ichan.tmp = $read -l $+ %_`sw %as.igchan.dir
    if (%as.ichan.add == %as.ichan.tmp) return | if (%as.ichan.tmp != $null) goto checkexist1 | if ($chr(35) !isin $left(%as.ichan.add,1)) write %as.igchan.dir $chr(35) $+ %as.ichan.add
    else write %as.igchan.dir %as.ichan.add | set -u %_`sw 0 | :loop3 | inc %_`sw | %as.ichan.tmp = $read -l $+ %_`sw %as.igchan.dir
    unset %as.ichan.add | if (%as.edit.ic == Yes) { did -o antispam 74 %as.ichan.sel %as.ichan.add | write -dl $+ %as.ichan.sel %as.igchan.dir | unset %as.ichan.sel | set %as.edit.ic No | as.ichan.fresh } 
    if (%as.ichan.tmp != $null) goto loop3 | return
  }
}
alias -l as.ichan.chg {
  if ($did(antispam,80).text == $null) { as.ichan.rem | return } | did -b antispam 76,77,79 | did -o antispam 74 %as.ichan.sel %as.ichan.add
  write -l $+ %as.ichan.sel %as.igchan.dir %as.ichan.add | did -fr antispam 80 | unset %as.ichan.edit , %as.c.edit.tmp | %as.edit.ic = No
}
alias -l as.ichan.rem {
  did -b antispam 76,77,79 | %as.ichan.rem = $did(antispam,74).sel | if (%as.ichan.rem == $null) return | did -d antispam 74 %as.ichan.rem
  did -fr antispam 80 | did -at antispam 75 &Add | write -dl $+ %as.ichan.rem %as.igchan.dir | if ($lines(%as.igchan.dir) == 0) { did -b antispam 76,77,78 } | %as.edit.ic = No
}
alias -l as.ichan.edit {
  did -fr antispam 80 | did -e antispam 79 | %as.ichan.sel = $did(antispam,74).sel | if (%as.ichan.sel == $null) return
  %as.ichan.edit = $read -l $+ %as.ichan.sel %as.igchan.dir | %as.ichan.add = $read -l $+ %as.ichan.sel %as.igchan.dir
  did -a antispam 80 %as.ichan.edit | %as.edit.ic = Yes
}
alias -l as.ichan.fresh { set -u %_`sw 0 | did -r antispam 74 | :loop | inc %_`sw | %as.ichan.tmp = $read -l $+ %_`sw %as.igchan.dir | did -a antispam 74 %as.ichan.tmp | if (%as.ichan.tmp != $null) goto loop }
alias -l as.ichan.clr {
  if ($lines(%as.igchan.dir) == 0) return | set %as.ic.clr.conf $input(Really want to clear all ignored channel?,128,- Anti-Spam) {
    if (%as.ic.clr.conf == $null) { dialog -v antispam | return } | dialog -v antispam | did -r antispam 80 | did -r antispam 74
    did -at antispam 75 &Agg | write -c %as.igchan.dir | %as.edit.ic = No | if ($lines(%as.igchan.dir) == 0) { did -b antispam 76,77,78,79 }
  }
}
alias -l as.nick.add {
  if ($dialog(antispam) == $null) goto popaddn | if ($did(antispam,33).text == $null) { did -fr antispam 33 | as.nick.fresh | return }
  did -fr antispam 33 | did -e antispam 32 | did -r antispam 28 | did -b antispam 30,31,60 | if (%as.nick.add == $null) return
  if (%as.nick.add == $chr(35)) { echo -a -[Anti-Spam]- It's not a nick!!! | as.nick.fresh | return }
  write %as.friendn.dir %as.nick.add
  if (%as.nick.add != $null) {
    as.nick.fresh | return | :popaddn | var %_`sw = 0 | %as.nick.add = $remove($active,window) | if (%popnl == 1) %as.nick.add = $snick($chan) 
    if (%popask == 1) set %as.nick.add $$?="Inserisci il nick amico. (Solo uno)" | :checkexist1 | inc %_`sw | %as.nick.tmp = $read -l $+ %_`sw %as.friendn.dir
    if (%as.nick.add == %as.nick.tmp) return | if (%as.nick.tmp != $null) goto checkexist1 | write %as.friendn.dir %as.nick.add
    set -u %_`sw 0 | :loop3 | inc %_`sw | %as.nick.tmp = $read -l $+ %_`sw %as.friendn.dir | unset %as.nick.add
    if (%as.edit.n == Yes) { did -o antispam 28 %as.nick.sel %as.nick.add | write -dl $+ %as.nick.sel %as.friendn.dir | unset %as.nick.sel | set %as.edit.n No | as.nick.fresh } 
    if (%as.nick.tmp != $null) goto loop3 | return
  }
}
alias -l as.nick.chg {
  if ($did(antispam,33).text == $null) { as.nick.rem | return } | did -b antispam 30,31,60 | did -o antispam 28 %as.nick.sel %as.nick.add
  write -l $+ %as.nick.sel %as.friendn.dir %as.nick.add | did -fr antispam 33 | unset %as.nick.edit , %as.n.edit.tmp | %as.edit.n = No
}
alias -l as.nick.rem {
  did -b antispam 30,31,60 | %as.nick.rem = $did(antispam,28).sel | if (%as.nick.rem == $null) return | did -d antispam 28 %as.nick.rem
  did -fr antispam 33 | did -at antispam 29 &Agg | write -dl $+ %as.nick.rem %as.friendn.dir | if ($lines(%as.friendn.dir) == 0) { did -b antispam 30,31,32 } | %as.edit.n = No
}
alias -l as.nick.edit {
  did -fr antispam 33 | did -e antispam 60 | %as.nick.sel = $did(antispam,28).sel | if (%as.nick.sel == $null) return
  %as.nick.edit = $read -l $+ %as.nick.sel %as.friendn.dir | %as.nick.add = $read -l $+ %as.nick.sel %as.friendn.dir
  did -a antispam 33 %as.nick.edit | %as.edit.n = Yes
}
alias -l as.nick.fresh {
  set -u %_`sw 0 | did -r antispam 28 | :loop | inc %_`sw | %as.nick.tmp = $read -l $+ %_`sw %as.friendn.dir
  did -a antispam 28 %as.nick.tmp | if (%as.nick.tmp != $null) goto loop
}
alias -l as.nick.clr {
  if ($lines(%as.friendn.dir) == 0) return | set %as.n.clr.conf $input(Really want to clear all your friend's nick?,128,- Anti-Spam) {
    if (%as.n.clr.conf == $null) { dialog -v antispam | return } | dialog -v antispam | did -r antispam 33
    did -r antispam 28 | did -at antispam 29 &Add | write -c %as.friendn.dir | %as.edit.n = No | if ($lines(%as.friendn.dir) == 0) { did -b antispam 30,31,32,60 }
  }
}
alias -l as.op.opt { if (%as.op.sel == None) did -c antispam 36 | if (%as.op.sel == Kick) did -c antispam 37 | if (%as.op.sel == Ban) did -c antispam 38 | if (%as.op.sel == BanKick) did -c antispam 39 }
alias -l as.bantype { %as.bt.sel = $did(antispam,89).text | did -ra antispam 90 $mask(nick!ident@kbu-124-202.tm.net.my,%as.bt.sel) }
alias -l as.echo { if ($dialog(antispam) != $null) did -c antispam 18 | if (%as.echo == Yes) { echo -a -[Anti-Spam]- 12,8Anti-Spam is now 5Active12,8 after %as.inp.mins minute(s). } | if (%as.echo == No) return }
alias -l as.getenable { if ($dialog(antispam) != $null) { 
    if (%as.enable == Yes) did -c antispam 18
    else did -u antispam 18
  }
  if (%as.en.time == No) return
  else {
    %as.mins = $calc(%as.inp.mins * 60)
    if (%as.enable == No) {
    .timer_as1 1 %as.mins .enable #antispam120 | .timer_as2 1 %as.mins set %as.enable Yes | .timer_as3 1 %as.mins as.echo | .timer_as4 1 %as.mins set %as.en.stat Y }
    else .timer_as* off
  }
}
alias -l as.check.act { if ($dialog(antispam) == $null) { .timer_chkact off | as.getenable } | else return }
alias -l as.quote.sel {
  did -fra antispam 48 $did(antispam,52).text | if ($did(antispam,48).text == $null) return | %as.q.list.edit = $did(antispam,48).text | %as.quote.dsel = $did(antispam,52).sel
  did -e antispam 49,50,51 | set %as.q.ledit 1
}
alias -l as.quote.list {
  did -b antispam 49,50,51 | did -r antispam 48,52,89 | var %lkq = 1
  while (%lkq <= $lines(%as.quote.file)) {
    %as.quote.list = $read -l $+ %lkq %as.quote.file | did -a antispam 52 %as.quote.list | inc %lkq
  }
  var %r = 0
  while (%r < 10) {
    did -a antispam 89 %r | inc %r
  }
  did -c antispam 89 4
}
alias -l as.quote.add { did -f antispam 48 | write %as.quote.file $did(antispam,48).text | as.quote.list | %as.q.ledit = 0 | unset %as.quote.list }
alias -l as.quote.chg {
  if (%as.q.list.edit == $null) { did -fr antispam 48 | did -b antispam 49,50,51 | return } | did -f antispam 48 | %as.q.ledit = 0 | write -l $+ %as.quote.dsel %as.quote.file %as.q.list.edit
  as.quote.list | unset %as.quote.list
}
alias -l as.quote.rem { did -f antispam 48 | %as.q.ledit = 0 | did -r antispam 48 | did -u antispam 52 %as.quote.dsel | write -dl $+ %as.quote.dsel %as.quote.file | as.quote.list | unset %as.quote.list }
alias -l as.check.version {
  var %cov = 1
  while (%cov <= $script(0)) {
    %as.old.version = $script(%cov)
    if (%as.old.version == $script(antispamme.mrc)) { .unload -rs " $+ $script(antispamme.mrc) $+ " }
    if (%as.old.version == $script(antispamme7.mrc)) { .unload -rs " $+ $script(antispamme7.mrc) $+ " }
    if (%as.old.version == $script(antispam7.mrc)) { .unload -rs " $+ $script(antispam7.mrc) $+ " }
    if (%as.old.version == $script(antispam75.mrc)) { .unload -rs " $+ $script(antispam75.mrc) $+ " }
    if (%as.old.version == $script(antispam80.mrc)) { .unload -rs " $+ $script(antispam80.mrc) $+ " }
    if (%as.old.version == $script(antispam90.mrc)) { .unload -rs " $+ $script(antispam90.mrc) $+ " }
    if (%as.old.version == $script(antispam100.mrc)) { .unload -rs " $+ $script(antispam100.mrc) $+ " }
    inc %cov
  }
}
alias -l as.dooper {
  if (%as.op.sel == Kick) { if (%as.ownkick == 1) kick $comchan($1,$2) $1 $3- | if (%as.ownkick == 0) kick $comchan($1,$2) $1 $read(%as.quote.file) }
  if (%as.op.sel == Ban) { if (%as.doban == 1) { ban $comchan($1,$2) $1 %as.bt.sel | .timer_ub $+ $1 $+ $comchan($1,$2) 1 $calc(%as.unbantime * 60) mode $comchan($1,$2) -b $address($1,%as.bt.sel) } | if (%as.doban == 0) ban $comchan($1,$2) $1 %as.bt.sel }
  if (%as.op.sel == Bankick) {
    if (%as.ownkick == 1) {
      if (%as.doban == 1) { ban $comchan($1,$2) $1 %as.bt.sel | .timer_asunban $+ $1 $+ $comchan($1,$2) 1 $calc(%as.unbantime * 60) mode $comchan($1,$2) -b $address($1,%as.bt.sel) }
      if (%as.doban == 0) { ban $comchan($1,$2) $1 %as.bt.sel | kick $comchan($1,$2) $1 $3- }
    }
    if (%as.ownkick == 0) {
      if (%as.doban == 1) { ban $comchan($1,$2) $1 %as.bt.sel | .timer_asunban $+ $1 $+ $comchan($1,$2) 1 $calc(%as.unbantime * 60) mode $comchan($1,$2) -b $address($1,%as.bt.sel) }
      if (%as.doban == 0) { ban $comchan($1,$2) $1 %as.bt.sel | kick $comchan($1,$2) $1 $read(%as.quote.file) }
    }
  }
}
alias -l as.dooper2 {
  if (%as.op.sel == Kick) {
    if (%as.ownkick == 1) kick $2 $1 $3-
    if (%as.ownkick == 0) kick $2 $1 $read(%as.quote.file)
  }
  if (%as.op.sel == Ban) {
    if (%as.doban == 1) { ban $2 $1 %as.bt.sel | .timer_ub $+ $1 $+ $2 1 $calc(%as.unbantime * 60) mode $2 -b $address($1,%as.bt.sel) }
    if (%as.doban == 0) ban $2 $1 %as.bt.sel
  }
  if (%as.op.sel == Bankick) {
    if (%as.ownkick == 1) {
      if (%as.doban == 1) { ban $2 $1 %as.bt.sel | .timer_asunban $+ $1 $+ $2 1 $calc(%as.unbantime * 60) mode $2 -b $address($1,%as.bt.sel) }
      if (%as.doban == 0) { ban $2 $1 %as.bt.sel | kick $2 $1 $3- }
    }
    if (%as.ownkick == 0) {
      if (%as.doban == 1) { ban $2 $1 %as.bt.sel | .timer_asunban $+ $1 $+ $2 1 $calc(%as.unbantime * 60) mode $2 -b $address($1,%as.bt.sel) }
      if (%as.doban == 0) { ban $2 $1 %as.bt.sel | kick $2 $1 $read(%as.quote.file) }
    }
  }
}
alias -l as.check.query {
  if ($lines(%as.spamw.dir) == 0) return | %allword = $strip($2-) | var %sw = 1 | unset %spamw | var %spam = 0
  while (%sw <= $lines(%as.spamw.dir)) {
    var %spamw = $gettok($read(%as.spamw.dir,%sw),1,61) | var %strig = $lower($remove($gettok($read(%as.spamw.dir,%sw),2,61),...))
    if ((match == %strig) && (%spamw == %allword)) { %spam = 1 | break }
    elseif ((contain == %strig) && (%spamw isin %allword)) { %spam = 1 | break }
    elseif (begin isin %strig) { var %nt = $numtok(%spamw,32) | var %findword = $gettok(%allword,1 - %nt,32) | if (%spamw == %findword) { %spam = 1 | break } }
    elseif (end isin %strig) {
      var %nt = $numtok(%allword,32) | var %ts = $calc($numtok(%spamw,32) - 1) | var %nt1 = $calc($numtok(%allword,32) - %ts)
      var %findword = $gettok(%allword,%nt1 - %nt,32) | if (%spamw == %findword) { %spam = 1 | break }
    }
    inc %sw
  }
  if (%spam == 0) { return } | if (%as.en.checknick == 0) goto next | var %mf = 1 | var %friend = $1
  if ($lines(%as.friendn.dir) == 0) goto next
  while (%mf <= $lines(%as.friendn.dir)) { var %sf = $read(%as.friendn.dir,%mf) | if (%sf isin %friend) { return } | inc %mf }
  :next | var %spammer = $1 | as.q.kill %spammer %allword
}
alias -l as.q.kill {
  var %ac = 1 | var %cmp3 = 0
  while (%ac <= $comchan($1,0)) {
    if (mp3 isin $comchan($1,%ac)) {
      if (($1 isop $comchan($1,%ac)) || ($1 isvo $comchan($1,%ac)) && ($me !isop $comchan($1,%ac))) { %cmp3 = 1 | goto loopk }
    }
    inc %ac
  }
  var %cc = 1
  while (%cc <= $comchan($1,0)) {
    if ($comchan($1,%cc) != $null) {
      if (%as.en.igchancheck == 0) goto dontcheck
      var %igc = 1
      while (%igc <= $lines(%as.igchan.dir)) {
        var %igchan = $read(%as.igchan.dir,%igc) | if ($comchan($1,%cc) == %igchan) { goto loopn } | else inc %igc
      }
      :dontcheck
      if ($1 isop $comchan($1,%cc)) return | if (($me isop $comchan($1,%cc)) && ($1 !isop $comchan($1,%cc)) && ($1 ison $comchan($1,%cc))) {
        if (%as.op.sel == None) goto loopl
        %spammer = $1 | %as.reason = No thanks. I dont like spam! - 12BlueWerkz | as.dooper %spammer %cc %as.reason
      }
    }
    :loopn | inc %cc
  }
  :loopl | if (%as.en.log == Yes) { write %as.filelog - [Query Message] - Spam by $1 - $2- | if ($window(@SpamLog) != $null) aline -hp @SpamLog - [Query Message] - Spam by $1 - $2- }
  :loopk
  if (%cmp3 == 1) return
  if (%as.sys.say == $null) %as.sys.say = [Auto-Reply] You are spamming. Stop it!
  if (%as.sys.1 = 1) close -m $1
  if (%as.sys.2 = 1) .ignore -p $1 3
  if (%as.sys.3 = 1) {
    var %i = 1, %u = 1
    while (%i <= $comchan($1,0)) {
      while (%u <= $nick($comchan($1,%i),0,o)) {
        if (($comchan($1,%i).op == $false) && ($nick($comchan($1,%i),%u,o) != $null)) { .msg $nick($comchan($1,%i),%u,o) [Auto-Report] $1 is spamming. Please put a stop to $1 $+ . Thanks. } | inc %u
      }
      inc %i
    }
  }
  if (%as.sys.4 = 1) if (webchat.org isin $server) .msg #massads < $+ $1 $+ > $2-
  if (%as.sys.5 = 1) .msg $1 %as.sys.say
}
alias -l as.check.chan {
  if ($lines(%as.spamw.dir) == 0) return | %`allword = $strip($2-) | var %`sw = 1 | unset %`spamw | var %`spam = 0
  while (%`sw <= $lines(%as.spamw.dir)) {
    var %`spamw = $gettok($read(%as.spamw.dir,%`sw),1,61) | var %`strig = $lower($remove($gettok($read(%as.spamw.dir,%`sw),2,61),...))
    if ((match == %`strig) && (%`spamw == %`allword)) { %`spam = 1 | break }
    elseif ((contain == %`strig) && (%`spamw isin %`allword)) { %`spam = 1 | break }
    elseif (begin isin %`strig) {
      %`nt = $numtok(%`spamw,32) | %`findword = $gettok(%`allword,1 - %`nt,32)
      if (%`spamw == %`findword) { %`spam = 1 | break }
    }
    elseif (end isin %`strig) {
      var %`nt = $numtok(%`allword,32) | var %`ts = $calc($numtok(%`spamw,32) - 1) | var %`nt1 = $calc($numtok(%`allword,32) - %`ts)
      var %`findword = $gettok(%`allword,%`nt1 - %`nt,32) | if (%`spamw == %`findword) { %`spam = 1 | break }
    }
    inc %`sw
  }
  if (%`spam == 0) { return } | if (%as.en.checknick == 0) goto next | var %`mf = 1 | var %`friend = $1 | if ($lines(%as.friendn.dir) == 0) goto next
  while (%`mf <= $lines(%as.friendn.dir)) {
    var %`sf = $read(%as.friendn.dir,%`mf) | if (%`sf isin %`friend) { return } | inc %`mf
  }
  :next | var %`spammer = $1 | as.c.kill %`spammer %`allword
}
alias -l as.c.kill {
  if ($1 isop $chan) return | if (%as.en.igchancheck == 0) goto dontcheck | var %ic = 0
  while (%ic <= $lines(%as.igchan.dir)) {
    var %ict = $read(%as.igchan.dir,%ic) | if (%ict == $chan) return | else inc %ic
  }
  :dontcheck | if (($me isop $chan) && ($1 ison $chan)) {
    if (%as.en.log == Yes) { write %as.filelog - [Channel Message] - Spam by $1 on [[ $+ $chan $+ ]] - $2- | if ($window(@SpamLog) != $null) aline -hp @SpamLog - [Channel Message] - Spam by $1 on [ $+ $chan $+ ] - $2- }
    if (%as.op.sel == None) goto report | %spammer = $1 | %as.reason = We DO NOT like spam. - 12BlueWerkz | as.dooper2 %spammer $chan %as.reason
  }
  :report
  if (%as.sys.4 = 1) if (webchat.org isin $server) .msg #massads < $+ $1 $+ > $2-
}
alias -l as.check.p.notice {
  if (($1 == ChanServ) || ($1 == NickServ) || ($1 == MemoServ) || ($1 == OperServ) || ($1 == HelpServ)) return
  if ($lines(%as.spamw.dir) == 0) return | %_allword = $strip($2-) | var %_sw = 1 | unset %_spamw | var %_spam = 0
  while (%_sw <= $lines(%as.spamw.dir)) {
    var %_spamw = $gettok($read(%as.spamw.dir,%_sw),1,61) | var %_strig = $lower($remove($gettok($read(%as.spamw.dir,%_sw),2,61),...))
    if ((match == %_strig) && (%_spamw == %_allword)) { %_spam = 1 | break }
    elseif ((contain == %_strig) && (%_spamw isin %_allword)) { %_spam = 1 | break }
    elseif (begin isin %_strig) { %_nt = $numtok(%_spamw,32) | %_findword = $gettok(%_allword,1 - %_nt,32) | if (%_spamw == %_findword) { %_spam = 1 | break } }
    elseif (end isin %_strig) {
      var %_nt = $numtok(%_allword,32) | var %_ts = $calc($numtok(%_spamw,32) - 1) | var %_nt1 = $calc($numtok(%_allword,32) - %_ts) | var %_findword = $gettok(%_allword,%_nt1 - %_nt,32) | if (%_spamw == %_findword) { %_spam = 1 | break }
    }
    inc %_sw
  }
  if (%_spam == 0) { return } | if (%as.en.checknick == 0) goto next | var %_mf = 1 | var %_friend = $1
  if ($lines(%as.friendn.dir) == 0) goto next
  while (%_mf <= $lines(%as.friendn.dir)) {
    var %_sf = $read(%as.friendn.dir,%_mf) | if (%_sf isin %_friend) { return } | inc %_mf
  }
  :next | var %_spammer = $1 | as.pn.kill %_spammer %_allword
}
alias -l as.pn.kill {
  var %cc = 1 | var %cmp3 = 0
  while (%cc <= $comchan($1,0)) {
    if (mp3 isin $comchan($1,%cc)) {
      if (($1 isop $comchan($1,%cc)) || ($1 isvo $comchan($1,%cc)) && ($me !isop $comchan($1,%cc))) { %cmp3 = 1 | goto loopn }
    }
    if (%as.en.igchancheck == 0) goto dontcheck
    if ($comchan($1,%cc) != $null) {
      var %igc = 1
      while (%igc <= $lines(%as.igchan.dir)) {
        var %igchan = $read(%as.igchan.dir,%igc) | if ($comchan($nick,%cc) == %igchan) { goto loopn } | else inc %igc
      }
      :dontcheck | if ($1 isop $comchan($nick,%cc)) return
      if (($me isop $comchan($nick,%cc)) && ($nick !isop $comchan($nick,%cc)) && ($1 ison $comchan($nick,%cc))) {
        if (%as.op.sel == None) goto loopl
        %spammer = $1 | %as.reason = No thanks. I dont like spam! - 12BlueWerkz | as.dooper %spammer %cc %as.reason
      }
    }
    :loopn | inc %cc
  }
  :loopl
  if (%as.en.log == Yes) { write %as.filelog - [Private Notice] - Spam by $1 - $2- | if ($window(@SpamLog) != $null) aline -hp @SpamLog - [Private Notice] - Spam by $1 - $2- }
  :loopk
  if (%cmp3 == 1) return
  haltdef
  if (%as.sys.say == $null) %as.sys.say = [Auto-Reply] You are spamming. Stop it!
  if (%as.sys.2 = 1) .ignore -pn $1 3
  if (%as.sys.3 = 1) {
    var %i = 1, %u = 1
    while (%i <= $comchan($1,0)) {
      while (%u <= $nick($comchan($1,%i),0,o)) {
        if (($comchan($1,%i).op == $false) && ($nick($comchan($1,%i),%u,o) != $null)) { .msg $nick($comchan($1,%i),%u,o) [Auto-Report] $1 is spamming. Please put a stop to $1 $+ . Thanks. } | inc %u
      }
      inc %i
    }
  }
  if (%as.sys.4 = 1) if (webchat.org isin $server) .msg #massads < $+ $1 $+ > $2- | if (%as.sys.5 = 1) .notice $1 %as.sys.say
}
alias -l as.check.c.notice {
  if (($1 == ChanServ) || ($1 == NickServ) || ($1 == MemoServ) || ($1 == OperServ) || ($1 == HelpServ)) return
  if ($lines(%as.spamw.dir) == 0) return | %-allword = $strip($2-) | var %-sw = 1 | unset %-spamw | var %-spam = 0
  while (%-sw <= $lines(%as.spamw.dir)) {
    var %-spamw = $gettok($read(%as.spamw.dir,%-sw),1,61) | var %-strig = $lower($remove($gettok($read(%as.spamw.dir,%-sw),2,61),...))
    if ((match == %-strig) && (%-spamw == %-allword)) { %-spam = 1 | break } | elseif ((contain == %-strig) && (%-spamw isin %-allword)) { %-spam = 1 | break }
    elseif (begin isin %-strig) { %-nt = $numtok(%-spamw,32) | %-findword = $gettok(%-allword,1 - %-nt,32) | if (%-spamw == %-findword) { %-spam = 1 | break } }
    elseif (end isin %-strig) {
      var %'nt = $numtok(%-allword,32) | var %'ts = $calc($numtok(%-spamw,32) - 1) | var %'nt1 = $calc($numtok(%-allword,32) - %'ts) | var %-findword = $gettok(%-allword,%'nt1 - %'nt,32) | if (%-spamw == %-findword) { %-spam = 1 | break }
    }
    inc %-sw
  }
  if (%-spam == 0) { return } | if (%as.en.checknick == 0) goto next | var %-mf = 1 | var %-friend = $1 | if ($lines(%as.friendn.dir) == 0) goto next
  while (%-mf <= $lines(%as.friendn.dir)) {
    var %-sf = $read(%as.friendn.dir,%-mf) | if (%-sf isin %-friend) { return } | inc %-mf
  }
  :next | var %-spammer = $1 | as.cn.kill %-spammer %-allword
}
alias -l as.cn.kill {
  if ($1 isop $chan) return | if (%as.en.igchancheck == 0) goto dontcheck | var %ic = 0
  while (%ic <= $lines(%as.igchan.dir)) {
    %ict = $read(%as.igchan.dir,%ic) | if (%ict == $chan) return | else inc %ic
  }
  :dontcheck | if (($me isop $chan) && ($1 ison $chan)) { if (%as.op.sel == None) goto loopl | %spammer = $1 | %as.reason = We DO NOT like spam. - 12BlueWerkz | as.dooper2 %spammer $chan %as.reason }
  :loopl
  haltdef
  if (%as.en.log == Yes) { write %as.filelog - [Channel Notice] - Spam by $1 on [[ $+ $chan $+ ]] - $2- | if ($window(@SpamLog) != $null) aline -hp @SpamLog - [Channel Notice] - Spam by $1 on [ $+ $chan $+ ] - $2- }
  if (%as.sys.2 = 1) .ignore -cn $1 3
  if (%as.sys.4 = 1) if (webchat.org isin $server) .msg #massads < $+ $1 $+ > $2-
}

;#########################################################
;Anti-Spam Dialog & Script events
;#########################################################

on *:dialog:antispam:init:0: {
  %as.start = 0 | %as.dont1 = 1 | %as.ver = 12 | as.check.version
  %as.spamw.dir = " $+ $scriptdirspamword.txt $+ "
  %as.friendn.dir = " $+ $scriptdirmyfriend.txt $+ "
  %as.quote.file = " $+ $scriptdirkickquote.txt $+ "
  %as.filelog = " $+ $scriptdirspam_log.txt $+ "
  %as.igchan.dir = " $+ $scriptdirigchan.txt $+ "
  %as.fsdir = $nofile(%as.filelog) | %as.log.sfn = $len(%as.fsdir) | if (%as.unbantime == $null) %as.unbantime = 30
  if (%as.run == $null) set %as.run 1 | if (%as.run == 1) { set %as.en.stat Y | set %as.enable Yes | set %as.en.time Yes | set %as.en.log Yes | set %as.inp.mins 1 | set %as.mins 60 | inc %as.run }
  if (%as.op.sel == $null) set %as.op.sel Bankick | if ($file(%as.spamw.dir) == $null) write -c %as.spamw.dir
  if ($file(%as.friendn.dir) == $null) write -c %as.friendn.dir | if ($file(%as.igchan.dir) == $null) write -c %as.igchan.dir
  if (%as.enable == Yes) { did -c antispam 18 | .enable #antispam120 } | else { did -u antispam 18 | .disable #antispam120 }
  if (%as.en.time == Yes) { did -c antispam 19 | did -n antispam 20 } | else did -m antispam 20
  if (%as.ownkick == $null) %as.ownkick = 0 | if (%as.doban == $null) %as.doban = 0 | if (%as.inp.mins != $null) did -a antispam 20 %as.inp.mins
  if (%as.inp.mins == $null) { set %as.inp.mins 0 | did -a antispam 20 %as.inp.mins } | if (%as.bt.sel == $null) %as.bt.sel = 3
  if (%as.en.log == Yes) did -c antispam 23 | if (%as.en.clr == Yes) did -c antispam 26
  if (%as.log.sfn > 32) %as.fsdir = $left(%as.fsdir,13) $+ ... $+ $right(%as.fsdir,15) | if (%as.sys.1 == $null) %as.sys.1 = 1
  if (%as.sys.say = $null) %as.sys.say = [Auto-Reply] You are spamming. Stop it!
  if (%as.op.sel == None) did -c antispam 36 | if (%as.op.sel == Kick) did -c antispam 37
  if (%as.op.sel == Ban) did -c antispam 38 | if (%as.op.sel == BanKick) did -c antispam 39
  if ($file(%as.filelog) == $null) { write %as.filelog Anti-Spam v12.0 by kidd2k | write %as.filelog [[ Log file ]] | write %as.filelog $str(-,100) }
  if ($lines(%as.spamw.dir) == 0) { did -b antispam 14,15,16 } | if ($lines(%as.friendn.dir) == 0) { did -b antispam 30,31,32 }
  if (%as.logwin == $null) %as.logwin = 1 | if (%as.logwin == 1) did -c antispam 70 | else if (%as.logwin == 0) did -u antispam 70
  if (%as.en.nickcheck == $null) %as.en.nickcheck = 1 | if (%as.en.igchancheck == $null) %as.en.igchancheck = 1
  %as.writespamlog = On | %as.edit.w = No | %as.q.ledit = 0 | as.word.fresh | as.nick.fresh | as.ichan.fresh
}
on *:dialog:antispam:edit:*: {
  if $did == 11 { %as.word.add = $did(antispam,11).text | %as.w.edit.tmp = $did(antispam,11).text }
  if $did == 20 { set %as.inp.mins $did(antispam,20).text | %as.mins = $calc(%as.inp.mins * 60) }
  if $did == 33 { %as.nick.add = $did(antispam,33).text | %as.n.edit.tmp = $did(antispam,33).text }
  if $did == 48 { %as.q.list.edit = $did(antispam,48).text | if (%as.q.ledit = 1) { did -e antispam 49,50 } | else { if (%as.q.ledit = 0) { did -e antispam 49 } | if ($did(antispam,48).text = $null) did -b antispam 49,50,51 } }
  if $did == 67 { %as.sys.say = $did(antispam,67).text }
  if $did == 80 { %as.ichan.add = $did(antispam,80).text | %as.c.edit.tmp = $did(antispam,33).text }
  if $did == 87 { %as.unbantime = $did(antispam,87).text }
}
on *:dialog:antispam:sclick:*: {
  if $did = 1 { %as.start = 1 | as.chan.btn }
  if $did = 4 { %as.start = 1 | as.word.btn }
  if $did = 5 { %as.start = 1 | as.sys.btn }
  if $did = 6 { %as.start = 1 | as.log.btn }
  if $did = 7 { %as.start = 1 | as.nick.btn }
  if $did = 8 { %as.start = 1 | as.op.btn }
  if $did = 9 { as.getenable | .timer_tt off | .timer_antispam off | dialog -x antispam antispam }
  if $did = 12 did -e antispam 14,15
  if $did = 13 as.word.add
  if $did = 14 as.word.rem
  if $did = 15 as.word.edit
  if $did = 16 as.word.clr
  if $did = 18 { if ($did(antispam,18).state == 1) { .timer_chkact off | set %as.enable Yes | .enable #antispam120 | set %as.echo No | set %as.en.stat Y } | { else .timer_chkact off | set %as.enable No | .disable #antispam120 | set %as.echo Yes | unset %as.en.stat | .timer_chkact 0 1 as.check.act } }
  if $did = 19 { if ($did(antispam,19).state == 1) { .timer_chkact off | set %as.en.time Yes | did -n antispam 20 | .timer_chkact 0 1 as.check.act } | { else .timer_as* off | set %as.en.time No | did -m antispam 20 } }
  if $did = 23 { if ($did(antispam,23).state == 1) set %as.en.log Yes | else unset %as.en.log }
  if $did = 26 { if ($did(antispam,26).state == 1) { set %as.en.clr Yes } | else set %as.en.clr No }
  if $did = 28 did -e antispam 30,31
  if $did = 29 as.nick.add
  if $did = 30 as.nick.rem
  if $did = 31 as.nick.edit
  if $did = 32 as.nick.clr
  if $did = 36 { if ($did(antispam,36).state == 1) { did -cuk antispam 8 | set %as.op.sel None | did -b antispam 86,87,89 } }
  if $did = 37 { if ($did(antispam,37).state == 1) { did -cuk antispam 8 | set %as.op.sel Kick | did -b antispam 86,87,89 } }
  if $did = 38 { if ($did(antispam,38).state == 1) { did -cuk antispam 8 | set %as.op.sel Ban | did -e antispam 86,89 | if (%as.doban == 0) did -b antispam 87 | else did -e antispam 87 } }
  if $did = 39 { if ($did(antispam,39).state == 1) { did -cuk antispam 8 | set %as.op.sel Bankick | did -e antispam 86,89 | if (%as.doban == 0) did -b antispam 87 | else did -e antispam 87 } }
  if $did = 46 { run $readini mirc.ini files browser mailto:webmaster@kidd2k.org }
  if $did = 49 as.quote.add
  if $did = 50 as.quote.chg
  if $did = 51 as.quote.rem
  if $did = 52 as.quote.sel
  if $did = 53 { if ($did(antispam,53).state == 1) { %as.ownkick = 1 } | else %as.ownkick = 0 }
  if $did = 59 as.word.chg
  if $did = 60 as.nick.chg
  if $did = 62 { if ($did(antispam,62).state == 1) { did -cuk antispam 5 | %as.sys.1 = 1 } | else { did -cuk antispam 5 | %as.sys.1 = 0 } }
  if $did = 63 { if ($did(antispam,63).state == 1) { did -cuk antispam 5 | %as.sys.2 = 1 } | else { did -cuk antispam 5 | %as.sys.2 = 0 } }
  if $did = 64 { if ($did(antispam,64).state == 1) { did -cuk antispam 5 | %as.sys.3 = 1 } | else { did -cuk antispam 5 | %as.sys.3 = 0 } }
  if $did = 65 { if ($did(antispam,65).state == 1) { did -cuk antispam 5 | %as.sys.4 = 1 } | else { did -cuk antispam 5 | %as.sys.4 = 0 } }
  if $did = 66 { if ($did(antispam,66).state == 1) { did -cuknf antispam 5,67 | %as.sys.5 = 1 } | else { did -cukm antispam 5,67 | %as.sys.5 = 0 } }
  if $did = 70 { if ($did(antispam,70).state == 1) { did -cuk antispam 6 | %as.logwin = 1 } | else { did -cuk antispam 6 | %as.logwin = 0 } }
  if $did = 73 { run $readini mirc.ini files browser http://www.lye-rulz.com }
  if $did = 74 did -e antispam 76,77
  if $did = 75 as.ichan.add
  if $did = 76 as.ichan.rem
  if $did = 77 as.ichan.edit
  if $did = 78 as.ichan.clr
  if $did = 79 as.ichan.chg
  if $did = 84 { if ($did(antispam,84).state == 1) %as.en.nickcheck = 1 | else %as.en.nickcheck = 0 }
  if $did = 85 { if ($did(antispam,85).state == 1) %as.en.igchancheck = 1 | else %as.en.igchancheck = 0 }
  if $did = 86 { if ($did(antispam,86).state == 1) { %as.doban = 1 | did -e antispam 87 } | else { %as.doban = 0 | did -b antispam 87 } }
  if $did = 89 as.bantype
}
on *:dialog:input_sw:init:0: { did -a input_sw 2 Contiene... | did -a input_sw 2 Inizia con... | did -a input_sw 2 Finisce con... | did -a input_sw 2 Altro... }
on *:dialog:input_sw:edit:1:set %as.word.add $did(input_sw,1).text
on *:dialog:input_sw:sclick:2:set %as.tgtp $did(input_sw,2).seltext
on *:dialog:input_sw:sclick:3: {
  if ((%as.word.add == $null) || ($did(input_sw,2).seltext == $null)) {
    if (%as.word.add == $null) { var %as.error = $input(Inserisci parole spam!,4,Anti-Spam) | did -f input_sw 1 | return } 
    if ($did(input_sw,2).seltext == $null) { var %as.error = $input(Please select the trigger type!,4,Anti-Spam) | did -f input_sw 2 | return }
  }
  write %as.spamw.dir $gettok(%as.word.add,1,61) $+ = $+ %as.tgtp | unset %as.word.add | dialog -x input_sw input_sw
}
on *:dialog:input_sw:sclick:4:unset %as.word.add
on 1:START: {
  if ($version < 5.91) {
    echo -a -[Anti-Spam]- 12,8You are using 5,8mIRC $version 12,8that not supported many functions or will causing many bug problems.
    echo -a -[Anti-Spam]- 12,8Please get 5,8mIRC 5.9112,8 or the 5,8latest version12,8. You can get it at http://www.mirc.com
    linesep | .unload -rs " $+ $script $+ " | echo -a -[Anti-Spam]- 0,12Script Unloaded. | linesep
  }
}
on 1:CONNECT: {
  if ($window(@SpamLog) != $null) return
  if (%as.en.clr == Yes) { clear @SpamLog | write -c %as.filelog | write %as.filelog Anti-Spam v12.0 by kidd2k | write %as.filelog [[ Log file ]] | write %as.filelog $str(-,100) }
  if (%as.enable == No) { echo -a -[Anti-Spam]- 12,8Anti-Spam is currently 5,8OFF | as.getenable | linesep }
  if (%as.enable == Yes) { echo -a -[Anti-Spam]- 12,8Anti-Spam is 5,8READY12,8 to kill the spammers!!! | linesep }
  if (%as.logwin == 1) { %as.writespamlog = On | window -nCk +nxstl @SpamLog 100 100 | loadbuf -p @SpamLog %as.filelog | %as.en.log = Yes }
}
#antispam120 off
on 1:TEXT:*:?:as.check.query $nick $1-
on 1:TEXT:*:#:as.check.chan $nick $1-
on ^1:NOTICE:*:?:as.check.p.notice $nick $1-
on ^1:NOTICE:*:#:as.check.c.notice $nick $1-
#antispam120 end

;#########################################################
;Anti-Spam Popups
;#########################################################
menu status {
  Anti-Spam v12.0 :antispam
}
menu @SpamLog {
  $iif(%as.en.log == Yes,$style(1)) &On:if ($dialog(antispam) != $null) { { did -c antispam 23 | set %as.en.log Yes } | else set %as.en.log Yes }
  $iif(%as.en.log == $null,$style(1)) O&ff:if ($dialog(antispam) != $null) { { did -u antispam 23 | unset %as.en.log } | else unset %as.en.log }
  -
  &Minimize:window -n @SpamLog
  &Clear:clear @SpamLog
  -
  &Reset {
    clear @SpamLog
    write -c %as.filelog 
    write %as.filelog Anti-Spam v12.0 by kidd2k
    write %as.filelog [[ Log file ]]
    write %as.filelog $str(-,100) 
    loadbuf 3 @SpamLog %as.filelog
  }
  -
  C&lose:close -@SpamLog
  -
  Anti-Spam v12.0
  .&Setup...:antispam
  .-
  .$iif(%as.en.stat == Y,$style(1)) &On:{ .timer_chkact off | set %as.en.stat Y | set %as.enable Yes | .enable #antispam120 | set %as.echo No | as.getenable }
  .$iif(%as.en.stat == $null,$style(1)) O&ff:{ unset %as.en.stat | set %as.enable No | .disable #antispam120 | set %as.echo Yes | as.getenable }
  .-
  .Add spam-&word...:as.word.add
  .Add s/one to f&riends list...:set -u %popask 1 | as.nick.add
  .Add ignored channel...:set -u %popask 1 | as.ichan.add
  .-
  .&About...:as.about
}