mIRC Home    About    Download    Register    News    Help

Print Thread
reading all items in an ini section #24907 18/05/03 08:06 PM
Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
hi, i got a section in an ini file like this:

[#channel]
Nick_92=a
Someother_nick=o
yet_another_nick=h
lastnick=v

what i want to do is read all the nicks in [#channel] and memo them using the networks memoserv. how can i run a command on each and every nick in [#channel]?i need something like this:

Code:
alias memosend {
var %nick = <this is the part i need help on>
var %message = $1-
memoserv send %nick %message
}


keek: Scots - intr.v. keeked, keekˇing, keeks
To peek; peep.
Re: reading all items in an ini section #24908 18/05/03 08:26 PM
Joined: May 2003
Posts: 730
S
ScatMan Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: May 2003
Posts: 730
alias memosend {
var %i = 1
while (%i <= $ini(file.ini,#channel,0)) {
ms send $ini(file.ini,#channel,%i) msg
inc %i
}
}
replace file.ini with the name of your ini file

Re: reading all items in an ini section #24909 19/05/03 04:41 PM
Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
Thank you Scatman, now one little other question, if i wanted to send it to only the poeple in the file that have an "a" after the = sign, (ie Neoknight=a) and not people with o/h/v, how would i tell that?


keek: Scots - intr.v. keeked, keekˇing, keeks
To peek; peep.
Re: reading all items in an ini section #24910 20/05/03 01:00 AM
Joined: May 2003
Posts: 730
S
ScatMan Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: May 2003
Posts: 730
alias memosend {
var %i = 1
while (%i <= $ini(file.ini,#channel,0)) {
if ($readini(file.ini,#channel,$ini(file.ini,#channel,%i)) == a) {
ms send $ini(file.ini,#channel,%i) msg
}
inc %i
}
}