Usually ini files are read using $readini because topic name and item name are known, and $readini has no problems at all with numeric topic or item names.

Since you have both x and y, $ini(file.ini,x,y) gives you the correct answer and it's shorter too.
Maybe add a switch ti $ini to tell mIRC it's the name and not the sequence number. It's also a good idea to think about your data, is an ini file where you know nothing about it's structure really the best way to store the data for your script?