[Feature Request] Restart bot after X minutes,
Having a possiblitiy in settings to restart the bot every X minutes would be really nice. Or after Xminutes after last catched pokemon.
Why would you want to do that?
To mitigate crashing risk.
If the script crashes, it has crashed and the process is ended, so it cannot restart itself.
I think what he means is to mitigate the "Unknown Pokestop" loop with this feature request.
I think so too, but that would be an awful way of achieving the fix if so.
Ideally every bug would be solved but unpredictable crashes can still happen anytime (so far it hasn't happened to me). To solve this you could easily make an autohotkey script that checks for the process every X minutes and if the process doesn't exist, it starts it anew. EDIT: So this literally just happened to me, I was running the bot and my router dc'ed for a few minutes:
[2016-07-24 20:13:33] [#] Finished walking [2016-07-24 20:13:33] [#] Arrived at Pokestop Traceback (most recent call last): File "C:\Users\XXX\Desktop\New folder\PokemonGo-Bot-dev\pokecli.py", line 219 , in
main() File "C:\Users\XXX\Desktop\New folder\PokemonGo-Bot-dev\pokecli.py", line 210 , in main bot.take_step() File "C:\Users\XXX\Desktop\New folder\PokemonGo-Bot-dev\pokemongo_bot__init_ _.py", line 36, in take_step self.stepper.take_step() File "C:\Users\XXX\Desktop\New folder\PokemonGo-Bot-dev\pokemongo_bot\stepper .py", line 61, in take_step self._work_at_position(position[0], position[1], position[2], True) File "C:\Users\XXX\Desktop\New folder\PokemonGo-Bot-dev\pokemongo_bot\stepper .py", line 134, in work_at_position self.bot.work_on_cell(cell, position, pokemon_only) File "C:\Users\XXX\Desktop\New folder\PokemonGo-Bot-dev\pokemongo_bot__init _.py", line 95, in work_on_cell hack_chain = worker.work() File "C:\Users\XXX\Desktop\New folder\PokemonGo-Bot-dev\pokemongo_bot\cell_wo rkers\seen_fort_worker.py", line 31, in work if 'responses' in response_dict
TypeError: argument of type 'NoneType' is not iterableC:\Users\XXX\Desktop\New folder\PokemonGo-Bot-dev>
Although probably nothing will be done to solve crashes, it would be a good idea to solve internet dc's.
Use crontab.
*/5 * * * * timeout 5m python /home/user/bot/pokecli.py
i have mine in a service in ubuntu and then restart the service every hour via cron.
Yep I think I'll make cron to handle those. I think this issue can be deleted.
Regards, koper89
@koper89 i think you can mark this as closed.
This command restart the bot every 1 hour, after a pause of 10 secs
while true; do timeout -k 1h -s SIGINT 1h python /home/user/bot/pokecli.py; sleep 10; done
@phupabegim @inerba How i use crontab with screen to run 2 bots with an ubuntu server?
thats what i got, but i think it didnt work:
0 */2 * * * /usr/bin/screen -dmS catchthemall7fun /home/Pokemon-Go-Bot/ python pokecli.py -a ptc -u USER -p PASS --location "New York, Central Park" -m all
How can close the other screen session and let it wait 5 min to the next restart ? I didnt use the latest dev.