mIRC Home    About    Download    Register    News    Help

Print Thread
$readini problem #205071 11/10/08 10:19 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
i using $readini for my protections, but i cant figure out hot to use the same line for all my protections, the only thing that change is the last value (marked with a ?), i use $pro to get the value from the file, the ini file looks like this:

[protection]
ctcp=Disabled
message=Disabled

amd the alias looks like:

alias pro {
return { $readini($mircdirscripts\ini\settings.ini,protection,?)
}
so i need to add the item i want to read, this is done while init a dialog. So is it a way to return the value the dialog looking for? tested with var %pro = ctcp . but no luck when i tested it.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: $readini problem [Re: sparta] #205072 11/10/08 10:53 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
How does the user know, by looking at the dialog what item is to be returned?
Personally, in the dialog, I would have a text item CTCP as ID 4 and the item where the information for that to be displayed as ID 5
Thus you could use something like
Code:
$readini($mircdirscript\ini\settings.ini,protection,$did(4))
for the CTCP information.


Re: $readini problem [Re: RusselB] #205073 11/10/08 10:59 PM
Joined: May 2008
Posts: 127
J
Joe_Dean Offline
Vogon poet
Offline
Vogon poet
J
Joined: May 2008
Posts: 127
On another note, $mircdir includes and ending slash (looks like you already know), but in order to combine $mircdir and the rest of the path, you must use: $+

Code:
$readini($mircdir $+ script\ini\settings.ini,protection,$did(4))

Re: $readini problem [Re: Joe_Dean] #205075 11/10/08 11:11 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
how can i do that? i using a combo, the value that can be chosen are - High - Normal - Disabled . and it's on INIT i need the value for the $readini ..


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: $readini problem [Re: Joe_Dean] #205083 12/10/08 12:18 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
That is incorrect.
Code:
//echo -a $mircdir $mircdirscript
For me, it shows c:\mIRC c:\mIRC\script

Re: $readini problem [Re: sparta] #205084 12/10/08 12:21 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Do you have a label at the top of the combo box to indicate what the combo box is for? If so, a slight alteration of my suggestion will suffice.