What it does/how to use it:
With this userfunction installed in your userfunctions folder, when your bot has finished doing what it's doing, run logPlayer() before logging in the next character and it will add some basic status information to a single log file. All characters get logged in to this single file and it overwrites old entries for the same player, with new entries at the bottom.
Here's a sample of what the log file looks like:
Code: Select all
Date/Time Name Level Max HP Gold Shells Tokens Mems Puris
06/04/15 00:22:42 BotName1 51 2,350 36,436 320 10 0 0
06/13/15 19:09:34 BotName2 91 64,685 518,850 350 3,995 0 0
06/19/15 07:09:14 BotName3 57 5,631 484,340 580 935 0 0
06/19/15 07:36:05 BotName4 57 5,761 825,573 840 965 0 1
06/19/15 08:02:21 BotName5 58 5,534 1,355,825 450 545 0 0
06/19/15 08:34:42 BotName6 58 7,270 1,006,804 340 1,670 0 0
06/19/15 09:06:42 BotName7 58 4,946 770,693 520 750 0 2
06/19/15 09:39:48 BotName8 57 5,424 808,665 270 625 0 0
06/19/15 11:04:30 BotName9 63 13,677 1,267,883 530 1,600 0 3
06/19/15 11:37:12 BotName10 52 6,075 596,617 520 1,020 0 1
06/19/15 12:06:58 BotName11 58 5,889 1,205,296 810 730 0 0
06/19/15 13:02:15 BotName12 54 3,173 420,836 580 1,285 0 0
The userfunction will check for existence of the log file and if it doesn't already exist, it will create it and create the headers. Then every time it is run after that it will update the entry for the current player that runs the script (or add an entry if one isn't already in the log). I use this log daily to get a quick look at how many tokens, shells, gold, and puris my bots have. I also use it if my bot script or client crashes so I can see which bot was the last one to finish his rounds, which would be the one on the bottom.
I have fixed the problems with the original file and verified it now works.