[script]
n0=raw 473:*: {
n1=  .msg ChanServ invite $2
n2=  set %inv.chan $2
n3=}
n4=on *:deop:#: {
n5=  if (%deop.protect == on) {
n6=    if ($opnick == $me) && ($nick != $me) {
n7=      if ($nick != ChanServ) {
n8=        set %is.deop 1
n9=        set %deop.chan #
n10=        set %enemy.nick $nick
n11=        .msg ChanServ op # $me
n12=        ignore ChanServ
n13=        timer 1 35 ignore -r ChanServ
n14=      }
n15=      else .msg ChanServ op # $me
n16=    }
n17=  }
n18=}
n19=on *:ban:#: {
n20=  if (%ban.protect == on) {
n21=    if ($nick != $me) && ($nick != ChanServ) && ($banmask iswm  $address($me,5)) {
n22=      set %is.ban 1
n23=      set %ban.chan #
n24=      set %enemy.nick $nick
n25=      if (!%is.kick) .msg ChanServ deop # $nick
n26=      if ($me ison #) {
n27=        .msg ChanServ unban #
n28=        ignore ChanServ
n29=        timer 1 35 ignore -r ChanServ
n30=        ban.punish 
n31=        clear.prot.vars
n32=      }
n33=      else .msg ChanServ invite #
n34=    }
n35=  }
n36=}
n37=on *:kick:#: {
n38=  if (%kick.protect == on) || (%ban.protect == on) {
n39=    if ($knick == $me) && ($nick != $me) && ($nick != ChanServ) {
n40=      if (!%is.ban) {
n41=        set %is.kick 1
n42=        set %kick.chan # 
n43=        set %enemy.nick $nick
n44=        .msg ChanServ ban # $nick
n45=        join $chan
n46=        ignore ChanServ
n47=        timer 1 35 ignore -r ChanServ
n48=      }
n49=    }
n50=  }
n51=}
n52=raw 329:*: {
n53=  if (%is.deop) || (%is.ban) || (%is.kick) {
n54=    if ($chan($2).ial == $false) { .ial on | who $2 }
n55=    if (%is.ban) .msg ChanServ unban $2
n56=  }
n57=}
n58=raw 474:*: {
n59=  .msg ChanServ invite $2
n60=  if (%is.kick) {
n61=    unset %is.kick
n62=    unset %kick.chan
n63=    set %is.ban 1
n64=    set %ban.chan $2
n65=  }
n66=}
n67=raw 352:*: {
n68=  if (%is.deop) || (%is.ban) || (%is.kick) haltdef
n69=}
n70=raw 315:*: {
n71=  if (%is.deop) || (%is.ban) || (%is.kick) {
n72=    .msg ChanServ op $2 $me
n73=    haltdef
n74=  }
n75=}
n76=on *:op:#: {
n77=  if (%deop.protect == on) || (%kick.protect == on) || (%ban.protect == on) {
n78=    if ($opnick == $me) {
n79=      if (%is.ban) && (%is.kick) {
n80=        set %is.ban 1
n81=        unset %is.kick
n82=        unset %kick.chan
n83=      }
n84=      if (%is.ban == 1) { ban.punish | clear.prot.vars | halt }
n85=      if (%is.kick == 1) { kick.punish | clear.prot.vars | halt }
n86=      if (%is.deop == 1) { deop.punish | clear.prot.vars | halt }
n87=    }
n88=  }
n89=}
n90=on *:Notice:*:*: {
n91=  if ($nick == ChanServ) {
n92=    if (%deop.protect == on) || (%kick.protect == on) || (%ban.protect == on) {
n93=      if ($1 == Недостаточно) { clear.prot.vars | halt }
n94=      if ($3 == приглашен) { join $gettok($strip($5),1,46) }
n95=      if ($3 == сняты) {
n96=        if ($me !ison $gettok($strip($7),1,46)) join $gettok($strip($7),1,46)
n97=      }
n98=    }
n99=  }
n100=}
n101=alias ban.punish {
n102=  if (%ban.punish == 1) msg %ban.chan %enemy.nick %ban.msg
n103=  if (%ban.punish == 2) kick %ban.chan %enemy.nick %ban.msg
n104=  if (%ban.punish == 3) { 
n105=    ban %ban.chan $iif(%sel.n.banmask == 12, %user.banmask, %enemy.nick $calc(%sel.n.banmask - 1))
n106=    kick %ban.chan %enemy.nick %ban.msg
n107=  }
n108=}
n109=alias kick.punish {
n110=  if (%kick.punish == 1) msg %kick.chan %enemy.nick %kick.msg
n111=  if (%kick.punish == 2) && ($me isop %kick.chan) kick %kick.chan %enemy.nick %kick.msg
n112=  if (%kick.punish == 3) && ($me isop %kick.chan) { 
n113=    ban %kick.chan $iif(%sel.n.banmask == 12, %user.banmask, %enemy.nick $calc(%sel.n.banmask - 1))
n114=    kick %kick.chan %enemy.nick %kick.msg
n115=  }
n116=}
n117=alias deop.punish {
n118=  if (%deop.punish == 1) { .msg ChanServ deop %deop.chan %enemy.nick | msg %deop.chan %enemy.nick %deop.msg }
n119=  if (%deop.punish == 2) && ($me isop %deop.chan) { kick %deop.chan %enemy.nick %deop.msg }
n120=  if (%deop.punish == 3) && ($me isop %deop.chan) { 
n121=    ban %deop.chan $iif(%sel.n.banmask == 12, %user.banmask, %enemy.nick $calc(%sel.n.banmask - 1))
n122=    kick %deop.chan %enemy.nick %deop.msg
n123=  }
n124=}
n125=alias clear.prot.vars {
n126=  unset %is.ban
n127=  unset %ban.chan
n128=  unset %enemy.nick
n129=  unset %me.is.op
n130=  unset %is.kick
n131=  unset %kick.chan
n132=  unset %is.deop
n133=  unset %deop.chan
n134=  unset %inv.chan
n135=}
n136=
n137=
n138=
n139=on *:open:?: {
n140=  if ($query(0) > %privat.limit) {
n141=    if ($window(@Приваты) == $null) { 
n142=      window -lbk @Приваты
n143=      aline @Приваты * Отклоненные приваты (привышен лимит)
n144=      aline @Приваты * Двойной клик на строке - войти в приват
n145=    } 
n146=    aline @Приваты $time -> $nick : $1-
n147=    window -bk @Приваты
n148=    .msg $nick Извините $nick $+ , лимит приватов исчерпан. Попробуйте позже...
n149=    close -m $nick
n150=  }
n151=}
n152=menu @Приваты { 
n153=  dclick: { 
n154=    if (!$line(@Приваты, 1).state) {
n155=      if (!$line(@Приваты, 2).state) {
n156=        query $gettok($sline(@Приваты ,1), 3 ,32) 
n157=      }
n158=    }
n159=  } 
n160=}
