PokemonGoF / PokemonGo-Bot

The Pokemon Go Bot, baking with community.
MIT License
3.87k stars 1.54k forks source link

Auto Restart Bot after crash #1732

Closed Yanush7 closed 8 years ago

Yanush7 commented 8 years ago

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)

lt-kraken commented 8 years ago

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

simonsmh commented 8 years ago

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

Yanush7 commented 8 years ago

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)

AlexBailey commented 8 years ago

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.

leovarmak commented 8 years ago

@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)

AlexBailey commented 8 years ago

@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?

leovarmak commented 8 years ago

@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 ? '

AlexBailey commented 8 years ago

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

leovarmak commented 8 years ago

@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

AlexBailey commented 8 years ago

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

leovarmak commented 8 years ago

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

AlexBailey commented 8 years ago

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

leovarmak commented 8 years ago

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

gregtampa commented 8 years ago

use the bash script...