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