#banpro on

on @!*:BAN:#:{ 
  if ($istok(%immune.user,$nick,32)) { return }
  if ($banmask iswm $address($me,5)) || ($ip isin $banmask) || ($me isin $banmask) || ($banmask iswm $ipmask) {
    var %c¤ = $wildsite
    if ($readini(mirc.ini,n,Ban-protection,action1) == (none)) { return }
    elseif ($readini(mirc.ini,n,Ban-protection,action1) == Deop kickban) { .raw -q mode # -bo+be $banmask $nick $mask($fulladdress,2) $address($me,2) | .raw -q kick # $nick : $+ $iif($readini(mirc.ini,n,Ban-protection,msg1),$readini(mirc.ini,Ban-protection,Msg1),Ban protection) }
    elseif ($readini(mirc.ini,n,Ban-protection,action1) == kick) { .raw -q mode $chan -b $banmask | .raw -q kick $chan $nick : $+ $iif($readini(mirc.ini,n,Ban-protection,msg1),$readini(mirc.ini,Ban-protection,Msg1),Ban protection) }
    elseif ($readini(mirc.ini,n,Ban-protection,action1) == Deop) { .raw -q mode $chan -bo $banmask $nick }
    elseif ($readini(mirc.ini,n,Ban-protection,action1) == Deop kick) { .raw -q mode # -bo $banmask $nick | kick # $nick : $+ $iif($readini(mirc.ini,n,Ban-protection,msg1),$readini(mirc.ini,Ban-protection,Msg1),Ban protection) }
    elseif ($readini(mirc.ini,n,Ban-protection,action1) == Deop filter kick (all clones)) { .raw -q mode $chan -bo+b $banmask $nick $mask($fulladdress,2) | fkick }
    elseif ($readini(mirc.ini,n,Ban-protection,action1) == Deop kickban and Add (auto-kick)) { if ($level($nick) != akick) .guser -a akick $nick 2 $iif($readini(mirc.ini,n,Ban-protection,msg1),$readini(mirc.ini,Ban-protection,Msg1),Ban protection) | .raw -q mode $chan -bo+b $banmask $nick %c¤ $+ $lf $+ kick $chan $nick : $+ $iif($readini(mirc.ini,n,Ban-protection,msg1),$readini(mirc.ini,n,Ban-protection,Msg1),Ban protection) }
    elseif ($readini(mirc.ini,n,Ban-protection,action1) == kick and Add (auto-kick)) { .guser -a akick $nick 2 $iif($readini(mirc.ini,n,Ban-protection,msg1),$readini(mirc.ini,Ban-protection,Msg1),Ban protection) | .raw -q mode $chan -b $banmask $+ $lf $+ kick $chan $nick : $+ $iif($readini(mirc.ini,n,Ban-protection,msg1),$readini(mirc.ini,n,Ban-protection,Msg1),Ban protection) }

    goto seconed 
    :seconed
    if ($readini(mirc.ini,n,Ban-protection,action2) == (none)) { return }
    elseif ($readini(mirc.ini,n,Ban-protection,action2) == ban site) { ban # $nick 2 }
    elseif ($readini(mirc.ini,n,Ban-protection,action2) == ban normal) { ban # $nick 1 }
    elseif ($readini(mirc.ini,n,Ban-protection,action2) == Deop all ops) { dopop }
    elseif ($readini(mirc.ini,n,Ban-protection,action2) == Chanserv unban chan me) { .msg ChanServ Unban $chan $me }
    elseif ($readini(mirc.ini,n,Ban-protection,action2) == Chanserv akick add site) { .msg ChanServ akick $chan add %c¤ }
    else { $readini(mirc.ini,Ban-protection,action2) }
    halt

  }
}
#banpro end

#kickpro on

On !*:KICK:#:{ 
  if ($knick == $me) {
    if ($istok(%immune.user,$nick,32)) { return }
    .auser -a mkick $me
    set -u1200 %c2 $wildsite
    set -u1200 %k|n $nick
    if ($readini(mirc.ini,n,Ban-protection,action3) == (none)) { return }
    elseif ($readini(mirc.ini,n,Ban-protection,action3) == Deop kickban and Add (auto-kick)) { if ($level($nick) != akick) .guser -a akick $nick 2 $iif($readini(mirc.ini,n,Ban-protection,msg2),$readini(mirc.ini,n,Ban-protection,Msg2),Kick protection) }
    elseif ($readini(mirc.ini,n,Ban-protection,action3) == kick 3 times) { .guser -a k1,k2 $nick 2 }
    elseif ($readini(mirc.ini,n,Ban-protection,action3) == kick 4 times) { .guser -a k1,k2,k3 $nick 2 }
    elseif ($readini(mirc.ini,n,Ban-protection,action3) == kick 5 times) { .guser -a k1,k2,k3,k4 $nick 2 }
    elseif ($readini(mirc.ini,n,Ban-protection,action3) == kick 6 times) { .guser -a k1,k2,k3,k4,k5 $nick 2 }
  }
}
on *:OP:#:{
  if ($opnick == $me) && (%offender != $null) {
    if ($readini(mirc.ini,Ban-protection,action6) == (none)) { return }
    elseif ($readini(mirc.ini,Ban-protection,action6) == kick) { .raw -q kick # $dpname $iif($readini(mirc.ini,n,Ban-protection,msg3),$readini(mirc.ini,Ban-protection,Msg3),Deop protection) }
    elseif ($readini(mirc.ini,Ban-protection,action6) == deop kick) { .raw -q mode # -o $dpname | .raw -q kick $chan $dpname : $+ $iif($readini(mirc.ini,Ban-protection,msg3),$readini(mirc.ini,Ban-protection,Msg3),Deop protection) }
    elseif ($readini(mirc.ini,Ban-protection,action6) == Deop kickban) { .raw -q mode $chan -o+be $dpname $daddress $address($me,2) | .raw -q kick $chan $dpname : $+ $iif($readini(mirc.ini,Ban-protection,msg3),$readini(mirc.ini,Ban-protection,Msg3),Deop protection) }
    elseif ($readini(mirc.ini,Ban-protection,action6) == Deop kick and Add (auto-kick)) { if ($level($dpname) != akick) .guser -a akick $dpname 2 $iif($readini(mirc.ini,Ban-protection,msg3),$readini(mirc.ini,Ban-protection,Msg3),Deop protection) | .raw -q mode # -o $dpname | .raw -q kick $chan $dpname : $+ $iif($readini(mirc.ini,n,Ban-protection,msg3),$readini(mirc.ini,n,Ban-protection,Msg3),Deop protection) }
    elseif ($readini(mirc.ini,n,Ban-protection,action6) == Deop kickban and Add (auto-kick)) { if ($level($dpname) != akick) .guser -a akick $dpname 2 $iif($readini(mirc.ini,n,Ban-protection,msg3),$readini(mirc.ini,Ban-protection,Msg3),Deop protection) | .raw -q mode $chan -o+be $dpname %osite $address($me,2) | .raw -q kick $chan $dpname : $+ $iif($readini(mirc.ini,n,Ban-protection,msg3),$readini(mirc.ini,n,Ban-protection,Msg3),Deop protection) }
    elseif ($readini(mirc.ini,Ban-protection,action6) == kick) { .raw -q kick # $dpname $iif($readini(mirc.ini,n,Ban-protection,msg3),$readini(mirc.ini,Ban-protection,Msg3),Deop protection) }
    elseif ($readini(mirc.ini,Ban-protection,action6) == kick 3 times) { .auser -a d1,d2 $dpname 2 | .raw -q kick # $dpname $iif($readini(mirc.ini,Ban-protection,msg3),$readini(mirc.ini,Ban-protection,Msg3),Deop protection) }
    elseif ($readini(mirc.ini,Ban-protection,action6) == kick 4 times) { .auser -a d1,d2,d3 $dpname 2 | .raw -q kick # $dpname $iif($readini(mirc.ini,Ban-protection,msg3),$readini(mirc.ini,Ban-protection,Msg3),Deop protection) }
    elseif ($readini(mirc.ini,Ban-protection,action6) == kick 5 times) { .auser -a d1,d2,d3,d4 $dpname 2 | .raw -q kick # $dpname $iif($readini(mirc.ini,Ban-protection,msg3),$readini(mirc.ini,Ban-protection,Msg3),Deop protection) }
    elseif ($readini(mirc.ini,Ban-protection,action6) == kick 6 times) { .auser -a d1,d2,d3,d4,d5 $dpname 2 | .raw -q kick # $dpname $iif($readini(mirc.ini,Ban-protection,msg3),$readini(mirc.ini,Ban-protection,Msg3),Deop protection) }
    else { if ($readini(mirc.ini,Ban-protection,action6) != $null) { $readini(mirc.ini,Ban-protection,action6) } }
  }
}

#kickpro end

#Deoppro on

ON *!:DEOP:#:{
  if ($istok(%immune.user,$nick,32)) { return }
  if ($opnick == $me) {
    set -u1200 %offender $nick 
    set -u1200 %osite $wildsite
    if ($len($1) < 4) { 
      if ($readini(mirc.ini,n,Ban-protection,action5) == (none)) { return | goto seoption1 }
      elseif ($readini(mirc.ini,n,Ban-protection,action5) == Chanserv op me) { .msg ChanServ op $chan $me | goto seoption1 }
      elseif ($readini(mirc.ini,n,Ban-protection,action5) == Chanserv op me deop nick) { .msg ChanServ deop $chan $nick | ChanServ op $chan $me | goto seoption1 }
      elseif ($readini(mirc.ini,n,Ban-protection,action5) == X op me) { .quote X op $chan $me | goto seoption1 }
      elseif ($readini(mirc.ini,n,Ban-protection,action5) == X op me deop nick) { .quote X deop $chan $nick | X op $chan $me | goto seoption1 }
      elseif ($readini(mirc.ini,n,Ban-protection,action5) == cycle chan to regain ops) { .raw -q part $chan | .raw -q join $chan $chan(#).key | goto seoption1 }
      else { if ($readini(mirc.ini,Ban-protection,action5) != $null) $readini(mirc.ini,Ban-protection,action5) | goto seoption1 }
    }
    elseif ($len($1) >= 5) { 
      if ($readini(mirc.ini,n,Ban-protection,action5) == (none)) { return |  goto seoption2 }
      elseif ($readini(mirc.ini,n,Ban-protection,action5) == Chanserv op me) { .timero -m 1 1900 .msg ChanServ op $chan $me | goto seoption2 }
      elseif ($readini(mirc.ini,n,Ban-protection,action5) == Chanserv op me deop nick) { .timero -m 1 1900 .msg ChanServ deop $chan $nick | ChanServ op $chan $me |  goto seoption2 }
      elseif ($readini(mirc.ini,n,Ban-protection,action5) == X op me) { timero -m 1 1900 .quote X op $chan $me |  goto seoption2 }
      elseif ($readini(mirc.ini,n,Ban-protection,action5) == X op me deop nick) { .timero -m 1 1900 quote X deop $chan $nick | X op $chan $me |  goto seoption2 }
      elseif ($readini(mirc.ini,n,Ban-protection,action5) == cycle chan to regain ops) { .timero -m 1 1900 .raw -q part $chan | .raw -q join $chan $chan(#).key |  goto seoption2 }
      else { if ($readini(mirc.ini,Ban-protection,action5) != $null) .timero -m 1 1900 $readini(mirc.ini,Ban-protection,action5) |  goto seoption2 }
    }
    :seoption1
    if ($readini(mirc.ini,Ban-protection,action7) == (none)) { return }  
    elseif ($readini(mirc.ini,Ban-protection,action7) == Chanserv akick add site) { .msg ChanServ akick $chan add %osite }
    elseif ($readini(mirc.ini,Ban-protection,action7) == Chanserv op me) { .msg ChanServ op $chan $me }
    else { if ($readini(mirc.ini,Ban-protection,action7) != $null) { $readini(mirc.ini,Ban-protection,action7) } }
    halt
    :seoption2 
    if ($readini(mirc.ini,Ban-protection,action7) == (none)) { return }
    elseif ($readini(mirc.ini,Ban-protection,action7) == Chanserv akick add site) { .timeru -m 1 1900 .msg ChanServ akick $chan add %osite }
    elseif ($readini(mirc.ini,Ban-protection,action7) == Chanserv op me) { .timeru -m 1 1900 .msg ChanServ op $chan $me }
    else { if ($readini(mirc.ini,Ban-protection,action7) != $null) { .timeru -m 1 1900 $readini(mirc.ini,Ban-protection,action7) } }
    else { if ($readini(mirc.ini,Ban-protection,action7) != $null) { .timeru -m 1 1900 $readini(mirc.ini,Ban-protection,action7) } }
    halt

  }
}
on ^mkick:OP:#:{
  if ($opnick == $me) && (%k|n != $null) {
    if ($readini(mirc.ini,n,Ban-protection,action3) == (none)) { return }
    elseif ($readini(mirc.ini,n,Ban-protection,action3) == Deop) { if (%k|n ison #) .raw -q mode # -o %k|n }
    elseif ($readini(mirc.ini,n,Ban-protection,action3) == Deop kick) { if (%k|n ison #) .raw -q mode # -o %k|n | .raw -q kick # %k|n : $+ $iif($readini(mirc.ini,n,Ban-protection,msg2),$readini(mirc.ini,Ban-protection,Msg2),Kick protection) }
    elseif ($readini(mirc.ini,n,Ban-protection,action3) == Deop kickban) { if (%k|n ison #) .raw -q mode # -o+b %k|n %c2 | .raw -q kick # %k|n : $+ $iif($readini(mirc.ini,n,Ban-protection,msg2),$readini(mirc.ini,Ban-protection,Msg2),Kick protection) }
    elseif ($readini(mirc.ini,n,Ban-protection,action3) == Deop kick and Add (auto-kick)) { if (%k|n ison #) .raw -q mode # -o %k|n | .raw -q kick # %k|n : $+ $iif($readini(mirc.ini,n,Ban-protection,msg2),$readini(mirc.ini,Ban-protection,Msg2),Kick protection) | if ($level(%k|n) != akick) .guser -a akick %k|n 2  }
    elseif ($readini(mirc.ini,n,Ban-protection,action3) == Deop kickban and Add (auto-kick)) { if ($level(%c2) != akick) .auser -a akick %c2 $iif($readini(mirc.ini,n,Ban-protection,msg2),$readini(mirc.ini,Ban-protection,Msg2),kick protection) | .raw -q mode $chan -o+b %k|n %c2 | .raw -q kick $chan %k|n : $+ $iif($readini(mirc.ini,n,Ban-protection,msg2),$readini(mirc.ini,n,Ban-protection,Msg2),kick protection) }
    elseif ($readini(mirc.ini,n,Ban-protection,action3) == kick 3 times) { if (%k|n ison #) .raw -q kick # %k|n $iif($readini(mirc.ini,n,Ban-protection,msg2),$readini(mirc.ini,Ban-protection,Msg2),Kick protection) }
    elseif ($readini(mirc.ini,n,Ban-protection,action3) == kick 4 times) { if (%k|n ison #) .raw -q kick # %k|n $iif($readini(mirc.ini,n,Ban-protection,msg2),$readini(mirc.ini,Ban-protection,Msg2),Kick protection) }
    elseif ($readini(mirc.ini,n,Ban-protection,action3) == kick 5 times) { if (%k|n ison #) .raw -q kick # %k|n $iif($readini(mirc.ini,n,Ban-protection,msg2),$readini(mirc.ini,Ban-protection,Msg2),Kick protection) }
    elseif ($readini(mirc.ini,n,Ban-protection,action3) == kick 6 times) { if (%k|n ison #) .raw -q kick # %k|n $iif($readini(mirc.ini,n,Ban-protection,msg2),$readini(mirc.ini,Ban-protection,Msg2),Kick protection) }
    elseif ($readini(mirc.ini,n,Ban-protection,action3) == kick) { if (%k|n ison #) .raw -q kick # %k|n $iif($readini(mirc.ini,n,Ban-protection,msg2),$readini(mirc.ini,Ban-protection,Msg2),Kick protection) }
    goto rd
    :rd
    if ($readini(mirc.ini,n,Ban-protection,action4) == (none)) { return }
    elseif ($readini(mirc.ini,n,Ban-protection,action4) == ban site) { ban # %k|n 2 }
    elseif ($readini(mirc.ini,n,Ban-protection,action4) == ban normal) { ban # %k|n 1 }
    elseif ($readini(mirc.ini,n,Ban-protection,action4) == Deop all ops) { dopop }
    elseif ($readini(mirc.ini,n,Ban-protection,action4) == Chanserv unban chan me) { .msg ChanServ Unban $chan $me }
    elseif ($readini(mirc.ini,n,Ban-protection,action4) == Chanserv akick add site) { msg ChanServ akick $chan add %c2 }
    else { $readini(mirc.ini,Ban-protection,action4) }
    halt
  }
}

#Deoppro end

on me:*:KICK:#:{ if ($level($me) == mkick) .rlevel -r mkick }

alias `Unban if (!$dialog(`Unban)) dialog -m `Unban `Unban
dialog `Unban {
  title "Настройка защиты"
  size -1 -1 380 360
  icon mIRC.exe,20
  option $ifmatch
  TAB "",1,-40 -40 1 1
  Tab "",2
  Tab "",888
  Tab "",889
  Box "",3, 5 35 370 285
  Check "",4,15 7 110 22,tab 1
  button "ОК",5,180 330 70 23,ok,default
  button "Отмена",6,255 330 70 23,cancel
  button "Исключения",7,105 330 72 23
  text "Делаем:",8,20 60 90 20,tab 1
  combo 9,65 58 285 200,drop,size,edit,tab 1
  text "Второе действие (вы можете написать свою команду)",10,20 95 300 30,tab 1 
  combo 11,20 115 330 220,drop,edit,size,tab 1
  text "Сообщение:",12,20 242 170 20,tab 1 
  Edit "",13,20 265 330 22,autohs,tab 1
  radio "Ban",14,150 7 60 23,push
  radio "Kick",15,220 7 60 23,push
  radio "DeOP",16,290 7 60 23,push
  button "Список Акиков",17,15 330 85 23
  Check "",18,15 7 110 22,tab 2
  Check "",19,15 7 110 22,tab 888
  ;kick
  text "Делаем:",20,20 60 90 20,tab 2
  combo 21,65 58 285 200,drop,size,edit,tab 2
  text "Второе действие (вы можете написать свою команду)",22,20 95 300 30,tab 2
  combo 23,20 115 330 220,drop,edit,tab 2
  text "Сообщение:",24,20 242 170 20,tab 2
  Edit "",25,20 265 330 22,autohs,tab 2
  box "Легенда:",26,20 150 330 85,tab 1
  text "$nick :             возвращает ник обидчика.",27,44 170 270 15,tab 1
  text "$wildsite :             возвращает адрес обидчика.",28,30 188 270 15,tab 1
  text "$chan :             возвращает название канала.",29,40 207 250 15,tab 1
  box "Легенда:",30,20 150 330 85,tab 2
  text "$kname :           возвращает ник обидчика.",31,41 170 270 15,tab 2
  text "$kaddress :           возвращает адрес обидчика.",32,30 188 270 15,tab 2
  text "$chan :           возвращает название канала.",33,49 207 250 15,tab 2
  text "Первое дествие:",34,20 72 90 25,tab 888
  combo 35,111 68 240 200,drop,size,edit,tab 888
  text "Ваша команда:",36,20 50 200 15,tab 888
  text "При ОПе:",37,20 95 70 30,tab 888
  combo 38,111 93 240 200,drop,size,edit,tab 888
  text "$dpname :           возвращает ник обидчика.",39,35 170 270 15,tab 888
  text "$daddress :           возвращает адрес обидчика.",40,30 188 270 15,tab 888
  text "$chan :           возвращает название канала.",41,49 207 250 15,tab 888
  box "Легенда:",42,20 150 330 85,tab 888
  text "Сообщение:",43,20 242 170 20,tab 888
  Edit "",44,20 265 330 22,autohs,tab 888
  text "Второе дествие:",45,20 122 90 30,tab 888
  combo 46,111 118 240 220,drop,edit,tab 888
  list 47 ,20 150 288 160,vsbar,hsbar,tab 889
  edit "",48,20 68 288 22,autohs,tab 889
  text "Добавить адрес (nick!user@host):",49,23 50 150 15,tab 889
  text "Причина акика:",50,23 93 100 15,tab 889
  edit "",51,20 110 288 22,autohs,tab 889
  text "Список акиков:",52,23 135 200 15,tab 889
  button "+",53,312 66 23 23,tab 889
  button "-",54,315 150 23 23,tab 889
  button "~",55,315 175 23 23,tab 889
  button "Очистить",57,312 275 55 23,tab 889
  Check "",56,15 7 110 22,tab 889
  button "Вверх",58,315 210 50 23,tab 889
  button "Вниз",59,315 235 50 23,tab 889
}

on *:dialog:`Unban:sclick:59:{ did -c $dname 47 $calc($did(47).sel + 1) }
on *:dialog:`Unban:sclick:58:{ did -c $dname 47 $calc($did(47).sel - 1) }
on *:dialog:`Unban:sclick:57:{ rlevel -r akick | did -r $dname 47 }
on *:dialog:`Unban:sclick:56:{
  if ($did(56).state == 1) { 
    did -raf $dname 56 Автокик при заходе вкл
    .enable #akick
  }
  elseif ($did(56).state == 0) {
    did -raf $dname 56 Автокик при заходе выкл
    .disable #akick
  }
}

on *:dialog:`Unban:sclick:4:{
  if ($did(4).state == 1) { 
    did -raf $dname 4 Бан защита вкл
    .enable #banpro
  }
  elseif ($did(4).state == 0) {
    did -raf $dname 4 Бан защита выкл
    .disable #banpro
  }
}
on *:dialog:`Unban:sclick:18:{
  if ($did(18).state == 1) { 
    did -raf $dname 18 Кик защита вкл
    .enable #kickpro
  }
  elseif ($did(18).state == 0) {
    did -raf $dname 18 Кик защита выкл
    .disable #kickpro
  }
}
on *:dialog:`Unban:sclick:19:{
  if ($did(19).state == 1) { 
    did -raf $dname 19 Деоп защита вкл
    .enable #Deoppro
  }
  elseif ($did(19).state == 0) {
    did -raf $dname 19 Деоп защита выкл
    .disable #Deoppro
  }
}
on *:dialog:`Unban:sclick:55:{
  if ($did(47).seltext != $null) {
    var %in = $gettok($did(`Unban,47).seltext,1,32)
    .ruser akick $gettok($did(`Unban,47).seltext,1,32)
    did -ra $dname 48 $gettok($did(`Unban,47).seltext,1,32)
    did -ra $dname 51 $gettok($did(`Unban,47).seltext,2-,32)
    did -d $dname 47 $did(`Unban,47).sel
    if  ($input(После правки нажмите + ,4,Info:)) return
  }

}

on *:dialog:`Unban:sclick:54:{ 
  if ($did(47).seltext != $null) {
    ruser akick $gettok($did(`Unban,47).seltext,1,32) 
    did -d $dname 47 $did(`Unban,47).sel
  }
}
on *:dialog:`Unban:sclick:53:{ 
  if ($did(`Unban,48) != $null) {
    auser -a akick $did(`Unban,48) $did(`Unban,51)
    did -za $dname 47 $did(`Unban,48) $did(`Unban,51)
    did -r $dname 48,51
  }
}

on *:dialog:`Unban:init:*:{
  var %1per = did -a $dname 9
  var %2per = did -a $dname 21
  var %3per = did -a $dname 11,23
  var %4per = did -a $dname 35
  var %5per = did -a $dname 38
  var %6per = did -a $dname 46
  if ($group(#akick).status == on) {
    did -raf $dname 56 Акик при заходе вкл
    did -c $dname 56
  }
  elseif ($group(#akick).status == off) { did -raf $dname 56 Акик при заходе выкл }

  if ($group(#banpro).status == on) { 
    did -raf $dname 4 Вкл Ban Защиту
    did -c $dname 4
  }
  elseif ($group(#banpro).status == off) { did -raf $dname 4 БаН ЗащЫта вЫкл }
  if ($group(#kickpro).status == on) { 
    did -raf $dname 18 Вкл Кик Защиту
    did -c $dname 18
  }
  elseif ($group(#kickpro).status == off) { did -raf $dname 18 Кик Защита выкл }
  if ($group(#Deoppro).status == on) { 
    did -raf $dname 19 Вкл Deop Защиту
    did -c $dname 19
  }
  elseif ($group(#Deoppro).status == off) { did -raf $dname 19 Deop Защита выкл }
  did -c $dname 14
  did -rz $dname 47 | var %d = 1 | while ($ulist(*,akick,%d)) { did -a $dname 47 $ulist(*,akick,%d) $ulist(*,akick,%d).info | inc %d }
  %1per Деоп
  %1per Кик
  %1per Деоп/кик
  %1per Деоп/кик/бан
  %1per Деоп/кик(всех клонов)
  %1per Деоп/кик/бан/акик
  %1per Кик/акик
  %1per (пусто)
  %2per Кик
  %2per Деоп
  %2per Деоп/кик
  %2per Деоп/кик/бан
  %2per Деоп/кик/акик
  %2per Деоп/кик/бан/акик
  %2per Кик 3 раза 
  %2per Кик 4 раза 
  %2per Кик 5 раз
  %2per Кик 6 раз
  %2per (пусто)
  %3per Бан адрес
  %3per Бан обычный
  %3per Деоп всех опов
  %3per Chanserv разбанивает меня
  %3per Chanserv добавляет в акик
  %3per (пусто)
  %4per Chanserv опит меня
  %4per Chanserv опит меня, деопит мудилу
  %4per X оп мне
  %4per X оп мне, деоп нику
  %4per Перезайти
  %4per (пусто)
  %5per Кик
  %5per Деоп/кик
  %5per Деоп/кик/бан
  %5per Деоп/кик/акик
  %5per Деоп/кик/бан/акик
  %5per Кик 3 раза 
  %5per Кик 4 раза
  %5per Кик 5 раз
  %5per Кик 6 раз
  %5per (пусто)
  %6per Chanserv добавляет в акик
  %6per Chanserv опит меня
  %6per (пусто)
  if ($readini(mirc.ini,n,Ban-protection,action1) != $null) {
    did -o $dname 9 ! $readini(mirc.ini,n,Ban-protection,action1) 
    did -f $dname 9
  }
  if ($readini(mirc.ini,n,Ban-protection,action2) != $null) did -o $dname 11 ! $readini(mirc.ini,n,Ban-protection,action2)
  if ($readini(mirc.ini,n,Ban-protection,Msg1) != $null) did -a $dname 13 $readini(mirc.ini,n,Ban-protection,Msg1) 
  if ($readini(mirc.ini,n,Ban-protection,Msg2) != $null) did -a $dname 25 $readini(mirc.ini,n,Ban-protection,Msg2)
  if ($readini(mirc.ini,n,Ban-protection,Msg3) != $null) did -a $dname 44 $readini(mirc.ini,n,Ban-protection,Msg3)  
  if ($readini(mirc.ini,n,Ban-protection,action3) != $null) {
    did -o $dname 21 ! $readini(mirc.ini,n,Ban-protection,action3) 
  }
  if ($readini(mirc.ini,n,Ban-protection,action4) != $null) {
    did -o $dname 23 ! $readini(mirc.ini,n,Ban-protection,action4) 
  }
  if ($readini(mirc.ini,n,Ban-protection,action5) != $null) {
    did -o $dname 35 ! $readini(mirc.ini,n,Ban-protection,action5) 
  }
  if ($readini(mirc.ini,n,Ban-protection,action6) != $null) {
    did -o $dname 38 ! $readini(mirc.ini,n,Ban-protection,action6) 
  }
  if ($readini(mirc.ini,n,Ban-protection,action7) != $null) {
    did -o $dname 46 ! $readini(mirc.ini,n,Ban-protection,action7) 
  }
  did -z $dname 47

}

on *:dialog:`Unban:sclick:17:{ did -c $dname 889 | did -u $dname 14,15,16 }
on *:dialog:`Unban:sclick:14:{ did -c $dname 1 }
on *:dialog:`Unban:sclick:15:{ did -c $dname 2 | did -f $dname 21 }
on *:dialog:`Unban:sclick:16:{ did -c $dname 888 | did -f $dname 35 }
on *:dialog:`Unban:sclick:9:{ if ($did(9) != $null) writeini -n mirc.ini Ban-protection action1 $did(9).seltext }

on *:dialog:`Unban:sclick:11:{
  if ($did(11).seltext != $null) writeini -n mirc.ini Ban-protection action2 $did(11).seltext
}
on *:dialog:`Unban:Edit:11:{
  if ($did(11) != $null) writeini -n mirc.ini Ban-protection action2 $did(11)
  elseif ($did(11) == $null) writeini -n mirc.ini Ban-protection action2 (none)
}
on *:dialog:`Unban:sclick:23:{
  if ($did(23).seltext != $null) writeini -n mirc.ini Ban-protection action4 $did(23).seltext
}
on *:dialog:`Unban:Edit:23:{
  if ($did(23) != $null) writeini -n mirc.ini Ban-protection action4 $did(23)
  elseif ($did(23) == $null) writeini -n mirc.ini Ban-protection action4 (none)
}
on *:dialog:`Unban:Edit:13:{
  if ($did(13) != $null) writeini -n mirc.ini Ban-protection Msg1 $did(13)
  elseif ($did(13) == $null) remini mirc.ini Ban-protection Msg1
}
on *:dialog:`Unban:Edit:25:{
  if ($did(25) != $null) writeini -n mirc.ini Ban-protection Msg2 $did(25)
  elseif ($did(25) == $null) remini mirc.ini Ban-protection Msg2
}
on *:dialog:`Unban:Edit:44:{
  if ($did(44) != $null) writeini -n mirc.ini Ban-protection Msg3 $did(44)
  elseif ($did(44) == $null) remini mirc.ini Ban-protection Msg3
}
on *:dialog:`Unban:sclick:35:{
  if ($did(35).seltext != $null) writeini -n mirc.ini Ban-protection action5 $did(35).seltext
}
on *:dialog:`Unban:Edit:35:{
  if ($did(35) != $null) writeini -n mirc.ini Ban-protection action5 $did(35)
  elseif ($did(35) == $null) writeini -n mirc.ini Ban-protection action5 (none)
}
on *:dialog:`Unban:sclick:38:{
  if ($did(38).seltext != $null) writeini -n mirc.ini Ban-protection action6 $did(38).seltext
}
on *:dialog:`Unban:Edit:38:{
  if ($did(38) != $null) writeini -n mirc.ini Ban-protection action6 $did(38)
  elseif ($did(38) == $null) writeini -n mirc.ini Ban-protection action6 (none)
}
on *:dialog:`Unban:sclick:46:{
  if ($did(46).seltext != $null) writeini -n mirc.ini Ban-protection action7 $did(46).seltext
}
on *:dialog:`Unban:Edit:46:{
  if ($did(46) != $null) writeini -n mirc.ini Ban-protection action7 $did(46)
  elseif ($did(46) == $null) writeini -n mirc.ini Ban-protection action7 (none)
}

on *:dialog:`Unban:sclick:21:{
  if ($did(21) != $null) writeini -n mirc.ini Ban-protection action3 $did(21).seltext
}

on *:dialog:`Unban:sclick:7:{ _:Exclude }

alias ipmask { return $+($left($address($me,5),$pos($address($me,5),@,1)),$ip) }

Menu channel,status,menubar,nicklist {
}
#akick on

on ^@akick:JOIN:#: { 
  if ($istok(%immune.user,$nick,32)) { echo -atc Highlight * юзер из списка акикоф $maddress вошел на # ( $+ отмена акик $nick в списке исключений $+ ) | return }
  .raw -q mode $chan +b $maddress 
  .raw -q kick $chan $nick $ulist($maddress,akick,1).info 
  halt
}
#akick end

on ^@k1:JOIN:#:{ .raw -q kick # $nick $iif($readini(mirc.ini,n,Ban-protection,msg2),$readini(mirc.ini,Ban-protection,Msg2),Kick protection) | .ruser k1 $wildsite | halt }
on ^@k2:JOIN:#:{ .raw -q kick # $nick $iif($readini(mirc.ini,n,Ban-protection,msg2),$readini(mirc.ini,Ban-protection,Msg2),Kick protection) | .ruser k2 $wildsite | halt }
on ^@k3:JOIN:#:{ .raw -q kick # $nick $iif($readini(mirc.ini,n,Ban-protection,msg2),$readini(mirc.ini,Ban-protection,Msg2),Kick protection) | .ruser k3 $wildsite | halt }
on ^@k4:JOIN:#:{ .raw -q kick # $nick $iif($readini(mirc.ini,n,Ban-protection,msg2),$readini(mirc.ini,Ban-protection,Msg2),Kick protection) | .ruser k4 $wildsite | halt }
on ^@k5:JOIN:#:{ .raw -q kick # $nick $iif($readini(mirc.ini,n,Ban-protection,msg2),$readini(mirc.ini,Ban-protection,Msg2),Kick protection) | .ruser k5 $wildsite | halt }
on ^@d1:JOIN:#:{ .raw -q kick # $nick $iif($readini(mirc.ini,n,Ban-protection,msg3),$readini(mirc.ini,Ban-protection,Msg3),Deop protection) | .ruser d1 $nick | halt }
on ^@d2:JOIN:#:{ .raw -q kick # $nick $iif($readini(mirc.ini,n,Ban-protection,msg3),$readini(mirc.ini,Ban-protection,Msg3),Deop protection) | .ruser d2 $nick | halt }
on ^@d3:JOIN:#:{ .raw -q kick # $nick $iif($readini(mirc.ini,n,Ban-protection,msg3),$readini(mirc.ini,Ban-protection,Msg3),Deop protection) | .ruser d3 $nick | halt }
on ^@d4:JOIN:#:{ .raw -q kick # $nick $iif($readini(mirc.ini,n,Ban-protection,msg3),$readini(mirc.ini,Ban-protection,Msg3),Deop protection) | .ruser d4 $nick | halt }
on ^@d5:JOIN:#:{ .raw -q kick # $nick $iif($readini(mirc.ini,n,Ban-protection,msg3),$readini(mirc.ini,Ban-protection,Msg3),Deop protection) | .ruser d5 $nick | halt }

alias _:Exclude {
  if (!$dialog(Exclude)) dialog -m Exclude Exclude
  goto c
  :c
  if ($active ischan) && ($snicks != $null) did -o Exclude 8 ! $snicks($active,1) 

}
dialog Exclude {
  title "ИсклЮчениЙА"
  size -1 -1 150 105
  option dbu
  icon mIRC.exe,20
  list 1,40 31 101 67, size hsbar vsbar
  button "Добавить", 2,4 18 32 12, default
  button "Удалить", 4,4 31 32 12
  button "Вверх",11,4 44 32 12
  button "Вниз",12,4 57 32 12
  button "ОК", 5,4 76 32 12, ok
  button "Отмена", 6,4 90 32 12, cancel
  combo  8,41 18 100 121,drop,size,edit
  box "",9,4 0 142 15
  text "Список юзеров исключений из защиты:",10,25 5 150 10

}
on *:dialog:Exclude:sclick:11:{ did -c $dname 1 $calc($did(1).sel - 1) }
on *:dialog:Exclude:sclick:12:{ did -c $dname 1 $calc($did(1).sel + 1) }


on *:dialog:Exclude:init:*:{
  didtok $dname 1 32 %immune.user
  did -z $dname 1
  did -a $dname 8 ChanServ
  did -a $dname 8 X
  if ($active Ischan) { var %h = $nick($active,0) | while (%h) { did -a $dname 8 $nick($active,%h) | dec %h } }

}
on *:dialog:Exclude:sclick:2:{
  if ($did(8).text == $null) { return } 
  else { 
    did -a $dname 1 $did(8).text 
    set %immune.user  $didtok(Exclude,1,32) 
    did -o $dname 8 !
    did -z $dname 1

  }
}
on *:dialog:Exclude:sclick:4:{
  if ($did(1).sel == $null) { return } 
  else {  
    did -d $dname 1 $did(1).sel 
    set %immune.user $didtok(Exclude,1,32) 
  }
}
alias dopop { var %mchannel = $chan($active) | if ($me isop %mchannel) { var %i = $nick(%mchannel,0,o), %nicks | while (%i) { if ($nick(%mchannel,%i,o) != $me) %nicks = $addtok(%nicks,$nick(%mchannel,%i,o),32) | if ($numtok(%nicks,32) == 6) { .raw -q mode %mchannel $+(-,$str(o,6)) %nicks | var %nicks } | dec %i } | if (%nicks) .raw -q mode %mchannel $+(-,$str(o,6)) %nicks | else { halt } } }
alias kname { return %k|n }
alias kaddress { return %c2 }
alias dpname { return %offender }
alias daddress { return %osite }
alias fkick { var %i = 1 | while ($ialchan($wildsite,$chan,%i).nick) { if ($ialchan($wildsite,$chan,%i).nick != $me) && ($ialchan($wildsite,$chan,%i).nick ison $chan) { .raw -q kick $chan $ialchan($wildsite,$chan,%i).nick :filter kick $wildsite } | inc %i } } 

alias Addakick {
  if (!$dialog(Addakick))  dialog -m Addakick Addakick
  goto p
  :p
  if ($active ischan) && ($snicks != $null) did -o Addakick 2 ! $snicks($active,1) 
}
dialog Addakick {
  title "СпиСок АкиКоФ"
  size -1 -1 150 115
  option dbu
  icon mIRC.exe,20
  text "Ник:",1,12 20 27 15
  combo 2,38 19 100 150,drop,edit,size
  box "СпиСочЭк:",3,5 5 140 90
  text "ПриЧЫна:",4,12 74 27 15
  combo 5,38 73 100 150,drop,edit,size
  text "ТиП:",6,12 48 17 15
  combo 7,38 46 100 150,drop,edit,size
  button "ОК",8,32 101 40 12,ok,default
  button "Отмена",9,78 101 40 12,cancel
  text "Маска:",10,39 35 80 8
  text "СообщЭниЙА для АкиКа:",11,39 63 80 8
}
on *:dialog:Addakick:init:*:{
  var %§ = did -a $dname 7
  var %? = did -a $dname 5
  if ($active Ischan) { var %/ = $nick($active,0) | while (%/) { did -a $dname 2 $nick($active,%/) | dec %/ } }
  %§ 0 *!user@host
  %§ 1 *!*user@host
  %§ 2 *!*@host
  %§ 3 *!*user@*.host
  %§ 4 *!*@*.host
  %§ 5 nick!user@host
  %§ 6 nick!*user@host
  %§ 7 nick!*@host
  %§ 8 nick!*user@*.host
  %§ 9 nick!*@*.host
  %? Blacklisted
  %? ТебЯ поимели
  %? ВсаСЫваЙ
  %? Дашь тебе стеклянный хуй, ты и хуй разобъешь и руки порежешь
  %? Поебать кого наебать,главное наебать, а кого наебать, это поебать
  %? Драть вас всех надо, как Сидорова маму!
  %? Добро всегда победит зло! Поставит его на колени и зверски убьёт!
}
on *:dialog:Addakick:sclick:8:{
  if ($did(2) != $null) {
    var %user = $did(2)
    guser -a akick $did(2) $iif($did(7) != $null,$left($did(7),1)) $iif($did(5) != $null,$did(5))
    var %com = 1 | while ($comchan(%user,%com)) { if ($comchan(%user,%com).op) ban -k $comchan(%user,%com) %user $iif($did(7) != $null,$left($did(7),1),1) $iif($did(5) != $null,$did(5),Banned) | inc %com }
  }
}
on *:LOAD:{
  if ($version < 6.12)  {
    echo -sc Info * У вас старая версия mIRC $version , надо минимум mIRC6.12 или выше, так что всасывай дружок или иди качай новую версию
    Unload -rs Banpro.mrc 
  }
  elseif ($version >= 6.12)  {
    if ($exists(mirc.ini) == $true) {
      writeini -n mirc.ini Ban-protection action1 Деоп
      writeini -n mirc.ini Ban-protection action2 Chanserv разбанивает меня
      writeini -n mirc.ini Ban-protection Доступ запрещен!
      writeini -n mirc.ini Ban-protection action3 КиК
      writeini -n mirc.ini Ban-protection action4 Бан обычный
      writeini -n mirc.ini Ban-protection Msg2 Прощай малышь!
      writeini -n mirc.ini Ban-protection action5 Перезайти
      writeini -n mirc.ini Ban-protection action6 Деоп/кик/бан
      writeini -n mirc.ini Ban-protection action7 (пусто)
      writeini -n mirc.ini Ban-protection Msg3 Вас поимели!
      `Unban
    }
  }
}
alias Unloadbanpro {
  remini mirc.ini Ban-protection
  Unset -s %immune.user
  Unset -s %offender
  Unset -s %osite
  Unset -s %k|n
  Unset -s %c2
  Unload -rs Banpro.mrc
}
ssssssssssssssssssssssssssssssssssss
