PokemonGoBot
PokemonGoBot copied to clipboard
Auto-restart capability for repeating bot-loop exceptions
Fixed issue: Provides a possible workaround for most "my bot crashed after 2h for no reason" issues.
Changes made:
- Added exception-handler to Bot.kt
- BotService now registers an exception handler for all submitted bots
- BotService now restarts all bots which exceed the configured autoRestartThreshold
- replaced println-statements with proper Log.x calls
When the bot restarts, does it go back to the starting lat/lon? Because if the last position was, say, 3km away from the starting position, then teleporting back to the starting position might result in a soft ban.
Maybe add a delay based on distance from starting position? I see there's an autoRestartPeriod setting that might suffice, even if it is just a fixed number. User could just configure the bot to never walk more than (60km/hr * autoRestartPeriod / 3600) km away from the starting location.