[script]
n0=on *:text:*:#: {
n1=  if (%antiflood.chan == on) {
n2=    if (%antiflood.chan.all) goto nac
n3=    var %cf 0
n4=    while (%cf < %antiflood.chan.count) {
n5=      inc %cf
n6=      if (# == %antiflood.chan. [ $+ [ %cf ] ]) {
n7=        :nac
n8=        if (%antiflood.nick. [ $+ [ $nick ] ] == $null) { set %antiflood.nick. [ $+ [ $nick ] ] 1 | .timer 1 %antiflood.max.msg.time unset %antiflood.nick. [ $+ [ $nick ] ] | goto end }
n9=        elseif (%antiflood.nick. [ $+ [ $nick ] ] isnum 1 - %antiflood.max.msg.limit) { inc %antiflood.nick. [ $+ [ $nick ] ] 1 | goto end }
n10=        else {
n11=          if (%antiflood.flooded. [ $+ [ $nick ] ] != $null) halt 
n12=          else set -u3 %antiflood.flooded. [ $+ [ $nick ] ] 1
n13=          if ($me isop #) antiflood.punish # $nick
n14=          else {
n15=            .ignore -cu60 $nick 2
n16=            set -u10 %fl.nick $nick
n17=            .notice $nick 4Игнор за флуд!
n18=            echo 4 -at * $nick флудит на канале $chan $+ . Игнор на 1 мин.
n19=            unset %antiflood.nick. [ $+ [ $nick ] ]
n20=            goto end
n21=          }
n22=        }
n23=        :end
n24=      }
n25=    }
n26=  }
n27=}
n28=alias antiflood.punish {
n29=  if (%antiflood.punishment == 1) {
n30=    var %wc 0
n31=    while (%wc < %antiflood.warn.cnt) {
n32=      inc %wc
n33=      if ($2 == %antiflood.warn. [ $+ [ %wc ] ]) {
n34=        echo 2 -t * $2 кикнут и забанен на 10 минут за флуд на канале $1
n35=        ban -u600 $1 $2 %sel.n.banmask
n36=        kick $1 $2 $replace(%antiflood.msg, chan, $1) Отдохни 10 минут...
n37=        unset %antiflood.warn. [ $+ [ %wc ] ]
n38=        var %nn 0
n39=        var %nnn 1
n40=        while (%nn < %antiflood.warn.cnt) {
n41=          inc %nn
n42=          if (%antiflood.warn. [ $+ [ %nn ] ]) { 
n43=            if (%antiflood.warn. [ $+ [ %nnn ] ] != %antiflood.warn. [ $+ [ %nn ] ]) {
n44=              set %antiflood.warn. [ $+ [ %nnn ] ] %antiflood.warn. [ $+ [ %nn ] ] 
n45=              unset %antiflood.warn. [ $+ [ %nn ] ]
n46=            }
n47=            inc %nnn 
n48=          }
n49=        }
n50=        set %antiflood.warn.cnt %nnn - 1
n51=        halt
n52=      }
n53=    }
n54=    echo 2 -t * $2 предупрежден о последствиях флуда на канале $1
n55=    .msg $2 $replace(%antiflood.msg, chan, $1)
n56=    inc %antiflood.warn.cnt
n57=    set -u300 %antiflood.warn. [ $+ [ %antiflood.warn.cnt ] ] $2
n58=    unset %antiflood.nick. [ $+ [ $2 ] ]
n59=  }
n60=  if (%antiflood.punishment == 2) {
n61=    echo 2 -t * $2 кикнут за флуд на канале $1
n62=    kick $1 $2 $replace(%antiflood.msg, chan, $1)
n63=  }
n64=  if (%antiflood.punishment == 3) {
n65=    echo 2 -t * $2 кикнут и забанен на 10 минут за флуд на канале $1
n66=    ban -u600 $1 $2 %sel.n.banmask
n67=    kick $1 $2 $replace(%antiflood.msg, chan, $1) Отдохни 10 минут...
n68=  }
n69=  if (%antiflood.punishment == 4) {
n70=    echo 2 -t * $2 кикнут и забанен насовсем за флуд на канале $1
n71=    ban $1 $2 %sel.n.banmask
n72=    kick $1 $2 $replace(%antiflood.msg, chan, $1) Все прощай...
n73=  }
n74=}
n75=on *:notice:*:*: {
n76=  if (%antiflood.notice == on) && ($nick != ChanServ) && ($nick != NickServ) {
n77=    if (%antiflood.notice.nick. [ $+ [ $nick ] ] == $null) { set %antiflood.notice.nick. [ $+ [ $nick ] ] 1 | .timer 1 %antiflood.max.msg.time unset %antiflood.notice.nick. [ $+ [ $nick ] ] | goto end }
n78=    elseif (%antiflood.notice.nick. [ $+ [ $nick ] ] isnum 1 - %antiflood.max.msg.limit) { inc %antiflood.notice.nick. [ $+ [ $nick ] ] 1 | goto end }
n79=    else {
n80=      if (%antiflood.flooded. [ $+ [ $nick ] ] != $null) halt 
n81=      else set -u3 %antiflood.flooded. [ $+ [ $nick ] ] 1
n82=      .ignore -nu300 $nick 2
n83=      set -u10 %fl.nick $nick
n84=      .notice $nick 4Игнор за флуд!
n85=      echo 4 -at * $nick флудит нотисами. Игнор на 5 мин.
n86=      unset %antiflood.notice.nick. [ $+ [ $nick ] ]
n87=      goto end
n88=    }
n89=    :end
n90=  }
n91=}
n92=on *:text:*:?: {
n93=  if (%antiflood.chat == on) {
n94=    if (%antiflood.chat.nick. [ $+ [ $nick ] ] == $null) { set %antiflood.chat.nick. [ $+ [ $nick ] ] 1 | .timer 1 %antiflood.max.msg.time unset %antiflood.chat.nick. [ $+ [ $nick ] ] | goto end }
n95=    elseif (%antiflood.chat.nick. [ $+ [ $nick ] ] isnum 1 - %antiflood.max.msg.limit) { inc %antiflood.chat.nick. [ $+ [ $nick ] ] 1 | goto end }
n96=    else {
n97=      if (%antiflood.flooded. [ $+ [ $nick ] ] != $null) halt 
n98=      else set -u3 %antiflood.flooded. [ $+ [ $nick ] ] 1
n99=      .ignore -pu300 $nick 2
n100=      set -u10 %fl.nick $nick
n101=      .msg $nick 4Игнор за флуд!
n102=      echo 4 -at * $nick флудит в привате. Игнор на 5 мин.
n103=      closemsg $nick
n104=      unset %antiflood.chat.nick. [ $+ [ $nick ] ]
n105=      goto end
n106=    }
n107=    :end
n108=  }
n109=}
n110=
n111=ctcp *:*:*: {
n112=  if (%antiflood.ctcp == on) {
n113=    if (%antiflood.ctcp.nick. [ $+ [ $nick ] ] == $null) { set %antiflood.ctcp.nick. [ $+ [ $nick ] ] 1 | .timer 1 %antiflood.max.msg.time unset %antiflood.ctcp.nick. [ $+ [ $nick ] ] | goto end }
n114=    elseif (%antiflood.ctcp.nick. [ $+ [ $nick ] ] isnum 1 - %antiflood.max.msg.limit) { inc %antiflood.ctcp.nick. [ $+ [ $nick ] ] 1 | goto end }
n115=    else {
n116=      if (%antiflood.ctcp.flooded. [ $+ [ $nick ] ] != $null) halt 
n117=      else set -u3 %antiflood.ctcp.flooded. [ $+ [ $nick ] ] 1
n118=      .ignore -tu300 $nick 2
n119=      set -u10 %ctcp.fl.nick $nick
n120=      .notice $nick 4Игнор за флуд!
n121=      echo 4 -at * $nick флудит CTCP. Игнор на 5 мин.
n122=      unset %antiflood.ctcp.nick. [ $+ [ $nick ] ]
n123=      goto end
n124=    }
n125=    :end
n126=  }
n127=}
