$readini problem. - 13/01/11 08:17 PM
Hello,
I've tried to rewrite my quotes script (just using a .txt) to let it use .ini now, but I've got one problem using $readini, which is the following:
Let's say I want to read 2=second test line. from ALL sections ([ThisThingy]).
So, I've got: $readini(%ini.quotes, <what am I supposed to put here?>, $2)
Let's say I'm testing it, so I've changed the part of <what am i...> to '#Channel1' which is a real section:
.
This way it works fine, my bot now says 'QUOTE 2: second test line.'. Ofcourse it doesn't work when I change #Channel1 to #Channel2, because there's no '2'.
I'd like the $readini to read from ALL sections. I've read the mIRC help file, but I only saw the $readini(mIRC.ini, mIRC, nick) which I am using and something about the n and p switch, which shouldnt help my problem.
I'd like this because I'm also using a channel-only function. Let's say: .quote #testchannel 2 - Now it reads '2' from #testchannel, but when no channel is specified, I'd like it to read from ALL sections.
%ini.quotes is an variable which returns the specified .ini file.
Possible?
I've tried to rewrite my quotes script (just using a .txt) to let it use .ini now, but I've got one problem using $readini, which is the following:
Let's say I want to read 2=second test line. from ALL sections ([ThisThingy]).
So, I've got: $readini(%ini.quotes, <what am I supposed to put here?>, $2)
Let's say I'm testing it, so I've changed the part of <what am i...> to '#Channel1' which is a real section:
Code:
[#Channel1] 1=first test line 2=second test line 3=third test line. [#Channel2] 4=fourth test line. 5=fifth test line
This way it works fine, my bot now says 'QUOTE 2: second test line.'. Ofcourse it doesn't work when I change #Channel1 to #Channel2, because there's no '2'.
I'd like the $readini to read from ALL sections. I've read the mIRC help file, but I only saw the $readini(mIRC.ini, mIRC, nick) which I am using and something about the n and p switch, which shouldnt help my problem.
I'd like this because I'm also using a channel-only function. Let's say: .quote #testchannel 2 - Now it reads '2' from #testchannel, but when no channel is specified, I'd like it to read from ALL sections.
%ini.quotes is an variable which returns the specified .ini file.
Possible?