mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2003
Posts: 157
RuFy Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Nov 2003
Posts: 157
Hi, I have this problem. I would like to calc how items are in a .ini files and specifically in a selected item. For example I need to calc how items are in:

$readini(servers.ini,recent)

I have tried with $ini but it work only with first item.
Thanks for the help. laugh

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Quote:
Hi, I have this problem. I would like to calc how items are in a .ini files and specifically in a selected item. For example I need to calc how items are in:

$readini(servers.ini,recent)

I have tried with $ini but it work only with first item.
Thanks for the help. laugh


im not 100 percent if your talking about this

%recent = $lines(servers.ini)
$readini($servers.ini,recent,%recent)

ill come back with a conclusing after im done with mirc ill do a bit of reading..


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Nov 2003
Posts: 157
RuFy Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Nov 2003
Posts: 157
No, there isn't this. I need something that calc last of the nx= var in $readini(servers.ini,recent) file.
For example if the string in $readini(servers.ini,recent) are 9 the result is:

$readini(servers.ini,recent,n9) Understood? shocked

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Quote:
No, there isn't this. I need something that calc last of the nx= var in $readini(servers.ini,recent) file.
For example if the string in $readini(servers.ini,recent) are 9 the result is:

$readini(servers.ini,recent,n9) Understood? shocked


$ini(servers.ini,4,0) <<< by using the $ini command you can caculate the number of lines in a ini file from a topic example...

[Hi]
n0=3010
[bye]
n0=sfkjjkf
[cya]
n0=39209424
[recent]
n0=irc.server.com
n1=irc.bleh.com
n2=irc.mircrules.com

see theres 4 topics [hi,bye,cya,recent]

so we need to tell $ini to give us the result of the lines = in topic 4 .. which is mostly topic 4 in server.ini if you didnt edit it..

$ini(servers.ini,4,0) << will read topic 4 and by putting it item 0 it will read all the lines back giving you the value of the calculated topic..

now im sure you want to be able to choose the last line of that ini which i forgot the path to it... for now since no one replies i hope this helps a tad bit..


*********************EDIT******************888

heres a dead try..

%rini = n $+ $ini(servers.ini,4,0)
$readini(servers.ini,recent,%rini)

this one will work the way you want it

Cheers

just a tad explanation on that
we needed to set a variable to calculate the lines on topic "recent" so again by using $ini(servers.ini,4,0) <<< server.ini chooses 4th topic which by setting the item 0 it will read the whole lines so if it read 9 lines the result is 9 so the varible is %rini = n $+ $ini(servers.ini,4,0) so this makes the varible return n9

then... the sript... $readini(servers.ini,recent,%rini) <<< which is really $readini(servers.ini,recent,n9)

Last edited by Lpfix5; 16/08/05 05:49 PM.

Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Ok, I will be assuming you are using these words for the parts of an ini (I honestly don't know what the official terms are for each section):

[Topic]
Section=Item

Number of "topics":

//echo -a $ini(file.ini,0)

Number of "sections" within a specific "topic":

//echo -a $ini(file.ini,Topic,0)

These will give you the number of sections/topics in your file. If you need more than that, just ask. smile

*EDIT*
Are you trying to list out the "sections"? Or are you trying to output the last "section"?

Last edited by Riamus2; 16/08/05 05:54 PM.

Invision Support
#Invision on irc.irchighway.net
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Quote:
Ok, I will be assuming you are using these words for the parts of an ini (I honestly don't know what the official terms are for each section):

[Topic]
Section=Item

Number of "topics":

//echo -a $ini(file.ini,0)

Number of "sections" within a specific "topic":

//echo -a $ini(file.ini,Topic,0)

These will give you the number of sections/topics in your file. If you need more than that, just ask. smile


I guess we posted at the same time lol but anyhoo im sure i got it patent down for him he wanted to read the last line of that to have it returned to him so i did a little variable


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Aug 2005
Posts: 128
S
Vogon poet
Offline
Vogon poet
S
Joined: Aug 2005
Posts: 128
Code:
$readini(servers.ini,recent,$ini(servers.ini,recent,$ini(servers.ini,recent,0)))

To get info about last connected server smile
I'm not sure that's what you want to do smile


Link Copied to Clipboard