I already have this easy script where when you whois someone, it grabs the $4 info from raw 311, checks the last token which represents the country, reads a text file and returns the country name.

I'm trying to script it so it could do the job for "unresolved" IP addresses. I have this text file with entries like that:
[10]
10.0.0.0/8=Some Country
[192]
192.168.60.0/24=Some Other Country
192.170.123.0/20=Somewhere On This Planet

The idea is to check the text file, if the returned IP is included in some range, return the result...

Looks good on paper, but the problem is, AFAIK, mIRC doesn't know how to handle those classless IP ranges.
I know I could simply return a long list of /24 and compare the first 3 tokens in the IP (x.y.z.0), but the text file would get too repetitive and heavy.

I'm looking for suggestions on how I should trick this script.


Show me the steps to somewhere in the sky...