AgustinSRG / Pokemon-Showdown-Node-Bot

Pokemon Showdown Bot for Node (Deprecated)
Other
34 stars 150 forks source link

[Suggestion] Return to battles after left and return #30

Closed danimesq closed 8 years ago

danimesq commented 8 years ago

When restart bot and bot is battling, the bot don't return to the battle.

Ecuacion commented 8 years ago

Yes, because if you restart the bot, all data stored in RAM is deleted, similar if you are battling and shut off the computer. For that reason when you use .kill and the bot is battling, it says there is a battle in progress, so if you use .forcekill or send a SIGINT/SIGTERM/SIGKILL you are aware that the bot will not return to the battle.

You can use .join battle-id and then .custom [battle-id] /joinbattle to re-join a battle.

Maybe a joinbattle battle-id commad to combine both lines is a good solution.

danimesq commented 8 years ago

An good solution for this is storing all current battles in a .json file for bot returning after, like an human does.

Ecuacion commented 8 years ago

Done in f5547304efce6cfad83fbd5abb74bc3a9b817c1c

You can enable the new battle autojoin feature setting exports.abandonedBattleAutojoin = true; in config.js