From f52b693ac717f3c8204f78dbb3d9b9e1311e0a67 Mon Sep 17 00:00:00 2001 From: Matt J Madsen Date: Wed, 24 Aug 2016 12:02:50 -0500 Subject: [PATCH 1/3] Fixed min_ball checks --- pokemongo_bot/cell_workers/move_to_map_pokemon.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pokemongo_bot/cell_workers/move_to_map_pokemon.py b/pokemongo_bot/cell_workers/move_to_map_pokemon.py index 39a927c547..e57cbb5725 100644 --- a/pokemongo_bot/cell_workers/move_to_map_pokemon.py +++ b/pokemongo_bot/cell_workers/move_to_map_pokemon.py @@ -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() @@ -305,11 +305,6 @@ 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']: @@ -317,6 +312,12 @@ def work(self): 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 From 359a22a5611ace0c9a4b150f1183be97ca0c811d Mon Sep 17 00:00:00 2001 From: Matt J Madsen Date: Wed, 24 Aug 2016 12:04:04 -0500 Subject: [PATCH 2/3] Updated configuration_files.md --- docs/configuration_files.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/configuration_files.md b/docs/configuration_files.md index d931ee5a7f..950109141c 100644 --- a/docs/configuration_files.md +++ b/docs/configuration_files.md @@ -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_balls` - 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 From 82204f89b1c14fe71e607c50e5f19c57111a8f85 Mon Sep 17 00:00:00 2001 From: Matt J Madsen Date: Wed, 24 Aug 2016 12:06:50 -0500 Subject: [PATCH 3/3] Fixed typo --- docs/configuration_files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration_files.md b/docs/configuration_files.md index 950109141c..9fc17488b7 100644 --- a/docs/configuration_files.md +++ b/docs/configuration_files.md @@ -506,7 +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_balls` - Minimum amount of balls required to run task +* `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