This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Save stats in script

Help for those learning Tcl or writing their own scripts.
Post Reply
S
Statium
Voice
Posts: 6
Joined: Fri Nov 04, 2011 2:31 am

Save stats in script

Post by Statium »

Hello! Please help with the script at the link
The problem is: After you restart bot stats reset. Thank you!
http://www.egghelp.ru/download.php?id=646
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

bind evnt - prerestart ::statistics::prerestart

proc statistics::prerestart {type} {
::statistics::save
}
add this before "# Quits." and it should save your statistics just before a restart.
Once the game is over, the king and the pawn go back in the same box.
S
Statium
Voice
Posts: 6
Joined: Fri Nov 04, 2011 2:31 am

Post by Statium »

Hasn't helped ;(
S
Statium
Voice
Posts: 6
Joined: Fri Nov 04, 2011 2:31 am

Post by Statium »

Nobody can help?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I've just noticed there's a 'load' function. Since the bot will loose the IRC connection, we will rely on that to call the load function.

Code: Select all

bind evnt - init-server ::statistics:connect

proc statistics:connect init-server {
::statistics::load
}
Add this code after the one posted above, and then .rehash the bot.
Once the game is over, the king and the pawn go back in the same box.
S
Statium
Voice
Posts: 6
Joined: Fri Nov 04, 2011 2:31 am

Post by Statium »

All doesn't help :(
Post Reply