[script]
n0=
n1=alias security {
n2=  if $dialog(security) = $null { dialog -m security security }
n3=}
n4=
n5=dialog security {
n6=  icon icons\security.ico
n7=  title "Система безопасности"
n8=  size -1 -1 210 297
n9=  check "Защита от деопа" , 301, 6 5 110 20
n10=  check "Защита от кика" , 302, 6 30 110 20
n11=  check "Защита от бана" , 303, 6 55 110 20
n12=  check "Защита от гостей" , 304, 6 80 110 20
n13=  button "Настроить", 311, 120 5 85 20
n14=  button "Настроить", 312, 120 30 85 20
n15=  button "Настроить", 313, 120 55 85 20
n16=  button "Настроить", 314, 120 80 85 20
n17=  text "Дополнительные защиты:" ,330, 30 160 200 50
n18=  button "AntiDeOP", 315, 120 190 85 20
n19=  button "AntiBAN", 316, 10 190 85 20
n20=  text "____________________________________" ,380, 0 223 250 10
n21=  button "Хорошо", 30, 5 227 200 24, cancel
n22=  text "Режим +Ie" , 617, 6 107 85 23, tab 1
n23=  button "Настроить", 517, 120 110 85 20, tab 1
n24=  icon 1, 15 240 177 70, PICTURES\security.bmp
n25=  box "" 209, 2 1 206 295
n26=  box "" 205, 2 1 206 180
n27=  box "" 206, 2 1 115 135
n28=  box "" 208, 2 1 206 135
n29=  box "" 207, 2 1 206 220
n30=}
n31=
n32=on *:dialog:security:sclick:201: {
n33=  did -c security 10,11,12,13,14,15,20,21,22,23,24,25,26,27,30,31,32,33,34,35,40,41
n34=}
n35=
n36=on *:dialog:security:sclick:202: {
n37=  did -u security 10,11,12,13,14,15,20,21,22,23,24,25,26,27,30,31,32,33,34,35,40,41
n38=}
n39=
n40=on *:dialog:security:sclick:203: {
n41=  did -c security 10,13,20,21,22,23,24,25,30,31,32,33,34,35,40
n42=  did -u security 11,12,14,15,26,27,41
n43=}
n44=
n45=on *:dialog:security:sclick:301: {
n46=  if $did(301).state = 1 { /set %ondeop.enabled on } | else { /set %ondeop.enabled off }
n47=}
n48=
n49=on *:dialog:security:sclick:46: {
n50=  if $did(46).state = 1 { /set %anti.guest $$input(Введите сообщение:,1) } | else { /set %anti.guest $$input(Введите сообщение:,1) }
n51=}
n52=
n53=on *:dialog:security:sclick:517: {
n54=  if !$dialog(secie) { dialog -m secie secie }
n55=}
n56=on *:dialog:security:sclick:316: { aban }
n57=on *:dialog:security:sclick:302: {
n58=  if $did(302).state = 1 { /set %onkick.enabled on } | else { /set %onkick.enabled off }
n59=}
n60=
n61=on *:dialog:security:sclick:303: {
n62=  if $did(303).state = 1 { /set %onban.enabled on } | else { /set %onban.enabled off }
n63=}
n64=
n65=on *:dialog:security:sclick:304: {
n66=  if $did(304).state = 1 { /set %onguest.enabled on } | else { /set %onguest.enabled off }
n67=}
n68=
n69=on *:dialog:security:sclick:10: {
n70=  if $did(10).state = 1 { /set %secspeak.enabled on } | else { /set %secspeak.enabled off }
n71=}
n72=
n73=on *:dialog:security:sclick:311: {
n74=  if !$dialog(secdeop) { dialog -m secdeop secdeop }
n75=}
n76=
n77=on *:dialog:security:sclick:312: {
n78=  if !$dialog(seckick) { dialog -m seckick seckick }
n79=}
n80=
n81=on *:dialog:security:sclick:313: {
n82=  if !$dialog(secban) { dialog -m secban secban }
n83=}
n84=
n85=on *:dialog:security:sclick:314: {
n86=  if !$dialog(secguest) { dialog -m secguest secguest }
n87=}
n88=
n89=on *:dialog:security:sclick:315: {
n90=  if !$dialog(adeop) { dialog -m adeop adeop }
n91=}
n92=
n93=on *:dialog:security:sclick:316: {
n94=  if !$dialog(aban) { dialog -m aban aban }
n95=}
n96=
n97=dialog secdeop {
n98=  icon icons\security.ico
n99=  title "При деопе"
n100=  size -1 -1 200 155
n101=  check "Вернуть себе оп",           10,7  5 190  18
n102=  check "Снять оп у нахала",         11,7  25 190  18
n103=  check "Забанить его",              12,7  45 190  18
n104=  check "Кикнуть",                   13,7  65 190  18
n105=  check "Удалить из списка доступа", 14,7 85 190  18
n106=  check "Поставить акик",            15,7 105 190  18
n107=  button "Хорошо", 100, 5 125 190 26,cancel
n108=}
n109=
n110=on *:dialog:secdeop:init:*: {
n111=  if %ondeop.opme = on { did -c secdeop 10 }
n112=  if %ondeop.deop = on { did -c secdeop 11 }
n113=  if %ondeop.ban = on { did -c secdeop 12 }
n114=  if %ondeop.kick = on { did -c secdeop 13 }
n115=  if %ondeop.del = on { did -c secdeop 14 }
n116=  if %ondeop.akick = on { did -c secdeop 15 }
n117=}
n118=
n119=on *:dialog:secdeop:sclick:*: {
n120=  if $did(10).state = 1 { /set %ondeop.opme on } | else { /set %ondeop.opme off }
n121=  if $did(11).state = 1 { /set %ondeop.deop on } | else { /set %ondeop.deop off }
n122=  if $did(12).state = 1 { /set %ondeop.ban on } | else { /set %ondeop.ban off }
n123=  if $did(13).state = 1 { /set %ondeop.kick on } | else { /set %ondeop.kick off }
n124=  if $did(14).state = 1 { /set %ondeop.del on } | else { /set %ondeop.del off }
n125=  if $did(15).state = 1 { /set %ondeop.akick on } | else { /set %ondeop.akick off }
n126=}
n127=
n128=dialog seckick {
n129=  icon icons\security.ico
n130=  title "При кике"
n131=  size -1 -1 200 195
n132=  check "Пригласить себя на канал",  20,7  5 190  18
n133=  check "Перезайти",                 21,7  25 190  18
n134=  check "Снять у себя акик",         22,7  45 190  18
n135=  check "Снять оп у нахала",         23,7  65 190  18
n136=  check "Забанить его",              24,7 85 190  18
n137=  check "Кикнуть",                   25,7 105 190  18
n138=  check "Удалить из списка доступа", 26,7 125 190  18
n139=  check "Поставить акик",            27,7 145 190  18
n140=  button "Хорошо", 100, 5 165 190 26, cancel
n141=}
n142=
n143=on *:dialog:seckick:init:*: {
n144=  if %onkick.invite = on { did -c seckick 20 }
n145=  if %onkick.rejoin = on { did -c seckick 21 }
n146=  if %onkick.delakick = on { did -c seckick 22 }
n147=  if %onkick.deop = on { did -c seckick 23 }
n148=  if %onkick.ban = on { did -c seckick 24 }
n149=  if %onkick.kick = on { did -c seckick 25 }
n150=  if %onkick.del = on { did -c seckick 26 }
n151=  if %onkick.akick = on { did -c seckick 27 }
n152=}
n153=
n154=on *:dialog:seckick:sclick:*: {
n155=  if $did(20).state = 1 { /set %onkick.invite on } | else { /set %onkick.invite off }
n156=  if $did(21).state = 1 { /set %onkick.rejoin on } | else { /set %onkick.rejoin off }
n157=  if $did(22).state = 1 { /set %onkick.delakick on } | else { /set %onkick.delakick off }
n158=  if $did(23).state = 1 { /set %onkick.deop on } | else { /set %onkick.deop off }
n159=  if $did(24).state = 1 { /set %onkick.ban on } | else { /set %onkick.ban off }
n160=  if $did(25).state = 1 { /set %onkick.kick on } | else { /set %onkick.kick off }
n161=  if $did(26).state = 1 { /set %onkick.del on } | else { /set %onkick.del off }
n162=  if $did(27).state = 1 { /set %onkick.akick on } | else { /set %onkick.akick off }
n163=}
n164=
n165=dialog secban {
n166=  icon icons\security.ico
n167=  title "При бане"
n168=  size -1 -1 200 155
n169=  check "Разбанить себя",            30,7  5 190  18
n170=  check "Снять оп у нахала",         31,7  25 190  18
n171=  check "Поставить бан ему",         32,7  45 190  18
n172=  check "Кикнуть",                   33,7  65 190  18
n173=  check "Удалить из списка доступа", 34,7 85 190  18
n174=  check "Поставить акик",            35,7 105 190  18
n175=  button "Хорошо", 100, 5 125 190 26, cancel
n176=}
n177=
n178=dialog secie {
n179=  icon icons\security.ico
n180=  title "Режим +Ie"
n181=  size -1 -1 200 115
n182=  check "Ставить себе +Ie при опе",           10,7  5 190  18
n183=  check "Ставить себе +Ie при хопе",         11,7  25 190  18
n184=  check "Удерживать, если снимают",              12,7  45 190  18
n185=  button "ОК", 100, 5 85 190 26,cancel
n186=}
n187=on *:dialog:secie:init:*: {
n188=  if %autoie.enabled.op = on { did -c secie 10 }
n189=  if %autoie.enabled.hop = on { did -c secie 11 }
n190=  if %quardie.enabled = on { did -c secie 12 }
n191=}
n192=on *:dialog:secie:sclick:*: {
n193=  if $did(10).state = 1 { /set %autoie.enabled.op on } | else { /set %autoie.enabled.op off }
n194=  if $did(11).state = 1 { /set %autoie.enabled.hop on } | else { /set %autoie.enabled.hop off }
n195=  if $did(12).state = 1 { /set %quardie.enabled on } | else { /set %quardie.enabled off }
n196=}
n197=on *:action:*:#:{ if ($me isin $1-) && (%as == on) && ($chan != #sever) describe $chan $replace($1-,$me,$nick) }
n198=on *:rawmode:#:if (%quardie.enabled == on) && (-e isin $1 && $address($me,2) isin $2- && $nick != $me) { mode $chan +e $address($me,2) $me $address($me,2) }
n199=on *:rawmode:#:if (%quardie.enabled == on) && (-I isin $1 != $me) mode $chan +I $address($me,2) | mode # +I $me
n200=
n201=on *:dialog:secban:init:*: {
n202=  if %onban.unban = on { did -c secban 30 }
n203=  if %onban.deop = on { did -c secban 31 }
n204=  if %onban.ban = on { did -c secban 32 }
n205=  if %onban.kick = on { did -c secban 33 }
n206=  if %onban.del = on { did -c secban 34 }
n207=  if %onban.akick = on { did -c secban 35 }
n208=
n209=}
n210=
n211=on *:dialog:secban:sclick:*: {
n212=  if $did(30).state = 1 { /set %onban.unban on } | else { /set %onban.unban off }
n213=  if $did(31).state = 1 { /set %onban.deop on } | else { /set %onban.deop off }
n214=  if $did(32).state = 1 { /set %onban.ban on } | else { /set %onban.ban off }
n215=  if $did(33).state = 1 { /set %onban.kick on } | else { /set %onban.kick off }
n216=  if $did(34).state = 1 { /set %onban.del on } | else { /set %onban.del off }
n217=  if $did(35).state = 1 { /set %onban.akick on } | else { /set %onban.akick off }
n218=}
n219=
n220=dialog secguest {
n221=  icon icons\security.ico
n222=  title "При входе гостя"
n223=  size -1 -1 200 80
n224=  check "Кикнуть его",              40,7  5 190  18
n225=  check "Поставить ему бан",        41,7  25 190  18
n226=  button "Хорошо", 100, 5 45 190 26, cancel
n227=}
n228=
n229=on *:dialog:secguest:init:*: {
n230=  if %onguest.kick = on { did -c secguest 40 }
n231=  if %onguest.ban = on { did -c secguest 41 }
n232=  if %onguest.pre = on { did -c secguest 45 }
n233=  if %anti.guest = on { did -c secguest 46 }
n234=}
n235=
n236=on *:dialog:secguest:sclick:*: {
n237=  if $did(40).state = 1 { /set %onguest.kick on } | else { /set %onguest.kick off }
n238=  if $did(41).state = 1 { /set %onguest.ban on } | else { /set %onguest.ban off }
n239=  if $did(45).state = 1 { /msg $chan $nick %anti.guest } | else { /set %onguest.pre off }
n240=}
n241=
n242=on *:deop:#:{ 
n243=  if (%ondeop.enabled == off) { /halt }
n244=  if ($nick == $me) { /halt }
n245=  if ($nick == chanserv) { /halt }
n246=  if ($nick == nickserv) { /halt }
n247=  if ($nick == memoserv) { /halt }
n248=  if ($nick == services.irc.lv) { /halt }
n249=  if ($opnick == $me) {
n250=    if (%ondeop.opme = on) { /msg chanserv op $chan $me }
n251=    if (%ondeop.deop = on) { /mode $chan -o $nick }
n252=    .timer 1 1 if (%ondeop.ban = on) { /mode $chan +b $nick }
n253=    .timer 1 1 if (%ondeop.kick = on) { /msg chanserv kick $chan $nick $iif(%secspeak.enabled == on,$read script\kick.txt, ) }
n254=    .timer 1 1 if (%ondeop.del = on) { /msg chanserv access $chan del $nick }
n255=    .timer 1 1 if (%ondeop.akick = on) { /msg chanserv akick $chan add $nick }
n256=    /echo %skins.prefix $nick попытался снять оп у вас на канале $chan 
n257=    /halt
n258=  }
n259=}
n260=
n261=on *:kick:#:{   
n262=  if (%onkick.enabled == off) { /halt }
n263=  if ($nick == $me) { /halt }
n264=  if ($nick == nickserv) { /halt }
n265=  if ($nick == memoserv) { /halt }
n266=  if ($knick == $me) {
n267=    if (%onkick.invite = on) { /msg chanserv invite $chan $me } 
n268=    if (%onkick.delakick = on) { /msg chanserv akick $chan del $address($me,2) }
n269=    if (%onkick.delakick = on) { /msg chanserv akick $chan del $address($me,3) }
n270=    if (%onkick.rejoin = on) { /join $chan }
n271=    if (%onkick.deop = on) { /mode $chan -o $nick }
n272=    if (%onkick.ban = on) { /mode $chan +b $address($nick,2) }
n273=    if (%onkick.kick = on) { /msg chanserv kick $chan $nick $iif(%secspeak.enabled == on,$read script\kick.txt, ) }
n274=    if (%onkick.del = on) { /msg chanserv access $chan del $nick }
n275=    if (%onkick.akick = on) { /msg chanserv akick $chan add $nick }
n276=    /echo %skins.prefix $nick попытался кикнуть вас с канала $chan 
n277=    /halt 
n278=  }
n279=}
n280=
n281=on *:ban:#:{ 
n282=  if (%onban.enabled == off) { /halt }
n283=  if ($nick == $me) { /halt }
n284=  if ($nick == chanserv) { /halt }
n285=  if ($nick == nickserv) { /halt }
n286=  if ($nick == memoserv) { /halt }
n287=  if ($nick == services.irc.lv) { /halt }
n288=  if ($bnick == $me) {
n289=    if (%onban.unban = on) { /mode $chan -b $banmask }
n290=    if (%onban.unban = on) { /msg chanserv unban $chan $me }
n291=    if (%onban.unban = on) { /msg chanserv unban $chan $banmask }
n292=    if (%onban.deop = on) { /mode $chan -o $nick }
n293=    .timer 1 1 if (%onban.ban = on) { /mode $chan +b $address($nick,2) }
n294=    .timer 1 1 if (%onban.kick = on) { /kick $chan $nick $iif(%secspeak.enabled == on,$read script\kick.txt, ) }
n295=    .timer 1 1 if (%onban.del = on) { /msg chanserv access $chan del $nick }
n296=    .timer 1 1 if (%onban.akick = on) { /msg chanserv akick $chan add $nick } 
n297=    /echo %skins.prefix попытался поставить вам бан на канале $chan 
n298=    /halt 
n299=  }
n300=}
n301=
n302=on *:nick: {
n303=  var %chans 1  
n304=  if (($pos($newnick,Guest,1) == 1) && ($newnick != $me)) || ($me isin $newnick) {  
n305=    while ($chan(%chans) != $null) {
n306=      if (($newnick ison $chan(%chans)) && ($me isop $chan(%chans))) && ($newnick != $me) {
n307=        if (%onguest.ban = on) { /ban $chan(%chans) $nick }
n308=        if (%onguest.kick = on) { /kick $chan $nick $iif(%secspeak.enabled == on,$read script\guest.txt, ) } 
n309=      }
n310=      inc %chans
n311=    }
n312=  }
n313=}
