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

Fixed a crash when a spin returns empty result. #974

Merged
merged 1 commit into from
Jul 26, 2016
Merged
Show file tree
Hide file tree
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
11 changes: 7 additions & 4 deletions pokemongo_bot/cell_workers/seen_fort_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def work(self):
'FORT_SEARCH' in response_dict['responses']:

spin_details = response_dict['responses']['FORT_SEARCH']
if spin_details['result'] == 1:
spin_result = spin_details.get('result', -1)
if spin_result == 1:
logger.log("Loot: ", 'green')
experience_awarded = spin_details.get('experience_awarded',
False)
Expand Down Expand Up @@ -105,19 +106,21 @@ def work(self):
'PokeStops you are indeed softbanned. Please try again '
'in a few hours.')
raise RuntimeError(message)
elif spin_details['result'] == 2:
elif spin_result == 2:
logger.log("[#] Pokestop out of range")
elif spin_details['result'] == 3:
elif spin_result == 3:
pokestop_cooldown = spin_details.get(
'cooldown_complete_timestamp_ms')
if pokestop_cooldown:
seconds_since_epoch = time.time()
logger.log('PokeStop on cooldown. Time left: ' + str(
format_time((pokestop_cooldown / 1000) -
seconds_since_epoch)))
elif spin_details['result'] == 4:
elif spin_result == 4:
logger.log("Inventory is full, switching to catch mode...", 'red')
self.config.mode = 'poke'
else:
logger.log("Unknown spin result: " + str(spin_result), 'red')

if 'chain_hack_sequence_number' in response_dict['responses'][
'FORT_SEARCH']:
Expand Down
2 changes: 1 addition & 1 deletion web
Submodule web updated from 83463c to 12007b