Hi im working on a stats generator script to generat stats in a .htm file.... So far so good but I have a problem... I have set up so the channel im logging adds a file called stats.$chan.user.ini ... it contains the following

[Nicks]
Nick1=2
Nick2=12
Nick3=5
Nick4=1
Nick5=22

where nick is the name of a person who has typet something in the channel and the number represents how many times he or she has type a msg... I want to be able to set them as a value for example
set %stats.top15.user1 user <-- the person who has the highest value (eg the most written lines)
set %stats.top15.user2 user <-- second place and so on...
I would also like to set %stats.top15.lines.user1 to the number of line the person wrote... The problem is that I cant get the nick from the ini file because I dont know who it is so I cant use the $readini and if-the-else...

Any suggestions how I can fix this ?