mIRC Homepage
Posted By: keeker reading all items in an ini section - 18/05/03 08:06 PM
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
}
Posted By: ScatMan Re: reading all items in an ini section - 18/05/03 08:26 PM
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
Posted By: keeker Re: reading all items in an ini section - 19/05/03 04:41 PM
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?
Posted By: ScatMan Re: reading all items in an ini section - 20/05/03 01:00 AM
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
}
}
© mIRC Discussion Forums