Okay now I am really confused Follows is my script:
alias random /dialog -m quitsedit quitsedit
dialog quitsedit {
title "Random Quits"
size -1 -1 308 222
option dbu
icon $mircdirimages\qms.ico, 0
check "Enable Random Quit messages", 1, 80 5 96 10, left
list 2, 5 50 227 100, size vsbar
icon 3, 5 155 265 12, $mircdirimages\QuitsDisplay.bmp, 0, left
edit "", 4, 5 30 228 10
text "Enter quit message", 5, 86 16 69 8, center
button "Save", 6, 104 180 40 12, ok
button "Cancel", 7, 164 180 40 12, cancel
button "Add", 8, 250 20 40 12
button "Update", 9, 250 40 40 12
button "Delete", 10, 250 60 40 12
text "Status", 11, 232 145 74 8, center
edit "", 12, 232 155 74 10
text "*Add", 13, 232 83 76 8, center
text "Add new quit message", 14, 232 93 76 8, center
text "*Update", 15, 232 104 76 8, center
text "Update quit message", 16, 232 113 76 8, center
text "*Delete", 17, 232 123 76 8, center
text "Delete quit message", 18, 232 133 76 8, center
}
on *:dialog:quitsedit:init:0: {
ReadQuitsIntoArray
FillQuitsList
if (%quits.enable == 0) { did -u $dname 1 }
if (%quits.enable == 1) { did -c $dname 1 }
}
on *:dialog:quitsedit:edit:*:{
;Changed quit entry box
if ($did == 4) {
set %quits.edit $did(4)
DrawQuitsPreview quitsedit 3
}
}
on *:dialog:quitsedit:sclick:*: {
;enable checkbox clicked
if ( $did == 1 ) { %quits.enable = On }
if ( $did == 0 ) { %quits.enable = Off }
;Quits list clicked
if ( $did == 2 ) {
set %quits.edit $did(2,$did(2).sel)
/did -ra quitsedit 4 %quits.edit
set %quits.num $did(2).sel
}
;changed quit editbox
if ( $did == 4 ) {
if ( $did(4) == $null ) {
DrawQuitsPreview
set %quits.name [ $+ [ %quits.num ] ] %quits.edit
}
else {
set %quits.edit $did(4)
DrawQuitsPreview
}
}
;Add button clicked
if ( $did == 8 ) {
if ( $did(4) == $null ) {
/did -ar quitsedit 12 Nothing to add
}
else {
AddNewQuit
FillQuitsList quitsedit 3
}
}
;Update button clicked
if ( $did == 9 ) {
set %quits.name [ $+ [ %quits.num ] ] %quits.edit
ReloadQuitsFile
}
;Delete button clicked
if ( $did == 10 ) {
}
}
alias ReadQuitsIntoArray {
//echo ReadQuitsIntoArray
set %quits.loop 1
set %quits.text $read(replacements/quits.txt, -n, %quits.loop)
//echo quits.text = %quits.text
while ( %quits.text != $null ) {
set %quits.name [ $+ [ %quits.loop ] ] %quits.text
inc %quits.loop
set %quits.text $read(replacements/quits.txt, -n, %quits.loop)
//echo quits.text = %quits.text
}
dec %quits.loop
set %quits.total %quits.loop
unset %quits.loop
}
alias ReloadQuitsFile {
//echo ReloadQuitsFile
echo -a Quits.total = %quits.total
; /remove replacements/quits.txt
; /clear -s
; set %quits.loop 1
; while ( %quits.loop < %quits.total ) {
; /write -l $+ %quits.loop replacements/quits.txt %quits.name [ $+ [ %quits.loop ] ]
; inc %quits.loop
; }
; unset %quits.loop
}
alias FillQuitsList {
//echo FillQuitsList
//did -r quitsedit 2
set %quits.loop 1
while ( %quits.loop <= %quits.total ) {
//did -a quitsedit 2 %quits.name [ $+ [ %quits.loop ] ]
inc %quits.loop
}
unset %quits.loop
}
alias AddNewQuit {
//echo AddNewQuit
set %quits.loop 1
set %dup.quits 0
while ( %quits.loop < %quits.total ) {
if ( %quits.name [ $+ [ %quits.loop ] ] == $did(4) ) {
set %dup.quits 1
}
inc %quits.loop
}
if ( %dup.quits != 1 ) {
inc %quits.total 1
set %quits.name [ $+ [ %quits.total ] ] $did(4)
}
unset %dup.quits
unset %quits.loop
/did -c quitsedit 2 1
}
alias DrawQuitsPreview {
//echo DrawQuitsPreview
set %quitpreview.string %quits.edit
if ( %quits.edit != $null ) {
window -ph +b @quitsedit.show 0 0 440 20
drawtext -bcp @quitsedit.show 1 1 Tahoma 12 0 0 440 20 %quitpreview.string
drawsave @quitsedit.show " $+ $scriptdirimages\QuitsDisplay.bmp $+ "
window -c @quitsedit.show
//did -g quitsedit 3 " $+ $scriptdirimages\QuitsDisplay.bmp $+ "
unset %quitpreview.string
}
}
before I run the scrript by typing /random the quits.txct file looks like this:
11It's always darkest....Just before it goes totally black
13Remember people No matter where you go......There you are.
11It's not as bad as it looks......It's much much worse!
4Ladies and gentleman take my advice 11Pull down your pants and slide on the ice.
13It's not who you know, or what you know. 9It's what you know about who you know.
11Once I thought I was wrong, but I was mistaken.
9You have obviously mistaken me for someone who gives a shit.
0I still think Doctors wear masks so nobody will recognize them if they screw up an operation.
11It's only funny until someone gets hurt. 8Then it's HILARIOUS!!!!!!
9If you and a friend are being chased by a bear you don't have to run daster than the bear. You
just have to run faster than your friend!
13Experience is what you get when you don't get what you want.
8Never insult a man until you have wlaked a mile in his shoes. (That way when he tries to chase
you your a mile away and you have his shoes!)
After I run the script the quits.txt file looks like this:
%away.status NO
%brb.status OFF
%being.flooded NO
%rdccccountdate 07/05/04
%banner.total 71
%firstletter.color.temp 04
...
%sys.version Version 1c
%sys.respondCTCP 0
%sys.encLeftvar
%banner.RHS.output
%quits.text
%quits.total 0
%quits.name1 11It's always darkest....Just before it goes totally black
%quits.name2 13Remember people No matter where you go......There you are.
%quits.name3 11It's not as bad as it looks......It's much much worse!
%quits.name4 4Ladies and gentleman take my advice 11Pull down your pants and slide on the ice.
%quits.name5 13It's not who you know, or what you know. 9It's what you know about who you know.
%quits.name6 11Once I thought I was wrong, but I was mistaken.
%quits.name7 9You have obviously mistaken me for someone who gives a shit.
%quits.name8 0I still think Doctors wear masks so nobody will recognize them if they screw up an operation.
%quits.name9 11It's only funny until someone gets hurt. 8Then it's HILARIOUS!!!!!!
%quits.name10 9If you and a friend are being chased by a bear you don't have to run daster than the bear. You just have to run faster than your friend!
%quits.name11 13Experience is what you get when you don't get what you want.
%quits.name12 8Never insult a man until you have wlaked a mile in his shoes. (That way when he tries to chase you your a mile away and you have his shoes!)
basically it changes to a list of all my variables. I am at a loss to unsderastand how this is happening. I know this is alot to ask but any help would be appreciated.