Skip to content
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

[Question] How to get pokemon attacks ? #251

Open
litil opened this issue Aug 22, 2016 · 3 comments
Open

[Question] How to get pokemon attacks ? #251

litil opened this issue Aug 22, 2016 · 3 comments

Comments

@litil
Copy link

litil commented Aug 22, 2016

I've been playing with the lib for a few days and I'm trying to understand what mean all attributes I get in the GetInventory response. For a pokemon for example, I see :
"pokemon_id":124, "cp":546, "stamina":61, "stamina_max":61, "move_1":222, "move_2":33, "individual_attack":15, "individual_defense":7, "individual_stamina":2, "cp_multiplier":0.4627983868122101, ...

How do I know the name and the strength of a pokemon's attacks? Is it related to move_X or individual_X ?

Also, how could I know how many candies I have for a pokemon family?

Thanks

@ameyer
Copy link

ameyer commented Aug 23, 2016

I don't know about the attacks, but you can get the candy like this

pokeAPI.GetInventory(function(err, inventory) {        
    var inventoryItems = inventory.inventory_delta.inventory_items;

    for(var i =0; i < inventoryItems.length; i++){
        var inventoryItem = inventoryItems[i];

        if(inventoryItem.inventory_item_data.pokemon_family){
            var pokemon = inventoryItem.inventory_item_data.pokemon_family;
            var id = pokemon['family_id'];
            var candy = pokemon['candy'];
        }
    }
});

@litil
Copy link
Author

litil commented Aug 24, 2016

Thanks a lot @ameyer !

Anyone knows how to get pokemons' attacks details?

@Metalick
Copy link

Metalick commented Oct 3, 2016

@litil inside hb:

` // Show MapPokemons (catchable) & catch
for (var i = hb.cells.length - 1; i >= 0; i--) {
for (var j = hb.cells[i].MapPokemon.length - 1; j >= 0; j--) { // use async lib with each or eachSeries should be better :)
var currentPokemon = hb.cells[i].MapPokemon[j];

                            (function (currentPokemon) {
                                var pokedexInfo = b.pokemonlist[parseInt(currentPokemon.PokedexTypeId) - 1];
                                console.log('[+] There is a ' + pokedexInfo.name + ' near!! I can try to catch it!' + currentPokemon.Latitude + "," + currentPokemon.Longitude);

                                b.EncounterPokemon(currentPokemon, function (suc, dat) {
                                    if (suc == "No result") return;
                                    //console.log('Encountering pokemon ' + pokedexInfo.name + '...');

                                    if (dat != null) {
                                        if (dat.WildPokemon != null) {
                                            console.log(chalk.bgYellow(">>> " + pokedexInfo.name + " | "+ dat.WildPokemon.pokemon.move_1 +" and "+ dat.WildPokemon.pokemon.move_2));
                                        }
                                    }
                                    //b.CatchPokemon(currentPokemon, 1, 1.950, 1, 1, function (xsuc, xdat) {
                                    //    var status = ['Unexpected error', 'Successful catch', 'Catch Escape', 'Catch Flee', 'Missed Catch'];
                                    //    console.log(status[xdat.Status]);
                                    //});
                                });
                            })(currentPokemon);`

Also check that #263 to get all correct response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants