Flood Protection — File Browser

FloodProtectionv2.0 / FloodProtectionv2.0 / flood.mrc

flood.mrc — 82.46 KB — Download this file

; _______________________________________________
;|
;| Flood Protection (using airc.dll)
;|_______________________________________________
;|
;| Version: 2.0
;| Author: RagingDemon
;| Addon type: utility
;| E-mail: gren_gr@yahoo.com
;| URL: www.geocities.com/gren_gr/flood_protection.zip
;| Copyright: 2004 @ January, 12
;|_______________________________________________
;|
;| Please do not modify the source code below
;|_______________________________________________


menu status,menubar,channel,query {
  -
  Flood Protection
  .$iif($dialog(flood),Close,Open) $+ : fp
  .Advertise addon: $iif($active == Status Window,echos U,describe $active u) $+ sing Flood Protection addon v2.0 for mIRC. Get it at www.geocities.com/gren_gr/flood_protection.zip.
  .-
  .Unload: $iif($input(Are you sure you want to unload Flood Protection addon?,yw,Warning),unload.me)
  -
}
alias -l fp_logo { return [FP] }
alias -l unload.me { if ($dialog(flood)) { dialog -x $ifmatch } | .unload -rs $+(",$script,") }
alias -l airc { return $+(",$scriptdirairc.dll,") }
alias -l fp_help { return $+(",$scriptdirfp_help.txt,") }
alias -l fp_versions { return $+(",$scriptdirfp_versions.txt,") }
alias -l floodset { return $scriptdirfp_set.ini }
alias -l floodset2 { return $scriptdirfp_set2.ini }
alias -l fp_netchans { return $+(",$scriptdirfp_netchans.txt,") }
alias -l echos { echo -s $1- }
alias -l echoa { echo $color(info) -a $1- }
alias -l caps { var %t = $remove($strip($1-),$chr(32),$chr(44),.,!,?) | if ($len(%t) < 10) { halt } | return $round($calc($regex(%t,/[A-ZÁ-Ù]/g) / $len(%t) * 100),1) }
alias -l fp_put {
  if ($dialog(flood)) {
    var %d = $ifmatch
    var %z = $dll($airc,FloodOptGet,text $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,text 4 2 $1-) }
    if ($gettok(%z,4,32) == 0) { did -u %d 16 | did -b %d 17,18,19,20,21 }
    else { did -c %d 16 | did -e %d 17,18,19,20,21 }
    did -ra %d 17 $gettok($dll($airc,FloodOptGet,text $1-),2,32)
    did -ra %d 19 $gettok($dll($airc,FloodOptGet,text $1-),3,32)
    var %z = $dll($airc,FloodOptGet,action $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,action 3 2 $1-) }
    if ($gettok(%z,4,32) == 0) { did -u %d 22 | did -b %d 23,24,25,26,27 }
    else { did -c %d 22 | did -e %d 23,24,25,26,27 }
    did -ra %d 23 $gettok($dll($airc,FloodOptGet,action $1-),2,32)
    did -ra %d 25 $gettok($dll($airc,FloodOptGet,action $1-),3,32)
    var %z = $dll($airc,FloodOptGet,notice $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,notice 3 3 $1-) }
    if ($gettok(%z,4,32) == 0) { did -u %d 28 | did -b %d 29,30,31,32,33 }
    else { did -c %d 28 | did -e %d 29,30,31,32,33 }
    did -ra %d 29 $gettok($dll($airc,FloodOptGet,notice $1-),2,32)
    did -ra %d 31 $gettok($dll($airc,FloodOptGet,notice $1-),3,32)
    var %z = $dll($airc,FloodOptGet,ctcp $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,ctcp 3 3 $1-) }
    if ($gettok(%z,4,32) == 0) { did -u %d 34 | did -b %d 35,36,37,38,39 }
    else { did -c %d 34 | did -e %d 35,36,37,38,39 }
    did -ra %d 35 $gettok($dll($airc,FloodOptGet,ctcp $1-),2,32)
    did -ra %d 37 $gettok($dll($airc,FloodOptGet,ctcp $1-),3,32)
    var %z = $dll($airc,FloodOptGet,nick $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,nick 3 5 $+($1,d) $2) }
    if ($gettok(%z,4,32) == 0) { did -u %d 40 | did -b %d 41,42,43,44,45 }
    else { did -c %d 40 | did -e %d 41,42,43,44,45  }
    did -ra %d 41 $gettok($dll($airc,FloodOptGet,nick $1-),2,32)
    did -ra %d 43 $gettok($dll($airc,FloodOptGet,nick $1-),3,32)
    var %z = $dll($airc,FloodOptGet,join $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,join 3 4 $+($1,d) $2) }
    if ($gettok(%z,4,32) == 0) { did -u %d 46 | did -b %d 47,48,49,50,51 }
    else { did -c %d 46 | did -e %d 47,48,49,50,51 }
    did -ra %d 47 $gettok($dll($airc,FloodOptGet,join $1-),2,32)
    did -ra %d 49 $gettok($dll($airc,FloodOptGet,join $1-),3,32)
    var %z = $dll($airc,FloodOptGet,repeat $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,repeat 3 2 $1-) }
    if ($gettok(%z,4,32) == 0) { did -u %d 82 | did -b %d 83,84,85,86,87 }
    else { did -c %d 82 | did -e %d 83,84,85,86,87 }
    did -ra %d 83 $gettok($dll($airc,FloodOptGet,repeat $1-),2,32)
    did -ra %d 85 $gettok($dll($airc,FloodOptGet,repeat $1-),3,32)
    var %z = $dll($airc,FloodOptGet,byte $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,byte 800 10 $+($1,d) $2) }
    if ($gettok(%z,4,32) == 0) { did -u %d 88 | did -b %d 89,90,91,92,93 }
    else { did -c %d 88 | did -e %d 89,90,91,92,93 }
    did -ra %d 89 $gettok($dll($airc,FloodOptGet,byte $1-),2,32)
    did -ra %d 91 $gettok($dll($airc,FloodOptGet,byte $1-),3,32)
    var %z = $dll($airc,FloodOptGet,op $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,op 3 1 $+($1,d) $2) }
    if ($gettok(%z,4,32) == 0) { did -u %d 56 | did -b %d 57,58,59,60,61 }
    else { did -c %d 56 | did -e %d 57,58,59,60,61 }
    did -ra %d 57 $gettok($dll($airc,FloodOptGet,op $1-),2,32)
    did -ra %d 59 $gettok($dll($airc,FloodOptGet,op $1-),3,32)
    var %z = $dll($airc,FloodOptGet,deop $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,deop 3 1 $1-) }
    if ($gettok(%z,4,32) == 0) { did -u %d 62 | did -b %d 63,64,65,66,67 }
    else { did -c %d 62 | did -e %d 63,64,65,66,67 }
    did -ra %d 63 $gettok($dll($airc,FloodOptGet,deop $1-),2,32)
    did -ra %d 65 $gettok($dll($airc,FloodOptGet,deop $1-),3,32)
    var %z = $dll($airc,FloodOptGet,kick $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,kick 4 2 $1-) }
    if ($gettok(%z,4,32) == 0) { did -u %d 68 | did -b %d 69,70,71,72,73 }
    else { did -c %d 68 | did -e %d 69,70,71,72,73 }
    did -ra %d 69 $gettok($dll($airc,FloodOptGet,kick $1-),2,32)
    did -ra %d 71 $gettok($dll($airc,FloodOptGet,kick $1-),3,32)
    var %z = $dll($airc,FloodOptGet,ban $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,ban 3 1 $1-) }
    if ($gettok(%z,4,32) == 0) { did -u %d 74 | did -b %d 75,76,77,78,79 }
    else { did -c %d 74 | did -e %d 75,76,77,78,79 }
    did -ra %d 75 $gettok($dll($airc,FloodOptGet,ban $1-),2,32)
    did -ra %d 77 $gettok($dll($airc,FloodOptGet,ban $1-),3,32)
    var %z = $dll($airc,FloodOptGet,unban $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,unban 3 1 $+($1,d) $2) }
    if ($gettok(%z,4,32) == 0) { did -u %d 113 | did -b %d 114,115,116,117,118 }
    else { did -c %d 113 | did -e %d 114,115,116,117,118 }
    did -ra %d 114 $gettok($dll($airc,FloodOptGet,unban $1-),2,32)
    did -ra %d 116 $gettok($dll($airc,FloodOptGet,unban $1-),3,32)
    var %z = $dll($airc,FloodOptGet,mode $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,mode 6 10 $1-) }
    if ($gettok(%z,4,32) == 0) { did -u %d 198 | did -b %d 204,205,201,202,203 }
    else { did -c %d 198 | did -e %d 204,205,201,202,203 }
    did -ra %d 204 $gettok($dll($airc,FloodOptGet,mode $1-),2,32)
    did -ra %d 201 $gettok($dll($airc,FloodOptGet,mode $1-),3,32)
    var %z = $dll($airc,FloodOptGet,topic $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,topic 5 10 $1-) }
    if ($gettok(%z,4,32) == 0) { did -u %d 206 | did -b %d 207,208,209,210,211 }
    else { did -c %d 206 | did -e %d 207,208,209,210,211 }
    did -ra %d 207 $gettok($dll($airc,FloodOptGet,topic $1-),2,32)
    did -ra %d 209 $gettok($dll($airc,FloodOptGet,topic $1-),3,32)
    var %z = $dll($airc,OptGet,flood $1- color)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- color off 2) }
    if ($gettok(%z,2,32) == off) { did -u %d 97 | did -b %d 98,99 }
    else { did -c %d 97 | did -e %d 98,99 }
    did -ra %d 98 $gettok(%z,3,32)
    var %z = $dll($airc,OptGet,flood $1- bold)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- bold off 2) }
    if ($gettok(%z,2,32) == off) { did -u %d 100 | did -b %d 101,102 }
    else { did -c %d 100 | did -e %d 101,102 }
    did -ra %d 101 $gettok(%z,3,32)
    var %z = $dll($airc,OptGet,flood $1- underlined)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- underlined off 2) }
    if ($gettok(%z,2,32) == off) { did -u %d 103 | did -b %d 104,105 }
    else { did -c %d 103 | did -e %d 104,105 }
    did -ra %d 104 $gettok(%z,3,32)
    var %z = $dll($airc,OptGet,flood $1- reversed)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- reversed off 2) }
    if ($gettok(%z,2,32) == off) { did -u %d 106 | did -b %d 107,108 }
    else { did -c %d 106 | did -e %d 107,108 }
    did -ra %d 107 $gettok(%z,3,32)
    var %z = $dll($airc,OptGet,flood $1- total)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- total on 5) }
    if ($gettok(%z,2,32) == off) { did -u %d 195 | did -b %d 196,197 }
    else { did -c %d 195 | did -e %d 196,197 }
    did -ra %d 196 $gettok(%z,3,32)
    var %z = $dll($airc,OptGet,flood $1- long)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- long off 250) }
    if ($gettok(%z,2,32) == off) { did -u %d 110 | did -b %d 111,112 }
    else { did -c %d 110 | did -e %d 111,112 }
    did -ra %d 111 $gettok(%z,3,32)
    var %z = $dll($airc,OptGet,flood $1- capitals)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- capitals off 80) }
    if ($gettok(%z,2,32) == off) { did -u %d 94 | did -b %d 95,96 }
    else { did -c %d 94 | did -e %d 95,96 }
    did -ra %d 95 $gettok(%z,3,32)
    var %z = $dll($airc,OptGet,flood $1- punish)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- punish kb) }
    if ($gettok(%z,2,32) == w) { did -c %d 161 1 | did -b %d 162,163,170,171,175,190 }
    elseif ($gettok(%z,2,32) == k) { did -c %d 161 2 | did -b %d 162,163,170,171 | did -e %d 190,175 }
    else { did -c %d 161 3 | did -e %d 162,163,170,171,175,190 }
    var %z = $dll($airc,OptGet,flood $1- banmask)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- banmask 2) }
    did -c %d 171 $calc($gettok(%z,2,32) + 1)
    var %z = $dll($airc,OptGet,flood $1- ban_time)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- ban_time p) }
    did -c %d 163 $iif($gettok(%z,2,32) isnum,$didwm(%d,163,$calc($ifmatch / 60) minute*),17)
    var %z = $dll($airc,OptGet,flood $1- filter_kick)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- filter_kick off) }
    if ($gettok(%z,2,32) == on) { did -c %d 175 1 }
    else { did -c %d 175 2 }
    var %z = $dll($airc,OptGet,flood $1- protect_ops)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- protect_ops on) }
    if ($gettok(%z,2,32) == on) { did -c %d 165 }
    else { did -u %d 165 }
    var %z = $dll($airc,OptGet,flood $1- protect_halfops)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- protect_halfops on) }
    if ($gettok(%z,2,32) == on) { did -c %d 166 }
    else { did -u %d 166 }
    var %z = $dll($airc,OptGet,flood $1- protect_voices)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- protect_voices on) }
    if ($gettok(%z,2,32) == on) { did -c %d 167 }
    else { did -u %d 167 }
    var %z = $dll($airc,OptGet,flood $1- protect_notifies)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- protect_notifies on) }
    if ($gettok(%z,2,32) == on) { did -c %d 168 }
    else { did -u %d 168 }
  }
}
alias -l fp_default_k {
  if ($1 == i) {
    if ($dialog(ki_reasons)) {
      did -ra $ifmatch 20 Text flood detected! (<user.counter> lines in <secs> sec(s). Limit is <max.counter> lines in <max.secs> sec(s). Ban: <punish>)
      did -ra $ifmatch 21 Action flood detected! (<user.counter> actions in <secs> sec(s). Limit is <max.counter> actions in <max.secs> sec(s). Ban: <punish>)
      did -ra $ifmatch 22 Notice flood detected! (<user.counter> notices in <secs> sec(s). Limit is <max.counter> notices in <max.secs> sec(s). Ban: <punish>)
      did -ra $ifmatch 23 CTCP flood detected! (<user.counter> CTCPs in <secs> sec(s). Limit is <max.counter> CTCPs in <max.secs> sec(s). Ban: <punish>)
      did -ra $ifmatch 24 Nick change flood detected! (<user.counter> nicks in <secs> sec(s). Limit is <max.counter> nicks in <max.secs> sec(s). Ban: <punish>)
      did -ra $ifmatch 25 Join flood detected! (<user.counter> joins in <secs> sec(s). Limit is <max.counter> joins in <max.secs> sec(s). Ban: <punish>)
      did -ra $ifmatch 26 Repeat flood detected! (<user.counter> repetitions in <secs> sec(s). Limit is <max.counter> repetitions in <max.secs> sec(s). Ban: <punish>)
      did -ra $ifmatch 27 Byte flood detected! (<user.counter> bytes in <secs> sec(s). Limit is <max.counter> bytes in <max.secs> sec(s). Ban: <punish>)
      did -ra $ifmatch 33 Op flood detected! (<user.counter> modes in <secs> sec(s). Limit is <max.counter> modes in <max.secs> sec(s). Ban: <punish>)
      did -ra $ifmatch 34 Deop flood detected! (<user.counter> modes in <secs> sec(s). Limit is <max.counter> modes in <max.secs> sec(s). Ban: <punish>)
      did -ra $ifmatch 35 Kick flood detected! (<user.counter> kicks in <secs> sec(s). Limit is <max.counter> kicks in <max.secs> sec(s). Ban: <punish>)
      did -ra $ifmatch 36 Ban flood detected! (<user.counter> modes in <secs> sec(s). Limit is <max.counter> modes in <max.secs> sec(s). Ban: <punish>)
      did -ra $ifmatch 37 Unban flood detected! (<user.counter> modes in <secs> sec(s). Limit is <max.counter> modes in <max.secs> sec(s). Ban: <punish>)
      did -ra $ifmatch 75 Mode flood detected! (<user.counter> modes in <secs> sec(s). Limit is <max.counter> modes in <max.secs> sec(s). Ban: <punish>)
      did -ra $ifmatch 78 Topic flood detected! (<user.counter> topics in <secs> sec(s). Limit is <max.counter> topics in <max.secs> sec(s). Ban: <punish>)
      did -ra $ifmatch 44 Color flood detected! (<user.counter> color(s). Limit is <max.counter> color(s). Ban: <punish>)
      did -ra $ifmatch 45 Bold flood detected! (<user.counter> bold chr(s). Limit is <max.counter> chr(s). Ban: <punish>)
      did -ra $ifmatch 46 Underlined flood detected! (<user.counter> underline chr(s). Limit is <max.counter> chr(s). Ban: <punish>)
      did -ra $ifmatch 47 Reversed flood detected! (<user.counter> reverse chr(s). Limit is <max.counter> chr(s). Ban: <punish>)
      did -ra $ifmatch 73 Control code flood detected! (<user.counter> control chr(s). Limit is <max.counter> chr(s). Ban: <punish>)
      did -ra $ifmatch 48 Long text flood detected! (<user.counter> chr(s). Limit is <max.counter> chr(s). Ban: <punish>)
      did -ra $ifmatch 49 Capital letter flood detected! (<user.counter> in sentence are capitals. Limit is <max.counter>. Ban: <punish>)
      did -ra $ifmatch 56 Text flood detected, don' t flood me! (<user.counter> lines in <secs> sec(s). Limit is <max.counter> lines in <max.secs> sec(s). You are now ignored! - <punish> ignore)
      did -ra $ifmatch 57 Action flood detected, don' t flood me! (<user.counter> actions in <secs> sec(s). Limit is <max.counter> actions in <max.secs> sec(s). You are now ignored! - <punish> ignore)
      did -ra $ifmatch 58 Notice flood detected, don' t flood me! (<user.counter> notices in <secs> sec(s). Limit is <max.counter> notices in <max.secs> sec(s). You are now ignored! - <punish> ignore)
      did -ra $ifmatch 59 CTCP flood detected, don' t flood me! (<user.counter> CTCPs in <secs> sec(s). Limit is <max.counter> CTCPs in <max.secs> sec(s). You are now ignored! - <punish> ignore)
      did -ra $ifmatch 60 Invite flood detected, don' t flood me! (<user.counter> invites in <secs> sec(s). Limit is <max.counter> invites in <max.secs> sec(s). You are now ignored! - <punish> ignore)
      did -ra $ifmatch 61 Byte flood detected, don' t flood me! (<user.counter> bytes in <secs> sec(s). Limit is <max.counter> bytes in <max.secs> sec(s). You are now ignored! - <punish> ignore)
    }
  }
  else {
    set %fp_kreason_chan_text Text flood detected! (<user.counter> lines in <secs> sec(s). Limit is <max.counter> lines in <max.secs> sec(s). Ban: <punish>)
    set %fp_kreason_chan_action Action flood detected! (<user.counter> actions in <secs> sec(s). Limit is <max.counter> actions in <max.secs> sec(s). Ban: <punish>)
    set %fp_kreason_chan_notice Notice flood detected! (<user.counter> notices in <secs> sec(s). Limit is <max.counter> notices in <max.secs> sec(s). Ban: <punish>)
    set %fp_kreason_chan_CTCP CTCP flood detected! (<user.counter> CTCPs in <secs> sec(s). Limit is <max.counter> CTCPs in <max.secs> sec(s). Ban: <punish>)
    set %fp_kreason_chan_nick Nick change flood detected! (<user.counter> nicks in <secs> sec(s). Limit is <max.counter> nicks in <max.secs> sec(s). Ban: <punish>)
    set %fp_kreason_chan_join Join flood detected! (<user.counter> joins in <secs> sec(s). Limit is <max.counter> joins in <max.secs> sec(s). Ban: <punish>)
    set %fp_kreason_chan_repeat Repeat flood detected! (<user.counter> repetitions in <secs> sec(s). Limit is <max.counter> repetitions in <max.secs> sec(s). Ban: <punish>)
    set %fp_kreason_chan_byte Byte flood detected! (<user.counter> bytes in <secs> sec(s). Limit is <max.counter> bytes in <max.secs> sec(s). Ban: <punish>)
    set %fp_kreason_chan_op Op flood detected! (<user.counter> modes in <secs> sec(s). Limit is <max.counter> modes in <max.secs> sec(s). Ban: <punish>)
    set %fp_kreason_chan_deop Deop flood detected! (<user.counter> modes in <secs> sec(s). Limit is <max.counter> modes in <max.secs> sec(s). Ban: <punish>)
    set %fp_kreason_chan_kick Kick flood detected! (<user.counter> kicks in <secs> sec(s). Limit is <max.counter> kicks in <max.secs> sec(s). Ban: <punish>)
    set %fp_kreason_chan_ban Ban flood detected! (<user.counter> modes in <secs> sec(s). Limit is <max.counter> modes in <max.secs> sec(s). Ban: <punish>)
    set %fp_kreason_chan_unban Unban flood detected! (<user.counter> modes in <secs> sec(s). Limit is <max.counter> modes in <max.secs> sec(s). Ban: <punish>)
    set %fp_kreason_chan_mode Mode flood detected! (<user.counter> modes in <secs> sec(s). Limit is <max.counter> modes in <max.secs> sec(s). Ban: <punish>)
    set %fp_kreason_chan_topic Topic flood detected! (<user.counter> topics in <secs> sec(s). Limit is <max.counter> topics in <max.secs> sec(s). Ban: <punish>)
    set %fp_kreason_chan_color Color flood detected! (<user.counter> color(s). Limit is <max.counter> color(s). Ban: <punish>)
    set %fp_kreason_chan_bold Bold flood detected! (<user.counter> bold chr(s). Limit is <max.counter> chr(s). Ban: <punish>)
    set %fp_kreason_chan_underlined Underlined flood detected! (<user.counter> underline chr(s). Limit is <max.counter> chr(s). Ban: <punish>)
    set %fp_kreason_chan_reversed Reversed flood detected! (<user.counter> reverse chr(s). Limit is <max.counter> chr(s). Ban: <punish>)
    set %fp_kreason_chan_long Long text flood detected! (<user.counter> chr(s). Limit is <max.counter> chr(s). Ban: <punish>)
    set %fp_kreason_chan_capitals Capital letter flood detected! (<user.counter> in sentence are capitals. Limit is <max.counter>. Ban: <punish>)
    set %fp_kreason_chan_total Control code flood detected! (<user.counter> control chr(s). Limit is <max.counter> chr(s). Ban: <punish>)
    set %fp_kreason_self_text Text flood detected, don' t flood me! (<user.counter> lines in <secs> sec(s). Limit is <max.counter> lines in <max.secs> sec(s). You are now ignored! - <punish> ignore)
    set %fp_kreason_self_action Action flood detected, don' t flood me! (<user.counter> actions in <secs> sec(s). Limit is <max.counter> actions in <max.secs> sec(s). You are now ignored! - <punish> ignore)
    set %fp_kreason_self_notice Notice flood detected, don' t flood me! (<user.counter> notices in <secs> sec(s). Limit is <max.counter> notices in <max.secs> sec(s). You are now ignored! - <punish> ignore)
    set %fp_kreason_self_CTCP CTCP flood detected, don' t flood me! (<user.counter> CTCPs in <secs> sec(s). Limit is <max.counter> CTCPs in <max.secs> sec(s). You are now ignored! - <punish> ignore)
    set %fp_kreason_self_invite Invite flood detected, don' t flood me! (<user.counter> invites in <secs> sec(s). Limit is <max.counter> invites in <max.secs> sec(s). You are now ignored! - <punish> ignore)
    set %fp_kreason_self_byte Byte flood detected, don' t flood me! (<user.counter> bytes in <secs> sec(s). Limit is <max.counter> bytes in <max.secs> sec(s). You are now ignored! - <punish> ignore)
  }
}
alias -l create {
  if (1 isin $1-) {
    .write -c $floodset
    var %z = $dll($airc,FloodOptSet,text 4 2)
    var %z = $dll($airc,FloodOptSet,action 3 2)
    var %z = $dll($airc,FloodOptSet,notice 3 3)
    var %z = $dll($airc,FloodOptSet,ctcp 3 3)
    var %z = $dll($airc,FloodOptSet,nick 3 5 +d)
    var %z = $dll($airc,FloodOptSet,join 3 4 +d)
    var %z = $dll($airc,FloodOptSet,repeat 3 2)
    var %z = $dll($airc,FloodOptSet,byte 800 10 +d)
    var %z = $dll($airc,FloodOptSet,op 3 1 +d)
    var %z = $dll($airc,FloodOptSet,deop 3 1)
    var %z = $dll($airc,FloodOptSet,kick 4 2)
    var %z = $dll($airc,FloodOptSet,ban 3 1)
    var %z = $dll($airc,FloodOptSet,unban 3 1 +d)
    var %z = $dll($airc,FloodOptSet,mode 6 10)
    var %z = $dll($airc,FloodOptSet,topic 5 10)
    var %z = $dll($airc,FloodOptSet,stext 4 2)
    var %z = $dll($airc,FloodOptSet,saction 3 4)
    var %z = $dll($airc,FloodOptSet,snotice 3 3)
    var %z = $dll($airc,FloodOptSet,sctcp 3 4)
    var %z = $dll($airc,FloodOptSet,sinvite 3 4)
    var %z = $dll($airc,FloodOptSet,sbyte 500 4 +d)
    var %z = $dll($airc, FloodOptSave,$floodset)
  }
  if (2 isin $1-) {
    .write -c $floodset2
    var %z = $dll($airc,OptSet,flood + ignore_host 2)
    var %z = $dll($airc,OptSet,flood + ignore_time 120)
    var %z = $dll($airc,OptSet,flood + common_punish off k)
    var %z = $dll($airc,OptSet,flood + info on)
    var %z = $dll($airc,OptSet,flood + notifies_excl on)
    var %z = $dll($airc,OptSet,flood + punish kb)
    var %z = $dll($airc,OptSet,flood + banmask 2)
    var %z = $dll($airc,OptSet,flood + ban_time p)
    var %z = $dll($airc,OptSet,flood + filter_kick off)
    var %z = $dll($airc,OptSet,flood + protect_ops on)
    var %z = $dll($airc,OptSet,flood + protect_halfops on)
    var %z = $dll($airc,OptSet,flood + protect_voices on)
    var %z = $dll($airc,OptSet,flood + protect_notifies on)
    var %z = $dll($airc,OptSet,flood + color off 2)
    var %z = $dll($airc,OptSet,flood + bold off 2)
    var %z = $dll($airc,OptSet,flood + underlined off 2)
    var %z = $dll($airc,OptSet,flood + reversed off 2)
    var %z = $dll($airc,OptSet,flood + total on 5)
    var %z = $dll($airc,OptSet,flood + long off 250)
    var %z = $dll($airc,OptSet,flood + capitals on 80)
    var %z = $dll($airc,OptTableSave,flood $floodset2)
  }
  if (3 isin $1-) { write -c $fp_netchans }
}
on *:load: { echos $fp_logo Flood Protection | echos $fp_logo ----------------------------------------- | echos $fp_logo Please read the help section. (Type /fp to open the dialog) | set %fp_confirm on | fp_default_k }
on *:unload: { if ($hget(fp_flood)) { hfree fp_flood } | dll -u $airc | unset %fp_* | echos $fp_logo Successfully unloaded Flood Protection addon. Thank you for using it... }
on *:start: {
  if ($version < 6.01) { echos $fp_logo Warning: You currently use mIRC $+(,$version,.) You need mIRC 6.01+ for this addon to work properly. Please download the newest version at www.mirc.com. Unloading addon... | unload.me | halt }
  if (!$isfile($airc)) { echos $fp_logo Warning: "airc.dll" which is essential for Flood Protection' s proper usage is missing or has been renamed. Please restore that file and reload this addon. Unloading addon... | unload.me | halt }
  if (!$isfile($fp_help)) { echos $fp_logo Warning: Flood Protection' s help file, "fp_help.txt", is missing or has been renamed. Help section will not be available until this file is restored. }
  var %z = $dll($airc,OptTableAdd,flood)
  if (!$isfile($fp_netchans)) { echos $fp_logo Warning: An error has occured while attempting to load your Flood Protection' s "channel - network list" file. Creating new file... | create 1 2 3 | echos $fp_logo Flood Protection' s "channel - network list" file has been successfully created! Continuing to load addon... }
  var %z = $dll($airc,FloodOptLoad,$floodset)
  if (-* iswm %z) {
    echos $fp_logo Warning: An error has occured while attempting to load your Flood Protection' s main settings. Creating new option file...
    create 1 2 3
    echos $fp_logo Flood Protection' s main settings file has been successfully created! Continuing to load addon...
  }
  var %z = $dll($airc,OptTableLoad,flood $floodset2)
  if (-* iswm %z) {
    echos $fp_logo Warning: An error has occured while attempting to load your Flood Protection' s miscellaneous settings. Creating new option file...
    create 1 2 3
    echos $fp_logo Flood Protection' s miscellaneous settings file has been successfully created!
  }
  hmake fp_flood 1000
  echos $fp_logo Flood Protection addon is successfully loaded.
  .reload -rs1 $+(",$script,")
}
alias fp { if ($dialog(flood)) { dialog -x $ifmatch } | else { dialog -m flood flood } }
dialog -l flood {
  title "Flood Protection - /flood - [All networks][All channels]"
  size -1 -1 370 380
  box "", 1, -1 -6 372 387
  button "Close", 2, 300 345 60 25, cancel
  box "", 3, 10 328 350 8
  tab "Chan 1", 4, 10 10 350 317
  tab "... 2", 55
  tab "... 3", 109
  tab "... 4", 80
  tab "Self", 81
  tab "Help", 53
  box "Select an option to edit its settings:", 5, 20 36 330 84
  text "Network - Channel:", 9, 30 56 110 15
  combo 7, 130 54 210 150, size, drop
  button "New", 12, 130 85 45 25
  button "Rem", 13, 185 85 45 25, disable
  button "Remove all", 14, 265 85 75 25, disable
  box "Channel flood protection against:", 15, 20 123 330 189
  check "Text", 16, 30 143 80 15, tab 4
  edit "", 17, 160 140 30 20, limit 2, tab 4
  text "lines", 18, 195 143 50 15, tab 4
  edit "", 19, 280 140 25 20, limit 2, tab 4
  text "sec(s)", 20, 310 143 35 15, tab 4
  text "/", 21, 235 143 15 15, tab 4
  check "Action", 22, 30 163 80 15, tab 4
  edit "", 23, 160 160 30 20, limit 2, tab 4
  text "actions", 24, 195 163 50 15, tab 4
  edit "", 25, 280 160 25 20, limit 2, tab 4
  text "sec(s)", 26, 310 163 35 15, tab 4
  text "/", 27, 235 163 15 15, tab 4
  check "Notice", 28, 30 183 80 15, tab 4
  edit "", 29, 160 180 30 20, limit 2, tab 4
  text "notices", 30, 195 183 50 15, tab 4
  edit "", 31, 280 180 25 20, limit 2, tab 4
  text "sec(s)", 32, 310 183 35 15, tab 4
  text "/", 33, 235 183 15 15, tab 4
  check "CTCP", 34, 30 203 80 15, tab 4
  edit "", 35, 160 200 30 20, limit 2, tab 4
  text "CTCPs", 36, 195 203 50 15, tab 4
  edit "", 37, 280 200 25 20, limit 2, tab 4
  text "sec(s)", 38, 310 203 35 15, tab 4
  text "/", 39, 235 203 15 15, tab 4
  check "Nick change", 40, 30 223 90 15, tab 4
  edit "", 41, 160 220 30 20, limit 2, tab 4
  text "nicks", 42, 195 223 50 15, tab 4
  edit "", 43, 280 220 25 20, limit 2, tab 4
  text "sec(s)", 44, 310 223 35 15, tab 4
  text "/", 45, 235 223 15 15, tab 4
  check "Join", 46, 30 243 80 15, tab 4
  edit "", 47, 160 240 30 20, limit 2, tab 4
  text "joins", 48, 195 243 50 15, tab 4
  edit "", 49, 280 240 25 20, limit 2, tab 4
  text "sec(s)", 50, 310 243 35 15, tab 4
  text "/", 51, 235 243 15 15, tab 4
  check "Repeat", 82, 30 263 80 15, tab 4
  edit "", 83, 160 260 30 20, limit 2, tab 4
  text "repet.", 84, 195 263 50 15, tab 4
  edit "", 85, 280 260 25 20, limit 2, tab 4
  text "sec(s)", 86, 310 263 35 15, tab 4
  text "/", 87, 235 263 15 15, tab 4
  check "Byte excess", 88, 30 283 80 15, tab 4
  edit "", 89, 160 280 30 20, limit 3, autohs, tab 4
  text "bytes", 90, 195 283 50 15, tab 4
  edit "", 91, 280 280 25 20, limit 2, tab 4
  text "sec(s)", 92, 310 283 35 15, tab 4
  text "/", 93, 235 283 15 15, tab 4
  button "Apply", 52, 230 345 60 25
  check "Mass op", 56, 30 143 90 15, tab 55
  edit "", 57, 160 140 30 20, limit 2, tab 55
  text "modes", 58, 195 143 50 15, tab 55
  edit "", 59, 280 140 25 20, limit 2, tab 55
  text "sec(s)", 60, 310 143 35 15, tab 55
  text "/", 61, 235 143 15 15, tab 55
  check "Mass deop", 62, 30 163 90 15, tab 55
  edit "", 63, 160 160 30 20, limit 2, tab 55
  text "modes", 64, 195 163 50 15, tab 55
  edit "", 65, 280 160 25 20, limit 2, tab 55
  text "sec(s)", 66, 310 163 35 15, tab 55
  text "/", 67, 235 163 15 15, tab 55
  check "Mass kick", 68, 30 183 90 15, tab 55
  edit "", 69, 160 180 30 20, limit 2, tab 55
  text "kicks", 70, 195 183 50 15, tab 55
  edit "", 71, 280 180 25 20, limit 2, tab 55
  text "sec(s)", 72, 310 183 35 15, tab 55
  text "/", 73, 235 183 15 15, tab 55
  check "Mass ban", 74, 30 203 90 15, tab 55
  edit "", 75, 160 200 30 20, limit 2, tab 55
  text "bans", 76, 195 203 50 15, tab 55
  edit "", 77, 280 200 25 20, limit 2, tab 55
  text "sec(s)", 78, 310 203 35 15, tab 55
  text "/", 79, 235 203 15 15, tab 55
  check "Mass unban", 113, 30 223 90 15, tab 55
  edit "", 114, 160 220 30 20, limit 2, tab 55
  text "unbans", 115, 195 223 50 15, tab 55
  edit "", 116, 280 220 25 20, limit 2, tab 55
  text "sec(s)", 117, 310 223 35 15, tab 55
  text "/", 118, 235 223 15 15, tab 55
  check "Mode", 198, 30 243 90 15, tab 55
  edit "", 204, 160 240 30 20, limit 2, tab 55
  text "modes", 205, 195 243 50 15, tab 55
  edit "", 201, 280 240 25 20, limit 2, tab 55
  text "sec(s)", 202, 310 243 35 15, tab 55
  text "/", 203, 235 243 15 15, tab 55
  check "Topic change", 206, 30 263 90 15, tab 55
  edit "", 207, 160 260 30 20, limit 2, tab 55
  text "topics", 208, 195 263 50 15, tab 55
  edit "", 209, 280 260 25 20, limit 2, tab 55
  text "sec(s)", 210, 310 263 35 15, tab 55
  text "/", 211, 235 263 15 15, tab 55
  check "Color", 97, 30 143 110 15, tab 109
  edit "", 98, 160 140 30 20, limit 2, tab 109
  text "chr(s)", 99, 195 143 30 15, tab 109
  check "Bold", 100, 30 163 110 15, tab 109
  edit "", 101, 160 160 30 20, limit 2, tab 109
  text "chr(s)", 102, 195 163 30 15, tab 109
  check "Underline", 103, 30 183 110 15, tab 109
  edit "", 104, 160 180 30 20, limit 2, tab 109
  text "chr(s)", 105, 195 183 30 15, tab 109
  check "Reverse", 106, 30 203 110 15, tab 109
  edit "", 107, 160 200 30 20, limit 2, tab 109
  text "chr(s)", 108, 195 203 30 15, tab 109
  check "or", 195, 245 171 35 15, tab 109
  edit "", 196, 280 168 30 20, limit 2, tab 109
  text "total", 197, 315 171 30 15, tab 109
  check "Long text", 110, 30 223 90 15, tab 109
  edit "", 111, 160 220 30 20, limit 3, autohs, tab 109
  text "chrs", 112, 195 223 50 15, tab 109
  check "Capital letters", 94, 30 243 90 15, tab 109
  edit "", 95, 160 240 30 20, limit 3, tab 109
  text "% allowed", 96, 195 243 80 15, tab 109
  box "User punishment:", 119, 20 36 330 124, tab 81
  text "Select hostmask when ignoring:", 172, 30 56 180 15, tab 81
  combo 173, 240 53 100 163, size, drop, tab 81
  text "Select ignore duration:", 120, 30 82 180 15, tab 81
  combo 121, 240 79 100 145, size, drop, tab 81
  check "Punish user in common channels, with", 122, 30 108 210 15, tab 81
  combo 123, 240 105 100 60, size, drop, tab 81
  check "Excempt notified users", 178, 30 134 130 15, tab 81
  check "Inform on ignore", 174, 240 134 103 15, tab 81
  check "Text", 124, 30 183 80 15, tab 81
  edit "", 125, 160 180 30 20, limit 2, tab 81
  text "lines", 126, 195 183 50 15, tab 81
  edit "", 127, 280 180 25 20, limit 2, tab 81
  text "sec(s)", 128, 310 183 35 15, tab 81
  text "/", 129, 235 183 15 15, tab 81
  check "Action", 130, 30 203 80 15, tab 81
  edit "", 131, 160 200 30 20, limit 2, tab 81
  text "actions", 132, 195 203 50 15, tab 81
  edit "", 133, 280 200 25 20, limit 2, tab 81
  text "sec(s)", 134, 310 203 35 15, tab 81
  text "/", 135, 235 203 15 15, tab 81
  check "Notice", 136, 30 223 80 15, tab 81
  edit "", 137, 160 220 30 20, limit 2, tab 81
  text "notices", 138, 195 223 50 15, tab 81
  edit "", 139, 280 220 25 20, limit 2, tab 81
  text "sec(s)", 140, 310 223 35 15, tab 81
  text "/", 141, 235 223 15 15, tab 81
  check "CTCP", 142, 30 243 80 15, tab 81
  edit "", 143, 160 240 30 20, limit 2, tab 81
  text "CTCPs", 144, 195 243 50 15, tab 81
  edit "", 145, 280 240 25 20, limit 2, tab 81
  text "sec(s)", 146, 310 243 35 15, tab 81
  text "/", 147, 235 243 15 15, tab 81
  check "Invite", 148, 30 263 80 15, tab 81
  edit "", 149, 160 260 30 20, limit 2, tab 81
  text "invites", 150, 195 263 50 15, tab 81
  edit "", 151, 280 260 25 20, limit 2, tab 81
  text "sec(s)", 152, 310 263 35 15, tab 81
  text "/", 153, 235 263 15 15, tab 81
  check "Byte excess", 154, 30 283 80 15, tab 81
  edit "", 155, 160 280 30 20, limit 3, autohs, tab 81
  text "bytes", 156, 195 283 50 15, tab 81
  edit "", 157, 280 280 25 20, limit 2, tab 81
  text "sec(s)", 158, 310 283 35 15, tab 81
  text "/", 159, 235 283 15 15, tab 81
  text "Punish user when flooding channel, with", 160, 30 145 200 15, tab 80
  combo 161, 240 142 100 80, size, drop, tab 80
  text "- Filter kick:", 190, 40 171 150 15, tab 80
  combo 175, 240 168 100 65, size, drop, tab 80
  text "- Select banmask:", 170, 40 197 180 15, tab 80
  combo 171, 240 194 100 163, size, drop, tab 80
  text "- Select ban duration:", 162, 40 224 180 15, tab 80
  combo 163, 240 220 100 145, size, drop, tab 80
  box "Protect user who is flooding if:", 164, 20 248 330 64, tab 80
  check "oped (@)", 165, 30 265 100 15, tab 80
  check "half-oped (%)", 166, 240 265 100 15, tab 80
  check "voiced (+)", 167, 30 285 100 15, tab 80
  check "in notify list", 168, 240 285 100 15, tab 80
  edit "", 169, 20 41 330 271, tab 53, read, multi, vsbar
  box "Self protection against:", 176, 20 163 330 149, tab 81
  menu "File", 179
  item "Insert default values in boxes", 180, 179
  item break, 181, 179
  item "Exit", 182, 179
  menu "Options", 183
  item "Completely disable channel flood protection", 184, 183
  item "Completely disable self flood protection", 185, 183
  item break, 191, 183
  item "Disable flood punishment while away", 199, 183
  item break, 200, 183
  item "Always ask for confirmation before saving settings", 192, 183
  item break, 186, 183
  item "Modify kick/ignore reasons", 187, 183
  menu "Help", 188
  item "About...", 189, 188
  item break, 212, 188
  item "Version updates", 213, 188
  box "", 193, 230 172 10 8, tab 109
  box "", 194, 230 134 2 83, tab 109
}
on *:dialog:flood:menu:*: {
  if ($did == 213) {
    if (!$exists($fp_versions)) { var %w = $input(The file containing information about version updates cannot be found. $crlf $+ $+($chr(40),It is either renamed or deleted,$chr(41)) $+ $crlf $+ $crlf Please restore the file and try again.,ow,Warning:) }
    else { run $fp_versions }
  }
  if ($did == 182) { dialog -x $dname }
  if ($did == 184) { if ($did($did).state == 1) { .enable #fp_chan | did -u $dname $did } | else { .disable #fp_chan | did -c $dname $did } }
  if ($did == 185) { if ($did($did).state == 1) { .enable #fp_self | did -u $dname $did } | else { .disable #fp_self | did -c $dname $did } }
  if ($did == 187) { $iif($dialog(ki_reasons),dialog -vr $ifmatch,dialog -m ki_reasons ki_reasons) }
  if ($did == 192) { if ($did($did).state == 1) { set %fp_confirm off | did -u $dname $did } | else { set %fp_confirm on | did -c $dname $did } }
  if ($did == 199) { if ($did($did).state == 1) { set %fp_away off | did -u $dname $did } | else { set %fp_away on | did -c $dname $did } }
  if ($did == 189) { var %b = $input(Flood Protection addon for mIRC 6.01+. $crlf $+ $crlf $+ Version: $crlf $+ 2.0 $crlf $+ $crlf $+ Main credits: $crlf $+ airc.dll by tabo $crlf $+ mIRC code/addon testing by RagingDemon $crlf $+ $crlf $+ © Copyright 2004 $crlf $+ $crlf $+ Note: For more information please refer to the help section.,oi,About Flood Protection) }
  if ($did == 180) {
    if ($input(Are you sure you want to insert the default values in all boxes?,yq,Insert default values)) {
      did -c $dname 16 | did -e $dname 17,18,19,20,21 | did -ra $dname 17 4 | did -ra $dname 19 2
      did -c $dname 22 | did -e $dname 23,24,25,26,27 | did -ra $dname 23 3 | did -ra $dname 25 2
      did -c $dname 28 | did -e $dname 29,30,31,32,33 | did -ra $dname 29 3 | did -ra $dname 31 3
      did -c $dname 34 | did -e $dname 35,36,37,38,39 | did -ra $dname 35 3 | did -ra $dname 37 3
      did -u $dname 40 | did -b $dname 41,42,43,44,45 | did -ra $dname 41 3 | did -ra $dname 43 5
      did -u $dname 46 | did -b $dname 47,48,49,50,51 | did -ra $dname 47 3 | did -ra $dname 49 4
      did -c $dname 82 | did -e $dname 83,84,85,86,87 | did -ra $dname 83 3 | did -ra $dname 85 2
      did -u $dname 88 | did -b $dname 89,90,91,92,93 | did -ra $dname 89 800 | did -ra $dname 91 10
      did -u $dname 97 | did -b $dname 98,99 | did -ra $dname 98 2
      did -c $dname 195 | did -ra $dname 196 5
      did -u $dname 100 | did -b $dname 101,102 | did -ra $dname 101 2
      did -u $dname 103 | did -b $dname 104,105 | did -ra $dname 104 2
      did -u $dname 106 | did -b $dname 107,108 | did -ra $dname 107 2
      did -u $dname 110 | did -b $dname 111,112 | did -ra $dname 111 250
      did -c $dname 94 | did -e $dname 95,96 | did -ra $dname 95 80
      did -u $dname 56 | did -b $dname 57,58,59,60,61 | did -ra $dname 57 3 | did -ra $dname 59 1
      did -c $dname 62 | did -e $dname 63,64,65,66,67 | did -ra $dname 63 3 | did -ra $dname 65 1
      did -c $dname 68 | did -e $dname 69,70,71,72,73 | did -ra $dname 69 4 | did -ra $dname 71 2
      did -c $dname 74 | did -e $dname 75,76,77,78,79 | did -ra $dname 75 3 | did -ra $dname 77 1
      did -u $dname 113 | did -b $dname 114,115,116,117,118 | did -ra $dname 114 3 | did -ra $dname 116 1
      did -c $dname 198 | did -e $dname 204,205,201,202,203 | did -ra $dname 204 6 | did -ra $dname 201 10
      did -c $dname 161 3 | did -e $dname 190,175,170,171,162,163 | did -c $dname 175 2 | did -c $dname 171,173 3 | did -c $dname 163 17
      did -c $dname 121 2 | did -c $dname 165,166,167,168
      did -u $dname 122 | did -bc $dname 123 1 | did -c $dname 178,174
      did -c $dname 124 | did -e $dname 125,126,127,128,129 | did -ra $dname 125 4 | did -ra $dname 127 2
      did -c $dname 130 | did -e $dname 131,132,133,134,135 | did -ra $dname 131 3 | did -ra $dname 133 4
      did -c $dname 136 | did -e $dname 137,138,139,140,141 | did -ra $dname 137 3 | did -ra $dname 139 3
      did -c $dname 142 | did -e $dname 143,144,145,146,147 | did -ra $dname 143 3 | did -ra $dname 145 4
      did -c $dname 148 | did -e $dname 149,150,151,152,153 | did -ra $dname 149 3 | did -ra $dname 151 4
      did -u $dname 154 | did -b $dname 155,156,157,158,159 | did -ra $dname 155 500 | did -ra $dname 157 4
      did -c $dname 206 | did -e $dname 207,208,209,210,211 | did -ra $dname 207 5 | did -ra $dname 209 10
      var %z = $input(Flood Protection' s default settings have been successfully inserted into all boxes! In order to save your new settings $+ $chr(44) click on the "Apply" button.,oi,Default settings inserted!)
    }
  }
}
on *:dialog:flood:sclick:*: {
  did -f $dname 1
  if ($did == 12) { $iif($dialog(add_new),dialog -vr $ifmatch,dialog -m add_new add_new) }
  if ($did == 81) {
    did -h $dname 5,7,9,12,13,14,15 | did -v $dname 176
    dialog -t $dname Flood Protection - /flood - Self protection
  }
  elseif ($did == 53) {
    did -h $dname 5,7,9,12,13,14,15
    if (!$isfile($fp_help)) { did -ra $dname 169 Couldn' t find help file (fp_help.txt). This section will be unavailable until the help file is restored and this dialog is re-opened. }
    dialog -t $dname Flood Protection - /flood - Help section
  }
  elseif ($istok(4 55 80 109,$did,32)) && (!$did(5).visible) { did -v $dname 5,7,9,12,13,14,15 }
  if ($did == 4) {
    did -ra $dname 15 Channel flood protection against:
    var %net = $iif(All networks - * iswm $did(7),All networks,$gettok($did(7),1,32)), %chan = $iif(* - All channels iswm $did(7),All channels,$gettok($did(7),-1,32))
    dialog -t $dname Flood Protection - /flood - $+($chr(91),%net,$chr(93),$chr(91),%chan,$chr(93))
  }
  if ($did == 55) {
    did -ra $dname 15 Channel flood protection against:
    var %net = $iif(All networks - * iswm $did(7),All networks,$gettok($did(7),1,32)), %chan = $iif(* - All channels iswm $did(7),All channels,$gettok($did(7),-1,32))
    dialog -t $dname Flood Protection - /flood - $+($chr(91),%net,$chr(93),$chr(91),%chan,$chr(93))
  }
  if ($did == 80) {
    did -ra $dname 15 Punishment settings:
    var %net = $iif(All networks - * iswm $did(7),All networks,$gettok($did(7),1,32)), %chan = $iif(* - All channels iswm $did(7),All channels,$gettok($did(7),-1,32))
    dialog -t $dname Flood Protection - /flood - $+($chr(91),%net,$chr(93),$chr(91),%chan,$chr(93))
  }
  if ($did == 109) {
    did -ra $dname 15 Channel flood protection against:
    var %net = $iif(All networks - * iswm $did(7),All networks,$gettok($did(7),1,32)), %chan = $iif(* - All channels iswm $did(7),All channels,$gettok($did(7),-1,32))
    dialog -t $dname Flood Protection - /flood - $+($chr(91),%net,$chr(93),$chr(91),%chan,$chr(93))
  }
  if ($did == 16) { if ($did($did).state == 1) { did -e $dname 17,18,19,20,21 } | else { did -b $dname 17,18,19,20,21 } }
  if ($did == 22) { if ($did($did).state == 1) { did -e $dname 23,24,25,26,27 } | else { did -b $dname 23,24,25,26,27 } }
  if ($did == 28) { if ($did($did).state == 1) { did -e $dname 29,30,31,32,33 } | else { did -b $dname 29,30,31,32,33 } }
  if ($did == 34) { if ($did($did).state == 1) { did -e $dname 35,36,37,38,39 } | else { did -b $dname 35,36,37,38,39 } }
  if ($did == 40) { if ($did($did).state == 1) { did -e $dname 41,42,43,44,45 } | else { did -b $dname 41,42,43,44,45 } }
  if ($did == 46) { if ($did($did).state == 1) { did -e $dname 47,48,49,50,51 } | else { did -b $dname 47,48,49,50,51 } }
  if ($did == 82) { if ($did($did).state == 1) { did -e $dname 83,84,85,86,87 } | else { did -b $dname 83,84,85,86,87 } }
  if ($did == 88) { if ($did($did).state == 1) { did -e $dname 89,90,91,92,93 } | else { did -b $dname 89,90,91,92,93 } }
  if ($did == 56) { if ($did($did).state == 1) { did -e $dname 57,58,59,60,61 } | else { did -b $dname 57,58,59,60,61 } }
  if ($did == 62) { if ($did($did).state == 1) { did -e $dname 63,64,65,66,67 } | else { did -b $dname 63,64,65,66,67 } }
  if ($did == 68) { if ($did($did).state == 1) { did -e $dname 69,70,71,72,73 } | else { did -b $dname 69,70,71,72,73 } }
  if ($did == 74) { if ($did($did).state == 1) { did -e $dname 75,76,77,78,79 } | else { did -b $dname 75,76,77,78,79 } }
  if ($did == 198) { if ($did($did).state == 1) { did -e $dname 204,205,201,202,203 } | else { did -b $dname 204,205,201,202,203 } }
  if ($did == 113) { if ($did($did).state == 1) { did -e $dname 114,115,116,117,118 } | else { did -b $dname 114,115,116,117,118 } }
  if ($did == 97) { if ($did($did).state == 1) { did -e $dname 98,99 } | else { did -b $dname 98,99 } }
  if ($did == 100) { if ($did($did).state == 1) { did -e $dname 101,102 } | else { did -b $dname 101,102 } }
  if ($did == 103) { if ($did($did).state == 1) { did -e $dname 104,105 } | else { did -b $dname 104,105 } }
  if ($did == 106) { if ($did($did).state == 1) { did -e $dname 107,108 } | else { did -b $dname 107,108 } }
  if ($did == 94) { if ($did($did).state == 1) { did -e $dname 95,96 } | else { did -b $dname 95,96 } }
  if ($did == 110) { if ($did($did).state == 1) { did -e $dname 111,112 } | else { did -b $dname 111,112 } }
  if ($did == 195) { if ($did($did).state == 1) { did -e $dname 196,197 } | else { did -b $dname 196,197 } }
  if ($did == 124) { if ($did($did).state == 1) { did -e $dname 125,126,127,128,129 } | else { did -b $dname 125,126,127,128,129 } }
  if ($did == 130) { if ($did($did).state == 1) { did -e $dname 131,132,133,134,135 } | else { did -b $dname 131,132,133,134,135 } }
  if ($did == 136) { if ($did($did).state == 1) { did -e $dname 137,138,139,140,141 } | else { did -b $dname 137,138,139,140,141 } }
  if ($did == 142) { if ($did($did).state == 1) { did -e $dname 143,144,145,146,147 } | else { did -b $dname 143,144,145,146,147 } }
  if ($did == 148) { if ($did($did).state == 1) { did -e $dname 149,150,151,152,153 } | else { did -b $dname 149,150,151,152,153 } }
  if ($did == 154) { if ($did($did).state == 1) { did -e $dname 155,156,157,158,159 } | else { did -b $dname 155,156,157,158,159 } }
  if ($did == 206) { if ($did($did).state == 1) { did -e $dname 207,208,209,210,211 } | else { did -b $dname 207,208,209,210,211 } }
  if ($did == 161) { if ($did($did).sel == 1) { did -b $dname 162,163,170,171,175,190 } | elseif ($did($did).sel == 2) { did -b $dname 162,163,170,171 | did -e $dname 175,190 } | else { did -e $dname 162,163,170,171,175,190 } }
  if ($did == 122) { if ($did($did).state == 1) { did -e $dname 123 } | else { did -b $dname 123 } }
  if ($did == 52) {
    var %params = $+(+,$iif(All networks - * iswm $did(7),,n),$iif(* - All channels iswm $did(7),,c)), %netchan = $iif(All networks - * iswm $did(7),,$gettok($did(7),1,32)) $iif(* - All channels iswm $did(7),,$gettok($did(7),-1,32))
    if (%fp_confirm == on) { if (!$input(Do you want to save your current settings? $crlf $+ $crlf $+ The below settings will be saved if you press the "Yes" button: $crlf $+ 1. Flood protection settings for: $crlf $+ $iif(All networks - * iswm $did(7),All networks,$gettok($did(7),1,32)) - $iif(* - All channels iswm $did(7),All channels,$gettok($did(7),-1,32)) $+ . $crlf $+ 2. Self flood protection settings. $crlf $+ $crlf $+ Continue?,yq,Save confirmation)) { halt } }
    var %z = $dll($airc,FloodOptSet,text $iif($did(17) isnum 2-99,$ifmatch,4) $iif($did(19) isnum 1-99,$ifmatch,2) $+(%params,$iif($did(16).state == 0,d)) %netchan)
    var %z = $dll($airc,FloodOptSet,action $iif($did(23) isnum 2-99,$ifmatch,3) $iif($did(25) isnum 1-99,$ifmatch,2) $+(%params,$iif($did(22).state == 0,d)) %netchan)
    var %z = $dll($airc,FloodOptSet,notice $iif($did(29) isnum 2-99,$ifmatch,3) $iif($did(31) isnum 1-99,$ifmatch,3) $+(%params,$iif($did(28).state == 0,d)) %netchan)
    var %z = $dll($airc,FloodOptSet,ctcp $iif($did(35) isnum 2-99,$ifmatch,3) $iif($did(37) isnum 1-99,$ifmatch,3) $+(%params,$iif($did(34).state == 0,d)) %netchan)
    var %z = $dll($airc,FloodOptSet,nick $iif($did(41) isnum 2-99,$ifmatch,3) $iif($did(43) isnum 1-99,$ifmatch,5) $+(%params,$iif($did(40).state == 0,d)) %netchan)
    var %z = $dll($airc,FloodOptSet,join $iif($did(47) isnum 2-99,$ifmatch,3) $iif($did(49) isnum 1-99,$ifmatch,4) $+(%params,$iif($did(46).state == 0,d)) %netchan)
    var %z = $dll($airc,FloodOptSet,repeat $iif($did(83) isnum 2-99,$ifmatch,3) $iif($did(85) isnum 1-99,$ifmatch,2) $+(%params,$iif($did(82).state == 0,d)) %netchan)
    var %z = $dll($airc,FloodOptSet,byte $iif($did(89) isnum 2-999,$ifmatch,800) $iif($did(91) isnum 1-99,$ifmatch,10) $+(%params,$iif($did(88).state == 0,d)) %netchan)
    var %z = $dll($airc,FloodOptSet,op $iif($did(57) isnum 2-99,$ifmatch,3) $iif($did(59) isnum 1-99,$ifmatch,1) $+(%params,$iif($did(56).state == 0,d)) %netchan)
    var %z = $dll($airc,FloodOptSet,deop $iif($did(63) isnum 2-99,$ifmatch,3) $iif($did(65) isnum 1-99,$ifmatch,1) $+(%params,$iif($did(62).state == 0,d)) %netchan)
    var %z = $dll($airc,FloodOptSet,kick $iif($did(69) isnum 2-99,$ifmatch,4) $iif($did(71) isnum 1-99,$ifmatch,2) $+(%params,$iif($did(68).state == 0,d)) %netchan)
    var %z = $dll($airc,FloodOptSet,ban $iif($did(75) isnum 2-99,$ifmatch,3) $iif($did(77) isnum 1-99,$ifmatch,1) $+(%params,$iif($did(74).state == 0,d)) %netchan)
    var %z = $dll($airc,FloodOptSet,unban $iif($did(114) isnum 2-99,$ifmatch,3) $iif($did(116) isnum 1-99,$ifmatch,1) $+(%params,$iif($did(113).state == 0,d)) %netchan)
    var %z = $dll($airc,FloodOptSet,mode $iif($did(204) isnum 2-99,$ifmatch,6) $iif($did(201) isnum 1-99,$ifmatch,10) $+(%params,$iif($did(198).state == 0,d)) %netchan)
    var %z = $dll($airc,FloodOptSet,topic $iif($did(207) isnum 2-99,$ifmatch,5) $iif($did(209) isnum 1-99,$ifmatch,10) $+(%params,$iif($did(206).state == 0,d)) %netchan)
    var %z = $dll($airc,OptSet,flood %params %netchan color $iif($did(97).state == 1,on,off) $iif($did(98) isnum 1-99,$ifmatch,2))
    var %z = $dll($airc,OptSet,flood %params %netchan bold $iif($did(100).state == 1,on,off) $iif($did(101) isnum 1-99,$ifmatch,2))
    var %z = $dll($airc,OptSet,flood %params %netchan underlined $iif($did(103).state == 1,on,off) $iif($did(104) isnum 1-99,$ifmatch,2))
    var %z = $dll($airc,OptSet,flood %params %netchan reversed $iif($did(106).state == 1,on,off) $iif($did(107) isnum 1-99,$ifmatch,2))
    var %z = $dll($airc,OptSet,flood %params %netchan long $iif($did(110).state == 1,on,off) $iif($did(111) isnum 2-999,$ifmatch,250))
    var %z = $dll($airc,OptSet,flood %params %netchan capitals $iif($did(94).state == 1,on,off) $iif($did(95) isnum 1-100,$ifmatch,80))
    var %z = $dll($airc,OptSet,flood %params %netchan total $iif($did(195).state == 1,on,off) $iif($did(196) isnum 1-99,$ifmatch,5))
    var %z = $dll($airc,FloodOptSet,stext $iif($did(125) isnum 2-99,$ifmatch,4) $iif($did(127) isnum 1-99,$ifmatch,2) $iif($did(124).state == 0,+d))
    var %z = $dll($airc,FloodOptSet,saction $iif($did(131) isnum 2-99,$ifmatch,3) $iif($did(133) isnum 1-99,$ifmatch,4) $iif($did(130).state == 0,+d))
    var %z = $dll($airc,FloodOptSet,snotice $iif($did(137) isnum 2-99,$ifmatch,3) $iif($did(139) isnum 1-99,$ifmatch,3) $iif($did(136).state == 0,+d))
    var %z = $dll($airc,FloodOptSet,sctcp $iif($did(143) isnum 2-99,$ifmatch,3) $iif($did(145) isnum 1-99,$ifmatch,4) $iif($did(142).state == 0,+d))
    var %z = $dll($airc,FloodOptSet,sinvite $iif($did(149) isnum 2-99,$ifmatch,3) $iif($did(151) isnum 1-99,$ifmatch,4) $iif($did(148).state == 0,+d))
    var %z = $dll($airc,FloodOptSet,sbyte $iif($did(155) isnum 2-999,$ifmatch,500) $iif($did(157) isnum 1-99,$ifmatch,4) $iif($did(154).state == 0,+d))
    var %z = $dll($airc,OptSet,flood + ignore_host $remove($gettok($did(173),1,32),:))
    var %z = $dll($airc,OptSet,flood + ignore_time $iif(p* iswm $did(121),p,$calc($gettok($did(121),1,32) * 60)))
    var %z = $dll($airc,OptSet,flood + common_punish $iif($did(122).state == 1,on,off) $iif($did(123).sel == 1,k,kb))
    var %z = $dll($airc,OptSet,flood + info $iif($did(174).state == 1,on,off))
    var %z = $dll($airc,OptSet,flood + notifies_excl $iif($did(178).state == 1,on,off))
    var %z = $dll($airc,OptSet,flood %params %netchan punish $iif(ban isin $did(161),kb,$left($did(161),1)))
    var %z = $dll($airc,OptSet,flood %params %netchan banmask $remove($gettok($did(171),1,32),:))
    var %z = $dll($airc,OptSet,flood %params %netchan ban_time $iif(p* iswm $did(163),p,$calc($gettok($did(163),1,32) * 60))))
    var %z = $dll($airc,OptSet,flood %params %netchan filter_kick $iif($did(175).sel == 1,on,off))
    var %z = $dll($airc,OptSet,flood %params %netchan protect_ops $iif($did(165).state == 1,on,off))
    var %z = $dll($airc,OptSet,flood %params %netchan protect_halfops $iif($did(166).state == 1,on,off))
    var %z = $dll($airc,OptSet,flood %params %netchan protect_voices $iif($did(167).state == 1,on,off))
    var %z = $dll($airc,OptSet,flood %params %netchan protect_notifies $iif($did(168).state == 1,on,off))
    var %z = $dll($airc, FloodOptSave,$floodset)
    var %z = $dll($airc,OptTableSave,flood $floodset2)
    var %z = $input(Your network/channel and self flood protection settings have been successfully saved!,oi,Save completed!)
  }
  if ($did == 7) {
    var %net = $iif(All networks - * iswm $did($did),All networks,$gettok($did($did),1,32)), %chan = $iif(* - All channels iswm $did($did),All channels,$gettok($did($did),-1,32))
    if ($did($did) == All networks - All channels) { did -b $dname 13 } | else { did -e $dname 13 }
    dialog -t $dname Flood Protection - /flood - $+($chr(91),%net,$chr(93),$chr(91),%chan,$chr(93))
    fp_put $+(+,$iif(All networks - * iswm $did(7),,n),$iif(* - All channels iswm $did(7),,c)) $iif(All networks - * iswm $did($did),,$gettok($did($did),1,32)) $iif(* - All channels iswm $did($did),,$gettok($did($did),-1,32))
  }
  if ($did == 13) {
    if ($did(7) != All networks - All channels) {
      write -dl $+ $calc($did(7).sel - 1) $fp_netchans
      var %t = $+(+,$iif(All networks - * iswm $did(7),,n),$iif(* - All channels iswm $did(7),,c)) $iif(All networks - * iswm $did(7),,$gettok($did(7),1,32)) $iif(* - All channels iswm $did(7),,$gettok($did(7),-1,32))
      var %z = $dll($airc,FloodOptDel,text %t)
      var %z = $dll($airc,FloodOptDel,action %t)
      var %z = $dll($airc,FloodOptDel,notice %t)
      var %z = $dll($airc,FloodOptDel,ctcp %t)
      var %z = $dll($airc,FloodOptDel,nick %t)
      var %z = $dll($airc,FloodOptDel,join %t)
      var %z = $dll($airc,FloodOptDel,repeat %t)
      var %z = $dll($airc,FloodOptDel,byte %t)
      var %z = $dll($airc,FloodOptDel,op %t)
      var %z = $dll($airc,FloodOptDel,deop %t)
      var %z = $dll($airc,FloodOptDel,kick %t)
      var %z = $dll($airc,FloodOptDel,ban %t)
      var %z = $dll($airc,FloodOptDel,unban %t)
      var %z = $dll($airc,FloodOptDel,mode %t)
      var %z = $dll($airc,FloodOptDel,topic %t)
      var %z = $dll($airc,OptDel,flood %t color)
      var %z = $dll($airc,OptDel,flood %t bold)
      var %z = $dll($airc,OptDel,flood %t underlined)
      var %z = $dll($airc,OptDel,flood %t reversed)
      var %z = $dll($airc,OptDel,flood %t total)
      var %z = $dll($airc,OptDel,flood %t long)
      var %z = $dll($airc,OptDel,flood %t capitals)
      var %z = $dll($airc,OptDel,flood %t punish)
      var %z = $dll($airc,OptDel,flood %t banmask)
      var %z = $dll($airc,OptDel,flood %t ban_time)
      var %z = $dll($airc,OptDel,flood %t filter_kick)
      var %z = $dll($airc,OptDel,flood %t protect_ops)
      var %z = $dll($airc,OptDel,flood %t protect_halfops)
      var %z = $dll($airc,OptDel,flood %t protect_voices)
      var %z = $dll($airc,OptDel,flood %t protect_notifies)
      did -d $dname 7 $did(7).sel
      if ($did(7).lines == 1) && ($lines($fp_netchans) == 0) { did -b $dname 14 }
      elseif ($calc($did(7).lines - 1) != $lines($fp_netchans)) { write -c $fp_netchans | did -r $dname 7 | did -a $dname 7 All networks - All channels | did -b $dname 14 }
      did -b $dname $did
      did -c $dname 7 1
      fp_put +
      var %z = $dll($airc, FloodOptSave,$floodset)
      var %z = $dll($airc,OptTableSave,flood $floodset2)
      dialog -t $dname Flood Protection - /flood - [All networks][All channels]
    }
    else { did -b $dname $did }
  }
  if ($did == 14) {
    if ($input(Are you sure you want to entirely clear all your network/channel settings? $crlf $+ $crlf $+ Note: Your global settings $+($chr(40),All networks - All channels,$chr(41)) will be left unchanged.,yw,Warning:)) {
      write -c $fp_netchans | write -c $floodset | write -c $floodset2
      var %z = $dll($airc,FloodOptDelMatch,* +*n* * *)
      var %z = $dll($airc,FloodOptDelMatch,* +*c* * *)
      var %z = $dll($airc,OptDelMatch,flood +*n* * * *)
      var %z = $dll($airc,OptDelMatch,flood +*c* * * *)
      did -b $dname 13,14 | did -r $dname 7 | did -a $dname 7 All networks - All channels | did -c $dname 7 1
      fp_put +
      var %z = $dll($airc, FloodOptSave,$floodset)
      var %z = $dll($airc,OptTableSave,flood $floodset2)
      dialog -t $dname Flood Protection - /flood - [All networks][All channels]
      var %z = $input(Your network/channel settings list has been successfully cleared.,oi,Network/channel list cleared!)
    }
  }
}
on *:dialog:flood:init:0: {
  if (!$isfile($fp_help)) { did -ra $dname 169 Couldn' t find help file. This section will be unavailable until the help file is restored and this dialog is re-opened. }
  else { loadbuf -or $dname 169 $fp_help }
  if (!$isfile($fp_netchans)) { create 1 2 3 }
  if (!$isfile($+(",$floodset,"))) { create 1 2 3 }
  if (!$isfile($+(",$floodset2,"))) { create 1 2 3 }
  $iif(%fp_confirm == on,did -c $dname 192)
  $iif(%fp_away == on,did -c $dname 199)
  didtok $dname 121,163 44 1 minute,2 minutes,3 minutes,4 minutes,5 minutes,10 minutes,15 minutes,20 minutes,25 minutes,30 minutes,35 minutes,40 minutes,45 minutes,50 minutes,55 minutes,60 minutes,Permanent
  didtok $dname 171,173 44 0: *!u@h,1: *!*u@h,2: *!*@h,3: *!*u@*.h,4: *!*@*.h,5: n!u@h,6: n!*u@h,7: n!*@h,8: n!*u@*.h,9: n!*@*.h
  didtok $dname 175 44 Enabled,Disabled
  did -a $dname 161 warning
  didtok $dname 123,161 44 kick,kick/ban
  did -a $dname 7 All networks - All channels
  did -c $dname 7 $didwm(7,All networks - All channels)
  loadbuf -o $dname 7 $fp_netchans
  if ($did(7).lines > 1) { did -e $dname 14 }
  if ($group(#fp_chan) == off) { did -c $dname 184 }
  if ($group(#fp_self) == off) { did -c $dname 185 }
  fp_put +
  var %z = $dll($airc,FloodOptGet,stext)
  if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,stext 4 2) }
  if ($gettok(%z,4,32) == 0) { did -b $dname 125,126,127,128,129 }
  else { did -c $dname 124 }
  did -a $dname 125 $gettok($dll($airc,FloodOptGet,stext),2,32)
  did -a $dname 127 $gettok($dll($airc,FloodOptGet,stext),3,32)
  var %z = $dll($airc,FloodOptGet,saction)
  if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,saction 3 4) }
  if ($gettok(%z,4,32) == 0) { did -b $dname 131,132,133,134,135 }
  else { did -c $dname 130 }
  did -a $dname 131 $gettok($dll($airc,FloodOptGet,saction),2,32)
  did -a $dname 133 $gettok($dll($airc,FloodOptGet,saction),3,32)
  var %z = $dll($airc,FloodOptGet,snotice)
  if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,snotice 3 3) }
  if ($gettok(%z,4,32) == 0) { did -b $dname 137,138,139,140,141 }
  else { did -c $dname 136 }
  did -a $dname 137 $gettok($dll($airc,FloodOptGet,snotice),2,32)
  did -a $dname 139 $gettok($dll($airc,FloodOptGet,snotice),3,32)
  var %z = $dll($airc,FloodOptGet,sctcp)
  if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,sctcp 3 4) }
  if ($gettok(%z,4,32) == 0) { did -b $dname 143,144,145,146,147 }
  else { did -c $dname 142 }
  did -a $dname 143 $gettok($dll($airc,FloodOptGet,sctcp),2,32)
  did -a $dname 145 $gettok($dll($airc,FloodOptGet,sctcp),3,32)
  var %z = $dll($airc,FloodOptGet,sinvite)
  if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,sinvite 3 4) }
  if ($gettok(%z,4,32) == 0) { did -b $dname 149,150,151,152,153 }
  else { did -c $dname 148 }
  did -a $dname 149 $gettok($dll($airc,FloodOptGet,sinvite),2,32)
  did -a $dname 151 $gettok($dll($airc,FloodOptGet,sinvite),3,32)
  var %z = $dll($airc,FloodOptGet,sbyte)
  if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,sbyte 500 4 +d) }
  if ($gettok(%z,4,32) == 0) { did -b $dname 155,156,157,158,159 }
  else { did -c $dname 154 }
  did -a $dname 155 $gettok($dll($airc,FloodOptGet,sbyte),2,32)
  did -a $dname 157 $gettok($dll($airc,FloodOptGet,sbyte),3,32)
  var %z = $dll($airc,OptGet,flood + ignore_host)
  if (-* iswm %z) { var %q = $dll($airc,OptSet,flood + ignore_host 2) }
  did -c $dname 173 $calc($gettok(%z,2,32) + 1)
  var %z = $dll($airc,OptGet,flood + ignore_time)
  if (-* iswm %z) { var %q = $dll($airc,OptSet,flood + ignore_time 120) }
  did -c $dname 121 $iif($gettok(%z,2,32) isnum,$didwm(121,$calc($ifmatch / 60) minute*),17)
  var %z = $dll($airc,OptGet,flood + common_punish)
  if (-* iswm %z) { var %q = $dll($airc,OptSet,flood + common_punish off k) }
  if ($gettok(%z,2,32) == on) { did -c $dname 122 }
  else { did -b $dname 123 }
  did -c $dname 123 $iif($gettok(%z,3,32) == k,1,2)
  var %z = $dll($airc,OptGet,flood + info)
  if (-* iswm %z) { var %q = $dll($airc,OptSet,flood + info on) }
  if ($gettok(%z,2,32) == on) { did -c $dname 174 }
  var %z = $dll($airc,OptGet,flood + notifies_excl)
  if (-* iswm %z) { var %q = $dll($airc,OptSet,flood + notifies_excl on) }
  if ($gettok(%z,2,32) == on) { did -c $dname 178 }
  var %z = $dll($airc, FloodOptSave,$floodset)
  var %z = $dll($airc,OptTableSave,flood $floodset2)
}
dialog -l add_new {
  title "New flood settings"
  size -1 -1 270 215
  box "", 1, -1 -6 272 222
  box "Add new network:", 2, 10 5 250 75
  text "Network:", 3, 20 26 80 15
  edit "", 4, 80 25 170 20, autohs
  check "Global network settings", 5, 80 50 170 15
  box "Add new channel:", 6, 10 83 250 75
  text "Channel:", 7, 20 104 80 15
  edit "", 8, 80 103 170 20, autohs
  check "Global channel settings", 9, 80 128 170 15
  box "", 10, 10 161 250 8
  button "Confirm", 11, 130 179 60 25, ok, disable
  button "Cancel", 12, 200 179 60 25, cancel
}
on *:dialog:add_new:edit:*: {
  if ($did == 4) { if ($len($did($did))) && ($chr(32) !isin $did($did)) { if ($did(9).state == 1) || ($len($did(8))) { did -e $dname 11 } | else { did -b $dname 11 } } | else { did -b $dname 11 } }
  if ($did == 8) { if ($len($did($did))) && ($chr(32) !isin $did($did)) { if ($did(5).state == 1) || ($len($did(4))) { did -e $dname 11 } | else { did -b $dname 11 } } | else { did -b $dname 11 } }
}
on *:dialog:add_new:sclick:*: {
  if ($did == 5) { if ($did($did).state == 1) { did -b $dname 4,9 | if ($len($did(8))) && ($chr(32) !isin $did(8)) { did -e $dname 11 } | else { did -b $dname 11 } } | else { did -e $dname 4,9 | if ($len($did(4))) && ($chr(32) !isin $did(4)) && ($len($did(8))) && ($chr(32) !isin $did(8)) { did -e $dname 11 } | else { did -b $dname 11 } } }
  if ($did == 9) { if ($did($did).state == 1) { did -b $dname 5,8 | if ($len($did(4))) && ($chr(32) !isin $did(4)) { did -e $dname 11 } | else { did -b $dname 11 } } | else { did -e $dname 5,8 | if ($len($did(8))) && ($chr(32) !isin $did(8)) && ($len($did(4))) && ($chr(32) !isin $did(4)) { did -e $dname 11 } | else { did -b $dname 11 } } }
  if ($did == 11) {
    var %flags = +
    if ($did(5).state != 1) { var %flags = $+(%flags,n) }
    if ($did(9).state != 1) { var %flags = $+(%flags,c) }
    if (%flags == +) || ((!$len($did(4))) && (!$len($did(8)))) || (($did(5).state == 1) && (!$len($did(8)))) || (($did(9).state == 1) && (!$len($did(4)))) || (!$did($did).enabled) { halt }
    else {
      if ($dialog(flood)) {
        if (!$isfile($fp_netchans)) { create 1 2 3 }
        if (!$isfile($+(",$floodset,"))) { create 1 2 3 }
        if (!$isfile($+(",$floodset2,"))) { create 1 2 3 }
        var %params = $iif($len($did(4)),$did(4)) $iif($len($did(8)),$did(8))
        var %z = $dll($airc,FloodOptGet,text %flags %params) 
        if (+OK* iswm %z) { if (!$input(Settings for specified network(s)-channel(s) already exist. $+ $crlf $+ Do you wish to overwrite them?,yw,Warning)) { halt } }
        var %dflags = $+(%flags,d)
        var %z = $dll($airc,FloodOptSet,text 4 2 %flags %params)
        var %z = $dll($airc,FloodOptSet,action 3 2 %flags %params)
        var %z = $dll($airc,FloodOptSet,notice 3 3 %flags %params)
        var %z = $dll($airc,FloodOptSet,ctcp 3 3 %flags %params)
        var %z = $dll($airc,FloodOptSet,nick 3 5 %dflags %params)
        var %z = $dll($airc,FloodOptSet,join 3 4 %dflags %params)
        var %z = $dll($airc,FloodOptSet,repeat 3 2 %flags %params)
        var %z = $dll($airc,FloodOptSet,byte 800 10 %dflags %params)
        var %z = $dll($airc,FloodOptSet,op 3 1 %dflags %params)
        var %z = $dll($airc,FloodOptSet,deop 3 1 %flags %params)
        var %z = $dll($airc,FloodOptSet,kick 4 2 %flags %params)
        var %z = $dll($airc,FloodOptSet,ban 3 1 %flags %params)
        var %z = $dll($airc,FloodOptSet,unban 3 1 %dflags %params)
        var %z = $dll($airc,FloodOptSet,mode 6 10 %flags %params)
        var %z = $dll($airc,FloodOptSet,topic 5 10 %flags %params)
        var %z = $dll($airc,OptSet,flood %flags %params punish kb)
        var %z = $dll($airc,OptSet,flood %flags %params banmask 2)
        var %z = $dll($airc,OptSet,flood %flags %params ban_time p)
        var %z = $dll($airc,OptSet,flood %flags %params filter_kick off)
        var %z = $dll($airc,OptSet,flood %flags %params protect_ops on)
        var %z = $dll($airc,OptSet,flood %flags %params protect_voices on)
        var %z = $dll($airc,OptSet,flood %flags %params protect_halfops on)
        var %z = $dll($airc,OptSet,flood %flags %params protect_notifies on)
        var %z = $dll($airc,OptSet,flood %flags %params color off 2)
        var %z = $dll($airc,OptSet,flood %flags %params bold off 2)
        var %z = $dll($airc,OptSet,flood %flags %params underlined off 2)
        var %z = $dll($airc,OptSet,flood %flags %params reversed off 2)
        var %z = $dll($airc,OptSet,flood %flags %params long off 250)
        var %z = $dll($airc,OptSet,flood %flags %params capitals on 80)
        var %z = $dll($airc,OptSet,flood %flags %params total on 5)
        var %z = $dll($airc, FloodOptSave,$floodset)
        var %z = $dll($airc,OptTableSave,flood $floodset2)
        var %d = flood, %z = $dll($airc,FloodOptGet,text %flags %params), %add1 = $iif($did(5).state == 1,All networks,$did(4)), %add2 = $iif($did(9).state == 1,All channels,$did(8))
        if ($didwm(%d,7,%add1 - %add2) == 0) { did -a %d 7 %add1 - %add2 | write $fp_netchans %add1 - %add2 }
        dialog -t %d Flood Protection - /flood - $+($chr(91),%add1,$chr(93),$chr(91),%add2,$chr(93))
        did -c %d 7 $didwm(%d,7,%add1 - %add2) | did -e %d 13,14
        did -u %d 16,22,28,34,40,46,82,88,56,62,68,74,113,97,100,103,106,110,94,165,166,167,168,175,195,198,206
        did -e %d 162,163,170,171,95,96,111,112,107,108,104,105,101,102,98,99,114,115,116,117,118,75,76,77,78,79,69,70,71,72,73,63,64,65,66,67,57,58,59,60,61,89,90,91,92,93,83,84,85,86,87,47,48,49,50,51,41,42,43,44,45,34,35,36,37,38,39,29,30,31,32,33,23,24,25,26,27,17,18,19,20,21,196,197,204,205,201,202,203,207,208,209,210,211
        fp_put %flags %params
      }
    }
  }
}
dialog -l ki_reasons {
  title "Kick/Ignore reasons"
  size -1 -1 400 342
  box "", 1, -1 -6 402 349
  tab "Chan 1", 2, 10 10 380 279
  tab "... 2", 3
  tab "... 3", 4
  tab "Self", 5
  tab "Help", 6
  button "Save", 7, 260 307 60 25
  button "Close", 8, 330 307 60 25, cancel
  box "", 9, 10 290 380 8
  button "Defaults", 10, 10 307 60 25
  box "Kick reasons for channel flood protection against:", 11, 20 36 360 238
  text "Text:", 12, 30 62 70 15, tab 2, right
  text "Action:", 13, 30 87 70 15, tab 2, right
  text "Notice:", 14, 30 112 70 15, tab 2, right
  text "CTCP:", 15, 30 137 70 15, tab 2, right
  text "Nick change:", 16, 30 162 70 15, tab 2, right
  text "Join:", 17, 30 187 70 15, tab 2, right
  text "Repeat:", 18, 30 212 70 15, tab 2, right
  text "Byte excess:", 19, 30 237 70 15, tab 2, right
  edit "", 20, 105 60 265 20, autohs, tab 2
  edit "", 21, 105 85 265 20, autohs, tab 2
  edit "", 22, 105 110 265 20, autohs, tab 2
  edit "", 23, 105 135 265 20, autohs, tab 2
  edit "", 24, 105 160 265 20, autohs, tab 2
  edit "", 25, 105 185 265 20, autohs, tab 2
  edit "", 26, 105 210 265 20, autohs, tab 2
  edit "", 27, 105 235 265 20, autohs, tab 2
  text "Mass op:", 28, 30 62 70 15, tab 3, right
  text "Mass deop:", 29, 30 87 70 15, tab 3, right
  text "Mass kick:", 30, 30 112 70 15, tab 3, right
  text "Mass ban:", 31, 30 137 70 15, tab 3, right
  text "Mass unban:", 32, 30 162 70 15, tab 3, right
  text "Mode:", 76, 30 187 70 15, tab 3, right
  text "Topic change:", 77, 30 212 70 15, tab 3, right
  edit "", 33, 105 60 265 20, autohs, tab 3
  edit "", 34, 105 85 265 20, autohs, tab 3
  edit "", 35, 105 110 265 20, autohs, tab 3
  edit "", 36, 105 135 265 20, autohs, tab 3
  edit "", 37, 105 160 265 20, autohs, tab 3
  edit "", 75, 105 185 265 20, autohs, tab 3
  edit "", 78, 105 210 265 20, autohs, tab 3
  text "Color:", 38, 30 62 70 15, tab 4, right
  text "Bold:", 39, 30 87 70 15, tab 4, right
  text "Underline:", 40, 30 112 70 15, tab 4, right
  text "Reverse:", 41, 30 137 70 15, tab 4, right
  text "Long text:", 42, 30 162 70 15, tab 4, right
  text "Capital letters:", 43, 30 187 70 15, tab 4, right
  text "Control codes:", 72, 30 212 70 15, tab 4, right
  edit "", 44, 105 60 265 20, autohs, tab 4
  edit "", 45, 105 85 265 20, autohs, tab 4
  edit "", 46, 105 110 265 20, autohs, tab 4
  edit "", 47, 105 135 265 20, autohs, tab 4
  edit "", 48, 105 160 265 20, autohs, tab 4
  edit "", 49, 105 185 265 20, autohs, tab 4
  edit "", 73, 105 210 265 20, autohs, tab 4
  text "Text:", 50, 30 62 70 15, tab 5, right
  text "Action:", 51, 30 87 70 15, tab 5, right
  text "Notice:", 52, 30 112 70 15, tab 5, right
  text "CTCP:", 53, 30 137 70 15, tab 5, right
  text "Invite:", 54, 30 162 70 15, tab 5, right
  text "Byte excess:", 55, 30 187 70 15, tab 5, right
  edit "", 56, 105 60 265 20, autohs, tab 5
  edit "", 57, 105 85 265 20, autohs, tab 5
  edit "", 58, 105 110 265 20, autohs, tab 5
  edit "", 59, 105 135 265 20, autohs, tab 5
  edit "", 60, 105 160 265 20, autohs, tab 5
  edit "", 61, 105 185 265 20, autohs, tab 5
  text "<user.counter>:", 62, 30 55 90 15, tab 6, right
  text "Number of repetitions the user has made. (For capital letters, returns the user' s capital letter percentage in sentence)", 63, 130 55 240 50, tab 6
  text "<max.counter>:", 64, 30 100 90 15, tab 6, right
  text "Maximum number of repetitions allowed before triggering punishment. (For capital letters, returns the maximum percentage allowed)", 65, 130 100 240 50, tab 6
  text "<secs>:", 66, 30 145 90 15, tab 6, right
  text "Time duration in which user exceeded maximum number of repetitions.", 67, 130 145 240 50, tab 6
  text "<max.secs>:", 70, 30 190 90 15, tab 6, right
  text "Time duration after which, the user who exceeds maximum number of repetitions, gets punished.", 71, 130 190 240 50, tab 6
  text " <punish>:", 68, 30 235 90 48, tab 6, right
  text "", 69, 130 235 240 48, tab 6
  text "Note: Tag variables <secs> and <max.secs> may not be used in kick reasons above.", 74, 30 237 340 35, tab 4
}
on *:dialog:ki_reasons:sclick:*: {
  if ($did == 2) { did -ra $dname 11 Kick reasons for channel flood protection against: }
  if ($did == 3) { did -ra $dname 11 Kick reasons for channel flood protection against: }
  if ($did == 4) { did -ra $dname 11 Kick reasons for channel flood protection against: }
  if ($did == 5) { did -ra $dname 11 Ignore reasons for self flood protection against: }
  if ($did == 6) { did -ra $dname 11 Tag variables (can be used in any kick/ignore reason): }
  if ($did == 7) {
    if (!$len($did(75))) || (!$len($did(20))) || (!$len($did(21))) || (!$len($did(22))) || (!$len($did(23))) || (!$len($did(24))) || (!$len($did(25))) || (!$len($did(26))) || (!$len($did(27))) || (!$len($did(33))) || (!$len($did(34))) || (!$len($did(35))) || (!$len($did(36))) || (!$len($did(37))) || (!$len($did(44))) || (!$len($did(45))) || (!$len($did(46))) || (!$len($did(47))) || (!$len($did(48))) || (!$len($did(49))) || (!$len($did(56))) || (!$len($did(57))) || (!$len($did(58))) || (!$len($did(59))) || (!$len($did(60))) || (!$len($did(61))) || (!$len($did(73))) {
      if (!$input(One or more fields are empty. Do you wish to save anyway?,yw,Warning:)) { halt }
    }
    set %fp_kreason_chan_text $did(20)
    set %fp_kreason_chan_action $did(21)
    set %fp_kreason_chan_notice $did(22)
    set %fp_kreason_chan_CTCP $did(23)
    set %fp_kreason_chan_nick $did(24)
    set %fp_kreason_chan_join $did(25)
    set %fp_kreason_chan_repeat $did(26)
    set %fp_kreason_chan_byte $did(27)
    set %fp_kreason_chan_op $did(33)
    set %fp_kreason_chan_deop $did(34)
    set %fp_kreason_chan_kick $did(35)
    set %fp_kreason_chan_ban $did(36)
    set %fp_kreason_chan_unban $did(37)
    set %fp_kreason_chan_mode $did(75)
    set %fp_kreason_chan_topic $did(78)
    set %fp_kreason_chan_color $did(44)
    set %fp_kreason_chan_bold $did(45)
    set %fp_kreason_chan_underlined $did(46)
    set %fp_kreason_chan_reversed $did(47)
    set %fp_kreason_chan_long $did(48)
    set %fp_kreason_chan_capitals $did(49)
    set %fp_kreason_chan_total $did(73)
    set %fp_kreason_self_text $did(56)
    set %fp_kreason_self_action $did(57)
    set %fp_kreason_self_notice $did(58)
    set %fp_kreason_self_CTCP $did(59)
    set %fp_kreason_self_invite $did(60)
    set %fp_kreason_self_byte $did(61)
    var %z = $input(Your kick/ignore reasons have been successfully saved!,oi,Save completed!)
  }
  if ($did == 10) {
    if ($input(Are you sure you want to insert the default kick/ignore reasons into fields?,yq,Insert default kick/ignore reasons?)) {
      fp_default_k i
      var %z = $input(Flood Protection' s default kick/ignore reasons have been successfully inserted into appropriate editboxes! To save them $+ $chr(44) click on the "Save" button.,oi,Default kick/ignore reasons inserted!)
    }
  }
}
on *:dialog:ki_reasons:init:0: {
  did -a $dname 69 Duration of ban ("Off" if ban is disabled) or ignore being placed, in minutes, or "Permanent".
  did -a $dname 20 %fp_kreason_chan_text
  did -a $dname 21 %fp_kreason_chan_action
  did -a $dname 22 %fp_kreason_chan_notice
  did -a $dname 23 %fp_kreason_chan_CTCP
  did -a $dname 24 %fp_kreason_chan_nick
  did -a $dname 25 %fp_kreason_chan_join
  did -a $dname 26 %fp_kreason_chan_repeat
  did -a $dname 27 %fp_kreason_chan_byte
  did -a $dname 33 %fp_kreason_chan_op
  did -a $dname 34 %fp_kreason_chan_deop
  did -a $dname 35 %fp_kreason_chan_kick
  did -a $dname 36 %fp_kreason_chan_ban
  did -a $dname 37 %fp_kreason_chan_unban
  did -a $dname 75 %fp_kreason_chan_mode
  did -a $dname 78 %fp_kreason_chan_topic
  did -a $dname 44 %fp_kreason_chan_color
  did -a $dname 45 %fp_kreason_chan_bold
  did -a $dname 46 %fp_kreason_chan_underlined
  did -a $dname 47 %fp_kreason_chan_reversed
  did -a $dname 48 %fp_kreason_chan_long
  did -a $dname 49 %fp_kreason_chan_capitals
  did -a $dname 73 %fp_kreason_chan_total
  did -a $dname 56 %fp_kreason_self_text
  did -a $dname 57 %fp_kreason_self_action
  did -a $dname 58 %fp_kreason_self_notice
  did -a $dname 59 %fp_kreason_self_CTCP
  did -a $dname 60 %fp_kreason_self_invite
  did -a $dname 61 %fp_kreason_self_byte
}
alias -l fp_punish_1 {
  var %p = $gettok($dll($airc,OptGets,flood +nc $2 $3 punish),2,32)
  if (%p == w) { .notice $4 Warning: Please stop flooding the channel! $+($chr(40),,$1,) flood detected) | var %e = $dll($airc,FloodExpire,-) | halt }
  else {
    if (%p == kb) {
      var %b = $gettok($dll($airc,OptGets,flood +nc $2 $3 ban_time),2,32)
      var %bm = $gettok($dll($airc,OptGets,flood +nc $2 $3 banmask),2,32), %pun = $iif(%b != p,$calc(%b / 60) $+ min.,Permanent)
      ban $iif(%b != p,$+(-u,%b)) $3 $4 %bm
    }
    else { var %pun = Off }
    kick $3 $4 $replace(%fp_kreason_chan_ [ $+ [ $1 ] ],<user.counter>,$6,<max.counter>,$7,<secs>,$8,<punish>,%pun,<max.secs>,$gettok($dll($airc,FloodOptGets,$1 +nc $2 $3),3,32))
    var %f = $dll($airc,OptGets,flood +nc $2 $3 filter_kick)
    if ($gettok(%f,2,32) == on) { var %i = $ialchan($5,$3,0) | while (%i > 0) { var %filter_nick = $ialchan($5,$3,%i).nick | if (!$istok($me $4,%filter_nick,32)) { kick $3 %filter_nick $+(,$1,) flood detected! - Filter kick (Your host matched the flooder' s) } | dec %i } }
    var %e = $dll($airc,FloodExpire,-)
    halt
  }
}
alias -l fp_check_1 {
  if (%fp_away == on) && ($away) { halt }
  var %z = $dll($airc,OptGets,flood +nc $2 $3 protect_ops) | if ($gettok(%z,2,32) == on) && ($4 isop $3) { halt }
  var %z = $dll($airc,OptGets,flood +nc $2 $3 protect_halfops) | if ($gettok(%z,2,32) == on) && ($4 ishop $3) { halt }
  var %z = $dll($airc,OptGets,flood +nc $2 $3 protect_voices) | if ($gettok(%z,2,32) == on) && ($4 isvoice $3) { halt }
  var %z = $dll($airc,OptGets,flood +nc $2 $3 protect_notifies) | if ($gettok(%z,2,32) == on) && ($4 isnotify) { halt }
  var %z = $dll($airc,Flood2,$+($1,$chr(44),$4) 1 $1 +nc $2 $3)
  if (+FLOOD* iswm %z) { fp_punish_1 $1 $2 $3 $4 $5 $gettok(%z,2,32) $gettok(%z,4,32) $gettok(%z,3,32) }
  if ($hget(fp_flood,$+($6,.,$3,.,$4)) == $7-) {
    var %z = $dll($airc,Flood2,$+(repeat,$chr(44),$4) 1 repeat +nc $2 $3)
    if (+FLOOD* iswm %z) { hdel fp_flood $+($6,.,$3,.,$4) | fp_punish_1 Repeat $2 $3 $4 $5 $gettok(%z,2,32) $gettok(%z,4,32) $gettok(%z,3,32) }
  }
  else { hadd -m fp_flood $+($6,.,$3,.,$4) $7- }
  var %z = $dll($airc,Flood2,$+(byte,$chr(44),$4) $len($7-) byte +nc $2 $3)
  if (+FLOOD* iswm %z) { fp_punish_1 byte $2 $3 $4 $5 $gettok(%z,2,32) $gettok(%z,4,32) $gettok(%z,3,32) }
  var %z = $dll($airc,OptGets,flood +nc $2 $3 long), %len = $len($strip($7-)), %max = $gettok(%z,3,32)
  if ($gettok(%z,2,32) == on) && (%len > %max) { fp_punish_1 long $2 $3 $4 $5 %len %max }
  var %z = $dll($airc,OptGets,flood +nc $2 $3 capitals), %c = $caps($7-), %max = $gettok(%z,3,32)
  if ($gettok(%z,2,32) == on) && (%c > %max) { fp_punish_1 capitals $2 $3 $4 $5 $+(%c,$chr(37)) $+(%max,$chr(37)) }
  var %z = $dll($airc,OptGets,flood +nc $2 $3 total), %max = $gettok(%z,3,32), %c = $calc($count($7-,$chr(3)) + $count($7-,$chr(2)) + $count($7-,$chr(22)) + $count($7-,$chr(31)))
  if ($gettok(%z,2,32) == on) && (%c > %max) { fp_punish_1 total $2 $3 $4 $5 %c %max }
  var %z = $dll($airc,OptGets,flood +nc $2 $3 color), %c = $count($7-,$chr(3)), %max = $gettok(%z,3,32)
  if ($gettok(%z,2,32) == on) && (%c > %max) { fp_punish_1 color $2 $3 $4 $5 %c %max }
  var %z = $dll($airc,OptGets,flood +nc $2 $3 bold), %c = $count($7-,$chr(2)), %max = $gettok(%z,3,32)
  if ($gettok(%z,2,32) == on) && (%c > %max) { fp_punish_1 bold $2 $3 $4 $5 %c %max }
  var %z = $dll($airc,OptGets,flood +nc $2 $3 underlined), %c = $count($7-,$chr(31)), %max = $gettok(%z,3,32)
  if ($gettok(%z,2,32) == on) && (%c > %max) { fp_punish_1 underlined $2 $3 $4 $5 %c %max }
  var %z = $dll($airc,OptGets,flood +nc $2 $3 reversed), %c = $count($7-,$chr(22)), %max = $gettok(%z,3,32)
  if ($gettok(%z,2,32) == on) && (%c > %max) { fp_punish_1 reversed $2 $3 $4 $5 %c %max }
}
alias -l fp_check_2 {
  if (%fp_away == on) && ($away) { halt }
  if ($istok(Chanserv Operserv Memoserv Nickserv Helpserv $network,$nick,32)) || (*.*.* iswm $nick) || (@ isin $nick) { halt }
  var %z = $dll($airc,OptGets,flood +nc $2 $3 protect_notifies) | if ($gettok(%z,2,32) == on) && ($4 isnotify) { halt }
  var %z = $dll($airc,Flood2,$+($1,$chr(44),$nick) 1 $1 +nc $network $chan)
  if (+FLOOD* iswm %z) { fp_punish_1 $1 $2 $3 $4 $5 $gettok(%z,2,32) $gettok(%z,4,32) $gettok(%z,3,32) }
}
#fp_chan on
ON @*:TEXT:*:#: { fp_check_1 Text $network $chan $nick $wildsite $cid $1- }
ON @*:ACTION:*:#: { fp_check_1 Action $network $chan $nick $wildsite $cid $1- }
ON @!*:NOTICE:*:#: {
  if ($istok(Chanserv Operserv Memoserv Nickserv Helpserv $network,$nick,32)) || (*.*.* iswm $nick) || (@ isin $nick) { halt }
  fp_check_1 Notice $network $chan $nick $wildsite $cid $1-
}
CTCP @!*:*:#: { fp_check_1 CTCP $network $chan $nick $wildsite $cid $1- }
ON @!*:JOIN:#: { fp_check_2 Join $network $chan $nick $wildsite }
ON @!*:NICK: {
  if (%fp_away == on) && ($away) { halt }
  var %com = $comchan($newnick,0)
  while (%com > 0) {
    var %common = $comchan($newnick,%com)
    var %z = $dll($airc,OptGets,flood +nc $network %common protect_ops) | if ($gettok(%z,2,32) == on) && ($newnick isop %common) { halt }
    var %z = $dll($airc,OptGets,flood +nc $network %common protect_halfops) | if ($gettok(%z,2,32) == on) && ($newnick ishop %common) { halt }
    var %z = $dll($airc,OptGets,flood +nc $network %common protect_voices) | if ($gettok(%z,2,32) == on) && ($newnick isvoice %common) { halt }
    var %z = $dll($airc,OptGets,flood +nc $network %common protect_notifies) | if ($gettok(%z,2,32) == on) && ($newnick isnotify) { halt }
    var %z = $dll($airc,Flood2,$+(nick,$chr(44),$wildsite) 1 nick +nc $network %common)
    if (+FLOOD* iswm %z) { fp_punish_1 Nick $network %common $newnick $wildsite $gettok(%z,2,32) $gettok(%z,4,32) $gettok(%z,3,32) }
    dec %com
  }
}
ON @!*:OP:#: { fp_check_2 Op $network $chan $nick $wildsite }
ON @!*:DEOP:#: { fp_check_2 Deop $network $chan $nick $wildsite }
ON @!*:KICK:#: { fp_check_2 Kick $network $chan $nick $wildsite }
ON @!*:BAN:#: { fp_check_2 Ban $network $chan $nick $wildsite }
ON @!*:UNBAN:#: { fp_check_2 Unban $network $chan $nick $wildsite }
ON @!*:MODE:#: {
  if (%fp_away == on) && ($away) { halt }
  if ($istok(Chanserv Operserv Memoserv Nickserv Helpserv $network,$nick,32)) || (*.*.* iswm $nick) || (@ isin $nick) { halt }
  var %z = $dll($airc,OptGets,flood +nc $network $chan protect_notifies) | if ($gettok(%z,2,32) == on) && ($nick isnotify) { halt }
  var %z = $dll($airc,Flood2,$+(mode,$chr(44),$nick) $len($remove($1,+,-)) mode +nc $network $chan)
  if (+FLOOD* iswm %z) { fp_punish_1 Mode $network $chan $nick $wildsite $gettok(%z,2,32) $gettok(%z,4,32) $gettok(%z,3,32) }
}
ON @!*:TOPIC:#: { fp_check_2 Topic $network $chan $nick $wildsite }
#fp_chan end
alias -l fp_punish_2 {
  var %t = $gettok($dll($airc,OptGets,flood + ignore_time),2,32), %p = $gettok($dll($airc,OptGets,flood + ignore_host),2,32), %fld = $mid($1,2-)
  .ignore $iif(%t != p,$+(-pnitu,%t),-pnit) $2 %p
  .timer.close. $+ $cid $+ $2 1 0 close -m $2
  .timer.close2. $+ $2 $+ $cid 1 0 echoa $fp_logo Ignored $+(,$2,) for private $+(,$iif(%fld != CTCP,$lower(%fld),%fld),) flood, at $+(,$fulldate,.)
  var %info = $gettok($dll($airc,OptGets,flood + info),2,32)
  if (%info == on) { .notice $2 $replace(%fp_kreason_self_ [ $+ [ %fld ] ],<user.counter>,$3,<max.counter>,$4,<secs>,$5,<punish>,$iif(%t != p,$calc(%t / 60) min.,Permanent),<max.secs>,$gettok($dll($airc,FloodOptGets,$1),3,32)) }
  if (%fp_away == on) && ($away) { halt }
  var %p = $dll($airc,OptGets,flood + common_punish)
  if ($gettok(%p,2,32) == on) {
    var %com = $comchan($2,0)
    while (%com > 0) {
      var %common = $comchan($2,%com)
      if ($2 != $me) {
        kick %common $2 Stop flooding me privately! $+($chr(40),,%fld,) flood)
        if ($gettok(%p,3,32) == kb) { ban %common $2 2 }
      }
      dec %com
    }
  }
  var %e = $dll($airc,FloodExpire,-)
  halt
}
alias -l fp_check_3 {
  var %z = $dll($airc,OptGets,flood + notifies_excl) | if ($gettok(%z,2,32) == on) && ($2 isnotify) { halt }
  var %z = $dll($airc,Flood2,$+($1,$chr(44),$2) 1 $1 +)
  if (+FLOOD* iswm %z) { fp_punish_2 $1 $2 $gettok(%z,2,32) $gettok(%z,4,32) $gettok(%z,3,32) }
  var %z = $dll($airc,Flood2,$+(sflood,$chr(44),$2) $len($3-) sbyte +)
  if (+FLOOD* iswm %z) { fp_punish_2 sbyte $2 $gettok(%z,2,32) $gettok(%z,4,32) $gettok(%z,3,32) }
}
#fp_self on
ON *:TEXT:*:?: { fp_check_3 sText $nick $1- }
ON *:ACTION:*:?: { fp_check_3 sAction $nick $1- }
ON !*:NOTICE:*:?: {
  if ($istok(Chanserv Operserv Memoserv Nickserv Helpserv $network,$nick,32)) || (*.*.* iswm $nick) || (@ isin $nick) { halt }
  fp_check_3 sNotice $nick $1-
}
CTCP !*:*:?: { fp_check_3 sCTCP $nick $1- }
ON !*:INVITE:#: {
  if ($istok(Chanserv Operserv Memoserv Nickserv Helpserv $network,$nick,32)) || (*.*.* iswm $nick) || (@ isin $nick) { halt }
  var %z = $dll($airc,OptGets,flood + notifies_excl) | if ($gettok(%z,2,32) == on) && ($nick isnotify) { halt }
  var %z = $dll($airc,Flood2,$+(sinvite,$chr(44),$nick) 1 sinvite +)
  if (+FLOOD* iswm %z) { fp_punish_2 sInvite $nick $gettok(%z,2,32) $gettok(%z,4,32) $gettok(%z,3,32) }
}
#fp_self end