From d01e39b97995e016513be4bfdbede23157130214 Mon Sep 17 00:00:00 2001 From: Matt J Madsen Date: Mon, 22 Aug 2016 10:48:43 -0500 Subject: [PATCH 1/5] Ultraball try emit_event --- pokemongo_bot/cell_workers/pokemon_catch_worker.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pokemongo_bot/cell_workers/pokemon_catch_worker.py b/pokemongo_bot/cell_workers/pokemon_catch_worker.py index 3211ab7b73..bcfabc8a03 100644 --- a/pokemongo_bot/cell_workers/pokemon_catch_worker.py +++ b/pokemongo_bot/cell_workers/pokemon_catch_worker.py @@ -353,6 +353,7 @@ def _do_catch(self, pokemon, encounter_id, catch_rate_by_ball, is_vip=False): # use untraball if there is no other balls with constraint to `min_ultraball_to_keep` if maximum_ball != ITEM_ULTRABALL and ball_count[ITEM_ULTRABALL] > min_ultraball_to_keep: maximum_ball = ITEM_ULTRABALL + self.emit_event('trying_ultraball', formatted='More ultraballs than minimum. Trying...') continue else: return WorkerResult.ERROR From 56f441a53699ce371c97325b1625d46a37bb81ad Mon Sep 17 00:00:00 2001 From: Matt J Madsen Date: Mon, 22 Aug 2016 10:54:09 -0500 Subject: [PATCH 2/5] Output change --- pokemongo_bot/cell_workers/pokemon_catch_worker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pokemongo_bot/cell_workers/pokemon_catch_worker.py b/pokemongo_bot/cell_workers/pokemon_catch_worker.py index bcfabc8a03..54e12206b6 100644 --- a/pokemongo_bot/cell_workers/pokemon_catch_worker.py +++ b/pokemongo_bot/cell_workers/pokemon_catch_worker.py @@ -348,7 +348,7 @@ def _do_catch(self, pokemon, encounter_id, catch_rate_by_ball, is_vip=False): while ball_count[current_ball] == 0 and current_ball < maximum_ball: current_ball += 1 if ball_count[current_ball] == 0: - self.emit_event('no_pokeballs', formatted='No usable pokeballs found!') + self.emit_event('no_pokeballs', formatted='No usable (non-ultra)pokeballs found!') # use untraball if there is no other balls with constraint to `min_ultraball_to_keep` if maximum_ball != ITEM_ULTRABALL and ball_count[ITEM_ULTRABALL] > min_ultraball_to_keep: From d17fd2edffb03b53f839657d851cbd8751c742ff Mon Sep 17 00:00:00 2001 From: Matt J Madsen Date: Mon, 22 Aug 2016 10:57:52 -0500 Subject: [PATCH 3/5] Change emit_events --- pokemongo_bot/cell_workers/pokemon_catch_worker.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pokemongo_bot/cell_workers/pokemon_catch_worker.py b/pokemongo_bot/cell_workers/pokemon_catch_worker.py index 54e12206b6..a8a4355b41 100644 --- a/pokemongo_bot/cell_workers/pokemon_catch_worker.py +++ b/pokemongo_bot/cell_workers/pokemon_catch_worker.py @@ -348,14 +348,13 @@ def _do_catch(self, pokemon, encounter_id, catch_rate_by_ball, is_vip=False): while ball_count[current_ball] == 0 and current_ball < maximum_ball: current_ball += 1 if ball_count[current_ball] == 0: - self.emit_event('no_pokeballs', formatted='No usable (non-ultra)pokeballs found!') - # use untraball if there is no other balls with constraint to `min_ultraball_to_keep` if maximum_ball != ITEM_ULTRABALL and ball_count[ITEM_ULTRABALL] > min_ultraball_to_keep: maximum_ball = ITEM_ULTRABALL - self.emit_event('trying_ultraball', formatted='More ultraballs than minimum. Trying...') + self.emit_event('enough_ultraballs', formatted='No regular balls left! Trying ultraball.') continue else: + self.emit_event('no_pokeballs', formatted='No pokeballs left!') return WorkerResult.ERROR # check future ball count From ead43995c7896b24f2f132df41bb619721e17041 Mon Sep 17 00:00:00 2001 From: Matt J Madsen Date: Mon, 22 Aug 2016 11:08:55 -0500 Subject: [PATCH 4/5] register_event(enough_ultraballs) --- pokemongo_bot/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pokemongo_bot/__init__.py b/pokemongo_bot/__init__.py index 3fd04997a8..97aa59e02f 100644 --- a/pokemongo_bot/__init__.py +++ b/pokemongo_bot/__init__.py @@ -306,6 +306,7 @@ def _register_events(self): ) ) self.event_manager.register_event('no_pokeballs') + self.event_manager.register_event('enough_ultraballs') self.event_manager.register_event( 'pokemon_catch_rate', parameters=( From e820e711634f75a09b441ae5a381bf86b54ee65d Mon Sep 17 00:00:00 2001 From: Matt J Madsen Date: Mon, 22 Aug 2016 11:15:18 -0500 Subject: [PATCH 5/5] Altered no_pokeballs output --- pokemongo_bot/cell_workers/pokemon_catch_worker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pokemongo_bot/cell_workers/pokemon_catch_worker.py b/pokemongo_bot/cell_workers/pokemon_catch_worker.py index a8a4355b41..5ca3ec51f3 100644 --- a/pokemongo_bot/cell_workers/pokemon_catch_worker.py +++ b/pokemongo_bot/cell_workers/pokemon_catch_worker.py @@ -354,7 +354,7 @@ def _do_catch(self, pokemon, encounter_id, catch_rate_by_ball, is_vip=False): self.emit_event('enough_ultraballs', formatted='No regular balls left! Trying ultraball.') continue else: - self.emit_event('no_pokeballs', formatted='No pokeballs left!') + self.emit_event('no_pokeballs', formatted='No pokeballs left! Fleeing...') return WorkerResult.ERROR # check future ball count