;This script was written in v5.91. Unless Khaled totally re-wrote ;mIRC, it _should_ work in all versions after. menu channel { - Unreal Flood Prot:chmod_f } alias chmod_f { set %chmod_f.chan $chan dialog -m chmod_f chmod_f echo 2 %chmod_f.chan *** - Retrieving %chmod_f.chan information. . . .enable #chmod_f mode %chmod_f.chan } dialog chmod_f { title "Channel flood control - DO NOT CLOSE WITH THE X -->" size -1 -1 209 159 option dbu tab "CTCP", 8, 2 3 205 129 edit "", 15, 8 32 24 11, tab 8 text ":ctcps in:", 16, 35 34 22 8, tab 8 edit "", 17, 60 32 24 11 text ":seconds", 18, 87 34 23 8 check "+C for:", 40, 116 22 30 10, tab 8 check "+m for:", 55, 116 33 30 10, tab 8 check "+M for:", 56, 116 43 30 10, tab 8 edit "", 41, 146 32 24 11, tab 8 text ":minutes", 42, 172 34 23 8, tab 8 tab "Nick changes", 9 edit "", 20, 8 32 24 11, tab 9 text ":nicks in:", 21, 35 34 22 8, tab 9 text ":minutes", 43, 172 34 23 8, tab 9 edit "", 44, 146 32 24 11, tab 9 check "+N for:", 45, 116 33 30 10, tab 9 tab "Knock", 10 edit "", 24, 8 32 24 11, tab 10 text ":times in:", 25, 35 34 22 8, tab 10 text ":minutes", 46, 172 34 23 8, tab 10 edit "", 47, 146 32 24 11, tab 10 check "+K for:", 48, 116 33 30 10, tab 10 tab "Messages/notices", 11 edit "", 28, 8 32 24 11, tab 11 text ":lines in:", 29, 35 34 22 8, tab 11 text ":minutes", 49, 172 34 23 8, tab 11 edit "", 50, 146 32 24 11, tab 11 check "+m for:", 51, 116 28 30 10, tab 11 check "+M for:", 58, 116 38 30 10, tab 11 tab "Joins", 12 edit "", 32, 8 32 24 11, tab 12 text ":joins in:", 33, 35 34 22 8, tab 12 text ":minutes", 52, 172 34 23 8, tab 12 edit "", 53, 146 32 24 11, tab 12 check "+i for:", 54, 116 28 30 10, tab 12 check "+R for:", 60, 116 38 30 10, tab 12 tab "Text", 13 edit "", 36, 8 32 24 11, tab 13 text ":lines in:", 37, 35 34 22 8, tab 13 check "ban user", 57, 116 33 32 10, tab 13 edit "", 19, 5 57 198 71, read multi button "Apply", 61, 20 138 37 12 button "Done!", 62, 64 138 37 12, ok button "Clear all", 63, 158 138 37 12 text "Created by the Wrath™ of dave - 2004", 64, 111 151 96 8, disable } on *:dialog:chmod_f:init:*:{ did -b chmod_f 41,44,47,50,53 did -ra chmod_f 19 CTCP flood control: Amount of /ctcp's allowed for a channel. Default action is auto +C (no ctcp's allowed). You may also chose +m (moderated) or +M (only registered users). Time limit is how long it will be set for (optional) } on *:dialog:chmod_f:sclick:*:{ if ($did = 8) did -ra chmod_f 19 CTCP flood control: Amount of /ctcp's allowed for a channel. Default action is auto +C (no ctcp's allowed). You may also chose +m (moderated) or +M (only registered users). Time limit is how long it will be set for (optional) if ($did = 9) did -ra chmod_f 19 Nick flood control: Amount of nick changes permitted. Action is +N (no nick changes permitted). Time limit is how long it will be set for (optional) if ($did = 10) did -ra chmod_f 19 Knock flood control: Amount ok /knock's that may be sent to the channel. Action is +K (no /knock's permitted). Time limit is how long it will be set for (optional) if ($did = 11) did -ra chmod_f 19 Message/notice flood control (all users): Amount of text the channel is allowed to see as a whole. Default action is +m (moderated) or you may chose +M (registered nicks may speak). Time limit is how long it will be set for (optional) if ($did = 12) did -ra chmod_f 19 Join flood control: Amount of joins allowed. Default action is +i (invite only) or you may chose +R (registered nicks only). Time limit is how long it will be set for (optional) if ($did = 13) did -ra chmod_f 19 Text flood control (one user): Amount of text one user may send to the channel. Default action is kick or you may chose to ban them. Time limit is how long it will be set for (optional) ;CTCPs; if ($did = 40) { if ($did(chmod_f,40).state == 1) did -e chmod_f 41 else { did -b chmod_f 41 unset %chmod_f.ctcp } did -u chmod_f 55,56 if ($did(chmod_f,41) == $null) set %chmod_f.ctcp $did(chmod_f,15) $+ c#C else set %chmod_f.ctcp $replacecs(%chmod_f.ctcp,m,C,M,C) } if ($did = 55) { if ($did(chmod_f,55).state == 1) did -e chmod_f 41 else { did -b chmod_f 41 unset %chmod_f.ctcp } did -u chmod_f 40,56 if ($did(chmod_f,41) == $null) set %chmod_f.ctcp $did(chmod_f,15) $+ c#m else set %chmod_f.ctcp $replacecs(%chmod_f.ctcp,C,m,M,m) } if ($did = 56) { if ($did(chmod_f,56).state == 1) did -e chmod_f 41 else { did -b chmod_f 41 unset %chmod_f.ctcp } did -u chmod_f 40,55 if ($did(chmod_f,41) == $null) set %chmod_f.ctcp $did(chmod_f,15) $+ c#M else set %chmod_f.ctcp $replacecs(%chmod_f.ctcp,C,M,m,M) } ;Nicks; if ($did = 45) { if ($did(chmod_f,45).state == 1) did -e chmod_f 44 else { did -b chmod_f 44 unset %chmod_f.nick } if ($did(chmod_f,44) == $null) set %chmod_f.nick $did(chmod_f,20) $+ n#N else set %chmod_f.nick n#N $+ $did(chmod_f,44) } ;Knocks; if ($did = 48) { if ($did(chmod_f,48).state == 1) did -e chmod_f 47 else { did -b chmod_f 47 unset %chmod_f.knock } if ($did(chmod_f,47) == $null) set %chmod_f.knock $did(chmod_f,24) $+ k#K else set %chmod_f.knock k#K $+ $did(chmod_f,47) } ;Messages; if ($did = 51) { if ($did(chmod_f,51).state == 1) did -e chmod_f 50 else { did -b chmod_f 50 unset %chmod_f.messages } did -u chmod_f 58 if ($did(chmod_f,50) == $null) set %chmod_f.messages $did(chmod_f,28) $+ m#m else set %chmod_f.messages $replacecs(%chmod_f.messages,M,m) } if ($did = 58) { if ($did(chmod_f,58).state == 1) did -e chmod_f 50 else { did -b chmod_f 50 unset %chmod_f.messages } did -u chmod_f 51 if ($did(chmod_f,50) == $null) set %chmod_f.messages $did(chmod_f,28) $+ m#M else set %chmod_f.messages $replacecs(%chmod_f.messages,#m,#M) } ;Joins; if ($did = 54) { if ($did(chmod_f,54).state == 1) did -e chmod_f 53 else { did -b chmod_f 53 unset %chmod_f.join } did -u chmod_f 60 if ($did(chmod_f,53) == $null) set %chmod_f.join $did(chmod_f,32) $+ j#i else set %chmod_f.join $replacecs(%chmod_f.join,R,i) } if ($did = 60) { if ($did(chmod_f,60).state == 1) did -e chmod_f 53 else { did -b chmod_f 53 unset %chmod_f.join } did -u chmod_f 54 if ($did(chmod_f,53) == $null) set %chmod_f.join $did(chmod_f,32) $+ j#R else set %chmod_f.join $replacecs(%chmod_f.join,i,R) } ;Text; if ($did = 57) { if ($did(chmod_f,57).state == 1) set %chmod_f.text $did(chmod_f,36) $+ t#b else set %chmod_f.text $did(chmod_f,36) $+ t } if ($did = 61) { if ($did(chmod_f,17) == $null) { did -f chmod_f 17 halt } if ($did(chmod_f,15) != $null) set %chmod_f.ctcp $did(chmod_f,15) $+ c $+ $iif($did(chmod_f,40).state == 1,$+ #C) $+ $iif($did(chmod_f,55).state == 1,$+ #m) $+ $iif($did(chmod_f,56).state == 1,$+ #M) $+ $iif($did(chmod_f,41) != $null && ($did(chmod_f,40).state == 1 || $did(chmod_f,55).state == 1 || $did(chmod_f,56).state == 1),$+ $did(chmod_f,41)) elseif ($did(chmod_f,20) != $null) set %chmod_f.nick $did(chmod_f,20) $+ n $+ $iif($did(chmod_f,45).state == 1,$+ #N) $+ $iif($did(chmod_f,44) != $null && $did(chmod_f,45).state == 1,$+ $did(chmod_f,44)) elseif ($did(chmod_f,24) != $null) set %chmod_f.knock $did(chmod_f,24) $+ k $+ $iif($did(chmod_f,48).state == 1,$+ #K) $+ $iif($did(chmod_f,47) != $null && $did(chmod_f,48).state == 1,$+ $did(chmod_f,47)) elseif ($did(chmod_f,28) != $null) set %chmod_f.messages $did(chmod_f,28) $+ m $+ $iif($did(chmod_f,51).state == 1,$+ #m) $+ $iif($did(chmod_f,58).state == 1,$+ #M) $+ $iif($did(chmod_f,50) != $null && ($did(chmod_f,51).state == 1 || $did(chmod_f,58).state == 1),$+ $did(chmod_f,50)) elseif ($did(chmod_f,32) != $null) set %chmod_f.join $did(chmod_f,32) $+ j $+ $iif($did(chmod_f,54).state == 1,$+ #i) $+ $iif($did(chmod_f,60).state == 1,$+ #R) $+ $iif($did(chmod_f,53) != $null && ($did(chmod_f,54).state == 1 || $did(chmod_f,60).state == 1),$+ $did(chmod_f,53)) elseif ($did(chmod_f,36) != $null) set %chmod_f.text $did(chmod_f,36) $+ t $+ $iif($did(chmod_f,57).state == 1,$+ #b) else { did -ra chmod_f 19 Look over your modes. They aren't set correctly. halt } set %chmod_f.modes $chr(91) $+ $iif(%chmod_f.ctcp != $null,%chmod_f.ctcp) $+ $iif(%chmod_f.join != $null,$chr(44) $+ %chmod_f.join) $+ $iif(%chmod_f.knock != $null,$chr(44) $+ %chmod_f.knock) $+ $iif(%chmod_f.messages != $null,$chr(44) $+ %chmod_f.messages) $+ $iif(%chmod_f.nick != $null,$chr(44) $+ %chmod_f.nick) $+ $iif(%chmod_f.text != $null,$chr(44) $+ %chmod_f.text) $+ $chr(93) $+ $iif($did(chmod_f,17) != $null,: $+ $did(chmod_f,17)) mode %chmod_f.chan +f %chmod_f.modes unset %chmod_f.modes } if ($did = 62) { .unset %chmod_f* .disable #chmod_f } if ($did = 63) { $iif($$?!="This will also clear channel mode +f. Is this ok?" = $true,mode %chmod_f.chan -f) did -r chmod_f 15,17,20,24,28,32,36,41,44,47,50,53 did -u chmod_f 40,45,48,51,54,55,56,57,58,60 did -b chmod_f 41,44,47,50,53 unset %chmod_f.modes } } on *:dialog:chmod_f:edit:*:{ if ((($did = 15) || ($did = 17) || ($did = 20) || ($did = 24) || ($did = 28) || ($did = 32) || ($did = 36) || ($did = 41) || ($did = 44) || ($did = 47) || ($did = 50) || ($did = 53)) && ($did(chmod_f,$did) !isnum)) { did -r chmod_f $did did -f chmod_f $did } ;CTCPs; if ($did = 41) set %chmod_f.ctcp %chmod_f.ctcp $+ $did(chmod_f,41) ;Messages; if ($did = 50) set %chmod_f.messages %chmod_f.messages $+ $did(chmod_f,50) ;Nicks; if ($did = 44) set %chmod_f.nick %chmod_f.nick $+ $did(chmod_f,44) ;Joins; if ($did = 53) set %chmod_f.join %chmod_f.join $+ $did(chmod_f,53) ;Knocks; if ($did = 47) set %chmod_f.knock %chmod_f.knock $+ $did(chmod_f,47) } on *:dialog:chmod_f:close:*:{ unset %chmod_f* } #chmod_f off raw 324:*:{ if (f isincs $3) { if ($chr(58) isin $4) { did -e chmod_f 17 did -a chmod_f 17 $right($4,- $+ $pos($4.modes,$chr(58))) var %chmod_f.modes $remove($replace($remove($left($4,$calc($pos($4,:)-1)),[,]),$chr(44)," "),") } else set %chmod_f.modes $remove($replace($remove($4,[,]),$chr(44)," "),") ;Here we set each type of +f submode; if ($matchtok(%chmod_f.modes,c,1,32) != $null ) { set %chmod_f.ctcp $matchtok(%chmod_f.modes,c,1,32) var %chmod_f.modes $remove(%chmod_f.modes,$matchtok(%chmod_f.modes,c,1,32)) } if ($matchtok(%chmod_f.modes,j,1,32) != $null ) { set %chmod_f.join $matchtok(%chmod_f.modes,j,1,32) var %chmod_f.modes $remove(%chmod_f.modes,$matchtok(%chmod_f.modes,j,1,32)) } if ($matchtok(%chmod_f.modes,k,1,32) != $null ) { set %chmod_f.knock $matchtok(%chmod_f.modes,k,1,32) var %chmod_f.modes $remove(%chmod_f.modes,$matchtok(%chmod_f.modes,k,1,32)) } if ($matchtok(%chmod_f.modes,m,1,32) != $null ) { set %chmod_f.messages $matchtok(%chmod_f.modes,m,1,32) var %chmod_f.modes $remove(%chmod_f.modes,$matchtok(%chmod_f.modes,m,1,32)) } if ($matchtok(%chmod_f.modes,n,1,32) != $null ) { set %chmod_f.nick $matchtok(%chmod_f.modes,n,1,32) var %chmod_f.modes $remove(%chmod_f.modes,$matchtok(%chmod_f.modes,n,1,32)) } if ($matchtok(%chmod_f.modes,t,1,32) != $null ) { set %chmod_f.text $matchtok(%chmod_f.modes,t,1,32) var %chmod_f.modes $remove(%chmod_f.modes,$matchtok(%chmod_f.modes,t,1,32)) } ;Now we update the dialog to match the channel modes; if (%chmod_f.join != $null) { did -e chmod_f 32 did -a chmod_f 32 $left(%chmod_f.join,$calc($pos(%chmod_f.join,j)-1)) if ($chr(35) isin %chmod_f.join) { if ($left($right(%chmod_f.join,- $+ $pos(%chmod_f.join,$chr(35))),1) === i) did -c chmod_f 54 if ($left($right(%chmod_f.join,- $+ $pos(%chmod_f.join,$chr(35))),1) === R) did -c chmod_f 60 did -e chmod_f 53 did -a chmod_f 53 $remove($right(%chmod_f.join,- $+ $pos(%chmod_f.join,$chr(35))),i,R) } } if (%chmod_f.nick != $null) { did -e chmod_f 20 did -a chmod_f 20 $left(%chmod_f.nick,$calc($pos(%chmod_f.nick,n)-1)) if ($chr(35) isin %chmod_f.nick) { if ($left($right(%chmod_f.nick,- $+ $pos(%chmod_f.nick,$chr(35))),1) === N) did -c chmod_f 45 did -e chmod_f 44 did -a chmod_f 44 $remove($right(%chmod_f.nick,- $+ $pos(%chmod_f.nick,$chr(35))),N) } } if (%chmod_f.ctcp != $null) { did -e chmod_f 15 did -a chmod_f 15 $left(%chmod_f.ctcp,$calc($pos(%chmod_f.ctcp,c)-1)) if ($chr(35) isin %chmod_f.ctcp) { if ($left($right(%chmod_f.ctcp,- $+ $pos(%chmod_f.ctcp,$chr(35))),1) === C) did -c chmod_f 40 if ($left($right(%chmod_f.ctcp,- $+ $pos(%chmod_f.ctcp,$chr(35))),1) === m) did -c chmod_f 55 if ($left($right(%chmod_f.ctcp,- $+ $pos(%chmod_f.ctcp,$chr(35))),1) === M) did -c chmod_f 56 did -e chmod_f 41 did -a chmod_f 41 $remove($right(%chmod_f.ctcp,- $+ $pos(%chmod_f.ctcp,$chr(35))),C,m,M) } } if (%chmod_f.knock != $null) { did -e chmod_f 24 did -a chmod_f 24 $left(%chmod_f.knock,$calc($pos(%chmod_f.knock,k)-1)) if ($chr(35) isin %chmod_f.knock) { if ($left($right(%chmod_f.knock,- $+ $pos(%chmod_f.knock,$chr(35))),1) === K) did -c chmod_f 48 did -e chmod_f 47 did -a chmod_f 47 $remove($right(%chmod_f.knock,- $+ $pos(%chmod_f.knock,$chr(35))),K) } } if (%chmod_f.messages != $null) { did -e chmod_f 28 did -a chmod_f 28 $left(%chmod_f.messages,$calc($pos(%chmod_f.messages,m)-1)) if ($chr(35) isin %chmod_f.messages) { if ($left($right(%chmod_f.messages,- $+ $pos(%chmod_f.messages,$chr(35))),1) === m) did -c chmod_f 51 if ($left($right(%chmod_f.messages,- $+ $pos(%chmod_f.messages,$chr(35))),1) === M) did -c chmod_f 58 did -e chmod_f 50 did -a chmod_f 50 $remove($right(%chmod_f.messages,- $+ $pos(%chmod_f.messages,$chr(35))),m,M) } } if (%chmod_f.text != $null) { did -e chmod_f 36 did -a chmod_f 36 $left(%chmod_f.text,$calc($pos(%chmod_f.text,t)-1)) if ($chr(35) isin %chmod_f.text) { did -c chmod_f 57 } } } halt } raw 329:*:{ halt } #chmod_f end