[script]
n0=#bandy.command on
n1=alias nsetup {
n2=  if ($isid) return
n3=  bandy.dialog $1-
n4=}
n5=#bandy.command end
n6=
n7=; # /autojoin
n8=; # Betritt die eingestellten Kanäle für das aktive Netzwerk
n9=; ##########################################################
n10=
n11=#bandy.command.autojoin on
n12=alias autojoin {
n13=  if ($isid) return
n14=  bandy.autojoin $1-
n15=}
n16=#bandy.command.autojoin end
n17=
n18=; ###################
n19=; # Interne Aliases #
n20=; ###################
n21=
n22=alias -l bandy.version return 1.0
n23=
n24=; # /bandy.autojoin
n25=; # Betritt die eingestellten Kanäle für das aktive Netzwerk
n26=; ##########################################################
n27=
n28=alias -l bandy.autojoin {
n29=  var %chans,%network = $bandy.network,%i = 1
n30=  if ($istok($hget(bandy,network),%network,32)) %chans = $hget(bandy,$+(%network,_chan))
n31=  else %chans = $hget(bandy,chan)
n32=  var %j = $numtok(%chans,32)
n33=  while (%i <= %j) {
n34=    join $replace($gettok(%chans,%i,32),$chr(58),$chr(32))
n35=    inc %i
n36=  }
n37=}
n38=
n39=; # /bandy.aautojoin
n40=; # Verzögert, falls eingestellt, den Autojoin
n41=; ############################################
n42=
n43=alias -l bandy.aautojoin {
n44=  var %delay,%delaysecs
n45=  if ($istok($hget(bandy,network),$bandy.network,32)) {
n46=    %delay = $hget(bandy,$+($bandy.network,_Delay))
n47=    %delaysecs = $hget(bandy,$+($bandy.network,_Delaysecs))
n48=  }
n49=  else {
n50=    %delay = $hget(bandy,Delay)
n51=    %delaysecs = $hget(bandy,Delaysecs)
n52=  }
n53=  if (%delay == 1) && (%delaysecs isnum) .timer 1 %delaysecs bandy.autojoin
n54=  else bandy.autojoin
n55=}
n56=
n57=; # /bandy.automode
n58=; # Setzt die eingestellten ConnectModes für das aktive Netzwerk
n59=; ##############################################################
n60=
n61=alias -l bandy.automode {
n62=  var %modes
n63=  if ($istok($hget(bandy,network),$bandy.network,32)) %modes = $hget(bandy,$+($bandy.network,_ConnectMode))
n64=  else %modes = $hget(bandy,ConnectMode)
n65=  if (%modes) mode $me %modes
n66=}
n67=
n68=; # /bandy.autoopermode
n69=; # Setzt die eingestellten OperModes für das aktive Netzwerk
n70=; ###########################################################
n71=
n72=alias -l bandy.autoopermode {
n73=  var %modes
n74=  if ($istok($hget(bandy,network),$bandy.network,32)) %modes = $hget(bandy,$+($bandy.network,_OperMode))
n75=  else %modes = $hget(bandy,OperMode)
n76=  if (%modes) mode $me %modes
n77=}
n78=
n79=; # /bandy.autooper
n80=; # Führt /oper mit den eingestellten Parametern aus
n81=; ##################################################
n82=
n83=alias -l bandy.autooper {
n84=  var %oper
n85=  if ($istok($hget(bandy,network),$bandy.network,32)) %oper = $hget(bandy,$+($bandy.network,_ConnectOper))
n86=  else %oper = $hget(bandy,ConnectOper)
n87=  if (%oper) oper %oper
n88=}
n89=
n90=; # /bandy.autoident
n91=; # Identifiziert den aktuellen Nick bei den Services
n92=; ###################################################
n93=
n94=alias -l bandy.autoident {
n95=  if ($istok($hget(bandy,network),$bandy.network,32)) var %pass = $hget(bandy,$+($bandy.network,_IdentNicks))
n96=  else var %pass = $hget(bandy,IdentNicks)
n97=  if (%pass) bandy.ident %pass
n98=}
n99=alias -l bandy.ident {
n100=  if ($bandy.network == QuakeNet) {
n101=    var %user = $gettok($gettok($1-,1,32),1,58)
n102=    var %pass = $gettok($gettok($1-,1,32),2,58)
n103=    !.msg Q@CServe.quakenet.org auth %user %pass
n104=  }
n105=  else {
n106=    var %pass = $gettok($wildtok($1-,$+($me,:*),1,32),2,58)
n107=    !.nickserv identify %pass
n108=    set %passghost %pass
n109=    set %nickghost $me
n110=  }
n111=}
n112=
n113=alias bandy.ghost.holen {
n114=  if ($bandy.network == QuakeNet) {
n115=    var %user = $gettok($gettok($1-,1,32),1,58)
n116=    var %pass = $gettok($gettok($1-,1,32),2,58)
n117=    var $me != %nickghost
n118=    !.msg Q@CServe.quakenet.org auth %user %pass
n119=  }
n120=  else {
n121=    var %pass = $gettok($wildtok($1-,$+($me,:*),1,32),2,58)
n122=    var $me != %nickghost
n123=    !.nick %nickghost
n124=    !.whois %nickghost
n125=    !.nickserv ghost %nickghost %passghost
n126=    !.nick %nickghost
n127=  }
n128=}
n129=
n130=
n131=; # /bandy.autoperform
n132=; # Führt die Perform-Kommandos für das aktive Netzwerk aus
n133=; #########################################################
n134=
n135=alias -l bandy.autoperform {
n136=  var %file
n137=  if ($istok($hget(bandy,network),$bandy.network,32)) %file = $bandy.sfile($+(perform\,$bandy.network,_perform))
n138=  else %file = $bandy.sfile(perform\perform)
n139=  if ($isfile(%file)) .play -c status %file 0
n140=}
n141=
n142=; # /bandy.dialog
n143=; # Öffnet den Setup-Dialog
n144=; #########################
n145=
n146=alias -l bandy.dialog {
n147=  if ($dialog(bandy.setup)) dialog -v bandy.setup
n148=  else dialog -m bandy.setup bandy.setup
n149=  if ($1) && ($istok($hget(bandy,network),$1,32)) {
n150=    did -c bandy.setup 2 $didwm(bandy.setup,2,$1)
n151=    bandy.setup.tempload $1
n152=  }
n153=}
n154=
n155=; # $bandy.sfile(file.ext)
n156=; # Gibt Dateipfad zurück für Datei in Script-Verzeichnis
n157=; # Format: "x:\path\file.ext
n158=; #######################################################
n159=
n160=alias -l bandy.sfile {
n161=  if ($version > 5.9) return $+(",$scriptdir,$1-,")
n162=  else return [ " $+ [ $scriptdir ] $+ [ $1- ] $+ " ]
n163=}
n164=
n165=; # $bandy.user
n166=; # Gibt user32.dll oder user.exe zurück Abhängig vom OS
n167=; ######################################################
n168=
n169=alias -l bandy.user {
n170=  if ($istok(XP 2K,$os,32)) return user32.dll
n171=  else return user.exe
n172=}
n173=
n174=; # $bandy.network
n175=; # Erweitert $network
n176=; ####################
n177=
n178=alias bandy.network {
n179=  if ($network) && (*.ChatNet.Org !iswm $server) && ($network != ETG) return $network
n180=  else {
n181=    if (*ChatNet.Org iswm $server) return ChatNet
n182=    elseif ($network == ETG) return EnterTheGame
n183=    elseif (*.*.quakenet.eu.org iswm $server) return QuakeNet
n184=    elseif (*.funchat.net iswm $server) return FunChat.Net
n185=    elseif (*.ca.us.webchat.org iswm $server) return WebChat
n186=    elseif (*.galaxynet.org iswm $server) return GalaxyNet
n187=    elseif ($istok($_efnet,$server,32)) return EFnet
n188=    elseif ($istok($_linknet,$server,32)) return LinkNet
n189=    elseif (*.GamesNET.net iswm $server) return GamesNET
n190=    elseif ($istok($_ircnet,$server,32)) return IRCnet
n191=  }
n192=}
n193=alias -l _efnet { return irc.homelien.no irc.hub.uk irc.du.se efnet.demon.co.uk irc.light.se irc.rt.ru irc.hemmet.chalmers.se irc.efnet.pl efnet.vuurwerk.nl irc.ins.net.uk irc.carrier1.net.uk irc.exodus.net ircd.lightning.net irc.lightning.net irc.mindspring.com *.umich.edu irc.Prison.NET irc.solidstreaming.net irc-h.total.net irc2.magic.ca irc.etsmtl.ca irc.magic.ca irc-h.powersurfr.com irc.powersurfr.com irc.plur.net ircd.east.gblx.net irc.nijenrode.nl irc.east.gblx.net *.concentric.net services.us *.umn.edu irc.emory.edu irc.colorado.edu *.stanford.edu *.lagged.org irc.mcs.net irc-h.magic.ca irc.isdnet.fr irc.gigabell.de hub.il irc.inter.net.il efnet.cs.hut.fi }
n194=alias -l _linknet { return irc.panthar.net irc.sh.cvut.cz irc.securebsd.de irc.isecomm.com irc.link-net.nl irc.no.link-net.org irc.fliphead.com irc.gamiix.com irc.mirkwarriors.net irc.orkan.net irc.glassbilen.net irc-c.netfire.com irc.c-com.org irc.kinexuseurope.co.uk }
n195=alias -l _ircnet { return irc.fr.ircnet.net irc.ircd.it ircnet.netvision.net.il irc.tokyo.wide.ad.jp irc.seed.net.tw linz.irc.at vienna.irc.at irc.belnet.be ircnet.wanadoo.be irc.felk.cvut.cz irc.fu-berlin.de irc.freenet.de irc.belwue.de irc.ircnet.dk irc.estpak.ee irc.cs.hut.fi irc.ee.auth.gr irc.elte.hu irc.ircnet.is irc.simnet.is irc.tin.it irc.nl.uu.net irc.xs4all.nl irc.snt.utwente.nl irc.sci.kun.nl irc.ifi.uio.no irc.pvv.ntnu.no lublin.irc.pl warszawa.irc.pl irc.msu.ru irc.ludd.luth.se ircnet.demon.co.uk ircnet.easynet.co.uk irc.stealth.net BelWue.DE freenet.de }
n196=
n197=; # /bandy.setup.tempsave
n198=; # Speichert aktuelle Einstellungen des Setup-Dialogs
n199=; # in temporärer Hash-Table ab.
n200=; ####################################################
n201=
n202=alias -l bandy.setup.tempsave {
n203=  var %bandy.chan = $did(bandy.setup,6).lines,%i = 1,%bandy.chans,%j = 1,%bandy.network = $did(bandy.setup,2).lines,%bandy.networks,%bandy.prefix = $iif($did(bandy.setup,2).seltext != --Default--,$+($did(bandy.setup,2).seltext,_)),%bandy.ident = $did(bandy.setup,28).lines,%bandy.idents,%k = 1
n204=  while (%i <= %bandy.chan) {
n205=    %bandy.chans = %bandy.chans $did(bandy.setup,6,%i).text
n206=    inc %i
n207=  }
n208=  while (%j <= %bandy.network) {
n209=    %bandy.networks = %bandy.networks $did(bandy.setup,2,%j).text
n210=    inc %j
n211=  }
n212=  while (%k <= %bandy.ident) {
n213=    %bandy.idents = %bandy.idents $did(bandy.setup,28,%k).text
n214=    inc %k
n215=  }
n216=  if (!$hget(bandy.temp)) hmake bandy.temp $calc(16 * $did(bandy.setup,2).lines)
n217=  hadd bandy.temp $+(%bandy.prefix,chan) %bandy.chans
n218=  hadd bandy.temp $+(%bandy.prefix,autojoin) $did(bandy.setup,12).state
n219=  hadd bandy.temp $+(%bandy.prefix,ConnectSetMode) $did(bandy.setup,14).state
n220=  hadd bandy.temp $+(%bandy.prefix,OperSetMode) $did(bandy.setup,17).state
n221=  hadd bandy.temp $+(%bandy.prefix,ConnectSetOper) $did(bandy.setup,19).state
n222=  ; hadd bandy.temp $+(%bandy.prefix,RegainNick) $did(bandy.setup,24).state
n223=  hadd bandy.temp $+(%bandy.prefix,Perform) $did(bandy.setup,34).state
n224=  hadd bandy.temp $+(%bandy.prefix,ConnectMode) $did(bandy.setup,16)
n225=  hadd bandy.temp $+(%bandy.prefix,OperMode) $did(bandy.setup,18)
n226=  hadd bandy.temp $+(%bandy.prefix,ConnectOper) $did(bandy.setup,20)
n227=  ; hadd bandy.temp $+(%bandy.prefix,PermNick) $did(bandy.setup,25)
n228=  hadd bandy.temp $+(%bandy.prefix,AutoIdent) $did(bandy.setup,27).state
n229=  hadd bandy.temp $+(%bandy.prefix,IdentNicks) %bandy.idents
n230=  hadd bandy.temp network $remtok(%bandy.networks,--Default--,32)
n231=  hadd bandy.temp $+(%bandy.prefix,Delay) $did(bandy.setup,36).state
n232=  hadd bandy.temp $+(%bandy.prefix,Delaysecs) $did(bandy.setup,37)
n233=  savebuf -o bandy.setup 35 $bandy.sfile($+(perform\temp,%bandy.prefix,perform))
n234=}
n235=
n236=; # /bandy.setup.tempload network
n237=; # Lädt Einstellungen aus temporärer Hash-Table für
n238=; # angegebenes Netzwerk in den Setup-Dialog.
n239=; ##################################################
n240=
n241=alias -l bandy.setup.tempload {
n242=  var %bandy.prefix = $iif($1 != --Default--,$+($1,_)),%bandy.chans = $hget(bandy.temp,$+(%bandy.prefix,chan)),%j = $numtok(%bandy.chans,32),%i = 1,%bandy.idents = $hget(bandy.temp,$+(%bandy.prefix,IdentNicks)),%k = $numtok(%bandy.idents,32),%l = 1,%m = 1,%line,%win
n243=  did -r bandy.setup 6,16,18,20,28,35,37
n244=  did -u bandy.setup 12,14,17,19,27,34,36
n245=  ;  did -r bandy.setup 6,16,18,20,25,28,35,37
n246=  ;  did -u bandy.setup 12,14,17,19,24,27,34,36
n247=
n248=  while (%i <= %j) {
n249=    did -a bandy.setup 6 $gettok(%bandy.chans,%i,32)
n250=    inc %i
n251=  }
n252=  while (%l <= %k) {
n253=    did -a bandy.setup 28 $gettok(%bandy.idents,%l,32)
n254=    inc %l
n255=  }
n256=  if ($hget(bandy.temp,$+(%bandy.prefix,autojoin)) == 1) did -c bandy.setup 12
n257=  if ($hget(bandy.temp,$+(%bandy.prefix,ConnectSetMode)) == 1) did -c bandy.setup 14
n258=  if ($hget(bandy.temp,$+(%bandy.prefix,OperSetMode)) == 1) did -c bandy.setup 17
n259=  if ($hget(bandy.temp,$+(%bandy.prefix,ConnectSetOper)) == 1) did -c bandy.setup 19
n260=  ; if ($hget(bandy.temp,$+(%bandy.prefix,RegainNick)) == 1) did -c bandy.setup 24
n261=  if ($hget(bandy.temp,$+(%bandy.prefix,AutoIdent)) == 1) did -c bandy.setup 27
n262=  if ($hget(bandy.temp,$+(%bandy.prefix,Perform)) == 1) did -c bandy.setup 34
n263=  if ($hget(bandy.temp,$+(%bandy.prefix,Delay)) == 1) did -c bandy.setup 36
n264=  did -a bandy.setup 16 $hget(bandy.temp,$+(%bandy.prefix,ConnectMode))
n265=  did -a bandy.setup 18 $hget(bandy.temp,$+(%bandy.prefix,OperMode))
n266=  did -a bandy.setup 20 $hget(bandy.temp,$+(%bandy.prefix,ConnectOper))
n267=  ; did -a bandy.setup 25 $hget(bandy.temp,$+(%bandy.prefix,PermNick))
n268=  did -a bandy.setup 37 $hget(bandy.temp,$+(%bandy.prefix,Delaysecs))
n269=  %win = @__loadperform
n270=  close -@ %win
n271=  window -hls %win
n272=  if ($isfile($bandy.sfile($+(perform\temp,%bandy.prefix,perform)))) loadbuf %win $bandy.sfile($+(perform\temp,%bandy.prefix,perform))
n273=  elseif ($isfile($bandy.sfile($+(perform\,%bandy.prefix,perform)))) loadbuf %win $bandy.sfile($+(perform\,%bandy.prefix,perform))
n274=  while (%m <= $line(%win,0)) {
n275=    %line = $line(%win,%m)
n276=    if ((%line) && (%line != $chr(32))) did -a bandy.setup 35 %line
n277=    inc %m
n278=  }
n279=  close -@ %win
n280=}
n281=
n282=; ##########
n283=; # Remote #
n284=; ##########
n285=
n286=; # Beim Starten
n287=; # Public Aliases nur aktivieren, falls nicht durch anderes
n288=; # Script genutzt.
n289=; # Einstellungen in Hash-Table laden
n290=; ###########################################################
n291=
n292=on *:start: {
n293=  .disable #bandy.command
n294=  if (!$isalias(nsetup)) .enable #bandy.command
n295=  .disable #bandy.command.autojoin
n296=  if (!$isalias(autojoin)) .enable #bandy.command.autojoin
n297=  if ($hget(bandy)) hfree bandy
n298=  hmake bandy 10
n299=  if ($isfile($bandy.sfile(nsetup.hsh))) hload bandy $bandy.sfile(nsetup.hsh)
n300=}
n301=
n302=; # Sobald Verbindung besteht
n303=; # AutoJoin aktiv? -> /bandy.autojoin
n304=; # Mode on Connect aktiv? -> /bandy.automode
n305=; # /oper aktiv? -> /bandy.autooper
n306=; # Perform aktiv? -> /bandy.autoperform
n307=; ##########################################
n308=
n309=on *:connect: {
n310=  if ($istok($hget(bandy,network),$bandy.network,32)) {
n311=    if ($hget(bandy,$+($bandy.network,_autojoin)) == 1) bandy.aautojoin
n312=    if ($hget(bandy,$+($bandy.network,_ConnectSetMode)) == 1) bandy.automode
n313=    if ($hget(bandy,$+($bandy.network,_ConnectSetOper)) == 1) bandy.autooper
n314=    if ($hget(bandy,$+($bandy.network,_Perform)) == 1) bandy.autoperform
n315=    if ($hget(bandy,$+($bandy.network,_AutoIdent)) == 1) && (!$istok($network,$bandy.network,32)) bandy.autoident
n316=  }
n317=  else {
n318=    if ($hget(bandy,autojoin) == 1) bandy.aautojoin
n319=    if ($hget(bandy,ConnectSetMode) == 1) bandy.automode
n320=    if ($hget(bandy,ConnectSetOper) == 1) bandy.autooper
n321=    if ($hget(bandy,Perform) == 1) bandy.autoperform
n322=    if ($hget(bandy,AutoIdent) == 1) && (!$istok($network,$bandy.network,32)) bandy.autoident
n323=  }
n324=}
n325=
n326=; # Sobald Operator-Status vergeben ist
n327=; # Falls Mode On Oper aktiv, führe /bandy.autoopermode aus
n328=; ########################################################
n329=
n330=raw 381:*: {
n331=  if ($istok($hget(bandy,network),$bandy.network,32)) {
n332=    if ($hget(bandy,$+($bandy.network,_OperSetMode)) == 1) bandy.autoopermode
n333=  }
n334=  else {
n335=    if ($hget(bandy,OperSetMode) == 1) bandy.autoopermode
n336=  }
n337=}
n338=
n339=; # Sobald Notice von NickServ kommt,
n340=; # den Nick zu identifizieren
n341=; # /bandy.autoident ausführen
n342=; ##########################################
n343=
n344=on *:notice:*:?: {
n345=  if ($nick == NickServ) && ($bandy.network == $network) {
n346=    if (This nickname is registered and protected. If it is your == $1-) || $&
n347=      (Dieser Nickname ist registriert und geschützt. Wenn es dein Nick == $1-) || $&
n348=      (Dieser Nickname ist registriert und geschützt.  Wenn es dein Nickname == $1-) || $&
n349=      (This nick is owned by someone else. Please choose another. == $1-) || $&
n350=      (This nick is owned by someone else. You must select a different one. == $1-) || $&
n351=      (Falls Sie nicht innerhalb der nächsten Minute Ihren Chatnamen ändern, wird er automatisch geändert. == $1-) || $&
n352=      (This nick is owned by someone else. Please choose another one. == $1-) {
n353=      if ($istok($hget(bandy,network),$bandy.network,32)) {
n354=        if ($hget(bandy,$+($bandy.network,_AutoIdent)) == 1) bandy.autoident
n355=      }
n356=      else {
n357=        if ($hget(bandy,AutoIdent) == 1) bandy.autoident
n358=      }
n359=    }
n360=  }
n361=}
n362=
n363=on *:nick: {
n364=  if $nick == $me {
n365=    if (!$istok($network,$bandy.network,32)) {
n366=      if ($istok($hget(bandy,network),$bandy.network,32)) {
n367=        if ($hget(bandy,$+($bandy.network,_AutoIdent)) == 1) bandy.autoident
n368=      }
n369=      else {
n370=        if ($hget(bandy,AutoIdent) == 1) bandy.autoident
n371=      }
n372=    }
n373=  }
n374=}
n375=
n376=alias -l bandy.filelist return nsetup.hsh nsetup-readme.txt getdir.dll Settings-File Documentation Dynamic-Link-Library
n377=
n378=; ###########
n379=; # Dialogs #
n380=; ###########
n381=
n382=; # Setup-Dalog Table
n383=; ###################
n384=
n385=dialog -l bandy.setup {
n386=  title "Network Setup [/nsetup]"
n387=  size -1 -1 165 180
n388=  option dbu
n389=  box "Network", 1, 5 5 155 30
n390=  combo 2, 10 16 60 50, size drop
n391=  button "N&eu", 3, 75 15 37 12
n392=  button "Lö&schen", 4, 117 15 37 12
n393=  tab "Au&tojoin", 5, 5 40 155 120
n394=  button "&Neu", 7, 118 65 37 12, tab 5
n395=  button "&Löschen", 8, 118 80 37 12, tab 5
n396=  button "&Edit", 9, 118 95 37 12, tab 5
n397=  check "&Join diesen Channel beim connect", 12, 10 55 90 10, tab 5
n398=  list 6, 10 65 103 75, tab 5 size vsbar
n399=  button "&Rauf", 21, 118 110 37 12, tab 5
n400=  button "&Runter", 22, 118 125 37 12, tab 5
n401=  check "Autojoin nach", 36, 10 145 50 10, tab 5
n402=  edit "", 37, 60 145 15 10, tab 5
n403=  text "Sekunden ausführen", 38, 80 147 60 8, tab 5
n404=  tab "Modes/Misc", 13
n405=  check "&Set on Connect", 14, 15 66 50 10, tab 13
n406=  box "Modes", 15, 10 56 145 45, tab 13
n407=  edit "", 16, 65 66 85 10, tab 13
n408=  check "S&et on Oper", 17, 15 76 50 10, tab 13
n409=  edit "", 18, 65 76 85 10, tab 13
n410=  check "/o&per", 19, 15 86 50 10, tab 13
n411=  edit "", 20, 65 86 85 10, tab 13
n412=  box "Misc", 23, 10 105 145 25, tab 13
n413=  text "Nick wiederholen", 24, 15 115 60 10, tab 13
n414=  button "AN", 39, 75 115 20 10, tab 13
n415=  button "AUS", 40, 100 115 20 10, tab 13
n416=  tab "Auto Identify", 26
n417=  check "Identify diese Nicks automatisch", 27, 10 55 95 10, tab 26
n418=  list 28, 10 65 103 90, tab 26 size vsbar
n419=  button "&Neu", 29, 118 65 37 12, tab 26
n420=  button "&Löschen", 30, 118 80 37 12, tab 26
n421=  button "&Edit", 32, 118 95 37 12, tab 26
n422=  tab "Perform", 33
n423=  check "Befehle ausführen beim Connect (trenne mit |)", 34, 10 55 130 10, tab 33
n424=  edit "", 35, 10 65 145 90, tab 33 multi return autohs autovs hsbar vsbar
n425=  button "&OK", 10, 81 165 37 12, ok
n426=  button "&Abbruch", 11, 123 165 37 12, cancel
n427=  text "", 31, 5 169 70 8
n428=}
n429=
n430=; # Input-Dialog Table
n431=; # Wird für versch. Eingaben verwendet
n432=; #####################################
n433=
n434=dialog -l bandy.input {
n435=  title ""
n436=  size -1 -1 145 52
n437=  option dbu
n438=  text "", 1, 30 5 110 13
n439=  edit "", 2, 30 20 110 10, hide result autohs disable
n440=  button "&OK", 3, 45 35 37 12, ok default
n441=  button "&Abbruch", 4, 88 35 37 12, cancel
n442=  icon 5, 5 5 16 16
n443=  combo 6, 30 20 110 50, disable hide sort size edit drop
n444=}
n445=;#Nickholen An/Aus
n446=;##################
n447=
n448=on *:dialog:bandy.setup:sclick:39: { enable #nickholen | /echo -a  $+ %sysfarben5 $+ »»»  $+ %sysfarben6 $+ Nick wiederholen ist nun AN }
n449=on *:dialog:bandy.setup:sclick:40: { disable #nickholen | /echo -a  $+ %sysfarben5 $+ »»»  $+ %sysfarben6 $+ Nick wiederholen ist nun AUS }
n450=
n451=; #################
n452=; # Dialog Events #
n453=; #################
n454=
n455=; # Init-Events für Input-Dialoge
n456=; # Texte, Titel und Art der Eingabemöglichkeit festlegen.
n457=; # Teilweise verden Vorschläge für Eingabe generiert.
n458=; ########################################################
n459=
n460=on *:dialog:bandy.networkadd:init:0: {
n461=  var %bandy.networks,%i = 1,%j = $scon(0)
n462=  while (%i <= %j) {
n463=    scid $scon(%i)
n464=    %bandy.networks = %bandy.networks $bandy.network
n465=    inc %i
n466=  }
n467=  if (%bandy.networks) { did -a bandy.networkadd 1 Eintrag Network Name, ohne Leerzeichen $+ $crlf $+ [Verbindung: %bandy.networks $+ ] }
n468=  else { did -a bandy.networkadd 1 Eintrag Network Name $+ $crlf $+ [Nur ein Wort bitte] }
n469=  dialog -t bandy.networkadd Network Setup: Hinzufügen Network
n470=  did -evf bandy.networkadd 2
n471=  did -g bandy.networkadd 5 2 $+($gettok($dll($bandy.sfile(getdir.dll),GetDir,System),2-,32),\,$bandy.user)
n472=}
n473=on *:dialog:bandy.channeladd:init:0: {
n474=  var %bandy.chan = $chan(0)
n475=  did -a bandy.channeladd 1 Eintrag der Channels, ohne Leerzeichen $+ $crlf $+ [Format: #chan:pass]
n476=  did -g bandy.channeladd 5 2 $+($gettok($dll($bandy.sfile(getdir.dll),GetDir,System),2-,32),\,$bandy.user)
n477=  dialog -t bandy.channeladd Network Setup: Hinzufügen Channel
n478=  did -evf bandy.channeladd 6
n479=  while (%bandy.chan > 0) {
n480=    did -a bandy.channeladd 6 $chan(%bandy.chan) $+ $iif($chan(%bandy.chan).key,$+(:,$chan(%bandy.chan).key))
n481=    dec %bandy.chan
n482=  }
n483=}
n484=on *:dialog:bandy.identadd:init:0: {
n485=  did -a bandy.identadd 1 Eintrag Nicks, ohne Leerzeichen $+ $crlf $+ [Format: nick:pass]
n486=  did -g bandy.identadd 5 2 $+($gettok($dll($bandy.sfile(getdir.dll),GetDir,System),2-,32),\,$bandy.user)
n487=  dialog -t bandy.identadd Network Setup: Hinzufügen AutoIdent-Nick
n488=  did -aevf bandy.identadd 2 $scid($activecid).me
n489=}
n490=on *:dialog:bandy.channeledit:init:0: {
n491=  did -a bandy.channeledit 1 Edit Channelname/Password $+ $crlf $+ [Format: #chan:pass]
n492=  did -g bandy.channeledit 5 2 $+($gettok($dll($bandy.sfile(getdir.dll),GetDir,System),2-,32),\,$bandy.user)
n493=  dialog -t bandy.channeledit Network Setup: Edit Channel
n494=  did -aevf bandy.channeledit 2 $did(bandy.setup,6).seltext
n495=}
n496=on *:dialog:bandy.identedit:init:0: {
n497=  did -a bandy.identedit 1 Edit Nickname/Password $+ $crlf $+ [Format: nick:pass]
n498=  did -g bandy.identedit 5 2 $+($gettok($dll($bandy.sfile(getdir.dll),GetDir,System),2-,32),\,$bandy.user)
n499=  dialog -t bandy.identedit Network Setup: Edit AutoIdent-Nick
n500=  did -aevf bandy.identedit 2 $did(bandy.setup,28).seltext
n501=}
n502=
n503=; # Übertrage Resultat bei OK
n504=; ###########################
n505=
n506=on *:dialog:bandy.channeladd:sclick:3: {
n507=  did -a bandy.channeladd 2 $did(6)
n508=}
n509=
n510=; # Setup-Dialog Events
n511=; #####################
n512=
n513=on *:dialog:bandy.setup:init:0: {
n514=  if ($group(#bandy.command) != on) dialog -t bandy.setup Network Setup
n515=  if ($hget(bandy.temp)) hfree bandy.temp
n516=  hmake bandy.temp 10
n517=  if ($isfile($bandy.sfile(nsetup.hsh))) hload bandy.temp $bandy.sfile(nsetup.hsh)
n518=
n519=  did -a bandy.setup 2 --Default--
n520=  did -c bandy.setup 2 1
n521=
n522=  var %bandy.networks = $hget(bandy.temp,network),%k = 1,%l = $numtok(%bandy.networks,32)
n523=  while (%k <= %l) {
n524=    did -a bandy.setup 2 $gettok(%bandy.networks,%k,32)
n525=    inc %k
n526=  }
n527=  bandy.setup.tempload --Default--
n528=  did -o bandy.setup 31 1 version: $bandy.version
n529=}
n530=on *:dialog:bandy.setup:sclick:2: {
n531=  ; Change Network
n532=  bandy.setup.tempload $did(2).seltext
n533=}
n534=on *:dialog:bandy.setup:sclick:3: {
n535=  ; Add Network
n536=  var %bandy.temp = $dialog(bandy.networkadd,bandy.input,-4),%bandy.tmp
n537=  if (%bandy.temp) {
n538=    if ($regex(%bandy.temp,^[a-zA-Z0-9\.\-]*$)) did -a bandy.setup 2 %bandy.temp
n539=    else {
n540=      if ($chr(32) isin %bandy.temp) %bandy.tmp = $input(Fehler: Man kann keine Leerzeichen verwenden im Network Namen.,516,Network Setup: Fehler)
n541=      else %bandy.tmp = $input(Fehler: Sonderzeichen sind nicht erlaubt im Network Namen.,516,Network Setup: Fehler)
n542=    }
n543=  }
n544=  bandy.setup.tempsave
n545=}
n546=on *:dialog:bandy.setup:sclick:4: {
n547=  ; Remove Network
n548=  if ($did(2).seltext != --Default--) {
n549=    hdel -w bandy.temp $+($did(2).seltext,_*)
n550=    did -d bandy.setup 2 $did(2).sel
n551=    did -c bandy.setup 2 1
n552=    bandy.setup.tempload $did(2).seltext
n553=  }
n554=  else var %bandy.tmp = $input(Fehler: Den Standardeintrag kannst Du nicht löschen.,516,Network Setup: Fehler)
n555=}
n556=on *:dialog:bandy.setup:sclick:7: {
n557=  ; Add Channel
n558=  scid $activecid
n559=  var %bandy.temp = $dialog(bandy.channeladd,bandy.input,-4),%i = 1,%j = $numtok(%bandy.temp,32),%add,%fail,%bandy.tmp,%msg
n560=  if (%bandy.temp) {
n561=    while (%i <= %j) {
n562=      %add = $gettok(%bandy.temp,%i,32)
n563=      if ($didwm(bandy.setup,6,%add) == 0) did -a bandy.setup 6 %add
n564=      else %fail = %fail %add
n565=      inc %i
n566=    }
n567=    if (%fail) {
n568=      %msg = Die folgende Einträge existieren bereits und werden nicht noch mal eingetragen:
n569=      %i = $numtok(%fail,32)
n570=      while (%i) {
n571=        %msg = %msg $+ $crlf $+ $gettok(%fail,%i,32)
n572=        dec %i
n573=      }
n574=      %bandy.tmp = $input(%msg,68,Network Setup: Information)
n575=    }
n576=  }
n577=  bandy.setup.tempsave
n578=}
n579=on *:dialog:bandy.setup:sclick:8: {
n580=  ; Remove Channel
n581=  if ($did(6).sel) {
n582=    did -d bandy.setup 6 $did(6).sel
n583=    bandy.setup.tempsave
n584=  }
n585=}
n586=on *:dialog:bandy.setup:sclick:9: {
n587=  ; Edit Channel
n588=  if ($did(6).sel) {
n589=    var %bandy.temp = $dialog(bandy.channeledit,bandy.input,-4)
n590=    if (%bandy.temp) { did -o bandy.setup 6 $did(6).sel %bandy.temp }
n591=    bandy.setup.tempsave
n592=  }
n593=}
n594=on *:dialog:bandy.setup:sclick:10: {
n595=  ; OK
n596=  bandy.setup.tempsave
n597=  hsave -o bandy.temp $bandy.sfile(nsetup.hsh)
n598=  if ($hget(bandy)) hfree bandy
n599=  hmake bandy 10
n600=  hload bandy $bandy.sfile(nsetup.hsh)
n601=  var %tmp = $findfile($bandy.sfile(perform\),temp*perform,0,1,.copy -o $+(",$1-,") $+(",$nofile($1-),$right($nopath($1-),-4),"))
n602=  var %tmp = $findfile($bandy.sfile(perform\),temp*perform,0,1,.remove $+(",$1-,"))
n603=}
n604=on *:dialog:bandy.setup:sclick:11: {
n605=  var %tmp = $findfile($bandy.sfile(perform\),temp*perform,0,1,.remove $+(",$1-,"))
n606=}
n607=on *:dialog:bandy.setup:sclick:12: {
n608=  ; Tempsave
n609=  bandy.setup.tempsave
n610=  did -f bandy.setup 6
n611=}
n612=on *:dialog:bandy.setup:sclick:14,17,19,24,27,34,36: bandy.setup.tempsave
n613=on *:dialog:bandy.setup:edit:16,18,20,25,35,37: bandy.setup.tempsave
n614=on *:dialog:bandy.setup:sclick:21: {
n615=  ; Autojoin Channel Up
n616=  var %line1 = $did(6).seltext,%line2 = $did(6,$calc($did(6).sel - 1)),%sel = $did(6).sel
n617=  if (%sel > 1) {
n618=    did -o bandy.setup 6 %sel %line2
n619=    did -co bandy.setup 6 $calc(%sel - 1) %line1
n620=    bandy.setup.tempsave
n621=  }
n622=}
n623=on *:dialog:bandy.setup:sclick:22: {
n624=  ; Autojoin Channel Down
n625=  var %line1 = $did(6).seltext,%line2 = $did(6,$calc($did(6).sel + 1)),%sel = $did(6).sel
n626=  if (%sel < $did(6).lines) {
n627=    did -o bandy.setup 6 %sel %line2
n628=    did -co bandy.setup 6 $calc(%sel + 1) %line1
n629=    bandy.setup.tempsave
n630=  }
n631=}
n632=on *:dialog:bandy.setup:sclick:29: {
n633=  ; Add Auto Ident Nick
n634=  var %bandy.temp = $dialog(bandy.identadd,bandy.input,-4),%i = 1,%j = $numtok(%bandy.temp,32),%add
n635=  if (%bandy.temp) {
n636=    while (%i <= %j) {
n637=      %add = $gettok(%bandy.temp,%i,32)
n638=      if ($didwm(bandy.setup,28,%add) == 0) did -a bandy.setup 28 %add
n639=      inc %i
n640=    }
n641=  }
n642=  bandy.setup.tempsave
n643=}
n644=on *:dialog:bandy.setup:sclick:30: {
n645=  ; Remove Auto Ident Nick
n646=  if ($did(28).sel) {
n647=    did -d bandy.setup 28 $did(28).sel
n648=    bandy.setup.tempsave
n649=  }
n650=}
n651=on *:dialog:bandy.setup:sclick:32: {
n652=  ; Edit Auto Ident Nick
n653=  if ($did(28).sel) {
n654=    var %bandy.temp = $dialog(bandy.identedit,bandy.input,-4)
n655=    if (%bandy.temp) { did -o bandy.setup 28 $did(28).sel %bandy.temp }
n656=    bandy.setup.tempsave
n657=  }
n658=}
