mIRC Homepage
hello again,

i'm trying to figure out how to make a settings file with /writeini in this format: [blahblah]
setting1 == on
setting2 == on
ect......
save and then read from that file and have it adjust the settings according to what settings were set to from the settings dialog. i am using checkboxes for the selections..

i've took the liberty of trying to look at examples from other scripts like sysreset and invision, but i don't want to just copy that those authors did allthough the end resulting code may look similar.... so i'm looking for either some help or suggestions on this.....

suggestion 1:
pick better scripts to learn from

suggestion 2:
open the mirc.ini file, you will see there is always the following format:

[SECTION]
item1=value
item2=value

To add to your ini file like that, simply use

/writeini filename.ini SECTION item value}

To read the value, simply use

$readini(filename.ini,SECTION,item
lol @ your first suggestion locutus.... :tongue:

i've looked at the mirc help file again and saw that the /writeini does infact do what i was asking about... ( i hate asking lamer questions, blah) so if i had somthing like this:

Code:
dialog Ini-Test {
  title "test"
  size -1 -1 87 84
  option dbu
  box "Settings", 1, 13 8 64 67
  check "Join Messages", 2, 21 21 50 10
  check "Part Messages", 3, 21 30 50 10
  check "Quit Messages", 4, 21 39 50 10
  button "Button", 5, 24 58 37 12, ok
} 


my alias would look like this then, correct?
Code:
 walias { /writeini -n dat\ini\test.ini $1 $2 $3- } 

so my call string would be sumthing like :
Code:
 if ($did == 2) { if ($did(ini-test,$did).state == 1) { $walias visuals Join On } | else { $walias visuals Join Off } }  

for my read:
Code:
ralias { $readini(test.ini $1 $2 } 

and call string:
Code:
if ($ralias(visuals,Join) == On) { did -c $dname 2}  

would this also be correct???
  • if ($did == 2) { $walias(visuals,Join,$iif($did(2).state,On,Off)) }

Although you might like to use
  • if ($did == 2) { $walias(visuals,Join,$did(2).state) }
which would make the entry 0 (Off) or 1 (On)
[visuals]
Join=0
Part=1

Then in the init you can use this simpler code.
  • if $ralias(visuals,Join) { did -c $dname 2 }
    if $ralias(visuals,Part) { did -c $dname 3 }

Code:
ralias [color:tomato]return[/color] $readini([color:red]dat\ini\[/color]test.ini,$1,$2)

Oh gezz, save yourself years of headache and read up on hash tables "/help /hmake"...
heh,


if your basing your comments on the example i gave then yes perhaps a hash table would work ok(i guess)... but theres more going on than just that........... thanks for the hint tho... wink
© mIRC Discussion Forums