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

Hotfix for #4675 #4684

Merged
merged 3 commits into from
Aug 24, 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
1 change: 1 addition & 0 deletions docs/configuration_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ This task will fetch current pokemon spawns from /raw_data of an PokemonGo-Map i
- `priority` - Will move to the pokemon with the highest priority assigned (tie breaking by distance)
* `prioritize_vips` - Will prioritize vips in distance and priority mode above all normal pokemon if set to true
* `min_time` - Minimum time the pokemon has to be available before despawn
* `min_ball` - Minimum amount of balls required to run task
* `max_distance` - Maximum distance the pokemon is allowed to be when walking, ignored when sniping
* `snipe`:
- `True` - Will teleport to target pokemon, encounter it, teleport back then catch it
Expand Down
13 changes: 7 additions & 6 deletions pokemongo_bot/cell_workers/move_to_map_pokemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def work(self):
superballs_quantity = inventory.items().get(GREATBALL_ID).count
ultraballs_quantity = inventory.items().get(ULTRABALL_ID).count

if (pokeballs_quantity + superballs_quantity + ultraballs_quantity) < 1:
if (pokeballs_quantity + superballs_quantity + ultraballs_quantity) < self.min_ball:
return WorkerResult.SUCCESS

self.update_map_location()
Expand All @@ -305,18 +305,19 @@ def work(self):

pokemon = pokemon_list[0]

if pokeballs_quantity < 1:
if superballs_quantity < 1:
if ultraballs_quantity < 1:
return WorkerResult.SUCCESS

if self.config['snipe']:
if self.snipe_high_prio_only:
if self.snipe_high_prio_threshold < pokemon['priority']:
self.snipe(pokemon)
else:
return self.snipe(pokemon)

# check for pokeballs (excluding masterball)
# checking again as we may have lost some if we sniped
pokeballs_quantity = inventory.items().get(POKEBALL_ID).count
superballs_quantity = inventory.items().get(GREATBALL_ID).count
ultraballs_quantity = inventory.items().get(ULTRABALL_ID).count

if pokeballs_quantity + superballs_quantity + ultraballs_quantity < self.min_ball:
return WorkerResult.SUCCESS

Expand Down