Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into HEAD
Browse files Browse the repository at this point in the history
* upstream/dev:
  Fix bot not returning back after telepoting (PokemonGoF#3014)
  Added cleanup of download and files for encrypt.so after they are no longer needed (PokemonGoF#3011)
  Added MaxPotion inventory count to summary. (PokemonGoF#3015)
  Fixed PokemonGoF#3000 (PokemonGoF#3003)
  • Loading branch information
mhdasding committed Aug 8, 2016
2 parents e891ebd + 7cc524e commit e4ceda5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ RUN cd /tmp && wget "http://pgoapi.com/pgoencrypt.tar.gz" \
&& cd pgoencrypt/src \
&& make \
&& cp libencrypt.so /usr/src/app/encrypt.so
&& cd /tmp
&& rm -rf /tmp/pgoencrypt*

VOLUME ["/usr/src/app/web"]

Expand Down
3 changes: 2 additions & 1 deletion pokemongo_bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,8 @@ def _print_character_info(self):
self.logger.info(
'Potion: ' + str(items_stock[101]) +
' | SuperPotion: ' + str(items_stock[102]) +
' | HyperPotion: ' + str(items_stock[103]))
' | HyperPotion: ' + str(items_stock[103]) +
' | MaxPotion: ' + str(items_stock[104]))

self.logger.info(
'Incense: ' + str(items_stock[401]) +
Expand Down
6 changes: 3 additions & 3 deletions pokemongo_bot/cell_workers/move_to_map_pokemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ def snipe(self, pokemon):
Args:
pokemon: Pokemon to snipe.
"""
last_position = self.bot.position[0:2]
self.bot.heartbeat()
self._teleport_to(pokemon)
self.bot.heartbeat()
Expand Down Expand Up @@ -261,7 +262,7 @@ def snipe(self, pokemon):
catch_worker = PokemonCatchWorker(pokemon, self.bot)
api_encounter_response = catch_worker.create_encounter_api_call()
time.sleep(SNIPE_SLEEP_SEC)
self._teleport_back()
self._teleport_back(last_position)
time.sleep(SNIPE_SLEEP_SEC)
self.bot.heartbeat()
catch_worker.work(api_encounter_response)
Expand Down Expand Up @@ -380,9 +381,8 @@ def _encountered(self, pokemon):
data=self._pokemon_event_data(pokemon)
)

def _teleport_back(self):
def _teleport_back(self, last_position):
"""Teleports trainer back to their last position."""
last_position = self.bot.position[0:2]
self.emit_event(
'move_to_map_pokemon_teleport_back',
formatted=('Teleporting back to previous location ({last_lat}, '
Expand Down

0 comments on commit e4ceda5

Please sign in to comment.