Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable hunting when no more balls #5871

Merged
merged 2 commits into from
Jan 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pokemongo_bot/cell_workers/pokemon_hunter.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ def work(self):
if not self.enabled:
return WorkerResult.SUCCESS

if self.bot.catch_disabled:
if not hasattr(self.bot,"hunter_disabled_global_warning") or \
(hasattr(self.bot,"hunter_disabled_global_warning") and not self.bot.hunter_disabled_global_warning):
self.logger.info("All catching tasks are currently disabled until {}. Pokemon Hunter will resume when catching tasks are re-enabled".format(self.bot.catch_resume_at.strftime("%H:%M:%S")))
self.bot.hunter_disabled_global_warning = True
return WorkerResult.SUCCESS

if self.get_pokeball_count() <= 0:
self.destination = None
self.last_cell_id = None
Expand Down