[script]
n0=;/////////////////////////////////////////////Avto join/////////////////////////////////////////////
n1=alias ajoin {
n2=  if $dialog(ajoin) = $null { dialog -ma ajoin ajoin }
n3=  else halt
n4=}
n5=
n6=dialog ajoin {
n7=  icon rg.ico, 0
n8=  title "Авто join [F2]"
n9=  size 460 300 170 150
n10=  button "OK",1,115 120 45 25, OK
n11=  combo 2,5 30 100 120
n12=  radio "On",3, 10 10 40 13
n13=  radio "Off",4, 60 10 40 15
n14=
n15=  button "Add",5,115 20 45 25
n16=  button "Del",6,115 50 45 25
n17=  button "Clear",7,115 80 45 25
n18=}
n19=on 1:dialog:ajoin:sclick:*: {
n20=  if ( $did = 3 ) { set %autojoin ON }
n21=  if ( $did = 4 ) { set %autojoin OFF }
n22=  if ( $did = 5 ) { 
n23=    did -r ajoin 2
n24=    set %channelsjoin $addtok(%channelsjoin,%channel.temp,44) 
n25=    set %temp.count 0
n26=    if ( %channelsjoin != $null ) { 
n27=      set %temp.real $count(%channelsjoin,$chr(44)) + 1
n28=      :ok
n29=      inc %temp.count
n30=      did -a ajoin 2 $gettok(%channelsjoin,%temp.count,44)
n31=      if ( %temp.count = %temp.real ) { halt }
n32=      goto ok
n33=    }
n34=  }
n35=  if ( $did = 6 ) { 
n36=    set %channelsjoin $remtok(%channelsjoin,%channel.temp,44)
n37=    did -r ajoin 2
n38=    set %temp.count 0
n39=    if ( %channelsjoin != $null ) { 
n40=      set %temp.real $count(%channelsjoin,$chr(44)) + 1
n41=      :ok
n42=      inc %temp.count
n43=      did -a ajoin 2 $gettok(%channelsjoin,%temp.count,44)
n44=      if ( %temp.count = %temp.real ) { halt }
n45=      goto ok
n46=    }
n47=  }
n48=  if ( $did = 7 ) { unset %channelsjoin | did -r ajoin 2 }
n49=  if ( $did = 2 ) { set %channel.temp $did(2).text }
n50=}
n51=on 1:dialog:ajoin:init:0: {
n52=  if ( %autojoin = ON ) { did -c ajoin 3 }
n53=  else { did -c ajoin 4 }
n54=  set %temp.count 0
n55=  if ( %channelsjoin != $null ) {   
n56=    set %temp.real $count(%channelsjoin,$chr(44)) + 1
n57=    :ok
n58=    inc %temp.count
n59=    did -a ajoin 2 $gettok(%channelsjoin,%temp.count,44)
n60=    if ( %temp.count = %temp.real ) { halt }
n61=    goto ok
n62=  }
n63=}
n64=on 1:dialog:ajoin:edit:*: {
n65=  if ( $did = 2 ) { 
n66=    if ( $left($did(2).text,1) != $chr(35) ) { error3 }
n67=    else { set %channel.temp $did(2).text }
n68=  }
n69=}
n70=dialog error3 {
n71=  title "Error"
n72=  size -1 -1 150 90
n73=  button "OK",1,55 60 40 20, cancel
n74=  text "Поставьте # вначале",2,10 20 110 40
n75=}
n76=alias error3 { dialog -m error3 error3 }
n77=on 1:dialog:error3:sclick:1: {
n78=  did -r ajoin 2
n79=  set %temp.count 0
n80=  if ( %channelsjoin != $null ) { set %temp.real $count(%channelsjoin,$chr(44)) + 1
n81=    :ok
n82=    inc %temp.count
n83=    did -a ajoin 2 $gettok(%channelsjoin,%temp.count,44)
n84=    if ( %temp.count = %temp.real ) { did -f ajoin 2 | halt }
n85=    goto ok
n86=  }
n87=}
n88=
n89=on 1:start: {
n90=  if (%allowautoconnect = on) {
n91=    /server %connserv | /nick %connnick
n92=  } | else { /halt }
n93=}
n94=
n95=on 1:connect: {
n96=  if (%autojoin = on) {
n97=    if ($me = %name1) && (%chk1 == on) { /msg nickserv identify %passw1 | echo %skin.sys Идентефицируюсь... }
n98=    if ($me = %name2) && (%chk2 == on) { /msg nickserv identify %passw2 | echo %skin.sys Идентефицируюсь... }
n99=    if ($me = %name3) && (%chk3 == on) { /msg nickserv identify %passw3 | echo %skin.sys Идентефицируюсь... }
n100=    if ($me = %name4) && (%chk4 == on) { /msg nickserv identify %passw4 | echo %skin.sys Идентефицируюсь... }
n101=    if ($me = %name5) && (%chk5 == on) { /msg nickserv identify %passw5 | echo %skin.sys Идентефицируюсь... }
n102=    /join %channelsjoin
n103=    } | else { 
n104=    if ($me = %name1) && (%chk1 == on) { /msg nickserv identify %passw1 | echo %skin.sys Идентефицируюсь... }
n105=    if ($me = %name2) && (%chk2 == on) { /msg nickserv identify %passw2 | echo %skin.sys Идентефицируюсь... }
n106=    if ($me = %name3) && (%chk3 == on) { /msg nickserv identify %passw3 | echo %skin.sys Идентефицируюсь... }
n107=    if ($me = %name4) && (%chk4 == on) { /msg nickserv identify %passw4 | echo %skin.sys Идентефицируюсь... }
n108=    if ($me = %name5) && (%chk5 == on) { /msg nickserv identify %passw5 | echo %skin.sys Идентефицируюсь... }
n109=  }
n110=}
n111=
n112=;/////////////////////////////////////////////Avto id/////////////////////////////////////////////
n113=
n114=alias autoid {
n115=  if $dialog(autoid) = $null { dialog -ma autoid autoid }
n116=  else halt
n117=}
n118=dialog autoid {
n119=  icon rg.ico, 0
n120=  title Авто идентефикация [F3] $str($chr(160),10)
n121=  size 420 300 260 160
n122=  button OK,100,85 132 40 20,ok
n123=  button Cancel,200,130 132 40 20,cancel
n124=  box "",1,1 -5 258 305
n125=  text "Ник:",5,60 10 40 15 
n126=  text "Пассворд:",6,150 10 50 15
n127=  check "",2,10 33 15 15  
n128=  edit %name1 ,3,30 30 75 20,center,autohs
n129=  edit %passw1 ,4,135 30 75 20,center,autohs
n130=  check "",7,10 53 15 15  
n131=  edit %name2 ,8,30 50 75 20,center,autohs
n132=  edit %passw2 ,9,135 50 75 20,center,autohs
n133=  check "",10,10 73 15 15  
n134=  edit %name3 ,11,30 70 75 20,center,autohs
n135=  edit %passw3 ,12,135 70 75 20,center,autohs
n136=  check "",13,10 93 15 15  
n137=  edit %name4 ,14,30 90 75 20,center,autohs
n138=  edit %passw4 ,15,135 90 75 20,center,autohs
n139=  check "",16,10 113 15 15  
n140=  edit %name5 ,17,30 110 75 20,center,autohs
n141=  edit %passw5 ,18,135 110 75 20,center,autohs
n142=  button Удал.,36,213 32 40 16 
n143=  button Удал.,37,213 52 40 16
n144=  button Удал.,38,213 72 40 16
n145=  button Удал.,39,213 92 40 16
n146=  button Удал.,40,213 112 40 16
n147=}
n148=on *:dialog:autoid:init:*: {
n149=  if %chk1 = ON { did -c autoid  2 }  
n150=  if %chk2 = ON { did -c autoid 7 }
n151=  if %chk3 = ON { did -c autoid 10 }
n152=  if %chk4 = ON { did -c autoid 13 }
n153=  if %chk5 = ON { did -c autoid 16 }
n154=}
n155=on *:dialog:autoid:sclick:100: {
n156=  if ($did(autoid,2).state = 1) { %chk1 = on } | else { %chk1 = off }
n157=  if ($did(autoid,7).state = 1) { %chk2 = on } | else { %chk2 = off }
n158=  if ($did(autoid,10).state = 1) { %chk3 = on } | else { %chk3 = off }
n159=  if ($did(autoid,13).state = 1) { %chk4 = on } | else { %chk4 = off }
n160=  if ($did(autoid,16).state = 1) { %chk5 = on } | else { %chk5 = off }
n161=  %name1 = $did(3) | %name2 = $did(8) | %name3 = $did(11) | %name4 = $did(14) | %name5 = $did(17)
n162=  %passw1 = $did(4) | %passw2 = $did(9) | %passw3 = $did(12) | %passw4 = $did(15) | %passw5 = $did(18)
n163=} 
n164=on *:dialog:autoid:sclick:*: {
n165=  if $did = 36 { did -ru autoid 3,4,2 }
n166=  if $did = 37 { did -ru autoid 7,8,9 }
n167=  if $did = 38 { did -ru autoid 10,11,12 }
n168=  if $did = 39 { did -ru autoid 13,14,15 }
n169=  if $did = 40 { did -ru autoid 16,17,18 }
n170=}
n171=on 1:NICK: {
n172=  if ($nick == $me) {
n173=    if ($newnick == %name1) && (%chk1 == on) { /msg nickserv identify %passw1 | echo %skin.sys Идентефицируюсь... }
n174=    if ($newnick == %name2) && (%chk2 == on) { /msg nickserv identify %passw2 | echo %skin.sys Идентефицируюсь... }
n175=    if ($newnick == %name3) && (%chk3 == on) { /msg nickserv identify %passw3 | echo %skin.sys Идентефицируюсь... }
n176=    if ($newnick == %name4) && (%chk4 == on) { /msg nickserv identify %passw4 | echo %skin.sys Идентефицируюсь... }
n177=    if ($newnick == %name5) && (%chk5 == on) { /msg nickserv identify %passw5 | echo %skin.sys Идентефицируюсь... }
n178=  }
n179=}
