This repository has been archived by the owner on Oct 2, 2021. It is now read-only.
forked from PokemonGoF/PokemonGo-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added catching of Pokemon from incense
Added documentation and new function Solving issue PokemonGoF#5151 - part 1
- Loading branch information
1 parent
8265d16
commit c361f58
Showing
5 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,8 @@ def work(self): | |
self.get_visible_pokemon() | ||
if self.config.get('catch_lured_pokemon', True): | ||
self.get_lured_pokemon() | ||
if self.config.get('catch_incensed_pokemon', True): | ||
self.get_incensed_pokemon() | ||
|
||
random.shuffle(self.pokemon) | ||
|
||
|
@@ -129,6 +131,26 @@ def get_lured_pokemon(self): | |
|
||
self.add_pokemon(pokemon) | ||
|
||
def get_incensed_pokemon(self): | ||
# call self.bot.api.get_incense_pokemon | ||
pokemon_to_catch = self.bot.api.get_incense_pokemon | ||
|
||
if len(pokemon_to_catch) > 0: | ||
for pokemon in pokemon_to_catch: | ||
|
||
# Update web UI | ||
with open(user_web_catchable, 'w') as outfile: | ||
This comment has been minimized.
Sorry, something went wrong.
LLNet
|
||
json.dump(pokemon, outfile) | ||
|
||
self.emit_event( | ||
'incensed_pokemon_found', | ||
level='info', | ||
formatted='Incense attracted a pokemon at {encounter_location}', | ||
data=pokemon | ||
) | ||
|
||
self.add_pokemon(pokemon) | ||
|
||
def add_pokemon(self, pokemon): | ||
if pokemon['encounter_id'] not in self.pokemon: | ||
self.pokemon.append(pokemon) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
incensed_pokemon_found?