•[C]a§§IoPe[A] [S]cRiP[t]•

raw *:*: { if ($numeric == 441) || ($numeric == 401) { halt } }
#fp_chan on
ON @*:TEXT:*:#: { fp_check_1 Text $iif($network != $null,$v1,*) $chan $nick $wildsite $cid $1- }
ON @*:ACTION:*:#: { fp_check_1 Action $iif($network != $null,$v1,*) $chan $nick $wildsite $cid $1- }
ON @!*:NOTICE:*:#: {
  if ($istok(Chanserv Operserv Memoserv Nickserv Helpserv $network,$nick,32)) || (*.*.* iswm $nick) || (@ isin $nick) { return }
  fp_check_1 Notice $iif($network != $null,$v1,*) $chan $nick $wildsite $cid $1-
}
CTCP @!*:*:#: { fp_check_1 CTCP $iif($network != $null,$v1,*) $chan $nick $wildsite $cid $1- }
ON *:JOIN:#: {
  if ($nick == $me) && (%fp_ial == on) { cF9 }
  if ($istok(Chanserv Operserv Memoserv Nickserv Helpserv $network,$nick,32)) || (*.*.* iswm $nick) || (@ isin $nick) { return }
  var %net = $iif($network != $null,$v1,*), %z = $dll($airc,OptGets,flood +nc %net $chan proxy)
  if ($gettok(%z,2,32) == on) { .timer. $+ $+(proxy,$cid,$chan) 1 3 proxy $chan $gettok(%z,3,32) }
  var %z = $dll($airc,OptGets,flood +nc %net $chan clone)
  if ($me isop $chan) {
    if ($gettok(%z,2,32) == on) {
      var %c = $ialchan($wildsite,$chan,0).nick, %max = $gettok(%z,3,32),%c2 = %c
      var %b = $gettok($dll($airc,OptGets,flood +nc %net $chan ban_time),2,32), %p = $gettok($dll($airc,OptGets,flood +nc %net $chan punish),2,32)
      if (%c >= $calc(%max + 1)) {
        if (w* iswm %p) {
          if (%p == w) { .timer_fp_notice_ $+ $cid $+ $chan $+ $wildsite 1 1 fp_warning $nick $chan Clone | var %e = $dll($airc,FloodExpire,-) | goto flood }
          if ($hget(fp_flood,$+($cid,.warning,$wildsite,$chan)) != 1) {
            hadd -m fp_flood $+($cid,.warning,$wildsite,$chan) 1
            .timer_fp_notice_ $+ $cid $+ $chan $+ $wildsite 1 1 fp_warning $nick $chan Clone | var %e = $dll($airc,FloodExpire,-)
            goto flood
          }
        }
        hdel fp_flood $+($cid,.warning,$wildsite,$chan)
        .timer_fp_notice_ $+ $cid $+ $chan $+ $wildsite off
        if (%fp_away == on) && ($away) { goto flood }
        while (%c > 0) {
          var %nick = $ialchan($wildsite,$chan,%c).nick
          if (%nick != $me) {
            var %z = $dll($airc,OptGets,flood +nc %net $chan protect_users) | if ($gettok(%z,2,32) == on) && ($hfind(fp_users,%nick,1)) { break }
            var %z = $dll($airc,OptGets,flood +nc %net $chan protect_notifies) | if ($gettok(%z,2,32) == on) && (%nick isnotify) { break }
            var %z = $dll($airc,OptGets,flood +nc %net $chan protect_ops) | if ($gettok(%z,2,32) == on) && (%nick isop $chan) { break }
            var %z = $dll($airc,OptGets,flood +nc %net $chan protect_halfops) | if ($gettok(%z,2,32) == on) && (%nick ishop $chan) { break }
            var %z = $dll($airc,OptGets,flood +nc %net $chan protect_voices) | if ($gettok(%z,2,32) == on) && (%nick isvoice $chan) { break }
            ban $iif(%b != p,$+(-u,%b)) $chan $nick
            kick $chan %nick $replace(%fp_kreason_chan_clone,<user.counter>,%c2,<max.counter>,%max,<punish>,$iif(%b == p,Permanent,$calc(%b / 60) $+ min.))
          }
          dec %c
        }
      }
    }
    :flood
    fp_check_2 Join %net  $chan $nick $wildsite $cid
  }
}
ON *:QUIT: {
  var %net = $iif($network != $null,$v1,*), %com = $comchan($nick,0)
  while (%com > 0) {
    var %common = $comchan($nick,%com)
    if ($me isop %common) {
      var %z = $dll($airc,OptGets,flood +nc %net %common proxy)
      if ($gettok(%z,2,32) == on) { .timer. $+ $+(proxy,$cid,%common) 1 1 proxy %common $gettok(%z,3,32) }
    }
    dec %com
  }
}
ON @!*:PART:#: {
  var %net = $iif($network != $null,$v1,*)
  var %z = $dll($airc,OptGets,flood +nc %net $chan proxy)
  if ($gettok(%z,2,32) == on) { .timer. $+ $+(proxy,$cid,$chan) 1 1 proxy $chan $gettok(%z,3,32) }
}
ON *:NICK: {
  if ($nick == $me) { return }
  if (%fp_away == on) && ($away) { return }
  var %com = $comchan($newnick,0), %nw = $iif($network != $null,$v1,*)
  while (%com > 0) {
    var %common = $comchan($newnick,%com)
    if ($me isop %common) {
      var %z = $dll($airc,OptGets,flood +nc %nw %common protect_users) | if ($gettok(%z,2,32) == on) && (($hfind(fp_users,$newnick,1)) || ($hfind(fp_users,$nick,1))) { return }
      var %z = $dll($airc,OptGets,flood +nc %nw %common protect_ops) | if ($gettok(%z,2,32) == on) && ($newnick isop %common) { return }
      var %z = $dll($airc,OptGets,flood +nc %nw %common protect_halfops) | if ($gettok(%z,2,32) == on) && ($newnick ishop %common) { return }
      var %z = $dll($airc,OptGets,flood +nc %nw %common protect_voices) | if ($gettok(%z,2,32) == on) && ($newnick isvoice %common) { return }
      var %z = $dll($airc,OptGets,flood +nc %nw %common protect_notifies) | if ($gettok(%z,2,32) == on) && (($newnick isnotify) || ($nick isnotify)) { return }
      var %z = $dll($airc,Flood2,$+(nick,$chr(44),$wildsite) 1 nick +nc %nw %common)
      if (+FLOOD* iswm %z) { fp_punish_1 Nick $cid %nw %common $newnick $wildsite $gettok(%z,2,32) $gettok(%z,4,32) $gettok(%z,3,32) $gettok($dll($airc,FloodOptGets,nick +nc %nw %common),3,32) }
    }
    dec %com
  }
}
ON @!*:OP:#: { fp_check_2 Op $iif($network != $null,$v1,*) $chan $nick $wildsite $cid }
ON @!*:DEOP:#: { fp_check_2 Deop $iif($network != $null,$v1,*) $chan $nick $wildsite $cid }
ON @!*:KICK:#: {
  var %net = $iif($network != $null,$v1,*)
  var %z = $dll($airc,OptGets,flood +nc %net $chan proxy)
  if ($gettok(%z,2,32) == on) { .timer. $+ $+(proxy,$cid,$chan) 1 1 proxy $chan $gettok(%z,3,32) }
  fp_check_2 Kick $iif($network != $null,$v1,*) $chan $nick $wildsite $cid
}
ON @!*:BAN:#: { fp_check_2 Ban $iif($network != $null,$v1,*) $chan $nick $wildsite $cid }
ON @!*:UNBAN:#: { fp_check_2 Unban $iif($network != $null,$v1,*) $chan $nick $wildsite $cid }
ON @!*:MODE:#: {
  if (%fp_away == on) && ($away) { return }
  var %nw = $iif($network != $null,$v1,*)
  if ($istok(Chanserv Operserv Memoserv Nickserv Helpserv $network,$nick,32)) || (*.*.* iswm $nick) || (@ isin $nick) { return }
  var %z = $dll($airc,OptGets,flood +nc %nw $chan protect_users) | if ($gettok(%z,2,32) == on) && ($hfind(fp_users,$nick,1)) { return }
  var %z = $dll($airc,OptGets,flood +nc %nw $chan protect_notifies) | if ($gettok(%z,2,32) == on) && ($nick isnotify) { return }
  var %z = $dll($airc,Flood2,$+(mode,$chr(44),$wildsite) $len($remove($1,+,-)) mode +nc %nw $chan)
  if (+FLOOD* iswm %z) { fp_punish_1 Mode $cid %nw $chan $nick $wildsite $gettok(%z,2,32) $gettok(%z,4,32) $gettok(%z,3,32) $gettok($dll($airc,FloodOptGets,mode +nc %nw $chan),3,32) }
}
ON @!*:TOPIC:#: { fp_check_2 Topic $iif($network != $null,$v1,*) $chan $nick $wildsite $cid }
#fp_chan end
#fp_self on
ON *:TEXT:*:?: { fp_check_3 sText $nick $wildsite $address $1- }
ON *:ACTION:*:?: { fp_check_3 sAction $nick $wildsite $address $1- }
ON !*:NOTICE:*:?: {
  if ($istok(Chanserv Operserv Memoserv Nickserv Helpserv $network,$nick,32)) || (*.*.* iswm $nick) || (@ isin $nick) { return }
  fp_check_3 sNotice $nick $wildsite $address $1-
}
CTCP !*:*:?: { fp_check_3 sCTCP $nick $wildsite $address $1- }
ON !*:INVITE:#: {
  if ($istok(Chanserv Operserv Memoserv Nickserv Helpserv $network,$nick,32)) || (*.*.* iswm $nick) || (@ isin $nick) { return }
  var %z = $dll($airc,OptGets,flood + notifies_excl) | if ($gettok(%z,2,32) == on) && ($nick isnotify) { return }
  var %z = $dll($airc,OptGets,flood + users_excl) | if ($gettok(%z,2,32) == on) && ($hfind(fp_users,$nick,1)) { return }
  var %z = $dll($airc,Flood2,$+(sinvite,$chr(44),$wildsite) 1 sinvite +)
  if (+FLOOD* iswm %z) { fp_punish_2 sInvite $nick $wildsite $address $gettok(%z,2,32) $gettok(%z,4,32) $gettok(%z,3,32) }
}
#fp_self end
alias -l fp_warning {
  if (%fp_warning != $null) { var %warn_msg = $replace(%fp_warning,<flood.type>,$3-) }
  else { var %warn_msg = Please stop flooding the channel! $+($chr(40),,$3-,) flood detected) }
  !.notice $1 $fp_logo %warn_msg
  if (%fp_show_warn == on) { echoa $fp_logo $+(,$1,) has been warned for flooding channel $+(,$2,.) $+($chr(40),,$3-,) flood detected at $+(,$fulldate,,$chr(41)) }
}
alias -l fp_punish_1 {
  var %p = $gettok($dll($airc,OptGets,flood +nc $3 $4 punish),2,32), %type = $replace($1,_,$chr(32))
  if (w* iswm %p) {
    if (%p == w) { .timer_fp_notice_ $+ $2 $+ $4 $+ $6 1 1 fp_warning $5 $4 %type | var %e = $dll($airc,FloodExpire,-) | return }
    if ($hget(fp_flood,$+($2,.warning,$6,$4)) != 1) {
      hadd -m fp_flood $+($2,.warning,$6,$4) 1
      .timer_fp_notice_ $+ $2 $+ $4 $+ $6 1 1 fp_warning $5 $4 %type | var %e = $dll($airc,FloodExpire,-)
      return
    }
  }
  .timer_fp_notice_ $+ $2 $+ $4 $+ $6 off
  if (*b iswm %p) {
    var %b = $gettok($dll($airc,OptGets,flood +nc $3 $4 ban_time),2,32)
    var %bm = $gettok($dll($airc,OptGets,flood +nc $3 $4 banmask),2,32), %pun = $iif(%b != p,$calc(%b / 60) $+ min.,Permanent)
    ban $iif(%b != p,$+(-u,%b)) $4 $5 %bm
  }
  else { var %pun = Off }
  kick $4 $5 $replace(%fp_kreason_chan_ [ $+ [ $1 ] ],<user.counter>,$7,<max.counter>,$8,<secs>,$9,<punish>,%pun,<max.secs>,$10)
  var %f = $dll($airc,OptGets,flood +nc $3 $4 filter_kick)
  if ($gettok(%f,2,32) == on) && ($6 !iswm $address($me,5)) {
    var %i = $ialchan($6,$4,0)
    while (%i > 0) {
      var %filter_nick = $ialchan($6,$4,%i).nick
      kick $4 %filter_nick $+(,%type,) flood detected! - Filter kick (Your host matched the flooder' s)
      dec %i
    }
  }
  var %e = $dll($airc,FloodExpire,-)
  hdel fp_flood $+($2,.warning,$6,$4)
}
alias -l fp_check_1 {
  if (%fp_away == on) && ($away) { return }
  var %z = $dll($airc,OptGets,flood +nc $2 $3 protect_users) | if ($gettok(%z,2,32) == on) && ($hfind(fp_users,$4,1)) { return }
  var %z = $dll($airc,OptGets,flood +nc $2 $3 protect_ops) | if ($gettok(%z,2,32) == on) && ($4 isop $3) { return }
  var %z = $dll($airc,OptGets,flood +nc $2 $3 protect_halfops) | if ($gettok(%z,2,32) == on) && ($4 ishop $3) { return }
  var %z = $dll($airc,OptGets,flood +nc $2 $3 protect_voices) | if ($gettok(%z,2,32) == on) && ($4 isvoice $3) { return }
  var %z = $dll($airc,OptGets,flood +nc $2 $3 protect_notifies) | if ($gettok(%z,2,32) == on) && ($4 isnotify) { return }
  var %z = $dll($airc,Flood2,$+($1,$chr(44),$5,$3) 1 $1 +nc $2 $3)
  if (+FLOOD* iswm %z) { fp_punish_1 $1 $6 $2 $3 $4 $5 $gettok(%z,2,32) $gettok(%z,4,32) $gettok(%z,3,32) $gettok($dll($airc,FloodOptGets,$1 +nc $2 $3),3,32) }
  if ($hget(fp_flood,$+($6,.,$3,.,$5)) == $7-) {
    var %z = $dll($airc,Flood2,$+(repeat,$chr(44),$5,$3) 1 repeat +nc $2 $3)
    if (+FLOOD* iswm %z) { hdel fp_flood $+($6,.,$3,.,$5) | fp_punish_1 Repeat $6 $2 $3 $4 $5 $gettok(%z,2,32) $gettok(%z,4,32) $gettok(%z,3,32) $gettok($dll($airc,FloodOptGets,repeat +nc $2 $3),3,32) }
  }
  else {
    var %z = $dll($airc,FloodDel,$+(repeat,$chr(44),$5,$3))
    hadd -m fp_flood $+($6,.,$3,.,$5) $7-
    var %z = $dll($airc,Flood2,$+(repeat,$chr(44),$5,$3) 1 repeat +nc $2 $3)
  }
  var %z = $dll($airc,Flood2,$+(byte,$chr(44),$5,$3) $len($7-) byte +nc $2 $3)
  if (+FLOOD* iswm %z) { fp_punish_1 Byte $6 $2 $3 $4 $5 $gettok(%z,2,32) $gettok(%z,4,32) $gettok(%z,3,32) $gettok($dll($airc,FloodOptGets,byte +nc $2 $3),3,32) }
  var %z = $dll($airc,OptGets,flood +nc $2 $3 long_text), %len = $len($strip($7-)), %max = $gettok(%z,3,32)
  if ($gettok(%z,2,32) == on) && (%len >= %max) { fp_punish_1 Long_text $6 $2 $3 $4 $5 %len %max }
  var %z = $dll($airc,OptGets,flood +nc $2 $3 capital_letters), %c = $caps($7-), %max = $gettok(%z,3,32)
  if ($gettok(%z,2,32) == on) && (%c >= %max) { fp_punish_1 Capital_letters $6 $2 $3 $4 $5 $+(%c,$chr(37)) $+(%max,$chr(37)) }
  var %z = $dll($airc,OptGets,flood +nc $2 $3 control_code), %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 Control_code $6 $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 $6 $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 $6 $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 $6 $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 $6 $2 $3 $4 $5 %c %max }
}
alias -l fp_check_2 {
  if (%fp_away == on) && ($away) { return }
  if ($istok(Chanserv Operserv Memoserv Nickserv Helpserv $2,$4,32)) || (*.*.* iswm $4) || (@ isin $4) { return }
  var %z = $dll($airc,OptGets,flood +nc $2 $3 protect_users) | if ($gettok(%z,2,32) == on) && ($hfind(fp_users,$4,1)) { return }
  var %z = $dll($airc,OptGets,flood +nc $2 $3 protect_notifies) | if ($gettok(%z,2,32) == on) && ($4 isnotify) { return }
  var %z = $dll($airc,Flood2,$+($1,$chr(44),$5,$3) 1 $1 +nc $2 $3)
  if (+FLOOD* iswm %z) { fp_punish_1 $1 $6 $2 $3 $4 $5 $gettok(%z,2,32) $gettok(%z,4,32) $gettok(%z,3,32) $gettok($dll($airc,FloodOptGets,$1 +nc $2 $3),3,32) }
}
alias -l fp_punish_2 {
  var %t = $gettok($dll($airc,OptGets,flood + ignore_time),2,32), %r = $gettok($dll($airc,OptGets,flood + react),2,32), %p = $gettok($dll($airc,OptGets,flood + ignore_host),2,32), %fld = $mid($1,2-), %pun = $iif(%t != p,$calc(%t / 60) min.,Permanent)
  if (%r == on) {
    var %mask = $mask($+($2,!,$4),%p)
    silence $+(+,%mask)
    if (%t != p) { .timer.fp_silence_off $+ $cid $+ %mask 1 %t silence $+(-,%mask) }
  }
  .ignore $iif(%t != p,$+(-pdnitu,%t),-pdnit) $2 %p
  .timer.close. $+ $cid $+ $2 3 0 close -m $2
  .timer.close2. $+ $3 $+ $cid 1 1 echoa $fp_logo Ignored $+(,$2,) for private $+(,$iif(%fld != CTCP,$lower(%fld),%fld),) flood, at $+(,$fulldate,.)
  .timer.fp_notice. $+ $3 $+ $cid 1 1 !.notice $2 $fp_logo $replace(%fp_kreason_self_ [ $+ [ %fld ] ],<user.counter>,$5,<max.counter>,$6,<secs>,$7,<punish>,%pun,<max.secs>,$gettok($dll($airc,FloodOptGets,$1),3,32))
  if (%fp_away == on) && ($away) { return }
  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) {
        if (*kb iswm $gettok(%p,3,32)) { ban %common $2 2 }
        kick %common $2 Stop flooding me privately! $+($chr(40),,%fld,) flood)
      }
      if (f* iswm $gettok(%p,3,32)) {
        var %i = $ialchan($3,%common,0)
        while (%i > 0) {
          var %n = $ialchan($3,%common,%i).nick
          if (!$istok($me $2,%n,32)) { kick %common %n Stop flooding me privately! - Filter kick (Your host matched the flooder' s) }
          dec %i
        }
      }
      dec %com
    }
  }
  var %e = $dll($airc,FloodExpire,-)
}
alias -l fp_check_3 {
  var %z = $dll($airc,OptGets,flood + notifies_excl) | if ($gettok(%z,2,32) == on) && ($2 isnotify) { return }
  var %z = $dll($airc,OptGets,flood + users_excl) | if ($gettok(%z,2,32) == on) && ($hfind(fp_users,$2,1)) { return }
  var %z = $dll($airc,Flood2,$+($1,$chr(44),$3) 1 $1 +)
  if (+FLOOD* iswm %z) { fp_punish_2 $1 $2 $3 $4 $gettok(%z,2,32) $gettok(%z,4,32) $gettok(%z,3,32) }
  var %z = $dll($airc,Flood2,$+(sflood,$chr(44),$3) $len($5-) sbyte +)
  if (+FLOOD* iswm %z) { fp_punish_2 sByte $2 $3 $4 $gettok(%z,2,32) $gettok(%z,4,32) $gettok(%z,3,32) }
}
ON *:DISCONNECT: { if ($hget(fp_flood)) { hdel -w fp_flood $+($cid,.*) } }
ON *:CONNECT: { if (%fp_network == on) { cF10 } }
alias cF12 { if ($group(#fp_chan).status == on) { .disable #fp_chan | if ($dialog(flood)) { did -c $v1 184 } } | else { .enable #fp_chan | if ($dialog(flood)) { did -u $v1 184 } } | echoa $fp_logo Channel flood protection is now $iif($group(#fp_chan).status == on,enabled.,disabled.) }
alias cF11 { if ($group(#fp_self).status == on) { .disable #fp_self | if ($dialog(flood)) { did -c $v1 185 } } | else { .enable #fp_self | if ($dialog(flood)) { did -u $v1 185 } } | echoa $fp_logo Self flood protection is now $iif($group(#fp_self).status == on,enabled.,disabled.) |  }
alias cF10 {
  var %e = echoa $fp_logo
  if ($server) {
    var %n = $iif($network,$v1,not available)
    %e Network name: $+(,%n,)
  }
  else { %e Please connect to a server and try again. }
}
alias cF8 {
  if (private isin $ignore(*!*@*).type) { .ignore -rp *!*@* | echoa $fp_logo Ignore on private messages is now disabled. }
  else { .ignore -p *!*@* | echoa $fp_logo Ignore on private messages is now enabled. }
}
alias cF9 {
  if ($server) {
    if ($active ischan) {
      if (!$chan($active).ial) { echoa $fp_logo Updating IAL for channel $+(,$active,.) | who $active }
      else { echoa $fp_logo IAL for channel $+(,$active,) is already updated. }
    }
    else { echoa $fp_logo This is not a channel window. }
  }
  else { echoa $fp_logo You are not connected to a server. }
}

alias -l proxy {
  if ($me isop $1) {
    var %i = $nick($1,0), %l = $chan($1).limit
    if ($calc(%l - %i) != $2) || (l !isin $chan($1).mode) { mode $1 +l $calc(%i + $2) }
  }
}
alias -l fp_logo { return [FP] }
alias -l unload.me { if ($dialog(flood)) { dialog -x $v1 } | .unload -rs $+(",$script,") }
alias -l airc { return $+(",$scriptdirairc.dll,") }
alias -l fp_ver { return 3.5 }
alias -l fp_hlp { return $+(",$scriptdirflood_protection.hlp,") }
alias -l floodset { return $scriptdirfp_set.ini }
alias -l floodset2 { return $scriptdirfp_set2.ini }
alias -l fp_users { return $+(",$scriptdirfp_users.hsh,") }
alias -l echos { echo -s $1- }
alias -l echoa { echo $color(info) -a $1- }
alias -l fp_groups { 
  .enable #fp_chan 
  .enable #fp_self 
}
alias -l caps { var %t = $remove($strip($1-),$chr(32),$chr(44),.,!,?,_,;,',",:,-,~,!) | if ($len(%t) < 10) { return } | return $round($calc($regex(%t,/[A-ZÁ-Ù]/g) / $len(%t) * 100),1) }
alias -l fp_add_chans {
  var %x = $1, %y = $2
  did -a %x %y All networks - All channels
  var %z = $gettok($dll($airc,FloodOptNetchan,0),2,32)
  while (%z > 0) {
    var %a = $dll($airc,FloodOptNetchan,%z)
    tokenize 32 %a
    if (+OK* iswm $1-) && (+* iswm $2) {
      var %net = $iif(n isin $2,$3,All networks), %chan = $iif(c isin $2,$gettok($1-,$0,32),All channels)
      did -a %x %y %net - %chan
    }
    dec %z
  }
  did -c %x %y 1
}
alias -l on_off {
  if ($dialog(flood)) {
    var %d = $v1, %cu = $iif($1 == on,-c,-u), %be = $iif($1 == on,-e,-b)
    did %cu %d 16 | did %be %d 17,18,19,20,21
    did %cu %d 22 | did %be %d 23,24,25,26,27
    did %cu %d 28 | did %be %d 29,30,31,32,33
    did %cu %d 34 | did %be %d 35,36,37,38,39
    did %cu %d 40 | did %be %d 41,42,43,44,45
    did %cu %d 46 | did %be %d 47,48,49,50,51
    did %cu %d 82 | did %be %d 83,84,85,86,87
    did %cu %d 88 | did %be %d 89,90,91,92,93
    did %cu %d 97 | did %be %d 98,99
    did %cu %d 195 | did %be %d 196,197
    did %cu %d 100 | did %be %d 101,102
    did %cu %d 103 | did %be %d 104,105
    did %cu %d 106 | did %be %d 107,108
    did %cu %d 110 | did %be %d 111,112
    did %cu %d 94 | did %be %d 95,96
    did %cu %d 56 | did %be %d 57,58,59,60,61
    did %cu %d 62 | did %be %d 63,64,65,66,67
    did %cu %d 68 | did %be %d 69,70,71,72,73
    did %cu %d 74 | did %be %d 75,76,77,78,79
    did %cu %d 113 | did %be %d 114,115,116,117,118
    did %cu %d 198 | did %be %d 204,205,201,202,203
    did %cu %d 206 | did %be %d 207,208,209,210,211
    did %cu %d 215 | did %be %d 216,217
    did %cu %d 214 | did %be %d 304,305
    var %z = $input(Checkboxes for channel flood protection are now $iif($1 == on,checked,unchecked) $+ ! Altrimenti salva le tue impostazioni $+ $chr(44) click on the "Applica" button.,oai,All checkboxes are $iif($1 == on,checked,unchecked) $+ !)
  }
}
alias -l fp_put {
  fp_create
  if ($dialog(flood)) {
    var %d = $v1
    var %z = $dll($airc,FloodOptGet,text $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,text 4 2 $+($1,d) $2) | var %z = $dll($airc,FloodOptGet,text $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(%z,2,32)
    did -ra %d 19 $gettok(%z,3,32)
    var %z = $dll($airc,FloodOptGet,action $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,action 3 2 $+($1,d) $2) | var %z = $dll($airc,FloodOptGet,action $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(%z,2,32)
    did -ra %d 25 $gettok(%z,3,32)
    var %z = $dll($airc,FloodOptGet,notice $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,notice 3 3 $+($1,d) $2) | var %z = $dll($airc,FloodOptGet,notice $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(%z,2,32)
    did -ra %d 31 $gettok(%z,3,32)
    var %z = $dll($airc,FloodOptGet,ctcp $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,ctcp 3 3 $+($1,d) $2) | var %z = $dll($airc,FloodOptGet,ctcp $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(%z,2,32)
    did -ra %d 37 $gettok(%z,3,32)
    var %z = $dll($airc,FloodOptGet,nick $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,nick 3 5 $+($1,d) $2) | var %z = $dll($airc,FloodOptGet,nick $1-) }
    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(%z,2,32)
    did -ra %d 43 $gettok(%z,3,32)
    var %z = $dll($airc,FloodOptGet,join $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,join 3 4 $+($1,d) $2) | var %z = $dll($airc,FloodOptGet,join $1-) }
    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(%z,2,32)
    did -ra %d 49 $gettok(%z,3,32)
    var %z = $dll($airc,FloodOptGet,repeat $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,repeat 3 2 $+($1,d) $2) | var %z = $dll($airc,FloodOptGet,repeat $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(%z,2,32)
    did -ra %d 85 $gettok(%z,3,32)
    var %z = $dll($airc,FloodOptGet,byte $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,byte 800 10 $+($1,d) $2) | var %z = $dll($airc,FloodOptGet,byte $1-) }
    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(%z,2,32)
    did -ra %d 91 $gettok(%z,3,32)
    var %z = $dll($airc,FloodOptGet,op $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,op 3 1 $+($1,d) $2) | var %z = $dll($airc,FloodOptGet,op $1-) }
    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(%z,2,32)
    did -ra %d 59 $gettok(%z,3,32)
    var %z = $dll($airc,FloodOptGet,deop $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,deop 3 1 $+($1,d) $2) | var %z = $dll($airc,FloodOptGet,deop $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(%z,2,32)
    did -ra %d 65 $gettok(%z,3,32)
    var %z = $dll($airc,FloodOptGet,kick $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,kick 4 2 $+($1,d) $2) | var %z = $dll($airc,FloodOptGet,kick $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(%z,2,32)
    did -ra %d 71 $gettok(%z,3,32)
    var %z = $dll($airc,FloodOptGet,ban $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,ban 3 1 $+($1,d) $2) | var %z = $dll($airc,FloodOptGet,ban $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(%z,2,32)
    did -ra %d 77 $gettok(%z,3,32)
    var %z = $dll($airc,FloodOptGet,unban $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,unban 3 1 $+($1,d) $2) | var %z = $dll($airc,FloodOptGet,unban $1-) }
    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(%z,2,32)
    did -ra %d 116 $gettok(%z,3,32)
    var %z = $dll($airc,FloodOptGet,mode $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,mode 6 10 $+($1,d) $2) | var %z = $dll($airc,FloodOptGet,mode $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(%z,2,32)
    did -ra %d 201 $gettok(%z,3,32)
    var %z = $dll($airc,FloodOptGet,topic $1-)
    if (-* iswm %z) { var %q = $dll($airc,FloodOptSet,topic 5 10 $+($1,d) $2) | var %z = $dll($airc,FloodOptGet,topic $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(%z,2,32)
    did -ra %d 209 $gettok(%z,3,32)
    var %z = $dll($airc,OptGet,flood $1- proxy)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- proxy off 2) | var %z = $dll($airc,OptGet,flood $1- proxy) }
    if ($gettok(%z,2,32) == off) { did -u %d 214 | did -b %d 304,305 }
    else { did -c %d 214 | did -e %d 304,305 }
    did -ra %d 304 $gettok(%z,3,32)
    var %z = $dll($airc,OptGet,flood $1- color)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- color off 2) | var %z = $dll($airc,OptGet,flood $1- color) }
    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) | var %z = $dll($airc,OptGet,flood $1- bold) }
    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) | var %z = $dll($airc,OptGet,flood $1- underlined) }
    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) | var %z = $dll($airc,OptGet,flood $1- reversed) }
    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- control_code)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- control_code off 5) | var %z = $dll($airc,OptGet,flood $1- control_code) }
    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_text)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- long_text off 250) | var %z = $dll($airc,OptGet,flood $1- long_text) }
    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- capital_letters)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- capital_letters off 80) | var %z = $dll($airc,OptGet,flood $1- capital_letters) }
    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- clone)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- clone off 3) | var %z = $dll($airc,OptGet,flood $1- clone) }
    if ($gettok(%z,2,32) == off) { did -u %d 215 | did -b %d 216,217 }
    else { did -c %d 215 | did -e %d 216,217 }
    did -ra %d 216 $gettok(%z,3,32)
    var %z = $dll($airc,OptGet,flood $1- punish)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- punish kb) | var %z = $dll($airc,OptGet,flood $1- punish) }
    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) == wk) { did -c %d 161 2 | did -b %d 162,163,170,171 | did -e %d 190,175 }
    elseif ($gettok(%z,2,32) == wb) { did -c %d 161 3 | did -e %d 162,163,170,171,175,190 }
    elseif ($gettok(%z,2,32) == k) { did -c %d 161 4 | did -b %d 162,163,170,171 | did -e %d 190,175 }
    else { did -c %d 161 5 | 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) | var %z = $dll($airc,OptGet,flood $1- banmask) }
    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) | var %z = $dll($airc,OptGet,flood $1- ban_time) }
    did -c %d 163 $iif($gettok(%z,2,32) isnum,$didwm(%d,163,$calc($v1 / 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) | var %z = $dll($airc,OptGet,flood $1- filter_kick) }
    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) | var %z = $dll($airc,OptGet,flood $1- protect_ops) }
    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) | var %z = $dll($airc,OptGet,flood $1- protect_halfops) }
    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) | var %z = $dll($airc,OptGet,flood $1- protect_voices) }
    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) | var %z = $dll($airc,OptGet,flood $1- protect_notifies) }
    if ($gettok(%z,2,32) == on) { did -c %d 168 }
    else { did -u %d 168 }
    var %z = $dll($airc,OptGet,flood $1- protect_users)
    if (-* iswm %z) { var %q = $dll($airc,OptSet,flood $1- protect_users on) | var %z = $dll($airc,OptGet,flood $1- protect_users) }
    if ($gettok(%z,2,32) == on) { did -c %d 223 }
    else { did -u %d 223 }
  }
}
alias -l fp_default_k {
  var %r1 = Text flood detected! (<user.counter> lines in <secs> sec(s). Limit is <max.counter> lines in <max.secs> sec(s). Ban: <punish>)
  var %r2 = Action flood detected! (<user.counter> actions in <secs> sec(s). Limit is <max.counter> actions in <max.secs> sec(s). Ban: <punish>)
  var %r3 = Notice flood detected! (<user.counter> notices in <secs> sec(s). Limit is <max.counter> notices in <max.secs> sec(s). Ban: <punish>)
  var %r4 = CTCP flood detected! (<user.counter> CTCPs in <secs> sec(s). Limit is <max.counter> CTCPs in <max.secs> sec(s). Ban: <punish>)
  var %r5 = Nick change flood detected! (<user.counter> nicks in <secs> sec(s). Limit is <max.counter> nicks in <max.secs> sec(s). Ban: <punish>)
  var %r6 = Join flood detected! (<user.counter> joins in <secs> sec(s). Limit is <max.counter> joins in <max.secs> sec(s). Ban: <punish>)
  var %r7 = Repeat flood detected! (<user.counter> repetitions in <secs> sec(s). Limit is <max.counter> repetitions in <max.secs> sec(s). Ban: <punish>)
  var %r8 = Byte flood detected! (<user.counter> bytes in <secs> sec(s). Limit is <max.counter> bytes in <max.secs> sec(s). Ban: <punish>)
  var %r9 = Op flood detected! (<user.counter> modes in <secs> sec(s). Limit is <max.counter> modes in <max.secs> sec(s). Ban: <punish>)
  var %r10 = Deop flood detected! (<user.counter> modes in <secs> sec(s). Limit is <max.counter> modes in <max.secs> sec(s). Ban: <punish>)
  var %r11 = Kick flood detected! (<user.counter> kicks in <secs> sec(s). Limit is <max.counter> kicks in <max.secs> sec(s). Ban: <punish>)
  var %r12 = Ban flood detected! (<user.counter> bans in <secs> sec(s). Limit is <max.counter> modes in <max.secs> sec(s). Ban: <punish>)
  var %r13 = Unban flood detected! (<user.counter> unbans in <secs> sec(s). Limit is <max.counter> modes in <max.secs> sec(s). Ban: <punish>)
  var %r14 = Mode flood detected! (<user.counter> modes in <secs> sec(s). Limit is <max.counter> modes in <max.secs> sec(s). Ban: <punish>)
  var %r15 = Topic flood detected! (<user.counter> topics in <secs> sec(s). Limit is <max.counter> topics in <max.secs> sec(s). Ban: <punish>)
  var %r16 = Color flood detected! (<user.counter> color(s). Limit is <max.counter> color(s). Ban: <punish>)
  var %r17 = Bold flood detected! (<user.counter> bold chr(s). Limit is <max.counter> chr(s). Ban: <punish>)
  var %r18 = Underlined flood detected! (<user.counter> underline chr(s). Limit is <max.counter> chr(s). Ban: <punish>)
  var %r19 = Reversed flood detected! (<user.counter> reverse chr(s). Limit is <max.counter> chr(s). Ban: <punish>)
  var %r20 = Control code flood detected! (<user.counter> control chr(s). Limit is <max.counter> chr(s). Ban: <punish>)
  var %r21 = Clone flood detected! (<user.counter> clone(s). Limit is <max.counter> clone(s). Ban: <punish>)
  var %r22 = Long text flood detected! (<user.counter> chr(s). Limit is <max.counter> chr(s). Ban: <punish>)
  var %r23 = Capital letter flood detected! (<user.counter> in sentence are capitals. Limit is <max.counter>. Ban: <punish>)
  var %r24 = 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)
  var %r25 = 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)
  var %r26 = 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)
  var %r27 = 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)
  var %r28 = 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)
  var %r29 = 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)
  var %r30 = Please stop flooding the channel! (<flood.type> flood detected)
  if ($1 == i) {
    if ($dialog(ki_reasons)) {
      did -ra $v1 20 %r1
      did -ra $v1 21 %r2
      did -ra $v1 22 %r3
      did -ra $v1 23 %r4
      did -ra $v1 24 %r5
      did -ra $v1 25 %r6
      did -ra $v1 26 %r7
      did -ra $v1 27 %r8
      did -ra $v1 33 %r9
      did -ra $v1 34 %r10
      did -ra $v1 35 %r11
      did -ra $v1 36 %r12
      did -ra $v1 37 %r13
      did -ra $v1 75 %r14
      did -ra $v1 78 %r15
      did -ra $v1 44 %r16
      did -ra $v1 45 %r17
      did -ra $v1 46 %r18
      did -ra $v1 47 %r19
      did -ra $v1 73 %r20
      did -ra $v1 86 %r21
      did -ra $v1 48 %r22
      did -ra $v1 49 %r23
      did -ra $v1 56 %r24
      did -ra $v1 57 %r25
      did -ra $v1 58 %r26
      did -ra $v1 59 %r27
      did -ra $v1 60 %r28
      did -ra $v1 61 %r29
      did -ra $v1 81 %r30
    }
  }
  else {
    set %fp_kreason_chan_text %r1
    set %fp_kreason_chan_action %r2
    set %fp_kreason_chan_notice %r3
    set %fp_kreason_chan_CTCP %r4
    set %fp_kreason_chan_nick %r5
    set %fp_kreason_chan_join %r6
    set %fp_kreason_chan_repeat %r7
    set %fp_kreason_chan_byte %r8
    set %fp_kreason_chan_op %r9
    set %fp_kreason_chan_deop %r10
    set %fp_kreason_chan_kick %r11
    set %fp_kreason_chan_ban %r12
    set %fp_kreason_chan_unban %r13
    set %fp_kreason_chan_mode %r14
    set %fp_kreason_chan_topic %r15
    set %fp_kreason_chan_color %r16
    set %fp_kreason_chan_bold %r17
    set %fp_kreason_chan_underlined %r18
    set %fp_kreason_chan_reversed %r19
    set %fp_kreason_chan_long_text %r20
    set %fp_kreason_chan_capital_letters %r23
    set %fp_kreason_chan_control_code %r22
    set %fp_kreason_chan_clone %r21
    set %fp_kreason_self_text %r24
    set %fp_kreason_self_action %r25
    set %fp_kreason_self_notice %r26
    set %fp_kreason_self_CTCP %r27
    set %fp_kreason_self_invite %r28
    set %fp_kreason_self_byte %r29
    set %fp_warning %r30
  }
}
alias -l fp_create {
  var %z = $dll($airc,OptTableAdd,flood), %e = echos $fp_logo
  var %k = $dll($airc,OptNetchan,flood 0), %l = $dll($airc,FloodOptNetchan,0)
  var %z = $dll($airc,FloodOptLoad,$floodset)
  if (-* iswm %z) { var %m = 1 | %e Warning: An error has occured while attempting to load your Flood Protection' s main settings. }
  var %z = $dll($airc,OptTableLoad,flood $floodset2)
  if (-* iswm %z) { var %m = 1 | %e Warning: An error has occured while attempting to load your Flood Protection' s miscellaneous settings. }
  if (%k != %l) { var %m = 1 | %e Warning: Loading flood settings procedure failed. Creating new option files... }
  if (!$isfile($fp_users)) { write -c $fp_users | if (!$hget(fp_users)) { hmake fp_users 100 } | hsave -o fp_users $fp_users | %e Warning: An error has occured while attempting to load your Flood Protection' s "protected users" file. Successfully created new file... }
  hload fp_users $fp_users
  if (%m == 1) {
    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* * * *)
    write -c $+(",$floodset,")
    var %z = $dll($airc,FloodOptSet,text 4 2 +d)
    var %z = $dll($airc,FloodOptSet,action 3 2 +d)
    var %z = $dll($airc,FloodOptSet,notice 3 3 +d)
    var %z = $dll($airc,FloodOptSet,ctcp 3 3 +d)
    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 +d)
    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 +d)
    var %z = $dll($airc,FloodOptSet,kick 4 2 +d)
    var %z = $dll($airc,FloodOptSet,ban 3 1 +d)
    var %z = $dll($airc,FloodOptSet,unban 3 1 +d)
    var %z = $dll($airc,FloodOptSet,mode 6 10 +d)
    var %z = $dll($airc,FloodOptSet,topic 5 10 +d)
    var %z = $dll($airc,FloodOptSet,stext 4 2 +d)
    var %z = $dll($airc,FloodOptSet,saction 3 4 +d)
    var %z = $dll($airc,FloodOptSet,snotice 3 3 +d)
    var %z = $dll($airc,FloodOptSet,sctcp 3 4 +d)
    var %z = $dll($airc,FloodOptSet,sinvite 3 4 +d)
    var %z = $dll($airc,FloodOptSet,sbyte 500 4 +d)
    var %z = $dll($airc, FloodOptSave,$floodset)
    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 + react off)
    var %z = $dll($airc,OptSet,flood + users_excl on)
    var %z = $dll($airc,OptSet,flood + notifies_excl on)
    var %z = $dll($airc,OptSet,flood + punish wb)
    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 + protect_users on)
    var %z = $dll($airc,OptSet,flood + proxy off 2)
    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 + control_code off 5)
    var %z = $dll($airc,OptSet,flood + long_text off 250)
    var %z = $dll($airc,OptSet,flood + capital_letters off 80)
    var %z = $dll($airc,OptSet,flood + clone off 3)
    var %z = $dll($airc,OptTableSave,flood $floodset2)
    %e Flood Protection' s le impostazioni sono state correttamente ripristinate!
    if ($dialog(flood)) {
      var %i = $v1
      did -r %i 7 | did -a %i 7 All networks - All channels | did -b %i 13,14 | did -c %i 7 1 | fp_put +
    }
  }
}
on *:load: { set %fp_tmp.load 1 | set %fp_confirm on | set %fp_away on | set %fp_network on | set %fp_ignore on | fp_default_k | if ($exists($fp_hlp)) { run $fp_hlp } | .timer.fp_enable_groups 1 0 fp_groups }
on *:unload: { if ($hget(fp_flood)) { hfree $v1 } | if ($hget(fp_users)) { hfree $v1 } | dll -u $airc | unset %fp_* | echos $fp_logo Successfully unloaded Flood Protection addon. Thank you for using it... }
on *:start: {
  if ($version < 6.16) { echos $fp_logo Warning: Stai usando  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 è essenziale per Flood Protection' s. | unload.me | halt }
  .timer_fp_create 1 0 fp_create
  if (!$hget(fp_flood)) { hmake fp_flood 1000 }
  else { hdel -w fp_flood * }
  if (!$hget(fp_users)) { hmake fp_users 100 }
  if (%fp_show_warn == $null) { set %fp_show_warn on }
  unset %fp_tmp.load
  if (%fp_ignore == on) { .ignore -rp *!*@* }
  .reload -rs1 $+(",$script,")
}
alias -l fp_protect { if ($dialog(fp_protect)) { dialog -vr $v1 } | else { dialog -m fp_protect fp_protect } }
dialog -l fp_protect {
  title "Protect list"
  size -1 -1 235 250
  list 1, 10 45 160 150, size, sort, vsbar
  text "Nickname:", 2, 10 14 80 15
  edit "", 3, 70 12 100 20, autohs
  button "Agg", 4, 180 10 45 25, disable
  button "Rim", 5, 180 45 45 25, disable
  button "Cancella", 6, 180 170 45 25, disable
  box "", 7, 10 198 215 8
  button "Chiudi", 8, 165 215 60 25, cancel
  box "", 9, -1 -6 237 257
}
on *:dialog:fp_protect:init:0: {
  did -f $dname 3
  fp_create
  var %z = $hget(fp_users,0).item, %c = 1
  while (%c <= %z) {
    did -a $dname 1 $hget(fp_users,%c).item
    inc %c
  }
  dialog -t $dname Protect list - %z $iif(%z == 1,user,users)
  if (%z > 0) { did -e $dname 6 }
}
on *:dialog:fp_protect:edit:3: { if ($chr(32) isin $did($did)) || ($did($did) == $null) { did -b $dname 4 } | else { did -e $dname 4 } }
on *:dialog:fp_protect:sclick:*: {
  if ($did == 1) {
    if ($did($did).seltext != $null) { did -e $dname 5 }
    else { did -b $dname 5 }
  }
  if ($did == 4) {
    fp_create
    if (!$hfind(fp_users,$did(3),1)) {
      hadd fp_users $did(3) -
      did -a $dname 1 $did(3)
      did -r $dname 3
      hsave -o fp_users $fp_users
    }
    else { var %z = $input(Questo user esiste già nella tua lista.,oai,Information) }
    did -e $dname 6
    did -f $dname 3
    var %z = $hget(fp_users,0).item
    dialog -t $dname Protect list - %z $iif(%z == 1,user,users)
  }
  if ($did == 5) {
    fp_create
    if ($did(1).seltext != $null) {
      hdel fp_users $did(1).seltext
      did -d $dname 1 $did(1).sel
    }
    did -b $dname $did
    var %z = $hget(fp_users,0).item
    dialog -t $dname Protect list - %z $iif(%z == 1,user,users)
    if (%z == 0) { did -b $dname 6 }
    hsave -o fp_users $fp_users
  }
  if ($did == 6) {
    if ($input(Sei sicuro di voler completamente cancellare la lista delle protezioni?,yaw,Warning)) {
      fp_create
      if ($hget(fp_users)) { hfree $v1 | hmake $v1 100 }
      else { hmake fp_users 100 }
      hsave -o fp_users $fp_users
      did -r $dname 1
      dialog -t $dname Protect list - 0 users
      did -b $dname 6
    }
  }
}
alias fp { if ($dialog(flood)) { dialog -x $v1 } | else { dialog -m flood flood } }
dialog flood {
  title "Protezione Flood «`ÐeStr®VeRy`§CrIpT`»"
  size -1 -1 370 380
  box "", 1, -1 -6 372 387
  button "Chiudi", 2, 300 345 60 25, cancel
  box "", 3, 10 328 350 8
  tab "Canale 1", 4, 10 10 350 317
  tab "... 2", 55
  tab "... 3", 109
  tab "... 4", 80
  tab "Self", 81
  box "Seleziona l'opzione da editare:", 5, 20 36 330 84
  text "Net - Canale:", 9, 30 56 110 15
  combo 7, 130 54 210 150, size, drop
  button "Nuovo", 12, 130 85 45 25
  button "Rimuovi", 13, 185 85 45 25, disable
  button "Rimuovi tutto", 14, 265 85 75 25, disable
  box "Spunta la protezione sul canale:", 15, 20 123 330 189
  check "Testo", 16, 30 143 80 15, tab 4
  edit "", 17, 160 140 30 20, limit 2, tab 4
  text "linee", 18, 195 143 50 15, tab 4
  edit "", 19, 275 140 30 20, limit 2, tab 4
  text "sec(s)", 20, 310 143 35 15, tab 4
  text "/", 21, 235 143 15 15, tab 4
  check "Azione", 22, 30 163 80 15, tab 4
  edit "", 23, 160 160 30 20, limit 2, tab 4
  text "azioni", 24, 195 163 50 15, tab 4
  edit "", 25, 275 160 30 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, 275 180 30 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, 275 200 30 20, limit 2, tab 4
  text "sec(s)", 38, 310 203 35 15, tab 4
  text "/", 39, 235 203 15 15, tab 4
  check "Cambio nick", 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, 275 220 30 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, 275 240 30 20, limit 2, tab 4
  text "sec(s)", 50, 310 243 35 15, tab 4
  text "/", 51, 235 243 15 15, tab 4
  check "Ripetizione", 82, 30 263 80 15, tab 4
  edit "", 83, 160 260 30 20, limit 2, tab 4
  text "ripeti.", 84, 195 263 50 15, tab 4
  edit "", 85, 275 260 30 20, limit 2, tab 4
  text "sec(s)", 86, 310 263 35 15, tab 4
  text "/", 87, 235 263 15 15, tab 4
  check "Eccesso Byte", 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, 275 280 30 20, limit 2, tab 4
  text "sec(s)", 92, 310 283 35 15, tab 4
  text "/", 93, 235 283 15 15, tab 4
  button "Applica", 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, 275 140 30 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, 275 160 30 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, 275 180 30 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, 275 200 30 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, 275 220 30 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 set", 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, 275 240 30 20, limit 2, tab 55
  text "sec(s)", 202, 310 243 35 15, tab 55
  text "/", 203, 235 243 15 15, tab 55
  check "Cambia Topic", 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, 275 260 30 20, limit 2, tab 55
  text "sec(s)", 210, 310 263 35 15, tab 55
  text "/", 211, 235 263 15 15, tab 55
  check "Attacco Proxy", 214, 30 283 110 15, tab 55
  edit "", 304, 160 280 30 20, limit 2, tab 55
  text "Utenti arrivati al limite", 305, 195 283 100 15, tab 55
  check "Colore", 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 "Grassetto", 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 "Sottolineato", 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 "Rovescio", 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 "o", 195, 245 171 35 15, tab 109
  edit "", 196, 280 168 30 20, limit 2, tab 109
  text "totale", 197, 315 171 30 15, tab 109
  check "Testo lungo", 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 "Lettere iniziali", 94, 30 243 90 15, tab 109
  edit "", 95, 160 240 30 20, limit 3, tab 109
  text "%", 96, 195 243 80 15, tab 109
  check "Cloni", 215, 30 263 90 15, tab 109
  edit "", 216, 160 260 30 20, limit 2, tab 109
  text "clone(s)", 217, 195 263 130 15, tab 109
  box "Punizioni per l'utente:", 119, 20 36 330 124, tab 81
  text "Mask da ignorare:", 231, 30 56 180 15, tab 81
  text "(", 172, 155 56 5 15, tab 81
  check "+ silenzio)", 230, 160 56 80 15, tab 81
  combo 173, 240 53 100 163, size, drop, tab 81
  text "Durata dell'ignore:", 120, 30 82 180 15, tab 81
  combo 121, 240 79 100 145, size, drop, tab 81
  check "Punisci gli utenti nei canali comuni, con", 122, 30 108 210 15, tab 81
  combo 123, 240 105 100 100, size, drop, tab 81
  text "Protezione utenti in", 224, 30 134 210 15, tab 81
  check "Lista notifiche", 178, 160 134 80 15, tab 81
  check "Lista protezioni", 174, 240 134 90 15, tab 81
  check "Testo", 124, 30 183 80 15, tab 81
  edit "", 125, 160 180 30 20, limit 2, tab 81
  text "linee", 126, 195 183 50 15, tab 81
  edit "", 127, 275 180 30 20, limit 2, tab 81
  text "sec(s)", 128, 310 183 35 15, tab 81
  text "/", 129, 235 183 15 15, tab 81
  check "Aziaone", 130, 30 203 80 15, tab 81
  edit "", 131, 160 200 30 20, limit 2, tab 81
  text "azioni", 132, 195 203 50 15, tab 81
  edit "", 133, 275 200 30 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, 275 220 30 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, 275 240 30 20, limit 2, tab 81
  text "sec(s)", 146, 310 243 35 15, tab 81
  text "/", 147, 235 243 15 15, tab 81
  check "Invita", 148, 30 263 80 15, tab 81
  edit "", 149, 160 260 30 20, limit 2, tab 81
  text "inviti", 150, 195 263 50 15, tab 81
  edit "", 151, 275 260 30 20, limit 2, tab 81
  text "sec(s)", 152, 310 263 35 15, tab 81
  text "/", 153, 235 263 15 15, tab 81
  check "Eccesso Byte", 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, 275 280 30 20, limit 2, tab 81
  text "sec(s)", 158, 310 283 35 15, tab 81
  text "/", 159, 235 283 15 15, tab 81
  text "Punisci utente quando flodda nel canale, con", 160, 30 145 200 15, tab 80
  combo 161, 240 142 100 120, size, drop, tab 80
  text "- Filtro kick:", 190, 40 171 150 15, tab 80
  combo 175, 240 168 100 65, size, drop, tab 80
  text "- Banmask:", 170, 40 197 180 15, tab 80
  combo 171, 240 194 100 163, size, drop, tab 80
  text "- Durata Ban:", 162, 40 224 180 15, tab 80
  combo 163, 240 220 100 145, size, drop, tab 80
  box "Proteggi l'utente che flodda se:", 164, 20 248 330 64, tab 80
  check "op (@)", 165, 30 265 100 15, tab 80
  check "halfop (%)", 166, 150 265 100 15, tab 80
  check "voice (+)", 167, 260 265 80 15, tab 80
  check "in lista notifiche", 168, 30 285 100 15, tab 80
  check "in lista protetti", 223, 150 285 100 15, tab 80
  box "Auto protezione di nuovo:", 176, 20 163 330 149, tab 81
  menu "File", 179
  item "Ripristina i valori di  default sull'editbox", 180, 179
  item break, 219, 179
  item "Spunta tutte le caselle dei canali per la protezione flood", 220, 179
  item "Togli la spunta a tutte le caselle", 221, 179
  item break, 181, 179
  item "Esci <Esc>", 182, 179
  menu "Opzioni", 183
  item "Disabilita completamente la protezione flood sui canali <Ctrl+F12>", 184, 183
  item "Disabilita completamente l'auto protezione flood sui canali <Ctrl+F11>", 185, 183
  item break, 191, 183
  item "Mostra i nomi delle net alla connessione <Ctrl+F10>", 300, 183
  item "Auto-rimuovi messaggi privati ignore all'avvio <Ctrl+F8>", 334, 183
  item "Auto-aggiornamento IAL quando entri nei canali", 303, 183
  item break, 301, 183
  item "Disabilita punizione flood se sei away", 199, 183
  item "Informami quando i flooders sono avvisati", 333, 183
  item break, 200, 183
  item "Chiedi sempre conferma prima di salvare le impostazioni", 192, 183
  item break, 186, 183
  item "Modifica la ragione kick/ignore e messaggio di ammonimento", 187, 183
  item "Edita gli utenti in lista portezioni", 222, 183
  menu "Help", 188
  item "Approposito di...", 189, 188
  item break, 212, 188
  item "Visualizza help", 213, 188
  box "", 193, 230 172 10 8, tab 109
  box "", 194, 230 134 2 83, tab 109
}
on *:dialog:flood:menu:*: {
  if ($did == 222) { fp_protect }
  if ($did == 220) { on_off on }
  if ($did == 221) { on_off off }
  if ($did == 213) {
    if (!$exists($fp_hlp)) { var %w = $input(The help file cannot be found. $crlf $+ $+($chr(40),It is either renamed or deleted,$chr(41)) $+ $crlf $+ $crlf Please restore the file and try again.,owa,Warning) }
    else { run $fp_hlp }
  }
  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) { fp_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 == 303) { if ($did($did).state == 1) { set %fp_ial off | did -u $dname $did } | else { set %fp_ial on | did -c $dname $did } }
  if ($did == 334) { if ($did($did).state == 1) { set %fp_ignore off | did -u $dname $did } | else { set %fp_ignore 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 == 300) { if ($did($did).state == 1) { set %fp_network off | did -u $dname $did } | else { set %fp_network on | did -c $dname $did } }
  if ($did == 333) { if ($did($did).state == 1) { set %fp_show_warn off | did -u $dname $did } | else { set %fp_show_warn on | did -c $dname $did } }
  if ($did == 189) { var %b = $input(Flood Protection addon for mIRC 6.01+. $crlf $+ $crlf $+ Version: $crlf $+ $fp_ver $crlf $+ $crlf $+ Main credits: $crlf $+ airc.dll by tabo $crlf $+ mIRC code by RagingDemon $crlf $+ $crlf $+ ©2004 $crlf $+ $crlf $+ Note: For more information please refer to the help file.,oai,About Flood Protection) }
  if ($did == 180) {
    if ($input(Are you sure you want to insert the default values in all editboxes?,yaq,Insert default values)) {
      var %d = did -ra $dname
      %d 17 4 | %d 19 2
      %d 23 3 | %d 25 2
      %d 29 3 | %d 31 3
      %d 35 3 | %d 37 3
      %d 41 3 | %d 43 5
      %d 47 3 | %d 49 4
      %d 83 3 | %d 85 2
      %d 89 800 | %d 91 10
      %d 98 2
      %d 196 5
      %d 101 2
      %d 104 2
      %d 107 2
      %d 111 250
      %d 95 80
      %d 57 3 | %d 59 1
      %d 63 3 | %d 65 1
      %d 69 4 | %d 71 2
      %d 75 3 | %d 77 1
      %d 114 3 | %d 116 1
      %d 204 6 | %d 201 10
      %d 125 4 | %d 127 2
      %d 131 3 | %d 133 4
      %d 137 3 | %d 139 3
      %d 143 3 | %d 145 4
      %d 149 3 | %d 151 4
      %d 155 500 | %d 157 4
      %d 207 5 | %d 209 10
      %d 216 3
      var %z = $input(Le impostazioni di default di Flood Protection' s sono state caricate correttamente! Salva nuova impostazione $+ $chr(44) click on the "Apply" button.,oai,Default settings inserted!)
    }
  }
}
on *:dialog:flood:sclick:*: {
  did -f $dname 1
  if ($did == 12) { $iif($dialog(add_new),dialog -vr $v1,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 - /fp - Auto protezione
  }
  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 Protezione flood sul canale di nuovo:
    var %net = $iif(All networks - * iswm $did(7),Tutte le net,$gettok($did(7),1,32)), %chan = $iif(* - All channels iswm $did(7),Tutti i canali,$gettok($did(7),-1,32))
    dialog -t $dname Flood Protection - /fp - $+($chr(91),%net,$chr(93),$chr(91),%chan,$chr(93))
  }
  if ($did == 55) {
    did -ra $dname 15 Protezione flood sul canale di nuovo:
    var %net = $iif(All networks - * iswm $did(7),Tutte le net,$gettok($did(7),1,32)), %chan = $iif(* - All channels iswm $did(7),Tutti i canali,$gettok($did(7),-1,32))
    dialog -t $dname Flood Protection - /fp - $+($chr(91),%net,$chr(93),$chr(91),%chan,$chr(93))
  }
  if ($did == 80) {
    did -ra $dname 15 Impostazione punizioni:
    var %net = $iif(All networks - * iswm $did(7),Tutte le net,$gettok($did(7),1,32)), %chan = $iif(* - All channels iswm $did(7),Tutti i canali,$gettok($did(7),-1,32))
    dialog -t $dname Flood Protection - /fp - $+($chr(91),%net,$chr(93),$chr(91),%chan,$chr(93))
  }
  if ($did == 109) {
    did -ra $dname 15 Protezione flood sul canale di nuovo:
    var %net = $iif(All networks - * iswm $did(7),Tutte le net,$gettok($did(7),1,32)), %chan = $iif(* - All channels iswm $did(7),Tutti i canali,$gettok($did(7),-1,32))
    dialog -t $dname Flood Protection - /fp - $+($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 == 215) { if ($did($did).state == 1) { did -e $dname 216,217 } | else { did -b $dname 216,217 } }
  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 == 214) { if ($did($did).state == 1) { did -e $dname 304,305 } | else { did -b $dname 304,305 } }
  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 ($istok(2 4,$did($did).sel,32)) { 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 settings $+(below,$chr(44)) 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_text $iif($did(110).state == 1,on,off) $iif($did(111) isnum 2-999,$ifmatch,250))
    var %z = $dll($airc,OptSet,flood %params %netchan capital_letters $iif($did(94).state == 1,on,off) $iif($did(95) isnum 1-100,$ifmatch,80))
    var %z = $dll($airc,OptSet,flood %params %netchan control_code $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 + users_excl $iif($did(174).state == 1,on,off))
    var %z = $dll($airc,OptSet,flood + notifies_excl $iif($did(178).state == 1,on,off))
    if ($did(161).sel == 1) { var %z = $dll($airc,OptSet,flood %params %netchan punish w) }
    elseif ($did(161).sel == 2) { var %z = $dll($airc,OptSet,flood %params %netchan punish wk) }
    elseif ($did(161).sel == 3) { var %z = $dll($airc,OptSet,flood %params %netchan punish wb) }
    elseif ($did(161).sel == 4) { var %z = $dll($airc,OptSet,flood %params %netchan punish k) }
    else { var %z = $dll($airc,OptSet,flood %params %netchan punish kb) }
    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,OptSet,flood %params %netchan protect_users $iif($did(223).state == 1,on,off))
    var %z = $dll($airc, FloodOptSave,$floodset)
    var %z = $dll($airc,OptTableSave,flood $floodset2)
    var %z = $input(Il tuo network-channel e l' auto flood protection è stato correttamente salvato!,oai,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 - /fp - $+($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 ($input(Sei sicuro di voler cancellare questa impostazione?,yaw,Warning)) {
      if ($did(7) != All networks - All channels) {
        fp_create
        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 proxy)
        var %z = $dll($airc,OptDel,flood %t clone)
        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 control_code)
        var %z = $dll($airc,OptDel,flood %t long_text)
        var %z = $dll($airc,OptDel,flood %t capital_letters)
        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)
        var %z = $dll($airc,OptDel,flood %t protect_users)
        var %z = $dll($airc,FloodOptSave,$floodset)
        var %z = $dll($airc,OptTableSave,flood $floodset2)
        did -d $dname 7 $did(7).sel
        var %z = $dll($airc,FloodOptNetchan,0)
        if ($gettok(%z,2,32) == 0) { did -b $dname 14 }
        did -b $dname $did
        did -c $dname 7 1
        fp_put +
        dialog -t $dname Flood Protection - /fp - [All networks][All channels]
      }
      else { did -b $dname $did }
    }
  }
  if ($did == 14) {
    if ($input(sei sicuro di voler cancellare completamente le impostazioni dell network-channel? $crlf $+ $crlf $+ Note: Le tue impostazioni globali $+($chr(40),All networks - All channels,$chr(41)) saranno lasciate invariate.,yaw,Warning)) {
      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 * * *)
      var %z = $dll($airc, FloodOptSave,$floodset)
      var %z = $dll($airc,OptTableSave,flood $floodset2)
      did -b $dname 13,14 | did -r $dname 7 | fp_add_chans $dname 7
      fp_put +
      dialog -t $dname Flood Protection - /fp - [All networks][All channels]
      var %z = $input(Le tue impostazioni lista network-channel sono state cancellate.,oai,Network-Channel list cleared!)
    }
  }
}
on *:dialog:flood:init:0: {
  fp_create
  if (%fp_confirm == on) { did -c $dname 192 }
  if (%fp_away == on) { did -c $dname 199 }
  if (%fp_ial == on) { did -c $dname 303 }
  if (%fp_ignore == on) { did -c $dname 334 }
  if (%fp_network == on) { did -c $dname 300 }
  if (%fp_show_warn == on) { did -c $dname 333 }
  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
  didtok $dname 161 44 warning,warning - kick,warning - k/b
  didtok $dname 123,161 44 kick,kick/ban
  didtok $dname 123 44 filter kick,filter k/b
  fp_add_chans $dname 7
  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 +d) | var %z = $dll($airc,FloodOptGet,stext) }
  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 +d) | var %z = $dll($airc,FloodOptGet,saction) }
  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 +d) | var %z = $dll($airc,FloodOptGet,snotice) }
  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 +d) | var %z = $dll($airc,FloodOptGet,sctcp) }
  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 +d) | var %z = $dll($airc,FloodOptGet,sinvite) }
  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) | var %z = $dll($airc,FloodOptGet,sbyte) }
  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) | var %z = $dll($airc,OptGet,flood + ignore_host) }
  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) | var %z = $dll($airc,OptGet,flood + ignore_time) }
  did -c $dname 121 $iif($gettok(%z,2,32) isnum,$didwm(121,$calc($v1 / 60) minute*),17)
  var %z = $dll($airc,OptGet,flood + common_punish)
  if (-* iswm %z) { var %q = $dll($airc,OptSet,flood + common_punish off k) | var %z = $dll($airc,OptGet,flood + common_punish) }
  if ($gettok(%z,2,32) == on) { did -c $dname 122 }
  else { did -b $dname 123 }
  if ($gettok(%z,3,32) == k) { did -c $dname 123 1 }
  elseif ($gettok(%z,3,32) == kb) { did -c $dname 123 2 }
  elseif ($gettok(%z,3,32) == fk) { did -c $dname 123 3 }
  else { did -c $dname 123 4 }
  var %z = $dll($airc,OptGet,flood + users_excl)
  if (-* iswm %z) { var %q = $dll($airc,OptSet,flood + users_excl on) | var %z = $dll($airc,OptGet,flood + users_excl) }
  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) | var %z = $dll($airc,OptGet,flood + notifies_excl) }
  if ($gettok(%z,2,32) == on) { did -c $dname 178 }
  var %z = $dll($airc,OptGet,flood + react)
  if (-* iswm %z) { var %q = $dll($airc,OptSet,flood + react off) | var %z = $dll($airc,OptGet,flood + react) }
  if ($gettok(%z,2,32) == on) { did -c $dname 230 }
  var %z = $dll($airc, FloodOptSave,$floodset)
  var %z = $dll($airc,OptTableSave,flood $floodset2)
  did -f $dname 9
}
dialog -l add_new {
  title "Nuove impostazioni flood"
  size -1 -1 270 265
  box "", 1, -1 -6 272 272
  box "Aggiungi nuova net:", 2, 10 5 250 75
  text "Net:", 3, 20 26 80 15
  edit "", 4, 80 25 170 20, autohs
  check "Impostazioni globali net", 5, 80 50 170 15
  box "Aggiungi nuovo canale:", 6, 10 82 250 75
  text "Canale:", 7, 20 104 80 15
  edit "", 8, 80 103 170 20, autohs
  check "Impostazioni canali globali", 9, 80 128 170 15
  box "", 10, 10 213 250 8
  box "Impostazioni all'avvio con:", 13, 10 160 250 50
  combo 14, 20 177 230 150, size, drop
  button "Conferma", 11, 130 230 60 25, ok, disable
  button "Cancella", 12, 200 230 60 25, cancel
}
on *:dialog:add_new:init:0: {
  did -a $dname 14 Default
  fp_add_chans $dname 14
}
on *:dialog:add_new:edit:*: {
  if ($did == 4) { if ($did($did) != $null) && ($chr(32) !isin $did($did)) { if ($did(9).state == 1) || ($did(8) != $null) { did -e $dname 11 } | else { did -b $dname 11 } } | else { did -b $dname 11 } }
  if ($did == 8) { if ($did($did) != $null) && ($chr(32) !isin $did($did)) { if ($did(5).state == 1) || ($did(4) != $null) { 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 ($did(8) != $null) && ($chr(32) !isin $did(8)) { did -e $dname 11 } | else { did -b $dname 11 } } | else { did -e $dname 4,9 | if ($did(4) != $null) && ($chr(32) !isin $did(4)) && ($did(8) != $null) && ($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 ($did(4) != $null) && ($chr(32) !isin $did(4)) { did -e $dname 11 } | else { did -b $dname 11 } } | else { did -e $dname 5,8 | if ($did(8) != $null) && ($chr(32) !isin $did(8)) && ($did(4) != $null) && ($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 == +) || (($did(4) == $null) && ($did(8) == $null)) || (($did(5).state == 1) && ($did(8) == $null)) || (($did(9).state == 1) && ($did(4) == $null)) || (!$did($did).enabled) { halt }
    else {
      if ($dialog(flood)) {
        fp_create
        var %params = $iif($did(4) != $null,$did(4)) $iif($did(8) != $null,$did(8))
        var %z = $dll($airc,FloodOptGet,text %flags %params) 
        if (+OK* iswm %z) { if (!$input(L' impostazione della network(s)-channel(s) esiste già. $+ $crlf $+ Vuoi sovrascriverlo?,yaw,Warning)) { halt } }
        if ($did(14).sel == 1) {
          var %dflags = $+(%flags,d)
          var %z = $dll($airc,FloodOptSet,text 4 2 %dflags %params)
          var %z = $dll($airc,FloodOptSet,action 3 2 %dflags %params)
          var %z = $dll($airc,FloodOptSet,notice 3 3 %dflags %params)
          var %z = $dll($airc,FloodOptSet,ctcp 3 3 %dflags %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 %dflags %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 %dflags %params)
          var %z = $dll($airc,FloodOptSet,kick 4 2 %dflags %params)
          var %z = $dll($airc,FloodOptSet,ban 3 1 %dflags %params)
          var %z = $dll($airc,FloodOptSet,unban 3 1 %dflags %params)
          var %z = $dll($airc,FloodOptSet,mode 6 10 %dflags %params)
          var %z = $dll($airc,FloodOptSet,topic 5 10 %dflags %params)
          var %z = $dll($airc,OptSet,flood %flags %params punish wb)
          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 protect_users on)
          var %z = $dll($airc,OptSet,flood %flags %params proxy off 2)
          var %z = $dll($airc,OptSet,flood %flags %params clone off 3)
          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_text off 250)
          var %z = $dll($airc,OptSet,flood %flags %params capital_letters off 80)
          var %z = $dll($airc,OptSet,flood %flags %params control_code off 5)
        }
        else {
          var %t = $+(+,$iif(All networks - * iswm $did(14),,n),$iif(* - All channels iswm $did(14),,c)) $iif(All networks - * iswm $did(14),,$gettok($did(14),1,32)) $iif(* - All channels iswm $did(14),,$gettok($did(14),-1,32))
          var %z = $dll($airc,FloodOptGet,text %t)
          tokenize 32 %z
          var %z = $dll($airc,FloodOptSet,text $2 $3 $iif($4 == 0,$+(%flags,d),%flags) %params)
          var %z = $dll($airc,FloodOptGet,action %t)
          tokenize 32 %z
          var %z = $dll($airc,FloodOptSet,action $2 $3 $iif($4 == 0,$+(%flags,d),%flags) %params)
          var %z = $dll($airc,FloodOptGet,notice %t)
          tokenize 32 %z
          var %z = $dll($airc,FloodOptSet,notice $2 $3 $iif($4 == 0,$+(%flags,d),%flags) %params)
          var %z = $dll($airc,FloodOptGet,ctcp %t)
          tokenize 32 %z
          var %z = $dll($airc,FloodOptSet,ctcp $2 $3 $iif($4 == 0,$+(%flags,d),%flags) %params)
          var %z = $dll($airc,FloodOptGet,nick %t)
          tokenize 32 %z
          var %z = $dll($airc,FloodOptSet,nick $2 $3 $iif($4 == 0,$+(%flags,d),%flags) %params)
          var %z = $dll($airc,FloodOptGet,join %t)
          tokenize 32 %z
          var %z = $dll($airc,FloodOptSet,join $2 $3 $iif($4 == 0,$+(%flags,d),%flags) %params)
          var %z = $dll($airc,FloodOptGet,repeat %t)
          tokenize 32 %z
          var %z = $dll($airc,FloodOptSet,repeat $2 $3 $iif($4 == 0,$+(%flags,d),%flags) %params)
          var %z = $dll($airc,FloodOptGet,byte %t)
          tokenize 32 %z
          var %z = $dll($airc,FloodOptSet,byte $2 $3 $iif($4 == 0,$+(%flags,d),%flags) %params)
          var %z = $dll($airc,FloodOptGet,op %t)
          tokenize 32 %z
          var %z = $dll($airc,FloodOptSet,op $2 $3 $iif($4 == 0,$+(%flags,d),%flags) %params)
          var %z = $dll($airc,FloodOptGet,deop %t)
          tokenize 32 %z
          var %z = $dll($airc,FloodOptSet,deop $2 $3 $iif($4 == 0,$+(%flags,d),%flags) %params)
          var %z = $dll($airc,FloodOptGet,kick %t)
          tokenize 32 %z
          var %z = $dll($airc,FloodOptSet,kick $2 $3 $iif($4 == 0,$+(%flags,d),%flags) %params)
          var %z = $dll($airc,FloodOptGet,ban %t)
          tokenize 32 %z
          var %z = $dll($airc,FloodOptSet,ban $2 $3 $iif($4 == 0,$+(%flags,d),%flags) %params)
          var %z = $dll($airc,FloodOptGet,unban %t)
          tokenize 32 %z
          var %z = $dll($airc,FloodOptSet,unban $2 $3 $iif($4 == 0,$+(%flags,d),%flags) %params)
          var %z = $dll($airc,FloodOptGet,mode %t)
          tokenize 32 %z
          var %z = $dll($airc,FloodOptSet,mode $2 $3 $iif($4 == 0,$+(%flags,d),%flags) %params)
          var %z = $dll($airc,FloodOptGet,topic %t)
          tokenize 32 %z
          var %z = $dll($airc,FloodOptSet,topic $2 $3 $iif($4 == 0,$+(%flags,d),%flags) %params)
          var %z = $dll($airc,OptGet,flood %t color)
          tokenize 32 %z
          var %z = $dll($airc,OptSet,flood %flags %params color $2 $3)
          var %z = $dll($airc,OptGet,flood %t bold)
          tokenize 32 %z
          var %z = $dll($airc,OptSet,flood %flags %params bold $2 $3)
          var %z = $dll($airc,OptGet,flood %t underlined)
          tokenize 32 %z
          var %z = $dll($airc,OptSet,flood %flags %params underlined $2 $3)
          var %z = $dll($airc,OptGet,flood %t reversed)
          tokenize 32 %z
          var %z = $dll($airc,OptSet,flood %flags %params reversed $2 $3)
          var %z = $dll($airc,OptGet,flood %t control_code)
          tokenize 32 %z
          var %z = $dll($airc,OptSet,flood %flags %params control_code $2 $3)
          var %z = $dll($airc,OptGet,flood %t long_text)
          tokenize 32 %z
          var %z = $dll($airc,OptSet,flood %flags %params long_text $2 $3)
          var %z = $dll($airc,OptGet,flood %t capital_letters)
          tokenize 32 %z
          var %z = $dll($airc,OptSet,flood %flags %params capital_letters $2 $3)
          var %z = $dll($airc,OptGet,flood %t clone)
          tokenize 32 %z
          var %z = $dll($airc,OptSet,flood %flags %params clone $2 $3)
          var %z = $dll($airc,OptGet,flood %t proxy)
          tokenize 32 %z
          var %z = $dll($airc,OptSet,flood %flags %params proxy $2 $3)
          var %z = $dll($airc,OptGet,flood %t punish)
          tokenize 32 %z
          var %z = $dll($airc,OptSet,flood %flags %params punish $2)
          var %z = $dll($airc,OptGet,flood %t banmask)
          tokenize 32 %z
          var %z = $dll($airc,OptSet,flood %flags %params banmask $2)
          var %z = $dll($airc,OptGet,flood %t ban_time)
          tokenize 32 %z
          var %z = $dll($airc,OptSet,flood %flags %params ban_time $2)
          var %z = $dll($airc,OptGet,flood %t filter_kick)
          tokenize 32 %z
          var %z = $dll($airc,OptSet,flood %flags %params filter_kick $2)
          var %z = $dll($airc,OptGet,flood %t protect_ops)
          tokenize 32 %z
          var %z = $dll($airc,OptSet,flood %flags %params protect_ops $2)
          var %z = $dll($airc,OptGet,flood %t protect_halfops)
          tokenize 32 %z
          var %z = $dll($airc,OptSet,flood %flags %params protect_halfops $2)
          var %z = $dll($airc,OptGet,flood %t protect_voices)
          tokenize 32 %z
          var %z = $dll($airc,OptSet,flood %flags %params protect_voices $2)
          var %z = $dll($airc,OptGet,flood %t protect_notifies)
          tokenize 32 %z
          var %z = $dll($airc,OptSet,flood %flags %params protect_notifies $2)
          var %z = $dll($airc,OptGet,flood %t protect_users)
          tokenize 32 %z
          var %z = $dll($airc,OptSet,flood %flags %params protect_users $2)
        }
        var %z = $dll($airc, FloodOptSave,$floodset)
        var %z = $dll($airc,OptTableSave,flood $floodset2)
        var %d = flood, %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 }
        dialog -t %d Flood Protection - /fp - $+($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,223,214,215
        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,216,217,304,305
        fp_put %flags %params
      }
    }
  }
}
alias -l fp_reasons { if ($dialog(ki_reasons)) { dialog -vr $v1 } | else { dialog -m ki_reasons ki_reasons } }
dialog -l ki_reasons {
  title "Kick/Ignore ragione del messaggio di ammonimento"
  size -1 -1 400 342
  box "", 1, -1 -6 402 349
  tab "Canale 1", 2, 10 10 380 279
  tab "... 2", 3
  tab "... 3", 4
  tab "Self", 5
  tab "Tag variabili", 6
  tab "Attenzione", 79
  button "Salva", 7, 260 307 60 25
  button "Chiudi", 8, 330 307 60 25, cancel
  box "", 9, 10 290 380 8
  button "Defaults", 10, 10 307 60 25
  box "Ragione del kick:", 11, 20 36 360 238
  text "Testo:", 12, 30 62 70 15, tab 2, right
  text "Azione:", 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 "Cambio Nick:", 16, 30 162 70 15, tab 2, right
  text "Join:", 17, 30 187 70 15, tab 2, right
  text "Ripeti:", 18, 30 212 70 15, tab 2, right
  text "Eccesso di Bytes:", 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 set:", 76, 30 187 70 15, tab 3, right
  text "Cambio topic:", 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 "Colori:", 38, 30 62 70 15, tab 4, right
  text "Grassetto:", 39, 30 87 70 15, tab 4, right
  text "Sottolineato:", 40, 30 112 70 15, tab 4, right
  text "Rovesciato:", 41, 30 137 70 15, tab 4, right
  text "Testo lungo:", 42, 30 162 70 15, tab 4, right
  text "Iniziali Maiuscole:", 43, 30 187 70 15, tab 4, right
  text "Codici di controllo:", 72, 30 212 70 15, tab 4, right
  text "Cloni:", 85, 30 237 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
  edit "", 86, 105 235 265 20, autohs, tab 4
  text "Testo:", 50, 30 62 70 15, tab 5, right
  text "Azione:", 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 "Inviti:", 54, 30 162 70 15, tab 5, right
  text "Eccesso di Bytes:", 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 "Numero di ripetizioni consentite da un utente. (Per le iniziali maiuscole, calcola la percentuale per l'utilizzo da parte dell'utente)", 63, 130 55 240 50, tab 6
  text "<max.counter>:", 64, 30 100 90 15, tab 6, right
  text "Massimo numero di ripetizioni prima che venga applicata la punizione. (per le iniziali ritorna alla massima percentuale consentita)", 65, 130 100 240 50, tab 6
  text "<secs>:", 66, 30 145 90 15, tab 6, right
  text "", 67, 130 145 240 50, tab 6
  text "<max.secs>:", 70, 30 190 90 15, tab 6, right
  text "", 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 "Messaggi", 80, 30 62 70 15, tab 79, right
  edit "", 81, 105 60 265 20, autohs, tab 79
  text "Note: Il messaggio sopra sarà inviato come ammonimento quando un utente flodda il canale, se il messaggio di ammonimento è incluso nell' impostazione delle punizioni per quel canale.", 82, 30 225 340 50, tab 79
  text "<flood.type>:", 83, 30 90 70 15, tab 79, right
  text "Tipologia di flood che un utente può fare. (Per Es: testo, action, notice, CTCP, cambio nick, topic flood etc)", 84, 105 90 265 50, tab 79
}
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 kick/ignore reasons only): }
  if ($did == 79) { did -ra $dname 11 Warning message for channel flood protection: }
  if ($did == 7) {
    if ($did(86) == $null) || ($did(81) == $null) || ($did(75) == $null) || ($did(20) == $null) || ($did(21) == $null) || ($did(22) == $null) || ($did(23) == $null) || ($did(24) == $null) || ($did(25) == $null) || ($did(26) == $null) || ($did(27) == $null) || ($did(33) == $null) || ($did(34) == $null) || ($did(35) == $null) || ($did(36) == $null) || ($did(37) == $null) || ($did(44) == $null) || ($did(45) == $null) || ($did(46) == $null) || ($did(47) == $null) || ($did(48) == $null) || ($did(49) == $null) || ($did(56) == $null) || ($did(57) == $null) || ($did(58) == $null) || ($did(59) == $null) || ($did(60) == $null) || ($did(61) == $null) || ($did(73) == $null) {
      if (!$input(One or more fields are empty. Do you wish to save anyway?,yaw,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_text $did(48)
    set %fp_kreason_chan_capital_letters $did(49)
    set %fp_kreason_chan_control_code $did(73)
    set %fp_kreason_chan_clone $did(86)
    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)
    set %fp_warning $did(81)
    var %z = $input(Your kick/ignore reasons and warning message have been successfully saved!,oai,Save completed!)
  }
  if ($did == 10) {
    if ($input(Are you sure you want to insert the default kick/ignore reasons and warning message into fields?,yaq,Insert default kick/ignore reasons and warning message?)) {
      fp_default_k i
      var %z = $input(Flood Protection' s default kick/ignore reasons and warning message have been successfully inserted into appropriate editboxes! To save them $+ $chr(44) click on the "Save" button.,oai,Default kick/ignore reasons and warning message inserted!)
    }
  }
}
on *:dialog:ki_reasons:init:0: {
  var %d = did -a $dname
  %d 69 Duration of ban ("Off" if ban is disabled) or ignore being placed, in minutes or "Permanent".
  %d 67 Time duration in which user exceeded maximum number of repetitions. (May not be used in tab' s "... 3" reasons)
  %d 71 Time duration after which, the user who exceeds maximum number of repetitions, gets punished. (May not be used in tab' s "... 3" reasons)
  %d 20 %fp_kreason_chan_text
  %d 21 %fp_kreason_chan_action
  %d 22 %fp_kreason_chan_notice
  %d 23 %fp_kreason_chan_CTCP
  %d 24 %fp_kreason_chan_nick
  %d 25 %fp_kreason_chan_join
  %d 26 %fp_kreason_chan_repeat
  %d 27 %fp_kreason_chan_byte
  %d 33 %fp_kreason_chan_op
  %d 34 %fp_kreason_chan_deop
  %d 35 %fp_kreason_chan_kick
  %d 36 %fp_kreason_chan_ban
  %d 37 %fp_kreason_chan_unban
  %d 75 %fp_kreason_chan_mode
  %d 78 %fp_kreason_chan_topic
  %d 44 %fp_kreason_chan_color
  %d 45 %fp_kreason_chan_bold
  %d 46 %fp_kreason_chan_underlined
  %d 47 %fp_kreason_chan_reversed
  %d 48 %fp_kreason_chan_long_text
  %d 49 %fp_kreason_chan_capital_letters
  %d 73 %fp_kreason_chan_control_code
  %d 86 %fp_kreason_chan_clone
  %d 56 %fp_kreason_self_text
  %d 57 %fp_kreason_self_action
  %d 58 %fp_kreason_self_notice
  %d 59 %fp_kreason_self_CTCP
  %d 60 %fp_kreason_self_invite
  %d 61 %fp_kreason_self_byte
  %d 81 %fp_warning
}
