Hi,

i have been working on a trivia bot lately, and I found on this msgboard a solution by qwerty, where you can save the hash table with statistics to file, then use the /filter command on it to sort the items.

The hash table is like this:
item:nickname
data: user statistics pasted together by an equal sign
(necessary to perform the filter command)

Now this worx perfectly but I have only now noticed the following:

Suppose there is a nickname called [John]-Doe,
well u can add that nickname to the hash table, everything still ok. However, if u save the stats file to file using:

/hsave -i stats statistics.txt

and u open up the .txt file, it seems that the nickname has changed to ~John~-Doe.
In other words the [ ] have been replaced with ~~

If u do /hsave stats statistics.txt, then the hash table isnt saved as an ini file, and then the nickname remains unchanged. Unfortunately the hash table can only be sorted if the file is saved as an ini file.

Now i take it, that the reason for this is, that mirc might confuse [John] with a section, so it changes those signs to ~~ for ambiguity reasons.

My question to any of u willing to answer me is:

what would be the best (read: fastest) way to go around this.

Because it would be way too slow if i have to save the stats hash table line by line into a txt file, changing the [ ] signs into a temporarily other sign like $chr(255), then doing the sort, and then line by line change $chr(255) again to [ ] and put out the information.

Is there any other (way more efficient way)??

Help is greatly appreciated!

Last edited by FiberOPtics; 20/03/04 01:19 AM.

Gone.