-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Suggestions] Only release low CP pokemon if you already caught it #15
Comments
Currently just dumps anything lower level - you will normally always catch it again! :) |
Easy to implement, snippet below works for me. def transfer_unique_pokemon(api):
api.get_inventory()
response_dict = api.call()
pokemons = []
#print('Response dictionary: \n\r{}'.format(json.dumps(response_dict, indent=2)))
if response_dict and 'responses' in response_dict:
if 'GET_INVENTORY' in response_dict['responses']:
if 'inventory_delta' in response_dict['responses']['GET_INVENTORY']:
if 'inventory_items' in response_dict['responses']['GET_INVENTORY']['inventory_delta']:
for item in response_dict['responses']['GET_INVENTORY']['inventory_delta']['inventory_items']:
#print('item {}'.format(item))
if 'inventory_item_data' in item:
if 'pokemon' in item['inventory_item_data']:
pokemon = item['inventory_item_data']['pokemon']
if 'is_egg' in pokemon:
continue
pokemons = pokemons + [(pokemon['pokemon_id'], pokemon['cp'],pokemon['id'])]
#Magic reverse sorts (poke_id, CP, uq_id)
pokemons.sort(reverse=True)
print pokemons
pokemons_seen = []
for pokemon in pokemons:
if pokemon[0] in pokemons_seen:
print('Already captured this pokemon, delete it:'+str(pokemon))
api.release_pokemon(pokemon_id=pokemon[2])
print('Response dictionary: \n\r{}'.format(json.dumps(response_dict, indent=2)))
time.sleep(1.2)
else:
pokemons_seen = pokemons_seen + [pokemon[0]] |
@rvanvenetie Can you do a pull request so everyone can profit easily? |
@rvanvenetie would you like to make a pull-request for this? More than happy to implement if you do :) |
Actually, I do not have the time to properly implement this atm. I've simply ignored the cp parameter, and replaced the call to `transfer_low_cp_pokomon' with a call to snippet above. |
Really want to see this one implemented. It would be nice to keep at least one of each pokemon. CP might not interest everyone. Although transferring the lower CP duplicate would be preferred. |
Related: #142 |
Closing to avoid duplication spam. ON the works in #274. |
Why should we release a low CP Pokemon if it's the first time we caught it?
The text was updated successfully, but these errors were encountered: