[script]
n0=;--------------------------------------------------------------------------------------------------------------------
n1=
n2=raw 352:*:halt 
n3=raw 315:*:halt   
n4=
n5=; as you join channels, this'll check for clones,
n6=; display them, and color them; works the same if
n7=; clones join any channels that you may be on
n8=
n9=on 1:JOIN:#:{
n10=  if (!$ial) .ial on
n11=  if ($nick == $me) { %chanx = $chan | who %chanx | .timer [ $+ [ $ticks ] ] 1 3 ccheck }
n12=  if ($nick != $me) {
n13=    %chan = $chan
n14=    %addy = $wildsite
n15=    %clones = $cclone(%addy,%chan)
n16=    if (%clones) {
n17=      if (!$hget(color,%addy)) {
n18=        %colornum = $iif(%colornum == 11,1,$calc(%colornum + 1))
n19=        %usecolor = $gettok(3.4.6.7.8.9.10.11.12.13.14,%colornum,46)
n20=      }
n21=      var %y = 1
n22=      while (%y <= $numtok(%clones,32)) {
n23=        cline $iif($hget(color,%addy),$ifmatch,%usecolor) %chan $gettok(%clones,%y,32)
n24=        inc %y
n25=      }
n26=      if (!$hget(color,%addy)) hadd -m color %addy %usecolor
n27=      echo -bf %chan 14[13ÊËÎÍÛ14]=>[11 %clones 14]<=>[13 $addres($$1,2) 14]
n28=      hfree clone
n29=    }
n30=    unset %chan %addy %clones %usecolor
n31=  }
n32=}
n33=
n34=; ccheck is the alias called to check for clones
n35=; as you join channels
n36=
n37=alias -l ccheck {
n38=  var %x = 1
n39=  while (%x <= $nick(%chanx,0)) {
n40=    %addyx = $address($nick(%chanx,%x),2)
n41=    %clones = $cclone(%addyx,%chanx)
n42=    if (%clones) { 
n43=      if (!$hget(color,%addyx)) {
n44=        %colornum = $iif(%colornum == 11,1,$calc(%colornum + 1))
n45=        %usecolor = $gettok(3.4.6.7.8.9.10.11.12.13.14,%colornum,46)
n46=      }
n47=      var %y = 1
n48=      while (%y <= $numtok(%clones,32)) {
n49=        cline $iif($hget(color,%addyx),$ifmatch,%usecolor) %chanx $gettok(%clones,%y,32)
n50=        inc %y
n51=      }
n52=      if (!$hget(color,%addyx)) hadd -m color %addyx %usecolor
n53=      echo -bf %chanx [4ÊËÎÍÛ]: %clones
n54=    }
n55=    inc %x
n56=  }
n57=  if ($hget(clone)) hfree clone
n58=  unset %chanx %addyx %clones %usecolor
n59=}
n60=
n61=; $cclone([addy],[chan]) is what i used to 
n62=; loop thru any clone matches and append them to
n63=; a variable that i could use later
n64=
n65=alias -l cclone {
n66=  if ($ialchan($1,$2,0) >= 2) && (!$hget(clone,$1)) {
n67=    var %x = 1
n68=    while ($ialchan($1,$2,%x)) {
n69=      var %c.l = $addtok(%c.l,$ialchan($1,$2,%x).nick,32)
n70=      hadd -m clone $1 %c.l
n71=      inc %x
n72=    }
n73=  }
n74=  return $iif(%c.l,$ifmatch,$null)
n75=}
n76=
n77=; as clones leave, are kicked or quit irc; we
n78=; need to uncolor the remaining match (if 1)
n79=; so i assigned the required data to variables
n80=; that i use later in the nocl alias
n81=
n82=on 1:PART:#:{ if ($ialchan($wildsite,#,0) >= 2) { %c.w = $wildsite | %c.c = $chan | .timer [ $+ [ $ticks ] ] 1 1 nocl } }
n83=on 1:KICK:#:{ if ($ialchan($wildsite,#,0) >= 2) { %c.w = $address($knick,2) | %c.c = $chan | .timer [ $+ [ $ticks ] ] 1 1 nocl } }
n84=on 1:QUIT:{ if ($comchan($nick,0) > 0) { var %x = 1 | while ($comchan($nick,%x)) { %c.c = $comchan($nick,%x) | inc %x } } | if ($ialchan($wildsite,%c.c,0) >= 2) { %c.w = $wildsite | .timer [ $+ [ $ticks ] ] 1 1 nocl } | else unset %c.* }
n85=
n86=; the nocl alias loops thru each channel you're  
n87=; on, and uncolors any existing clone matches, if 
n88=; only one still remains
n89=
n90=alias -l nocl {
n91=  var %x = 1
n92=  while ($chan(%x)) {
n93=    if ($ialchan(%c.w,$chan(%x),0) == 1) {
n94=      cline -r $chan(%x) $ialchan(%c.w,$chan(%x),1).nick
n95=    }
n96=    inc %x
n97=  }
n98=  unset %c.*
n99=}
n100=on ^$*:hotlink:/[a-z]/i:*:{ if ($mouse.key !& 4) { halt } }
n101=on $*:hotlink:/[a-z]/i:*:{
n102=  var %g
n103=  noop $regsub($1,/[^\wöüäÖÜÄêéèâáàôóòÊÉÈÂÁÀÔÓÒ]/g,,%g)
n104=  popdll.new popup
n105=  popdll.add popup +d 0 0 — $shorten(12,%g)
n106=  popdll.add popup
n107=  popdll.add popup + 0 0 &Acronym lookup $cr acro %g
n108=  popdll.add popup + 0 0 &Dictionary $cr dict %g
n109=  popdll.add popup + 0 0 &Google $cr google %g
n110=  popdll.add popup + 0 0 &IMDB $cr imdb %g
n111=  popdll.add popup + 0 0 &Wikipedia $cr wiki %g
n112=  popdll.disp popup
n113=}
n114=alias pclones {
n115=  var %a = 1,%i = $ialchan($1,$chan,0),%r
n116=  while (%a <= %i) {
n117=    var %n = $ialchan($1,$chan,%a).nick
n118=    if (%n != $me) {
n119=      %r = %r %n
n120=      if ($len(%r) > $iif($prop == short,40,500)) {
n121=        %r = %r ...
n122=        break
n123=      }
n124=    }
n125=    inc %a
n126=  }
n127=  return $replace(%r,$chr(32),$chr(44) $+ $chr(32))
n128=}
n129=alias giveaop {
n130=  .aop on
n131=  .aop $1-2 3 $network
n132=  mode $2 +o $1
n133=  thmecho -a $thmhl($1) has been added to the auto-op list on $thmhl($2) $+ .
n134=}
n135=alias giveavoice {
n136=  .avoice on
n137=  .avoice $1-2 3 $network
n138=  mode $2 +v $1
n139=  thmecho -a $thmhl($1) has been added to the auto-voice list on $thmhl($2) $+ .
n140=}
n141=alias takeaop {
n142=  .aop -r $1-2 3
n143=  thmecho -a $thmhl($1) has been removed from the auto-op list on $thmhl($2) $+ .
n144=}
n145=alias takeavoice {
n146=  .avoice -r $1-2 3
n147=  thmecho -a $thmhl($1) has been removed from the auto-voice list on $thmhl($2) $+ .
n148=}
n149=alias takemodes {
n150=  .avoice -r $1-2 3
n151=  .aop -r $1-2 3
n152=  thmecho -a $thmhl($1) has been removed from the auto-voice and auto-op lists on $thmhl($2) $+ .
n153=}
n154=alias chan.bans { if ($1 isnum) && ($chan($2).ibl) && ($ibl($2,$1)) { return $+($1,. $remove($v1,:),	by $ibl($2,$1).by,:pcb) Ban $chr(35) $+ $1 in $2 $cr $ibl($2,$1) set by $ibl($2,$1).by } }
n155=alias sub.away { if ($1 isnum) && ($hget(awaypreset,$1).item) { return $+(&,$v1,:a) $v1 } }
n156=alias setqueryvar { $iif($2 == u,unset,set) %query.popnick $1 }
n157=alias pslaps {
n158=  if ($1 == begin) { .fopen slaps script\txt\slaps.txt }
n159=  elseif ($1 == end) { .fclose slaps }
n160=  elseif ($fread(slaps)) { return & $+ $v1 }
n161=}
n162=alias sub.games {
n163=  if ($1 isnum) {
n164=    var %g = $decode($gettok($var(%game.*.added,$1),2,46),m)
n165=    if (%g != $null) {
n166=      var %d = $replace(%g,:,;,$chr(123),[,$chr(125),])
n167=      if ($prop != ip) { return %d $+ :games.open %g }
n168=      else { return %d $+ :games.open -i %g }
n169=    }
n170=  }
n171=}
n172=alias remignore {
n173=  .ignore -r $$1- 5
n174=  thmecho -a Removed $thmhl($1) from ignore list.
n175=}
n176=alias thmignore {
n177=  .ignore on
n178=  .ignore $$1- %ignore.mask
n179=  thmecho -a Now ignoring $thmhl($wd($1-,-1)) $+ .
n180=  if (p isincs $1) && ($window($wd($1-,-1))) { window -c $v1 }
n181=}
n182=alias tignore {
n183=  .ignore on
n184=  var %m
n185=  if ($regex(igntime,$1,/-[^ ]*u(\d+)[^ ]*/)) {
n186=    .ignore $1- %ignore.mask
n187=    thmecho -a Now ignoring $thmhl($2-) for $thmhl($duration($regml(igntime,1))) $+ .
n188=  }
n189=  else {
n190=    %m = $int($$eddialog(Please enter an ignore time in minutes.))
n191=    if (%m !isnum) {
n192=      errdialog please enter a number.
n193=      return
n194=    }
n195=    .ignore $1 $+ $calc(%m *60) $$2- %ignore.mask
n196=    thmecho -a Now ignoring $thmhl($2-) for $thmhl($duration($calc(%m *60))) $+ .
n197=  }
n198=  if (p isincs $1) && ($window($wd($1-,-1))) { window -c $v1 }
n199=}
n200=alias tignore.sub {
n201=  if ($1 == 1) { return &Complete:tignore -u $+ $3 $2 }
n202=  elseif ($1 == 2) { return - }
n203=  elseif ($1 == 3) { return C&hannel:tignore -cu $+ $3 $2 }
n204=  elseif ($1 == 4) { return C&ontrol codes:tignore -ku $+ $3 $2 }
n205=  elseif ($1 == 5) { return C&TCP:tignore -tu $+ $3 $2 }
n206=  elseif ($1 == 6) { return &DCC:tignore -du $+ $3 $2 }
n207=  elseif ($1 == 7) { return &Notice:tignore -nu $+ $3 $2 }
n208=  elseif ($1 == 8) { return &Private:tignore -pu $+ $3 $2 }
n209=}
n210=alias reperform {
n211=  if ($1 == -a) { _do scon -at1 reperform }
n212=  else {
n213=    if ($status != connected) { thmerror -a You are not connected. }
n214=    elseif ($isfile(perform.ini)) {
n215=      unset %rpfrm.done
n216=      filter -kg perform.ini rpfrm.filter $+(/^n\d+=,$curconserv,$chr(44),.+/i)
n217=      if (%rpfrm.done) {
n218=        unset %rpfrm.done
n219=        thmecho -a Re-executed perform list on $thmhl($curconserv) $+ .
n220=      }
n221=      else { thmerror -a Perform list for $thmhl($curconserv) is empty. }
n222=    }
n223=    else { thmerror -a perform.ini file not found. }
n224=  }
n225=}
n226=alias mask.sub { if ($1 isnum 0-9) { return $iif($1 == % [ $+ [ $2 ] $+ ] .mask,$style(1)) $+([&,$1,] $mask($iif($3,$3,nick!ident@some.host.com),$1),:chg,$2,mask) $1 } }
n227=alias chgbanmask {
n228=  set %ban.mask $1
n229=  if ($dialog(settings)) { did -c $v1 1377 $calc($1 +1) }
n230=  thmecho -a Ban mask changed to $thmhl($mask(nick!ident@some.host.com,$1)) $+ .
n231=}
n232=alias chgignoremask {
n233=  set %ignore.mask $1
n234=  if ($dialog(settings)) { did -c $v1 1376 $calc($1 +1) }
n235=  thmecho -a Ignore mask changed to $thmhl($mask(nick!ident@some.host.com,$1)) $+ .
n236=}
n237=alias pcb {
n238=  noop $regex(pcb,$1-,^(.+) \x0D (.+)$)
n239=  var %1 = $regml(pcb,1),%2 = $regml(pcb,2)
n240=  if (%qinfo.action == 1) {
n241=    clipboard %1 $+ : %2
n242=    thmecho -a Information copied to clipboard: %1 $+ : %2
n243=  }
n244=  elseif (%qinfo.action == 2) {
n245=    clipboard %2
n246=    thmecho -a Information copied to clipboard: %2
n247=  }
n248=  elseif (%qinfo.action == 3) { say $sbr(%1) %2 }
n249=  elseif (%qinfo.action == 4) { thmecho -a %1 $+ : %2 }
n250=}
n251=alias massmode {
n252=  if ($1 ischan) {
n253=    var %i,%cn
n254=    if ($2 == +) { %i = $nick($1,0,a,$3) }
n255=    else { %i = $nick($1,0,$3) }
n256=    var %d = 0,%x,%r = $mid($prefix,$pos($nickmode,$3),1)
n257=    if (%i) {
n258=      if (!$ydialog(You are about to give mode $2 $+ $3 to %i user(s) on $1 $+ . Continue?)) { return }
n259=      while (%i) {
n260=        if ($2 == +) { %cn = $nick($1,%i,a,$3) }
n261=        else { %cn = $nick($1,%i,$3) }
n262=        if ($me != %cn) || ($2 == +) {
n263=          %x = $addtok(%x,%cn,32)
n264=          if ($numtok(%x,32) == $modespl) {
n265=            $iif(%d,.timer 1 %d) mode $1-2 $+ $str($3,$modespl) %x
n266=            %x = ""
n267=            inc %d
n268=          }
n269=        }
n270=        dec %i
n271=      }
n272=      if (%x) { $iif(%d,.timer 1 %d) mode $1-2 $+ $str($3,$numtok(%x,32)) %x }
n273=    }
n274=    else { thmerror -a There aren't any users on $thmhl($1) who could be given mode $+($2,$3,.) }
n275=  }
n276=  else { thmerror -a Wrong parameters. }
n277=}
n278=alias mmode {
n279=  var %i = $snick($1,0),%d = 0,%x,%r = $mid($prefix,$pos($nickmode,$3),1)
n280=  while (%i) {
n281=    if (%r $iif($2 == +,!) $+ isin $nick($1,$snick($1,%i)).pnick) {
n282=      %x = $addtok(%x,$snick($1,%i),32)
n283=      if ($numtok(%x,32) == $modespl) {
n284=        $iif(%d,.timer 1 %d) mode $1-2 $+ $str($3,$modespl) %x
n285=        %x = ""
n286=        inc %d
n287=      }
n288=    }
n289=    dec %i
n290=  }
n291=  if (%x) { $iif(%d,.timer 1 %d) mode $1-2 $+ $str($3,$numtok(%x,32)) %x }
n292=}
n293=alias pfavserv {
n294=  var %x = $wd(%autoconservs,$1)
n295=  if ($1 isnum) && (%x) { return $iif($network == $v1,$style(1)) $+(&,$1,. %x,:server) $2 %x }
n296=}
n297=alias pservhist {
n298=  var %x = $gettok(%serv.hist,$1,124)
n299=  if ($1 isnum 1-5) && (%x) { return $iif($server == $gettok(%x,1,9),$style(1)) $+(&,$1,. %x,:server) $iif($status == connected,-m) $gettok(%x,1,9) }
n300=}
n301=alias pident { return $iif($ial($1),$gettok($gettok($v1,2,33),1,64),Unknown) }
n302=alias phost { return $iif($ial($1),$gettok($v1,2-,64),Unknown) }
n303=alias pidle { return $sduration($nick($chan,$1).idle) }
n304=alias comchans {
n305=  var %i = 1,%t,%r
n306=  while ($comchan($1,%i)) {
n307=    %t = $v1
n308=    if (%t != $chan) { %r = $addtok(%r,%t,32) }
n309=    if ($len(%r) > 30) && (!$2) {
n310=      %r = %r $+ ... $nbr($comchan($1,0))
n311=      break
n312=    }
n313=    inc %i
n314=  }
n315=  if (%r) { return %r }
n316=  else { return # }
n317=}
n318=alias repmodename { return $replacex($1-,~,owner,.,owner,@,op,%,halfop,+,voice,&,protected) }
n319=alias psetumode { if ($1 <= $len($nickmode)) { return $iif($2 == +,&Give,&Take) $+($repmodename($mid($prefix,$1,1)),	,$nbr($2 $+ $mid($nickmode,$1,1)),:mmode) $chan $2 $mid($nickmode,$1,1) } }
n320=alias psetmmode { if ($1 <= $len($nickmode)) { return Mass $+($iif($2 == -,de),&,$repmodename($mid($prefix,$1,1)),	,$nbr($2 $+ $mid($nickmode,$1,1)),:massmode) $chan $2 $mid($nickmode,$1,1) } }
n321=alias psetmkmode { if ($1 <= $len($nickmode)) { return Masked $+($iif($2 == -,de),&,$repmodename($mid($prefix,$1,1)),	,$nbr($2 $+ $mid($nickmode,$1,1)),:smode.popup) $mid($prefix,$1,1) $2 $mid($nickmode,$1,1) $chan } }
n322=alias smode.popup { smode $2- $$eddialog(Please enter a hostmask you want to $iif($2 == -,de) $+ $repmodename($1) $+ .,nickname!ident@host.com) }
n323=alias pusers { return $nick($chan,0,$1) $iif($1 != a,$nbr($percent($nick($chan,0,$1),$nick($chan,0),0))) }
n324=alias ppeak {
n325=  if ($hget(peaks,$chan)) {
n326=    tokenize 32 $v1
n327=    return $1 $nbr($asctime($2,dd/mm/yy))
n328=  }
n329=  else { return Íåèçâåñòíî }
n330=}
n331=alias qinfo.setup { nndlg -m qinfo.setup }
n332=dialog qinfo.setup {
n333=  title "Quickinfo setup [/qinfo.setup]"
n334=  size -1 -1 272 134
n335=  option pixels
n336=  icon script\pics\nntray.ico
n337=  box "When clicking on an item, do the following", 1, 4 4 264 96
n338=  radio "&Post text && description to active channel/query", 6, 12 20 248 18
n339=  radio "&Echo text && description to active channel/query", 7, 12 38 250 18
n340=  radio "Cop&y text && description to clipboard", 4, 12 56 198 18
n341=  radio "Copy &text to clipboard", 5, 12 74 132 18
n342=  button "&Ok", 2, 104 106 80 24, ok
n343=  button "&Cancel", 3, 188 106 80 24, cancel
n344=}
n345=on *:dialog:qinfo.setup:*:*:{
n346=  if ($devent == init) { did -c $dname $calc(%qinfo.action +3) }
n347=  elseif ($devent == sclick) && ($did == 2) {
n348=    var %x
n349=    if ($did(4).state) { %x = 1 }
n350=    elseif ($did(5).state) { %x = 2 }
n351=    elseif ($did(6).state) { %x = 3 }
n352=    else { %x = 4 }
n353=    set %qinfo.action %x
n354=  }
n355=}
n356=alias pumd {
n357=  var %x = $left($nick($chan,$1).pnick,1),%c = Unknown
n358=  if ($1 !isreg $chan) {
n359=    if (%x == @) { %c = Îïåðàòîð }
n360=    elseif (%x == %) { %c = Ïîëó îïåðàòîð }
n361=    elseif (%x == +) { %c = Ãîëîñ }
n362=    elseif (%x == & ) { %c = Àäìèíèñòðàòîð }
n363=    elseif (%x ==  ~) { %c = Ôàóíäåð }
n364=    return %x $nbr(%c)
n365=  }
n366=  else { return Îòñóòñòâóåò }
n367=}
n368=dialog Bnc {
n369=  title "S-BNC "
n370=  size -1 -1 430 260
n371=  button "", 1000, 0 0 0 0,default
n372=  button "", 1001, 0 0 0 0,ok
n373=  list 1, 7 13 130 190,size sort
n374=  box "BNCs", 2, 2 -1 141 210
n375=  edit "", 3, 58 212 82 20,autohs
n376=  button "Add", 4, 5 212 50 20
n377=  button "Delete", 5, 5 235 134 20
n378=  box "BNC Address:", 6, 150 -1 134 40,hide
n379=  edit "", 7, 155 13 124 20,autohs hide
n380=  box "Port:", 8, 150 41 134 40,hide
n381=  edit "", 9, 155 55 124 20,autohs hide
n382=  box "Password:", 10, 150 84 134 40,hide
n383=  edit "", 11, 155 98 124 20,autohs hide
n384=  box "Vhost:", 12, 150 127 134 40,hide
n385=  edit "", 13, 155 141 124 20,autohs hide
n386=  box "Ident:", 14, 150 169 134 40,hide
n387=  edit "", 15, 155 184 124 20,autohs hide
n388=  button "Save!", 16, 165 215 100 20,hide
n389=  list 17, 294 13 130 190,size hide
n390=  box "Irc Servers", 18, 289 -1 141 210,hide
n391=  edit "", 19, 345 212 82 20,autohs hide
n392=  button "Add", 20, 292 212 50 20,hide
n393=  button "Delete", 21, 292 235 134 20,hide
n394=}
n395=alias -l dia_bnc {
n396=  if ($dialog(Bnc) != Bnc) dialog -dmr Bnc Bnc
n397=}
n398=on *:dialog:Bnc:init:*:{
n399=  get_bncs Bnc 1
n400=}
n401=alias -l get_bncs {
n402=  var %sk.i 1
n403=  var %sk.bnc $ini($scriptdirbnc.ini,1)
n404=  if (%sk.bnc) {
n405=    ;unhide all other dialog things
n406=    if ($1 == Bnc) did -v Bnc 6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21
n407=    while (%sk.bnc) {
n408=      ;add Bnc's to the listbox
n409=      did -a $1 1 %sk.bnc
n410=      inc %sk.i
n411=      set %sk.bnc $ini($scriptdirbnc.ini,%sk.i)
n412=    }
n413=    ;select first Bnc and get its info
n414=    did -c $1 1 1
n415=    if ($1 == Bnc) get_bncinfo $did(Bnc,1).seltext
n416=  }
n417=
n418=}
n419=alias -l get_bncinfo {
n420=  did -ra Bnc 7 $readini($scriptdirbnc.ini,$$1,Bnc)
n421=  did -ra Bnc 9 $readini($scriptdirbnc.ini,$$1,Port)
n422=  did -ra Bnc 11 $readini($scriptdirbnc.ini,$$1,Password)
n423=  did -ra Bnc 13 $readini($scriptdirbnc.ini,$$1,Vhost)
n424=  did -ra Bnc 15 $readini($scriptdirbnc.ini,$$1,Ident)
n425=  get_bncslist $$1
n426=}
n427=alias -l get_bncslist {
n428=  did -r Bnc 17  
n429=  var %sk.b 0
n430=  var %sk.bncserver $readini($scriptdirbnc.ini,$$1,server $+ %sk.b)
n431=  while (%sk.bncserver) {
n432=    did -a Bnc 17 %sk.bncserver
n433=    inc %sk.b
n434=    set %sk.bncserver $readini($scriptdirbnc.ini,$$1,server $+ %sk.b)
n435=  }
n436=}
n437=on *:dialog:Bnc:sclick:4:{
n438=  if (($did(Bnc,3).text) && ($didwm(Bnc,1,$did(Bnc,3).text) == 0)) {
n439=    var %sk.bncadd $did(Bnc,3).text
n440=    did -a Bnc 1 %sk.bncadd
n441=    if ($dialog(bnclist)) did -a bnclist 1 %sk.bncadd
n442=    writeini -n $scriptdirbnc.ini %sk.bncadd Bnc %sk.bncadd
n443=    if ($did(Bnc,21).visible == $false) { 
n444=      did -v Bnc 6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21 
n445=    }
n446=    did -c Bnc 1 $didwm(Bnc,1,%sk.bncadd)
n447=    get_bncinfo $did(Bnc,1).seltext
n448=  }
n449=  did -r Bnc 3
n450=}
n451=on *:dialog:Bnc:sclick:1:{
n452=  get_bncinfo $did(Bnc,1).seltext
n453=}
n454=on *:dialog:Bnc:sclick:5:{
n455=  if ($did(Bnc,1).seltext) {
n456=    var %sk.bncdel $did(Bnc,1).seltext
n457=    did -d Bnc 1 $did(Bnc,1).sel
n458=    remini $scriptdirbnc.ini %sk.bncdel
n459=    did -c Bnc 1 1
n460=    if ($did(Bnc,1).seltext) {
n461=      get_bncinfo $did(Bnc,1).seltext
n462=    }
n463=    else {
n464=      did -h Bnc 6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21 
n465=    }
n466=    set %sk.bnc $bncnum(%sk.bncdel)
n467=    if (%sk.bnc != 6) {
n468=      rem_bnc %sk.bnc
n469=    }
n470=  }
n471=}
n472=alias -l rem_bnc {
n473=  var %sk.bncc 1
n474=  var %sk.bncr %sk.bnc [ $+ [ %sk.bncc ] ]
n475=  while (%sk.bncr) {
n476=    inc %sk.bncc
n477=    set %sk.bncr %sk.bnc [ $+ [ %sk.bncc ] ]
n478=  }
n479=  dec %sk.bncc
n480=  if (%sk.bncc == 1) { unset %sk.bnc1 | return }
n481=  if (%sk.bncr == $null) { set %sk.bncr %sk.bnc [ $+ [ %sk.bncc ] ] }
n482=  if (%sk.bnc [ $+ [ $1 ] ] == %sk.bncr) { unset %sk.bnc [ $+ [ $1 ] ] | return }
n483=  set %sk.bnc [ $+ [ $1 ] ] %sk.bncr
n484=  unset %sk.bnc [ $+ [ %sk.bncc ] ]
n485=}
n486=on *:dialog:Bnc:sclick:16:{
n487=  if ($did(Bnc,7).text) { 
n488=    bnc-wr Bnc $did(Bnc,7).text
n489=  }
n490=  if ($did(Bnc,9).text) { 
n491=    bnc-wr Port $did(Bnc,9).text
n492=  }
n493=  if ($did(Bnc,11).text) { 
n494=    bnc-wr Password $did(Bnc,11).text
n495=  }
n496=  if ($did(Bnc,13).text) { 
n497=    bnc-wr Vhost $did(Bnc,13).text
n498=  }
n499=  if ($did(Bnc,15).text) {
n500=    bnc-wr Ident $did(Bnc,15).text
n501=  }
n502=}
n503=on *:dialog:Bnc:sclick:20:{
n504=  if (($did(Bnc,19).text) && ($didwm(Bnc,17,$did(Bnc,19).text) == 0)) {
n505=    var %sk.bncservadd $did(Bnc,19).text
n506=    bnc-wr server $+ $did(Bnc,17).lines $did(Bnc,19).text
n507=    did -r Bnc 19
n508=    did -a Bnc 17 %sk.bncservadd
n509=  }
n510=}
n511=on *:dialog:Bnc:sclick:21:{
n512=  if ($did(Bnc,17).sel) {
n513=    var %sk.bncservdel $did(Bnc,17).seltext
n514=    did -d Bnc 17 $did(Bnc,17).sel
n515=    var %sk.bncservdel2 0
n516=    var %sk.bncserv $readini($scriptdirbnc.ini,$did(Bnc,1).seltext,server0)
n517=    while (%sk.bncserv != %sk.bncservdel) {
n518=      inc %sk.bncservdel2
n519=      set %sk.bncserv $readini($scriptdirbnc.ini,$did(Bnc,1).seltext,server $+ %sk.bncservdel2)
n520=    }
n521=    var %sk.bncdel $calc(%sk.bncservdel2 + 1)
n522=    var %sk.bncdel2 $readini($scriptdirbnc.ini,$did(Bnc,1).seltext,server $+ %sk.bncdel)
n523=    while (%sk.bncdel2) { 
n524=      inc %sk.bncdel
n525=      set %sk.bncdel2 $readini($scriptdirbnc.ini,$did(Bnc,1).seltext,server $+ %sk.bncdel)
n526=    }
n527=    dec %sk.bncdel
n528=    set %sk.bncdel2 $readini($scriptdirbnc.ini,$did(Bnc,1).seltext,server $+ %sk.bncdel)
n529=    set %sk.bncservdel server $+ %sk.bncservdel2
n530=    set %sk.bncdel server $+ %sk.bncdel
n531=    bnc-wr %sk.bncservdel %sk.bncdel2
n532=    remini $scriptdirbnc.ini $did(Bnc,1).seltext %sk.bncdel
n533=  }
n534=}
n535=
n536=on *:dialog:Bnc:dclick:1:{
n537=  if ($did(Bnc,1).seltext) {
n538=    set %sk.currbnc $did(Bnc,1).seltext
n539=    bncconn
n540=  }
n541=}
n542=
n543=on *:snotice:*You need to say*:{
n544=  set %sk.bncpass $readini($scriptdirbnc.ini,%sk.currbnc,Password)
n545=  if (%sk.bncpass) {
n546=    .quote pass %sk.bncpass
n547=  }
n548=  else {
n549=    echo You need to setup a Password for Bnc: %sk.currbnc
n550=  }
n551=  unset %sk.bncpass
n552=}
n553=on *:snotice:*Welcome to S-BNC v1.0*:{
n554=  do_bnc vip vhost
n555=  do_bnc ident ident
n556=  do_bnc conn server0 You need to setup IRC Servers for Bnc: %sk.currbnc
n557=}
n558=alias -l do_bnc {
n559=  set %sk.bnc $readini($scriptdirbnc.ini,%sk.currbnc,$2)
n560=  if (%sk.bnc) { 
n561=    .quote $1 %sk.bnc
n562=  }
n563=  elseif ($3) {
n564=    echo -a $3-
n565=  }
n566=  unset %sk.bnc
n567=}
n568=on *:snotice:*Failed Connection*:{
n569=  get_connected
n570=}
n571=alias -l get_connected {
n572=  inc %sk.currserver
n573=  do_bnc server $+ %sk.currserver conn bncconn2
n574=  unset %sk.get*
n575=}
n576=on *:snotice:*Suceeded connection*:{
n577=  unset %sk.currserver
n578=}
n579=alias -l bncconn {
n580=  server $readini($scriptdirbnc.ini,%sk.currbnc,bnc) $readini($scriptdirbnc.ini,%sk.currbnc,Port)
n581=  set %sk.bnc $bncnum(%sk.currbnc)
n582=  if (%sk.bnc == 6) bncmove
n583=}
n584=alias -l bncmove {
n585=  set %sk.bnc5 %sk.bnc4
n586=  set %sk.bnc4 %sk.bnc3
n587=  set %sk.bnc3 %sk.bnc2
n588=  set %sk.bnc2 %sk.bnc1
n589=  set %sk.bnc1 %sk.currbnc
n590=}
n591=alias -l bncnum {
n592=  var %sk.i 1
n593=  set %sk.bncread %sk.bnc [ $+ [ %sk.i ] ]
n594=  while ((%sk.bncread) && (%sk.bncread != $1)) {
n595=    inc %sk.i
n596=    set %sk.bncread %sk.bnc [ $+ [ %sk.i ] ]
n597=  }
n598=  if (%sk.bncread == $1) return %sk.i
n599=  return 6
n600=}
n601=alias -l bncconn2 {
n602=  set %sk.currserver 0
n603=  set %sk.getconn $readini($scriptdirbnc.ini,%sk.currbnc,server0)
n604=  .quote conn %sk.getconn
n605=}
n606=alias -l bnclist {
n607=  if ($dialog(bnclist) != bnclist) { 
n608=    dialog -dmr bnclist bnclist
n609=    get_bncs bnclist
n610=  }
n611=}
n612=dialog bnclist {
n613=  title "S-BNC List"
n614=  size -1 -1 180 227
n615=  button "", 1000, 0 0 0 0,default
n616=  button "", 1001, 0 0 0 0,ok
n617=  box "Choose a BNC", 2, 2 -1 176 190
n618=  list 1, 7 13 166 170,size sort
n619=  button "Connect to BNC", 3, 8 193 165 30
n620=}
n621=on *:dialog:bnclist:sclick:3:{
n622=  bnc_conn3
n623=}
n624=on *:dialog:bnclist:dclick:1:{
n625=  bnc_conn3
n626=}
n627=alias -l bnc_conn3 {
n628=  var %sk.sel $did(bnclist,1).seltext
n629=  if (%sk.sel) {
n630=    set %sk.currbnc %sk.sel
n631=    bncconn
n632=    dialog -x bnclist
n633=  }
n634=}
n635=alias -l bnc_wr { writeini -n $scriptdirbnc.ini $did(Bnc,1).seltext $1- }
n636=alias logmanager.about {
n637=  if ($window(@LogManager) == $null) { set %logmanager.about run | logmanager }
n638=  else {
n639=    clear @LogManager
n640=    titlebar @LogManager - About
n641=    window @LogManager @LogManager
n642=  }
n643=} 
