PokemonGo-Bot icon indicating copy to clipboard operation
PokemonGo-Bot copied to clipboard

Auto Restart Bot after crash

Open Yanush7 opened this issue 10 years ago • 14 comments

Expected Behavior

Bot auto restart every time when it is closed (or x times specified as an option) so when you leave it for few hours you do not need to worry that after 10 min it crashed, and the rest of the hours when you were not knowing that it is not actually working are lost. It is more feature request than issue i guess?

Actual Behavior

Cant leave the bot for long time unattented because of some random closing.

Steps to Reproduce

Leave the bot working for 1, 2 r 3 hours

Other Information

OS: Windows 7 Git Commit: (run 'git log -n 1 --pretty=format:"%H"' and paste it here)

Yanush7 avatar Jul 29 '16 22:07 Yanush7

I created a cmd file for this :) I'm still waiting for it to be added to the wiki :)

https://github.com/PokemonGoF/PokemonGo-Bot/issues/1706

lt-kraken avatar Jul 29 '16 22:07 lt-kraken

I created a shell for this which is useful. It's great to have this build-in feature.

simonsmh avatar Jul 29 '16 23:07 simonsmh

#1706 I commented this one as it was not working correctly for me. But thanks a lot - I was just about making some cmd for it and you saved my time :) Finally i can read all the errors which led to randome closing (and i see that all the people have problems now with those inventory and pokestops errors)

Yanush7 avatar Jul 29 '16 23:07 Yanush7

Anything working for this for OSX? e.g. AppleScript? Would be amazing to leave this running whilst at work knowing it's going to be running still by the time I'm home. My thought was perhaps an Apple script that restarts the bot after every 30 minutes or so? I wouldn't imagine that would look too dodgy on niantic's servers and I imagine scheduling the restart would be a lot easier than detecting a crash/error, given there's no crashes and errors popping up every day or so.

AlexBailey avatar Jul 30 '16 00:07 AlexBailey

@AlexBailey That Bash script works for both Linux and OS X !

Using Bash on OS X

#!/bin/bash while true do ./pokecli.py echo ">pokecli exited... restarting..."; sleep 5; done

But if you still want an AppleScript check this - https://github.com/PokemonGoF/PokemonGo-Bot/wiki/Restarting-bot(s)

leovarmak avatar Jul 30 '16 04:07 leovarmak

@leovarmak so how often does this restart the bot? it's been running for 5 minutes and i've yet to see the echo message or a restart?

AlexBailey avatar Jul 30 '16 04:07 AlexBailey

@AlexBailey This script restarts the bot whenever it crashes. So you can run it all night without actually having to worry about the 'What if the bot stops ? '

leovarmak avatar Jul 30 '16 04:07 leovarmak

@leovarmak So it will detect both a connection error or a crash and will keep restarting every 5 seconds?

AlexBailey avatar Jul 30 '16 04:07 AlexBailey

@AlexBailey I am sure it will detect a crash. I have been using this since 2 days. Well I just gave the connection test a try and it works too ! So it will try to restart the bot every 5 seconds incase of a connection error and bot crash

leovarmak avatar Jul 30 '16 04:07 leovarmak

@leovarmak has it ever failed on any occasion? seems like a pretty neat and tidy bash script

AlexBailey avatar Jul 30 '16 04:07 AlexBailey

I don't remember it failing on OS X. But the BatchScript failed few times on Windows. Do give it a try man ! Let me know if you run into something

leovarmak avatar Jul 30 '16 04:07 leovarmak

@leovarmak Cheers for the help, and will do! you should have credited @MeGaPk either way though - so thank you both for the help

AlexBailey avatar Jul 30 '16 04:07 AlexBailey

@AlexBailey I forgot :p . @MeGaPk Thats for the code mate ! you really changed on how this bot works with a quick hack 👍

leovarmak avatar Jul 30 '16 04:07 leovarmak

use the bash script...

gregtampa avatar Jul 30 '16 09:07 gregtampa