;Setup Dialog Example by Pasmal ;Load this file to your remotes (/load -rs dialog.txt) ;To open the dialog, type /ss ([s]cript [s]etup) alias ss { ;-dm creates a [d]esktop [m]odeless dialog. dialog -dm setup setup } ;this table, setup, is something i threw together. Feel free to change/modify/experiment. ;if you are ever confused with an item, check the dialog.html file at www.helpdesk.mircx.com/documents dialog setup { title "Script Setup" size -1 -1 500 300 button "Done",1,375 230 113 60, OK box "Personal Preferences",2, 3 3 493 293 box "About",3, 375 22 112 200 text "Nick Name:",4, 15 30 64 25 edit "",5, 74 27 70 20,autohs text "Alt Nick Name:",6, 150 30 94 25 edit "",7, 222 27 70 20,autohs text "Real Name:",8, 15 55 64 25 edit "",9,74 50 70 20 text "Gender:",10,150 55 50 25 radio "Male",11,200 52 45 20,group radio "Female",12,250 52 70 20 text "Favourite Channels:",13, 15 88 94 25 combo 14,15 110 120 140,sort button "Add Chan",15, 140 140 84 25 button "Remove Chan",16, 140 170 84 25 button "Join Chan",17, 140 200 84 25 check "Join Channels On Connect",18, 15 240 160 25 text "Mr Dialog Script Version: 1.0 Author: Me! This is just an example setup 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 text "Age:",20,150 75 40 25 combo 21,180 72 70 160,drop button "Reset Channel List",22, 15 265 120 25 } on *:DIALOG:setup:init:0: { ;setup 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 ; an init occurs. did -a setup 21 < 5 did -a setup 21 5 to 9 did -a setup 21 10 to 14 did -a setup 21 15 to 19 did -a setup 21 20 to 24 did -a setup 21 25 to 29 did -a setup 21 29 to 34 did -a setup 21 34 to 38 did -a setup 21 38 to 42 did -a setup 21 43+ ;those did -a's add items to the drop down combo that selects your age. if (%setup.connect == $null) { set %setup.connect off } if (%setup.connect == on) { did -c setup 18 } ;this did -c checks the "Join Channels On Connect" if you had previously ticked it if (%setup.nick != $null) { did -a setup 5 %setup.nick } ;if you had already filled in a nick then this will display it if (%setup.alt != $null) { did -a setup 7 %setup.alt } ;if you had already filled in a alt. nick then this will display it if (%setup.real != $null) { did -a setup 9 %setup.real } ;if you had already filled in a real name then this will display it if (%setup.gender == male) { did -c setup 11 } ; if you selected male as the gender, then did -c setup 11 will put a dot in the male radio box if (%setup.gender == female) { did -c setup 12 } ; if you selected female as the gender, then did -c setup 12 will put a dot in the female radio box update.setup ;update.setup is a custom alias that adds all the favourite channels to the fav. channels combo. } alias -l update.setup { ;this alias gets your favourite channels and displays them ;the fav. channels list is stored in a variable, %setup.list ;An example setup.list: #chan1,#chan2,#chan3, etc.... did -r setup 14 ;did -r removes all the text in the combo box set %temp.total $count(%setup.list,$chr(44)) set %temp.count 0 :start inc %temp.count 1 ;did -a adds the text to the combo box. did -a setup 14 $gettok(%setup.list,%temp.count,44) if (%temp.count < %temp.total) { goto start } } on *:DIALOG:setup:edit:*: { ;this event reacts when someone types text in any editbox in the setup dialog. ; the $did(id).text identifier returns all the text in the editbox. ; if you use $did outside an on DIALOG event, then you must specify the dialog name ; i.e. $did(setup,5).text if ($did == 5) { set %setup.nick $did(5).text ;the id 5 is the editbox for your nickname } if ($did == 7) { set %setup.alt $did(7).text ;the id 7 is the editbox for your alt. name } if ($did == 9) { set %setup.real $did(9).text ;this id repersents the real name editbox } if ($did == 21) { set %setup.age $did(21).text ;this id repersents the age group selected in the drop down combo } if ($did == 14) { set %setup.temp.channel $did(14).text ;this is the text entered into the editbox in the favourite channels combo } } on *:DIALOG:setup:sclick:*: { ;this event reacts when a mouse clicks once on an item. if ($did == 22) { unset %setup.list update.setup ;the id 22 stands for the "reset channels list" button. } if ($did == 15) { set %setup.list %setup.list $+ %setup.temp.channel $+ , update.setup ;the id 15 stands for the "Add Chan" button } if ($did == 16) { set -u1 %setup.tc %setup.channel.selected $+ , set %setup.list $remove(%setup.list,%setup.tc) update.setup ;the ID 16 stands for the "Remove Chan" button } if ($did == 17) { join %setup.channel.selected ;the ID 17 stands for the "Join Chan" button } if ($did == 11) { set %setup.gender Male ;if the person clicked on the "male" radio box, then this will change the gender to male. } if ($did == 12) { ;and vice versa for female. set %setup.gender Female } if ($did == 14) { set %setup.channel.selected $did($dname,14,$did(14).sel) ;this id/event is used to put the selected channel in a variable ;this is used when a person adds/removes/joins the selected channel. } if ($did == 18) { if (%setup.connect == on) { set %setup.connect off | halt } if (%setup.connect == off) { set %setup.connect on | halt } ;the id 18 is the checkbox for the "Join Channels On Connect". ;Another way of seeing if it is checked or not is to use $did(id).state } } on *:CONNECT: { ;this will, if enabled, auto join the favourite channels on connect. if (%setup.connect == on) { set %temp.total $count(%setup.list,$chr(44)) set %temp.count 0 :start inc %temp.count 1 join $gettok(%setup.list,%temp.count,44) if (%temp.count < %temp.total) { goto start } } }