diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index db121e8e46..c307c84537 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -71,3 +71,4 @@ * pmquan * net8q * SyncX + * umbreon222 diff --git a/pokemongo_bot/cell_workers/move_to_map_pokemon.py b/pokemongo_bot/cell_workers/move_to_map_pokemon.py index 81fcd9faa5..a598a9f69f 100644 --- a/pokemongo_bot/cell_workers/move_to_map_pokemon.py +++ b/pokemongo_bot/cell_workers/move_to_map_pokemon.py @@ -257,9 +257,12 @@ def work(self): pokemon = pokemon_list[0] - # if we only have ultraballs and the target is not a vip don't snipe/walk - if (pokeballs + superballs) < self.min_ball and not pokemon['is_vip']: - return WorkerResult.SUCCESS + if pokeballs < 1: + if superballs < 1: + if ultraballs < 1: + return WorkerResult.SUCCESS + if not pokemon['is_vip']: + return WorkerResult.SUCCESS if self.config['snipe']: if self.snipe_high_prio_only: diff --git a/pokemongo_bot/cell_workers/pokemon_catch_worker.py b/pokemongo_bot/cell_workers/pokemon_catch_worker.py index 1846cd2a66..ff524dc740 100644 --- a/pokemongo_bot/cell_workers/pokemon_catch_worker.py +++ b/pokemongo_bot/cell_workers/pokemon_catch_worker.py @@ -67,6 +67,10 @@ def __init__(self, pokemon, bot, config): ############################################################################ def work(self, response_dict=None): + pokeballs = self.bot.item_inventory_count(1) + superballs = self.bot.item_inventory_count(2) + ultraballs = self.bot.item_inventory_count(3) + response_dict = response_dict or self.create_encounter_api_call() # validate response @@ -93,6 +97,14 @@ def work(self, response_dict=None): if not self._should_catch_pokemon(pokemon): return WorkerResult.SUCCESS + is_vip = self._is_vip_pokemon(pokemon) + if pokeballs < 1: + if superballs < 1: + if ultraballs < 1: + return WorkerResult.SUCCESS + if not is_vip: + return WorkerResult.SUCCESS + # log encounter self.emit_event( 'pokemon_appeared', @@ -113,7 +125,6 @@ def work(self, response_dict=None): sleep(3) # check for VIP pokemon - is_vip = self._is_vip_pokemon(pokemon) if is_vip: self.emit_event('vip_pokemon', formatted='This is a VIP pokemon. Catch!!!')