PokemonGoBot icon indicating copy to clipboard operation
PokemonGoBot copied to clipboard

Auto-restart capability for repeating bot-loop exceptions

Open rraumberger opened this issue 8 years ago • 1 comments

Fixed issue: Provides a possible workaround for most "my bot crashed after 2h for no reason" issues.

Changes made:

  1. Added exception-handler to Bot.kt
  2. BotService now registers an exception handler for all submitted bots
  3. BotService now restarts all bots which exceed the configured autoRestartThreshold
  4. replaced println-statements with proper Log.x calls

rraumberger avatar Aug 09 '16 14:08 rraumberger

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.

ritsu avatar Aug 12 '16 13:08 ritsu