Well, for one, your $readini has too many parameters. Unless $1 is n or p or np, the format is incorrect. Also, there's not much need to have every $N number listed in your guessleg alias unless you want it to throw a default error if there aren't enough words.
Here's an example of how to use an INI file. I'm not entirely clear on what you're doing, so you may have to adjust this some to fit your needs.
on *:text:!leg *:#:{
writeini -n legendary.ini $2 $nick $nick
}
alias count {
echo -a Total nicks who chose $1 -- $readini(legendary.ini,$1,0)
}
alias nicks {
var %count = $readini(legendary.ini,$1,0)
while (%count) {
echo -a $readini(legendary.ini,$1,%count)
dec %count
}
}
Uses:
!leg guess (save choice of "guess")
/count guess (show number of nicks who chose "guess")
/nicks guess (list all nicks who chose "guess")
Notes:
Be aware that the /nicks alias can cause flooding and can freeze your client if there are many nicks. You can do various flood control techniques to avoid this, or at least limit it significantly, if it becomes a problem. Remember that this is just a basic example of how to save and read an ini file.
I'm saving the nick to both item and data because I don't think there really is any data needed here. If you do have data that you want to store, you can change the writeini so that it stores the data as something other than $nick.
This was set up to handle a single word after !leg. If multiple words need to be handled, you'll need to adjust how you store the data.
I did not include any checks to verify that the formats used are correct. If you want to include those, you'll need to add them.
Below is an example of what the ini file would look like if I entered !leg guess, then you entered !leg guess, then Guest entered !leg other :
[guess]
Riamus2=Riamus2
rogga=rogga
[other]
Guest=Guest