Closed baskettcase closed 8 years ago
Looking at NicklasW\PkmGoApi\Api\Pokemon
in src/Api/Pokemon/Pokemon.php
, you can get the IV values with getIndividualAttack()
, getIndividualDefense()
and getIndividualStamina()
Aha thank you @jaspervdm
You can get the IV ratio directly with getIvRatio()
Thank you, I was able to figure that out once you gave me the direction to look, plus I did a sort by:
$pokemons = $pokeBank->getPokemonsByType(PokemonId::MAGIKARP)->sortByIVRatio(true);
My next question is how can I iterate through all my pokemon, instead of just one type. I've tried a couple different combinations, but I can't seem to find the right method.. seems like I can only work with a subset of the data?
Also.. every time I login, I believe my coordinates have to be set correct? If that's the case.. by default where is it setting me when I run any of the scripts?
@baskettcase To get your Pokemon as an array use $pokeBank->getPokemons()
// Initialize the pokemon go application
$application = new ApplicationKernel($manager);
// Retrieve the pokemon go api instance
$pokemonGoApi = $application->getPokemonGoApi();
// Retrieve the inventory
$inventory = $pokemonGoApi->getInventory();
// Retrieve the poke bank
$pokeBank = $inventory->getPokeBank();
//Print your Pokemon as an Array
echo '<pre>' . print_r( $pokeBank->getPokemons() ) . '</pre>';
And no, for the time being don't worry about setting your coordinates.
Resolved.
Sorry to comment on a "Resolved" issue, but after all the bans that I've seen going around, the not worrying about setting my coordinates thing that @lambasoft mentioned.. I am starting to worry about it. Can you explain why I shouldn't worry about it? :)
Is there a way of getting the IV values of each of the pokemon a person has? I went through the "Issues" and closed ones and didn't see anything about it, so Im hoping that there is a way?