mIRC Home    About    Download    Register    News    Help

Print Thread
help or suggestions with custum settings file #99836 06/10/04 02:10 PM
Joined: Aug 2004
Posts: 423
C
clutz1572 Offline OP
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
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.....


Re: help or suggestions with custum settings file #99837 06/10/04 05:08 PM
Joined: Mar 2003
Posts: 1,271
L
LocutusofBorg Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
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


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
Re: help or suggestions with custum settings file #99838 07/10/04 05:11 AM
Joined: Aug 2004
Posts: 423
C
clutz1572 Offline OP
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
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???

Re: help or suggestions with custum settings file #99839 07/10/04 10:00 PM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
  • 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)


Re: help or suggestions with custum settings file #99840 09/10/04 07:02 AM
Joined: Dec 2002
Posts: 580
N
NaquadaServ Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
Oh gezz, save yourself years of headache and read up on hash tables "/help /hmake"...


NaquadaBomb
www.mirc-dll.com
Re: help or suggestions with custum settings file #99841 10/10/04 02:53 AM
Joined: Aug 2004
Posts: 423
C
clutz1572 Offline OP
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
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