Depending on the specific layout of the text file, spermis may be able to load their text file directly into a hash table, as the general format that a hash table saves in, when using the /hsave command, is standard text (exception being if the -i switch is used, then the format matches that of an ini file)
If the map name is first and none of the map names contain spaces, then the file can be loaded into a hash table directly using the /hload command (after the table is made using /hmake)
Here's my suggestion for a hash table code
on *:text:!locate*:*:{
if !$2 { .notice $nick Usage: !locate <map_name> }
else {
var %a = 1, %b = $hfind(Maps,$+(*,$2,*),0,w)
while %a <= %b {
.msg $iif($chan,$chan,$nick) $hfind(Maps,$+(*,$2,*),%a,w) $hget($v1)
inc %a
}
}
}
on *:start:{
if !$hget(Maps) { .hmake Maps 100 }
if $exists(Maps.txt) { .hload Maps Maps.txt }
}
on *:exit:{
.hsave -o Maps Maps.txt
}
on *:disconnect:{
.hsave -o Maps Maps.txt
}
on *:text:!addmap*:*:{
if !$2 || !$3 { .notice $nick Usage: !addmap <map_name> <map link> }
else { .hadd -m Maps $2 $3- }
}
on *:text:!delmap*:*:{
if !$2 { .notice $nick Usage: !delmap <map_name> }
else { .hdel Maps $2 }
}
The above code presumes that the text file is called Maps.txt, the file is located in the mIRC installation directory, and it matches the format I specified earlier.
If any of those requirements are not met, then I do not guarantee that the code will work.
I also included commands to allow maps to be added or deleted from the hash table, however I didn't restrict access to those commands, so you should be careful when letting people know about them. All commands are coded to work from either a channel or from a pm/query window.