[script]
n0=;Setup Dialog Example by Pasmal
n1=;Load this file to your remotes (/load -rs dialog.txt)
n2=;To open the dialog, type /ss ([s]cript [s]etup)
n3=alias ss {
n4=  ;-dm creates a [d]esktop [m]odeless dialog.
n5=  dialog -dm setup2 setup2
n6=}
n7=;this table, setup2, is something i threw together. Feel free to change/modify/experiment.
n8=;if you are ever confused with an item, check the dialog.html file at www.helpdesk.mircx.com/documents
n9=dialog setup2 {
n10=  title "Script setup2"
n11=  size -1 -1 500 300
n12=  button "Done",1,375 230 113 60, OK
n13=  box "Personal Preferences",2, 3 3 493 293
n14=  box "About",3, 375 22 112 200
n15=  text "Nick Name:",4, 15 30 64 25
n16=  edit "",5, 74 27 70 20,autohs
n17=  text "Alt Nick Name:",6, 150 30 94 25
n18=  edit "",7, 222 27 70 20,autohs
n19=  text "Real Name:",8, 15 55 64 25
n20=  edit "",9,74 50 70 20
n21=  text "Gender:",10,150 55 50 25
n22=  radio "Male",11,200 52 45 20,group
n23=  radio "Female",12,250 52 70 20
n24=  text "Favourite Channels:",13, 15 88 94 25
n25=  combo 14,15 110 120 140,sort
n26=  button "Add Chan",15, 140 140 84 25
n27=  button "Remove Chan",16, 140 170 84 25
n28=  button "Join Chan",17, 140 200 84 25
n29=  check "Join Channels On Connect",18, 15 240 160 25
n30=  text "Mr Dialog Script     Version: 1.0      Author: Me!                                                    This is just an example setup2 dialog. This dialog lets you set your nicknames, gender, and favourite channels. Of course you could add more like favourite server, passwords, etc...",19,380 37 104 190
n31=  text "Age:",20,150 75 40 25
n32=  combo 21,180 72 70 160,drop
n33=  button "Reset Channel List",22, 15 265 120 25
n34=}
n35=on *:DIALOG:setup2:init:0: {
n36=  ;setup2 is the name of the dialog. init is the event that occurs when the dialog is first created. 0 is the default id for when
n37=  ; an init occurs.
n38=  did -a setup2 21 < 5
n39=  did -a setup2 21 5 to 9
n40=  did -a setup2 21 10 to 14
n41=  did -a setup2 21 15 to 19
n42=  did -a setup2 21 20 to 24
n43=  did -a setup2 21 25 to 29
n44=  did -a setup2 21 29 to 34
n45=  did -a setup2 21 34 to 38
n46=  did -a setup2 21 38 to 42
n47=  did -a setup2 21 43+
n48=  ;those did -a's add items to the drop down combo that selects your age.
n49=  if (%setup2.connect == $null) { set %setup2.connect off }
n50=  if (%setup2.connect == on) { did -c setup2 18 }
n51=  ;this did -c checks the "Join Channels On Connect" if you had previously ticked it
n52=  if (%setup2.nick != $null) { did -a setup2 5 %setup2.nick }
n53=  ;if you had already filled in a nick then this will display it
n54=  if (%setup2.alt != $null) { did -a setup2 7 %setup2.alt }
n55=  ;if you had already filled in a alt. nick then this will display it
n56=  if (%setup2.real != $null) { did -a setup2 9 %setup2.real }
n57=  ;if you had already filled in a real name then this will display it
n58=  if (%setup2.gender == male) { did -c setup2 11 }
n59=  ; if you selected male as the gender, then did -c setup2 11 will put a dot in the male radio box
n60=  if (%setup2.gender == female) { did -c setup2 12 }
n61=  ; if you selected female as the gender, then did -c setup2 12 will put a dot in the female radio box
n62=  update.setup2
n63=  ;update.setup2 is a custom alias that adds all the favourite channels to the fav. channels combo.
n64=}
n65=alias -l update.setup2 {
n66=  ;this alias gets your favourite channels and displays them
n67=  ;the fav. channels list is stored in a variable, %setup2.list
n68=  ;An example setup2.list: #chan1,#chan2,#chan3, etc....
n69=  did -r setup2 14
n70=  ;did -r removes all the text in the combo box
n71=  set %temp.total $count(%setup2.list,$chr(44))
n72=  set %temp.count 0
n73=  :start
n74=  inc %temp.count 1
n75=  ;did -a adds the text to the combo box.
n76=  did -a setup2 14 $gettok(%setup2.list,%temp.count,44)
n77=  if (%temp.count < %temp.total) { goto start }
n78=}
n79=on *:DIALOG:setup2:edit:*: {
n80=  ;this event reacts when someone types text in any editbox in the setup2 dialog.
n81=  ; the $did(id).text identifier returns all the text in the editbox.
n82=  ; if you use $did outside an on DIALOG event, then you must specify the dialog name
n83=  ; i.e. $did(setup2,5).text 
n84=  if ($did == 5) { 
n85=    set %setup2.nick $did(5).text
n86=    ;the id 5 is the editbox for your nickname 
n87=  }
n88=  if ($did == 7) { 
n89=    set %setup2.alt $did(7).text
n90=    ;the id 7 is the editbox for your alt. name
n91=  }
n92=  if ($did == 9) { 
n93=    set %setup2.real $did(9).text
n94=    ;this id repersents the real name editbox
n95=  }
n96=  if ($did == 21) {
n97=    set %setup2.age $did(21).text
n98=    ;this id repersents the age group selected in the drop down combo
n99=  }
n100=  if ($did == 14) {
n101=    set %setup2.temp.channel $did(14).text
n102=    ;this is the text entered into the editbox in the favourite channels combo
n103=  }
n104=}
n105=on *:DIALOG:setup2:sclick:*: {
n106=  ;this event reacts when a mouse clicks once on an item. 
n107=  if ($did == 22) {
n108=    unset %setup2.list
n109=    update.setup2
n110=    ;the id 22 stands for the "reset channels list" button.
n111=  } 
n112=  if ($did == 15) {
n113=    set %setup2.list %setup2.list $+ %setup2.temp.channel $+ ,
n114=    update.setup2
n115=    ;the id 15 stands for the "Add Chan" button 
n116=  }
n117=  if ($did == 16) {
n118=    set -u1 %setup2.tc %setup2.channel.selected $+ ,
n119=    set %setup2.list $remove(%setup2.list,%setup2.tc)
n120=    update.setup2
n121=    ;the ID 16 stands for the "Remove Chan" button  
n122=  }
n123=  if ($did == 17) {
n124=    join %setup2.channel.selected
n125=    ;the ID 17 stands for the "Join Chan" button
n126=  }
n127=  if ($did == 11) { 
n128=    set %setup2.gender Male 
n129=    ;if the person clicked on the "male" radio box, then this will change the gender to male.
n130=  }
n131=  if ($did == 12) {
n132=    ;and vice versa for female.
n133=    set %setup2.gender Female
n134=  }
n135=  if ($did == 14) {
n136=    set %setup2.channel.selected $did($dname,14,$did(14).sel)
n137=    ;this id/event is used to put the selected channel in a variable
n138=    ;this is used when a person adds/removes/joins the selected channel. 
n139=  }
n140=  if ($did == 18) {
n141=    if (%setup2.connect == on) { set %setup2.connect off | halt }
n142=    if (%setup2.connect == off) { set %setup2.connect on | halt }
n143=    ;the id 18 is the checkbox for the "Join Channels On Connect".
n144=    ;Another way of seeing if it is checked or not is to use $did(id).state  
n145=  }
n146=}
n147=on *:CONNECT: {
n148=  ;this will, if enabled, auto join the favourite channels on connect. 
n149=  if (%setup2.connect == on) {
n150=    set %temp.total $count(%setup2.list,$chr(44))
n151=    set %temp.count 0
n152=    :start
n153=    inc %temp.count 1
n154=    join $gettok(%setup2.list,%temp.count,44)
n155=    if (%temp.count < %temp.total) { goto start }
n156=  }
n157=}
