on *:dialog:cprot.*.edit:sclick:7:{ tokenize 32 $did($did,1) if (slclick select * iswm $1-) { if ($5) { did -e $dname 11 } else { did -b $dname 11,30 } if ($5) && (!$6) { did -e $dname 30 } else { did -b $dname 30 } } } on *:dialog:cprot.*.edit:sclick:30:{ did -i $dname 7 1 page select did -i $dname 7 1 cb root $wd($did(7,1),4-5) set %cprot.editaction $gettok($wd($prot.svac,$calc($wd($did(7,1),5) -1)),2-,58) noop $dialog(cp.actionadd,cp.actionadd,-4) unset %cprot.editaction } on *:dialog:cprot.*.edit:sclick:11:{ prot.delocc } on *:dialog:cprot.*.edit:sclick:15:{ prot.addocc } dialog cprot.ctcpflood.edit,cprot.join-/partflood.edit,cprot.mass-deop.edit,cprot.noticeflood.edit,cprot.repeating.edit,cprot.textflood.edit { title "Edit channel protection" size -1 -1 248 266 option pixels icon script\pics\nntray.ico box "", 1, 4 2 240 86 check "&Enable protection", 14, 12 20 108 18 text "Times", 2, 32 42 32 16 text "Seconds", 3, 32 64 46 16 edit "", 5, 118 38 118 22, limit 3 edit "", 6, 118 60 118 22, limit 3 list 7, 12 112 142 112, size box "Actions to perform", 4, 4 96 240 136 button "&Add occasion", 15, 158 114 76 24 button "&Edit actions", 30, 158 138 76 24, disable button "&Remove", 11, 158 168 76 24, disable button "&Ok", 8, 80 238 80 24 button "&Cancel", 9, 164 238 80 24, cancel } on *:dialog:cprot.ctcpflood.edit:*:*:{ cprot.genflooddlg } on *:dialog:cprot.join-/partflood.edit:*:*:{ cprot.genflooddlg } on *:dialog:cprot.mass-deop.edit:*:*:{ cprot.genflooddlg } on *:dialog:cprot.noticeflood.edit:*:*:{ cprot.genflooddlg } on *:dialog:cprot.repeating.edit:*:*:{ cprot.genflooddlg } on *:dialog:cprot.textflood.edit:*:*:{ cprot.genflooddlg } alias cprot.genflooddlg { if ($devent == init) { mdx SetControlMDX $dname 7 TreeView haslines hasbuttons showsel notooltips > script\dlls\views.mdx cprot.edload did -a $dname 1 $cell(settings,115,1) protection $nbr($did(settings,112).seltext) cprot.chkstate 2,3,4,5,6,7,15 } elseif ($devent == sclick) { if ($did == 8) { if ($did(5) isnum 1-999) && ($did(6) isnum 1-999) { cprot.edsave dialog -c $dname } else { errdialog please enter valid numbers for the "Times" and "Seconds" fields! } } elseif ($did == 14) { if ($did($did).state) { did -e $dname 2,5,7,4,15 if ($did(5) != 1) { did -e $dname 3,6 } } else { did -b $dname 2,3,5,6,7,4,11,15 } did -u $dname 7 } } elseif ($devent == edit) { if ($istok(5 6,$did,32)) { numonlyedit $dname $did } if ($did == 5) { did $iif($did($did) == 1,-b,-e) $dname 3,6 } } } dialog cprot.codes.edit { title "Edit channel protection" size -1 -1 248 366 option pixels icon script\pics\nntray.ico box "", 1, 4 2 240 86 check "&Enable protection", 14, 12 20 108 18 text "Times", 2, 32 42 32 16 text "Seconds", 3, 32 64 46 16 edit "", 5, 118 38 118 22, limit 3 edit "", 6, 118 60 118 22, limit 3 box "Trigger on these control codes", 12, 4 94 240 96 check "A&ll", 13, 12 112 40 18 check "Color&s", 16, 70 112 56 18 check "Re&verse", 20, 146 112 64 18 check "&Bold", 17, 70 128 46 18 check "Rese&t", 19, 146 128 56 18 check "&Underline", 18, 70 144 70 18 text "Min. number of codes in text", 21, 14 164 140 16 edit "", 22, 162 160 74 22, limit 3 box "Actions to perform", 4, 4 196 240 136 list 7, 12 212 142 112, size button "&Add occasion", 15, 158 214 76 24 button "&Edit actions", 30, 158 238 76 24, disable button "&Remove", 11, 158 268 76 24, disable button "&Ok", 8, 80 338 80 24 button "&Cancel", 9, 164 338 80 24, cancel } on *:dialog:cprot.codes.edit:*:*:{ if ($devent == init) { mdx SetControlMDX $dname 7 TreeView haslines hasbuttons showsel notooltips > script\dlls\views.mdx cprot.edload var %s = $did(settings,112).seltext,%t = %cprot. [ $+ [ %s ] $+ ] .codes.trig did -a $dname 1 Control codes protection $nbr(%s) did -a $dname 22 %cprot. [ $+ [ %s ] $+ ] .codes.mincodes if ( isin %t) { did -c $dname 16 } if ( isin %t) { did -c $dname 17 } if ( isin %t) { did -c $dname 18 } if ( isin %t) { did -c $dname 20 } if ( isin %t) { did -c $dname 19 } if ($regex(%t,/[]/g) == 5) { did -c $dname 13 did -b $dname 16,17,18,19,20 } cprot.chkstate 2,3,4,5,6,7,12,15,13,16,17,18,19,20,21,22 } elseif ($devent == sclick) { if ($did == 8) { if ($did(5) isnum 1-999) && ($did(6) isnum 1-999) { set %cprot. [ $+ [ $did(settings,112).seltext ] $+ ] .codes.mincodes $iif($did(22),$did(22),1) set %cprot. [ $+ [ $did(settings,112).seltext ] $+ ] .codes.trig $+(/[,$iif($did(13).state,,$+($iif($did(16).state,),$iif($did(17).state,),$iif($did(18).state,),$iif($did(20).state,),$iif($did(19).state,))),]/g) cprot.edsave dialog -c $dname } else { errdialog please enter valid numbers for the "Times" and "Seconds" fields! } } elseif ($did == 13) { did $iif($did($did).state,-b,-e) $dname 16,17,18,19,20 } elseif ($did == 14) { if ($did($did).state) { if ($did(13).state) { did -e $dname 2,5,7,4,15,12,13 } else { did -e $dname 2,5,7,4,15,12,13,16,17,18,19,20 } if ($did(5) != 1) { did -e $dname 3,6 } did -e $dname 21,22 } else { did -b $dname 2,3,5,6,7,4,11,15,12,13,16,17,18,19,20,21,22 } did -u $dname 7 } } elseif ($devent == edit) { if ($istok(5 6 22,$did,32)) { numonlyedit $dname $did } if ($did == 5) { did $iif($did($did) == 1,-b,-e) $dname 3,6 } } } alias cprot.chkstate { if ($wd($did(settings,115).seltext,5) == 2) { did -c $dname 14 } else { did -b $dname $1 } } dialog cprot.caps.edit { title "Edit channel protection" size -1 -1 248 308 option pixels icon script\pics\nntray.ico box "", 1, 4 2 240 110 check "&Enable protection", 14, 12 20 108 18 text "Times", 2, 32 42 32 16 edit "", 5, 118 38 118 22, limit 3 text "Seconds", 3, 32 64 46 16 edit "", 6, 118 60 118 22, limit 3 text "Caps amount", 12, 32 86 70 16 edit "", 13, 118 82 96 22, limit 3 text "%", 16, 218 86 16 14 box "Actions to perform", 4, 4 118 240 156 list 7, 12 134 142 132, size button "&Add occasion", 15, 158 136 76 24 button "&Edit actions", 30, 158 160 76 24, disable button "&Remove", 11, 158 190 76 24, disable button "&Ok", 8, 80 280 80 24 button "&Cancel", 9, 164 280 80 24, cancel } on *:dialog:cprot.caps.edit:*:*:{ if ($devent == init) { mdx SetControlMDX $dname 7 TreeView haslines hasbuttons showsel notooltips > script\dlls\views.mdx cprot.edload var %s = $did(settings,112).seltext did -a $dname 1 Caps protection $nbr(%s) did -a $dname 13 $calc(%cprot. [ $+ [ %s ] $+ ] .caps.percent *100) cprot.chkstate 2,3,4,5,6,7,12,15,13,16 } elseif ($devent == sclick) { if ($did == 8) { if ($did(5) isnum 1-999) && ($did(6) isnum 1-999) { set %cprot. [ $+ [ $did(settings,112).seltext ] $+ ] .caps.percent $calc($did(13) /100) cprot.edsave dialog -c $dname } else { errdialog please enter valid numbers for the "Times" and "Seconds" fields! } } elseif ($did == 14) { if ($did($did).state) { did -e $dname 2,5,7,4,12,13,15,16 if ($did(5) != 1) { did -e $dname 3,6 } } else { did -b $dname 2,3,5,6,7,4,11,15,12,13,16 } did -u $dname 7 } } elseif ($devent == edit) { if ($istok(5 6 13,$did,32)) { numonlyedit $dname $did } if ($did == 5) { did $iif($did($did) == 1,-b,-e) $dname 3,6 } } } dialog cprot.badword.edit { title "Edit channel protection" size -1 -1 248 364 option pixels icon script\pics\nntray.ico box "", 1, 4 2 240 86 check "&Enable protection", 14, 12 20 108 18 text "Times", 2, 32 42 32 16 edit "", 5, 118 38 118 22, limit 3 text "Seconds", 3, 32 64 46 16 edit "", 6, 118 60 118 22, limit 3 box "Bad words", 12, 4 94 240 94 list 100, 12 110 142 68, sort size extsel vsbar button "&Add", 101, 158 112 76 24 button "Re&move", 102, 158 136 76 24 box "Actions to perform", 4, 4 194 240 136 list 7, 12 210 142 112, size button "Add o&ccasion", 15, 158 212 76 24 button "&Edit actions", 30, 158 236 76 24, disable button "&Remove", 11, 158 266 76 24, disable button "&Ok", 8, 80 336 80 24 button "&Cancel", 9, 164 336 80 24, cancel } on *:dialog:cprot.badword.edit:*:*:{ if ($devent == init) { mdx SetControlMDX $dname 7 TreeView haslines hasbuttons showsel notooltips > script\dlls\views.mdx cprot.edload var %s = $did(settings,112).seltext did -a $dname 1 Badword protection $nbr(%s) didtok $dname 100 44 $mkregex(%cprot. [ $+ [ %s ] $+ ] .badword.words).re cprot.chkstate 2,3,4,5,6,7,12,15,100,101,102 } elseif ($devent == sclick) { if ($did == 8) { if ($did(5) isnum 1-999) && ($did(6) isnum 1-999) { set %cprot. [ $+ [ $did(settings,112).seltext ] $+ ] .badword.words $mkregex($didtok(100,44)) cprot.edsave dialog -c $dname } else { errdialog please enter valid numbers for the "Times" and "Seconds" fields! } } elseif ($did == 101) { var %x = $$eddialog(Enter a new bad word!) if (!$didwm(100,%x)) { did -a $dname 100 %x } else { errdialog this bad word is already in the list! } } elseif ($did == 100) { did $iif($did($did).sel,-e,-b) $dname 102 } elseif ($did == 102) { while ($did(100).sel) { did -d $dname 100 $v1 } did -b $dname 102 } elseif ($did == 14) { if ($did($did).state) { did -e $dname 2,5,7,4,15,12,100,101 if ($did(5) != 1) { did -e $dname 3,6 } } else { did -b $dname 2,3,5,6,7,4,11,15,12,100,101,102 } did -u $dname 100,7 } } elseif ($devent == edit) { if ($istok(5 6,$did,32)) { numonlyedit $dname $did } if ($did == 5) { did $iif($did($did) == 1,-b,-e) $dname 3,6 } } } dialog cprot.advertising.edit { title "Edit channel protection" size -1 -1 248 364 option pixels icon script\pics\nntray.ico box "", 1, 4 2 240 86 check "&Enable protection", 14, 12 20 108 18 text "Times", 2, 32 42 32 16 edit "", 5, 118 38 118 22, limit 3 text "Seconds", 3, 32 64 46 16 edit "", 6, 118 60 118 22, limit 3 box "Strictness", 12, 4 94 240 94 list 13, 16 108 32 72, size text "", 16, 62 110 172 16 text "", 17, 62 126 172 52 box "Actions to perform", 4, 4 194 240 136 list 7, 12 210 142 112, size button "&Add occasion", 15, 158 212 76 24 button "&Edit actions", 30, 158 236 76 24, disable button "&Remove", 11, 158 266 76 24, disable button "&Ok", 8, 80 336 80 24 button "&Cancel", 9, 164 336 80 24, cancel } on *:dialog:cprot.advertising.edit:*:*:{ if ($devent == init) { mdx SetControlMDX $dname 7 TreeView haslines hasbuttons showsel notooltips > script\dlls\views.mdx mdx SetControlMDX $dname 13 TrackBar vertical > script\dlls\bars.mdx mdx SetBorderStyle $dname 13 var %s = $did(settings,112).seltext did -i $dname 13 1 params %cprot. [ $+ [ %s ] $+ ] .advertising.strict 1 3 * * * * 20 did -i $dname 13 1 ticfreq 1 bold $dname 16 adprot.sref cprot.edload cprot.chkstate 2,3,4,5,6,7,12,13,15,16,17 did -a $dname 1 Advertising protection $nbr(%s) } elseif ($devent == sclick) { if ($did == 13) { adprot.sref } elseif ($did == 8) { if ($did(5) isnum 1-999) && ($did(6) isnum 1-999) { set %cprot. [ $+ [ $did(settings,112).seltext ] $+ ] .advertising.strict $gettok($did(13,1),1,32) cprot.edsave dialog -c $dname } else { errdialog please enter valid numbers for the "Times" and "Seconds" fields! } } elseif ($did == 14) { if ($did($did).state) { did -e $dname 2,5,7,4,15,12,13,16,17 if ($did(5) != 1) { did -e $dname 3,6 } } else { did -b $dname 2,3,5,6,7,4,11,15,12,13,16,17 } did -u $dname 7 } } elseif ($devent == edit) { if ($istok(5 6,$did,32)) { numonlyedit $dname $did } if ($did == 5) { did $iif($did($did) == 1,-b,-e) $dname 3,6 } } } alias prot.addocc { did -i $dname 7 1 cb root 2 var %n = $did(7).lines if (%n < 6) { did -i $dname 7 1 cb root 2 did -a $dname 7 +e 1 1 0 0 0 $ord(%n) occasion } else { errdialog you can only add up to 5 occasions! } } alias prot.cleanini { hmake cleanini var %v = $var(%?prot.*.action,0) while (%v) { var %c = $var(%?prot.*.action,%v),%e = [ [ %c ] ] if ($regex(num,%e,/(?:cm|cc|s|es|k|kl|bn)\-([0-9A-Z]+)|(?:wu\-\d\-([0-9A-Z]+))/g)) { var %z = 1 while ($regml(num,%z)) { hadd cleanini $v1 1 inc %z } } dec %v } .fopen $iif(!$isfile(script\txt\paction.ini),-o) paction.old script\txt\paction.ini .fopen -o paction.new script\txt\paction.new while (!$feof) { var %l = $fread(paction.old) if (%l) && (($hget(cleanini,$gettok(%l,1,61))) || ([*] iswm %l)) { .fwrite -n paction.new %l } } .fclose paction.* .remove script\txt\paction.ini .rename script\txt\paction.new script\txt\paction.ini hfree cleanini } alias prot.delocc { did -i $dname 7 1 page select var %t = $gettok($did(7,1),4-,32) did -i $dname 7 1 cb root $deltok(%t,-1,32) did -d $dname 7 $wd(%t,-1) if ($numtok(%t,32) == 2) { var %i = $did(7).lines while (%i > 1) { did -i $dname 7 1 replaceitem %i $puttok($did(7,%i),$ord($calc(%i -1)),7,32) dec %i } } did -u $dname 7 did -b $dname 11,30 } alias cprot.edsave { var %s = $did(settings,112).seltext,%t = $cell(settings,115,1),%r = $prot.svac,%d,%z set %cprot. [ $+ [ %s ] $+ ] . [ $+ [ %t ] ] $did(14).state set %cprot. [ $+ [ %s ] $+ ] . [ $+ [ %t ] $+ ] .action %r if ($1 != -c) { set %cprot. [ $+ [ %s ] $+ ] . [ $+ [ %t ] $+ ] .secs $did(6) %d = $did(6) } if ($1 != -i) { set %cprot. [ $+ [ %s ] $+ ] . [ $+ [ %t ] $+ ] .times $did(5) %z = $did(5) } did -o settings 115 $did(settings,115).sel 0 +fs 0 0 $calc($did(14).state +1) $cell(settings,115,1) $+ + 0 0 0 $iif(%z,%z,n/a) $+ + 0 0 0 $iif(%d && %z != 1,%d $+ $iif($1 == -i,*60),n/a) $+ + 0 0 0 $prot.traction(%r) $+  $+ $gettok($did(settings,115).seltext,2-,4) prot.cleanini } alias cprot.aload { var %i = 1 did -i $dname 7 1 cb root did -a $dname 7 +be 1 1 0 0 0 Actions did -i $dname 7 1 cb last while (%i <= $0) { did -a $dname 7 +e 1 1 0 0 0 $ord(%i) occasion did -i $dname 7 1 cb last var %v = 1,%z = $numtok($ [ $+ [ %i ] ],43) while (%v <= %z) { var %u = $gettok($gettok($ [ $+ [ %i ] ],2-,58),%v,43) if (%u) { did -a $dname 7 + 1 1 0 0 0 $+($prot.naction(%u), ,%u) } inc %v } did -i $dname 7 1 cb up inc %i } } alias cprot.edload { var %x = $cell(settings,115,1),%s = $did(settings,112).seltext if ($1 != -c) { did -a $dname 6 %cprot. [ $+ [ %s ] $+ ] . [ $+ [ %x ] $+ ] .secs } if ($1 != -i) { did -a $dname 5 %cprot. [ $+ [ %s ] $+ ] . [ $+ [ %x ] $+ ] .times } if (!$1) && ($did(5) == 1) { did -b $dname 3,6 } cprot.aload %cprot. [ $+ [ %s ] $+ ] . [ $+ [ %x ] $+ ] .action } alias adprot.sref { var %x = $wd($did(13,1),1) if (%x == 1) { did -ra $dname 16 High: did -ra $dname 17 The protection immediately triggers whenever a #channel or URL is mentioned in the channel you are protecting. } elseif (%x == 2) { did -ra $dname 16 Medium (recommended): did -ra $dname 17 The protection is only triggered when a #channel/URL along with a trigger like "join" or "visit" is mentioned. } else { did -ra $dname 16 Low: did -ra $dname 17 The protection is only triggered when a #chan/URL along with a trigger like "visit" is mentioned and there are control codes in the text. } } alias cprot.edit { var %s = $+(cprot.,$cell(115,1),.edit) noop $dialog(%s,%s,-4) } alias cprot.setsave { var %i = $did(settings,115).lines while (%i > 1) { set $+(%,cprot.,$did(settings,112).seltext,.,$cell(settings,115,%i,1)) $calc($wd($did(settings,115,%i),5) -1) dec %i } } alias cprot.loaddef { var %c = $+(cprot.,$did(settings,112).seltext,.) set % $+ %c $+ advertising 0 | set % $+ %c $+ advertising.strict 2 | set % $+ %c $+ advertising.times 1 | set % $+ %c $+ advertising.secs 30 | set % $+ %c $+ advertising.action 1:wu-1-d 2:b-1800-3+k-d set % $+ %c $+ badword 0 | set % $+ %c $+ badword.times 1 | set % $+ %c $+ badword.secs 30 | set % $+ %c $+ badword.action 1:wu-1-d 2:b-1800-3+k-d | unset % [ $+ [ %c ] $+ ] badword.words set % $+ %c $+ caps 0 | set % $+ %c $+ caps.times 2 | set % $+ %c $+ caps.secs 30 | set % $+ %c $+ caps.percent 0.9 | set % $+ %c $+ caps.action 1:wu-1-d 2:b-1800-3+k-d set % $+ %c $+ codes 0 | set % $+ %c $+ codes.mincodes 3 | set % $+ %c $+ codes.trig /[]/g | set % $+ %c $+ codes.times 2 | set % $+ %c $+ codes.secs 30 | set % $+ %c $+ codes.action 1:wu-1-d 2:b-1800-3+k-d set % $+ %c $+ ctcpflood 1 | set % $+ %c $+ ctcpflood.times 2 | set % $+ %c $+ ctcpflood.secs 10 | set % $+ %c $+ ctcpflood.action 1:wu-1-d 2:b-1800-3+k-d set % $+ %c $+ join-/partflood 0 | set % $+ %c $+ join-/partflood.times 5 | set % $+ %c $+ join-/partflood.secs 10 | set % $+ %c $+ join-/partflood.action 1:wu-1-d 2:b-1800-3+k-d set % $+ %c $+ mass-deop 0 | set % $+ %c $+ mass-deop.times 4 | set % $+ %c $+ mass-deop.secs 10 | set % $+ %c $+ mass-deop.action 1:wu-1-d 2:b-1800-3+k-d set % $+ %c $+ noticeflood 1 | set % $+ %c $+ noticeflood.times 2 | set % $+ %c $+ noticeflood.secs 20 | set % $+ %c $+ noticeflood.action 1:wu-1-d 2:b-1800-3+k-d set % $+ %c $+ repeating 1 | set % $+ %c $+ repeating.times 3 | set % $+ %c $+ repeating.secs 10 | set % $+ %c $+ repeating.action 1:wu-1-d 2:b-1800-3+k-d set % $+ %c $+ textflood 0 | set % $+ %c $+ textflood.times 8 | set % $+ %c $+ textflood.secs 6 | set % $+ %c $+ textflood.action 1:wu-1-d 2:b-1800-3+k-d if ($dialog(settings)) { cprot.setload } prot.cleanini } alias cprot.setload { var %s = $did(settings,112).seltext,%c = cprot. $+ %s,%t,%x = Advertising Badword Caps Codes CTCPflood Join-/Partflood Mass-deop Noticeflood Repeating Textflood,%i = 1 did -b settings 117 if ((% [ $+ [ %c ] $+ ] .usepreset) || (%cprot.presetonly)) && (%s != Preset) { did -b settings 37,145,146,147,36,115 } else { did -e settings 37,145,146,147,36,115 } if (%s != Preset) && (!%cprot.presetonly) { did -e $dname 144 } else { did -b $dname 144 } did $iif(%s == Preset,-b,-e) settings 114 did $iif(% [ $+ [ %c ] $+ ] .usepreset,-c,-u) settings 144 did $iif(% [ $+ [ %c ] $+ ] .punishops,-c,-u) settings 145 did $iif(% [ $+ [ %c ] $+ ] .punishvoiced,-c,-u) settings 146 window -h @cprot.setload while ($wd(%x,%i)) { var %u = $v1,%t = [ % [ $+ [ %c ] $+ ] . [ $+ [ %u ] $+ ] .times ] echo @cprot.setload 0 + 0 0 $iif( [ % [ $+ [ %c ] $+ ] . [ $+ [ %u ] ] ] ,2,1) %u $+ + 0 0 0 %t $+ + 0 0 0 $iif(%t == 1,n/a, [ % [ $+ [ %c ] $+ ] . [ $+ [ %u ] $+ ] .secs ] ) $+ + 0 0 0 $prot.traction( [ % [ $+ [ %c ] $+ ] . [ $+ [ %u ] $+ ] .action ] ) inc %i } filter -cwo @cprot.setload settings 115 close -@ @cprot.setload } alias prot.naction { if ($1 == bl) { return Blacklist user } elseif ($1 == do) { return Deop/devoice user } elseif ($1 == bp) { return Beep } elseif ($1 == cq) { return Close query } elseif ($1 == fl) { return Flash mIRC } elseif (es-* iswm $1) { return Echo msg. } elseif (bn-* iswm $1) { return Show balloon } elseif (wu-* iswm $1) { return Warn user } elseif ($regex(cp2,$1,/^b-(\d+)-.+$/)) { return Ban user $iif($regml(cp2,1),$nbr($calc($v1 /60) $+ m)) } elseif (k-* iswm $1) { return Kick user } elseif (kl-* iswm $1) { return Kill user } elseif ($regex(cp1,$1,/^i-.+-(\d+)-.+$/)) { return Ignore user $iif($regml(cp1,1),$nbr($calc($v1 /60) $+ m)) } elseif (cc-* iswm $1) { return Custom command } elseif (cm-* iswm $1) { return Change channel modes } elseif (s-* iswm $1) { return Play sound } elseif ($1 == us) { return Unban self } elseif ($1 == is) { return Ignore spam } } dialog cp.actionadd { title "Add action" size -1 -1 301 272 option pixels icon script\pics\nntray.ico tab "Warnings", 1, 4 6 292 236 check "&Beep (if sounds are enabled)", 7, 14 34 162 18, tab 1 check "&Flash mIRC (if minimized)", 6, 14 50 142 18, tab 1 check "&Show echo message to self:", 24, 14 66 158 18, tab 1 edit " triggered your protection in ! Taking countermeasures...", 15, 30 84 256 22, disable tab 1 autohs limit 200 check "S&how balloon tip (if enabled), message:", 8, 14 108 214 18, tab 1 edit " triggered your protection in ! Taking countermeasures...", 9, 30 126 256 22, disable tab 1 autohs limit 200 check "W&arn user, message:", 22, 14 152 128 18, tab 1 edit "Don't in ! Taking countermeasures...", 23, 30 170 256 22, disable tab 1 autohs limit 200 text "Send as", 3, 32 196 44 16, disable tab 1 radio "¬ice", 2, 82 194 54 18, disable tab 1 radio "&private message", 4, 82 212 104 18, disable tab 1 tab "Control", 13 check "&Ban user", 35, 14 34 68 18, tab 13 check "&Unban after", 32, 32 50 84 18, disable tab 13 combo 51, 124 48 56 134, disable tab 13 size edit limit 3 drop text "minutes", 34, 192 52 42 16, disable tab 13 text "Ban mask:", 21, 50 76 54 16, disable tab 13 combo 36, 124 72 162 170, disable tab 13 size drop check "&Deop/devoice user", 29, 14 98 116 18, tab 13 check "&Kick user, reason:", 25, 14 114 110 18, tab 13 edit "Don't !", 26, 30 132 256 22, disable tab 13 autohs limit 200 check "K&ill user (IRCop only), reason:", 55, 14 158 168 18, tab 13 edit "Don't !", 56, 30 176 256 22, disable tab 13 autohs limit 200 tab "Ignore", 14 check "&Ignore", 38, 14 34 56 18, tab 14 check "&Complete", 54, 32 50 68 18, disable tab 14 check "&Private", 39, 32 66 60 18, disable tab 14 check "&DCC", 43, 122 66 48 18, disable tab 14 check "C&hannel", 40, 32 82 64 18, disable tab 14 check "I&nvite", 44, 122 82 54 18, disable tab 14 check "N&otice", 41, 32 98 54 18, disable tab 14 check "Co&des", 45, 122 98 54 18, disable tab 14 check "C&TCP", 42, 32 114 52 18, disable tab 14 check "&Remove after", 46, 32 130 88 18, disable tab 14 combo 33, 124 128 56 134, disable tab 14 size edit limit 3 drop text "minutes", 48, 192 132 42 16, disable tab 14 text "Ignore mask:", 49, 50 156 66 16, disable tab 14 combo 50, 124 152 162 170, disable tab 14 size drop tab "Misc.", 5 check "&Blacklist user", 16, 14 34 86 18, tab 5 check "&Custom command:", 30, 14 50 110 18, tab 5 edit "", 31, 30 68 256 22, disable tab 5 autohs limit 200 check "&Set channel mode(s):", 27, 14 94 124 18, tab 5 edit "+", 28, 30 112 256 22, disable tab 5 autohs limit 50 check "&Play sound:", 47, 14 136 80 18, tab 5 edit "", 52, 30 154 220 22, disable tab 5 autohs limit 400 button "&...", 53, 252 154 34 22, disable tab 5 tab "Help", 37 text "Here is a list of identifiers you can use in your custom kick messages and warnings:", 11, 14 36 262 26, tab 37 list 10, 12 80 114 150, tab 37 sort size vsbar text "Description:", 17, 136 66 60 14, tab 37 text "No item selected.", 18, 136 80 148 148, tab 37 text "Identifiers:", 12, 14 66 56 14, tab 37 button "&Ok", 19, 133 244 80 24 button "&Cancel", 20, 217 244 80 24, cancel } on *:dialog:cp.actionadd:*:*:{ if ($devent == init) { didtok $dname 33,51 44 2,5,10,30,60,120,300 did -c $dname 2,33,51 3 var %i = 0 while (%i <= 9) { did -a $dname 36,50 $+([,%i,]) $mask(nick!ident@some.host.com,%i) inc %i } did -c $dname 36 %ban.mask did -c $dname 50 %ignore.mask didtok $dname 10 44 ,,,,,,,, var %i = 1,%t = $numtok(%cprot.editaction,43) while (%i <= %t) { tokenize 45 $gettok(%cprot.editaction,%i,43) if ($1 == bl) { did -c $dname 16 } elseif ($1 == do) { did -c $dname 29 } elseif ($1 == bp) { did -c $dname 7 } elseif ($1 == fl) { did -c $dname 6 } elseif ($1 == es) { did -c $dname 24 did -e $dname 15 if ($2 != d) { did -ra $dname 15 $decode($readini(script\txt\paction.ini,cpaction,$2),m) } } elseif ($1 == bn) { did -c $dname 8 did -e $dname 9 if ($2 != d) { did -ra $dname 9 $decode($readini(script\txt\paction.ini,cpaction,$2),m) } } elseif ($1 == wu) { did -c $dname 22 did -e $dname 23,2,3,4 if (!$2) { did -u $dname 2 did -c $dname 4 } if ($3 != d) { did -ra $dname 23 $decode($readini(script\txt\paction.ini,cpaction,$3),m) } } elseif ($1 == b) { did -c $dname 35 did -e $dname 32,34,21,36 if ($2) { did -c $dname 32 did -e $dname 51 if ($didwm(51,$calc($2 /60))) { did -c $dname 51 $v1 } else { did -ac $dname 51 $calc($2 /60) } } did -c $dname 36 $calc($3 +1) } elseif ($1 == k) { did -c $dname 25 did -e $dname 26 if ($2 != d) { did -ra $dname 26 $decode($readini(script\txt\paction.ini,cpaction,$2),m) } } elseif ($1 == kl) { did -c $dname 55 did -e $dname 56 if ($2 != d) { did -ra $dname 56 $decode($readini(script\txt\paction.ini,cpaction,$2),m) } } elseif ($1 == i) { did -c $dname 38 did -e $dname 54,48,46,49,50 if ($2 == a) { did -c $dname 54 } else { did -e $dname 39,40,41,42,43,44,45 if (p isin $2) { did -c $dname 39 } if (c isin $2) { did -c $dname 40 } if (n isin $2) { did -c $dname 41 } if (t isin $2) { did -c $dname 42 } if (d isin $2) { did -c $dname 43 } if (i isin $2) { did -c $dname 44 } if (k isin $2) { did -c $dname 45 } } if ($3) { did -c $dname 46 did -e $dname 33 if ($didwm(33,$calc($3 /60))) { did -c $dname 33 $v1 } else { did -ac $dname 33 $calc($3 /60) } } did -c $dname 50 $calc($4 +1) } elseif ($1 == cc) { did -c $dname 30 did -e $dname 31 if ($2 != d) { did -ra $dname 31 $decode($readini(script\txt\paction.ini,cpaction,$2),m) } } elseif ($1 == cm) { did -c $dname 27 did -e $dname 28 if ($2 != d) { did -ra $dname 28 $decode($readini(script\txt\paction.ini,cpaction,$2),m) } } elseif ($1 == s) { did -c $dname 47 did -e $dname 52,53 if ($2 != d) { did -ra $dname 52 $decode($readini(script\txt\paction.ini,cpaction,$2),m) } } inc %i } } elseif ($devent == sclick) { if ($did == 10) { var %s = $did($did).seltext if (%s == ) { did -ra $dname 18 is replaced with the channel the protection is triggered in. } elseif (%s == ) { did -ra $dname 18 is replaced with the action the user shouldn't have taken (e.g: "use too many control codes"). } elseif (%s == ) { did -ra $dname 18 is replaced with the type of protection that triggered. } elseif (%s == ) { did -ra $dname 18 is replaced with the nick of the person who triggered the protection. } elseif (%s == ) { did -ra $dname 18 is replaced with the amount of times the nickname needed to flood/repeat/etc. until the protection triggered. } elseif (%s == ) { did -ra $dname 18 is replaced with the amount of seconds the nickname needed to perform the flood to trigger the protection. } elseif (%s == ) { did -ra $dname 18 is replaced with the occasion number the nickname is flooding. } elseif (%s == ) { did -ra $dname 18 is replaced with the type of reaction the protection triggers. } elseif (%s == ) { did -ra $dname 18 is replaced with the type of reaction the protection triggers when the user is flooding again. } } elseif ($did == 24) { did $iif($did($did).state,-e,-b) $dname 15 } elseif ($did == 8) { did $iif($did($did).state,-e,-b) $dname 9 } elseif ($did == 22) { did $iif($did($did).state,-e,-b) $dname 23,2,3,4 } elseif ($did == 35) { did $iif($did($did).state,-e,-b) $dname 32,34,21,36 if ($did($did).state) && ($did(32).state) { did -e $dname 51 } else { did -b $dname 51 } } elseif ($did == 32) { did $iif($did($did).state,-e,-b) $dname 51 } elseif ($did == 25) { did $iif($did($did).state,-e,-b) $dname 26 } elseif ($did == 55) { did $iif($did($did).state,-e,-b) $dname 56 } elseif ($did == 38) { did $iif($did($did).state,-e,-b) $dname 54,48,46,49,50 if (!$did(54).state) || (!$did($did).state) { did $iif($did($did).state,-e,-b) $dname 39,40,41,42,43,44,45 } if ($did($did).state) && ($did(46).state) { did -e $dname 33 } else { did -b $dname 33 } } elseif ($did == 54) { did $iif($did($did).state,-b,-e) $dname 39,40,41,42,43,44,45 } elseif ($did == 46) { did $iif($did($did).state,-e,-b) $dname 33 } elseif ($did == 30) { did $iif($did($did).state,-e,-b) $dname 31 } elseif ($did == 27) { did $iif($did($did).state,-e,-b) $dname 28 } elseif ($did == 47) { did $iif($did($did).state,-e,-b) $dname 52,53 } elseif ($did == 53) { did -ra $dname 52 $relpath($$sfile(*.wav;*.mid;*.mp3;*.ogg;*.wma,Choose a sound file to play!)) } elseif ($did == 19) { var %r,%t = $cell(settings,115,1),%d = $+(cprot.,%t,.edit),%f = script\txt\paction.ini,%u if ($did(7).state) { %r = bp } if ($did(6).state) { %r = %r fl } if ($did(24).state) { if ($did(15)) { var %u = $trnum,%r = %r es- $+ %u writeini -n %f cpaction %u $encode($v1,m) } else { %r = %r es-d } } if ($did(8).state) { if ($did(9)) { var %u = $trnum,%r = %r bn- $+ %u writeini -n %f cpaction %u $encode($v1,m) } else { %r = %r bn-d } } if ($did(22).state) { var %z = $did(2).state if ($did(23)) { var %u = $trnum,%r = %r $+(wu-,%z,-,%u) writeini -n %f cpaction %u $encode($v1,m) } else { %r = %r $+(wu-,%z,-d) } } if ($did(35).state) { %r = %r $+(b-,$iif($did(32).state,$iif($int($did(51)) isnum,$calc($v1 *60),0),0),-,$calc($did(36).sel -1)) } if ($did(29).state) { %r = %r do } if ($did(25).state) { if ($did(26)) { var %u = $trnum,%r = %r k- $+ %u writeini -n %f cpaction %u $encode($v1,m) } else { %r = %r k-d } } if ($did(55).state) { if ($did(56)) { var %u = $trnum,%r = %r kl- $+ %u writeini -n %f cpaction %u $encode($v1,m) } else { %r = %r kl-d } } if ($did(38).state) { var %h if ($did(54).state) { %h = a } else { if ($did(39).state) { %h = p } if ($did(40).state) { %h = %h $+ c } if ($did(41).state) { %h = %h $+ n } if ($did(42).state) { %h = %h $+ t } if ($did(43).state) { %h = %h $+ d } if ($did(44).state) { %h = %h $+ i } if ($did(45).state) { %h = %h $+ k } if (!%h) { %h = a } } %r = %r $+(i-,%h,-,$iif($did(46).state,$iif($did(33) isnum,$calc($v1 *60),0),0),-,$calc($did(50).sel -1)) } if ($did(16).state) { %r = %r bl } if ($did(30).state) { if ($did(31)) { var %u = $trnum,%r = %r cc- $+ %u writeini -n %f cpaction %u $encode($v1,m) } else { %r = %r cc-d } } if ($did(27).state) { if ($did(28)) { var %u = $trnum,%r = %r cm- $+ %u writeini -n %f cpaction %u $encode($v1,m) } else { %r = %r cm-d } } if ($did(47).state) { if ($did(52)) { var %u = $trnum,%r = %r s- $+ %u writeini -n %f cpaction %u $encode($v1,m) } else { %r = %r s-d } } did -i %d 7 1 page select did -i %d 7 1 cb root $wd($did(%d,7,1),4-5) var %i = $numtok(%r,32),%wa,%o = $did(%d,7).lines while ($did(%d,7).lines > 1) { did -d %d 7 2 } if (%i > 5) { var %wa = 1,%r = $wd(%r,1-5),%i = 5 } while (%i) { did -a %d 7 + 1 1 0 0 0 $+($prot.traction(1: $+ $wd(%r,%i)), ,$wd(%r,%i)) dec %i } did -i %d 7 1 sort dialog -c $dname if (%wa) { errdialog you have chosen more than 5 actions so only the first 5 have been added! } } } } alias cprot.dchk { hadd -mu $+ %cprot. [ $+ [ %cprot.curchan ] $+ ] . [ $+ [ $1 ] $+ ] .secs cprot $+($1,.,$chan,.,$cid,.,$fulladdress,.t-,$trnum) 1 if ($hfind(cprot,$+($1,.,$chan,.,$cid,.,$fulladdress,.t-*),0,w) >= %cprot. [ $+ [ %cprot.curchan ] $+ ] . [ $+ [ $1 ] $+ ] .times) { cprot.dotrig $1 } } alias cprot.dotrig { if ($hget(cprot)) { hdel -w cprot $+($1,.,$chan,.,$cid,.,$fulladdress,.t-*) } hinc -mu3600 cprot $+($1,.,$chan,.,$cid,.,$fulladdress,.p) var %j,%o = $hget(cprot,$+($1,.,$chan,.,$cid,.,$fulladdress,.p)),%r = %cprot. [ $+ [ %cprot.curchan ] $+ ] . [ $+ [ $1 ] $+ ] .action if (%o >= $numtok(%r,32)) { hdel cprot $+($1,.,$chan,.,$cid,.,$fulladdress,.p) } var %x = 1,%c = $gettok($wd(%r,%o),2-,58) set %cprot.msgrep , $+ $chan $+ ,, $+ $1 $+ ,, $+ $cprot.repflood($1) $+ ,, $+ $nick $+ ,, $+ [ %cprot. [ $+ [ %cprot.curchan ] $+ ] . [ $+ [ $1 ] $+ ] .times ] $+ ,, $+ [ %cprot. [ $+ [ %cprot.curchan ] $+ ] . [ $+ [ $1 ] $+ ] .secs ] $+ ,, $+ %o $+ ,, $+ $prot.traction(1: $+ %c) $+ ,, $+ $iif($wd(%r,$calc(%o +1)),$prot.traction($v1),n/a) while ($gettok(%c,%x,43)) { var %t = $v1,%d if (%t == bp) { beep } elseif (%t == fl) { flash } elseif (%t == do) { mode $chan -ov $nick $nick } elseif (%t == bl) { prot.blackadd $iif($address($nick,%ban.mask),$v1,$nick $+ !*@*) Don't $cprot.repflood($1) $+ ! } elseif ($regex(cpt,%t,/^k-([0-9A-Z]+|d)$/)) { kick $chan $nick $iif($regml(cpt,1) != d,$cprot.getmsg($v1),Don't $cprot.repflood($1) $+ !) $kc } elseif ($regex(cpt,%t,/^kl-([0-9A-Z]+|d)$/)) { kill $nick $iif($regml(cpt,1) != d,$cprot.getmsg($v1),Don't $cprot.repflood($1) $+ !) } elseif ($regex(cpt,%t,/^es-([0-9A-Z]+|d)$/)) { if ($regml(cpt,1) != d) { thmecho -a $cprot.getmsg($v1) } else { thmecho -a $thmhl($nick) triggered your $thmhl($1) protection in $thmhl($chan) $+ . } } elseif ($regex(cpt,%t,/^bn-([0-9A-Z]+|d)$/)) { npop $1 protection in $+($chan,,$iif($regml(cpt,1) != d,$cprot.getmsg($v1),$nick triggered your $1 protection in $chan $+ .)) %j = 1 } elseif ($regex(cpt,%t,/^wu-(1|0)-([0-9A-Z]+|d)$/)) { $iif($regml(cpt,1),.notice,.msg) $nick $iif($regml(cpt,2) != d,$cprot.getmsg($v1),Don't $cprot.repflood($1) in $chan $+ !) } elseif ($regex(cpt,%t,/^b-(\d+)-([0-9])$/)) { ban $iif($regml(cpt,1),-u $+ $v1) $chan $nick $regml(cpt,2) } elseif ($regex(cpt,%t,/^i-([pcntdik]+|a)-(\d+)-([0-9])$/)) { .ignore $+(-,$iif($regml(cpt,1) != a,$v1),$iif($regml(cpt,2),u $+ $v1)) $nick $regml(cpt,3) } elseif ($regex(cpt,%t,/^cc-([0-9A-Z]+|d)$/)) { if ($regml(cpt,1) != d) { $cprot.getmsg($v1) } else { thmerror -a No command for the $thmhl($1) protection in $thmhl($chan) specified! } } elseif ($regex(cpt,%t,/^cm-([0-9A-Z]+|d)$/)) { if ($regml(cpt,1) != d) { mode $chan $cprot.getmsg($v1) } else { thmerror -a No channel mode change for the $thmhl($1) protection in $thmhl($chan) specified! } } elseif ($regex(cpt,%t,/^s-([0-9A-Z]+|d)$/)) { var %s = $cprot.getmsg($regml(cpt,1)) if ($regml(cpt,1) != d) && ($isfile(%s)) { splay %s } else { thmerror -a No sound for the $thmhl($1) protection in $thmhl($chan) specified! } } inc %x } if ($balloon.trig(c)) && (!%j) { npop Channel protection $+($iif($scid(0) > 1,$nbr($curconserv)),,$nick) triggered your $1 protection in $chan $+ ! Taking countermeasures... } unset %cprot.msgrep } alias prot.blackadd { if ($1 !iswm $address($me,5)) { hadd black $1- hsave -ob black script\tables\black.tbl if ($dialog(black)) { did -a black 5 0 + 0 0 0 $1 $+ + 0 0 0 $2 did -e black 17 } scon -at1 bkacs } } alias cprot.repflood { return $replacex($1-,advertising,advertise,badword,use bad words,caps,write in caps,codes,use too many control codes,ctcpflood,ctcp flood,join-/partflood,join-/partflood,mass-deop,mass-deop,noticeflood,notice flood,repeating,repeat yourself,textflood,text flood) } alias cprot.getmsg { return $replacex($decode($readini(script\txt\paction.ini,cpaction,$1),m), [ %cprot.msgrep ] ) } alias cprot.chkst { if (!$ccontrol($2)) || (!$prot.exclps($address($1,5))) { return 0 } if (%cprot. [ $+ [ $2 ] $+ ] .usepreset) || (%cprot.presetonly) { set %cprot.curchan Preset } else { set %cprot.curchan $2 } if (($1 isop $2) || ($1 ishop $2)) { if (%cprot. [ $+ [ %cprot.curchan ] $+ ] .punishops) { return 1 } } elseif ($1 isvoice $2) { if (%cprot. [ $+ [ %cprot.curchan ] $+ ] .punishvoiced) { return 1 } } else { return 1 } } alias cprot.chktxtevent { if ($cprot.chkst($nick,$chan)) { var %t = $strip($1-) if (%cprot. [ $+ [ %cprot.curchan ] $+ ] .advertising) { var %s = %cprot. [ $+ [ %cprot.curchan ] $+ ] .advertising.strict if ($regex(%t,/#[^\s]+|http://[^\s]+\.[^\s]+|www\.[^\s]+\.[^\s]+/)) { if (%s == 1) { cprot.dchk advertising } elseif ($regex(%t,/j[o0][i1]n|amsg|need|visit|brauch|besuch|komm|verlos|live|check|support|free|p[o0]rn|pr[o0]n|sex|pussy|idle|pl(?:s|z|ease)|perform/i)) { if (%s == 2) { cprot.dchk advertising } elseif ($1- != %t) { cprot.dchk advertising } } } } if (%cprot. [ $+ [ %cprot.curchan ] $+ ] .repeating) { var %b = $+(repeating.,$md5(%t),.,$chan,.,$cid,.,$fulladdress,.t-) hadd -mu $+ %cprot. [ $+ [ %cprot.curchan ] $+ ] .repeating.secs cprot $+(%b,$trnum) 1 if ($hfind(cprot,%b $+ *,0,w) >= %cprot. [ $+ [ %cprot.curchan ] $+ ] .repeating.times) { cprot.dotrig repeating hdel -w cprot %b $+ * } } var %bwl = %cprot. [ $+ [ %cprot.curchan ] $+ ] .badword.words if (%cprot. [ $+ [ %cprot.curchan ] $+ ] .badword) && (%bwl) && ($regex(bwprot,%t,%bwl)) { cprot.dchk badword } if (%cprot. [ $+ [ %cprot.curchan ] $+ ] .caps) && ($len(%t) > 4) && ($calc($regex(%t,/[A-ZÄÖÜ]/g) / $len(%t)) >= %cprot. [ $+ [ %cprot.curchan ] $+ ] .caps.percent) { cprot.dchk caps } if (%cprot. [ $+ [ %cprot.curchan ] $+ ] .textflood) { cprot.dchk textflood } if (%cprot. [ $+ [ %cprot.curchan ] $+ ] .codes) && ($regex($1-,%cprot. [ $+ [ %cprot.curchan ] $+ ] .codes.trig) >= [ %cprot. [ $+ [ %cprot.curchan ] $+ ] .codes.mincodes ] ) { cprot.dchk codes } } }