Skip to content

Commit

Permalink
Incubate_eggs_merge
Browse files Browse the repository at this point in the history
  • Loading branch information
RedViper9 committed Aug 18, 2016
1 parent 90f137f commit c788718
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pokemongo_bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def _register_events(self):
'wake'
)
)

# random pause
self.event_manager.register_event(
'next_random_pause',
Expand Down Expand Up @@ -382,7 +382,7 @@ def _register_events(self):
)
self.event_manager.register_event(
'next_egg_incubates',
parameters=('distance_in_km',)
parameters=('km_needed', 'distance_in_km',)
)
self.event_manager.register_event('incubator_already_used')
self.event_manager.register_event('egg_already_incubating')
Expand Down
8 changes: 6 additions & 2 deletions pokemongo_bot/cell_workers/incubate_eggs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ def work(self):
else:
self.emit_event(
'next_egg_incubates',
formatted='Next egg incubates in {distance_in_km:.2f} km',
formatted='Next egg ({km_needed} km) incubates in {distance_in_km:.2f} km',
data={
'km_needed': self.used_incubators[0]['km_needed'],
'distance_in_km': km_left
}
)
Expand Down Expand Up @@ -118,9 +119,12 @@ def _check_inventory(self, lookup_ids=[]):
incubators = [incubators]
for incubator in incubators:
if 'pokemon_id' in incubator:
start_km = incubator.get('start_km_walked', 9001)
km_walked = incubator.get('target_km_walked', 9001)
temp_used_incubators.append({
"id": incubator.get('id', -1),
"km": incubator.get('target_km_walked', 9001)
"km": km_walked,
"km_needed": (km_walked - start_km)
})
else:
temp_ready_incubators.append({
Expand Down

0 comments on commit c788718

Please sign in to comment.