Armax / Pokemon-GO-node-api

Pokemon GO api node.js library
MIT License
875 stars 198 forks source link

How do you get data on the pokemon you just caught? #243

Open ameyer opened 7 years ago

ameyer commented 7 years ago

Using pokeAPI.CatchPokemon, I just get back a CatchPokemonResponse with a status and MissPercent.

Other than checking the inventory, how do I get information (id, type, cp, etc) on the Pokemon that was caught?

ameyer commented 7 years ago

I enabled CapturedPokemonId in pokemon.proto and changed to a fixed64. I also enabled CaptureAward in pokemon.proto.

Now I at least get something good.

  CapturedPokemonId: Long { low: 231617896, high: -1834732217, unsigned: true },
  CaptureAward: 
   { ActivityType: [ 1, 12, 13 ],
     XP: [ 100, 100, 10 ],
     Candy: [ 3, 0, 0 ],
     Stardust: [ 100, 0, 0 ] } }

But now how would I take that Pokemon ID and get info on that pokemon?

monarchfish commented 7 years ago

how do you get CaptureAward?

when you EncounterPokemon it's will callback some data like pokemon ID

monarchfish commented 7 years ago

EncounterPokemon second callback like this

{ WildPokemon: { EncounterId: Long { low: -69370227, high: -664151409, unsigned: true }, LastModifiedMs: Long { low: -1859329067, high: 342, unsigned: false }, Latitude: 24.979762628558674, Longitude: 121.41825154371163, SpawnPointId: '34681d1ebe3', pokemon: { Id: null, PokemonId: 120, cp: 37 }, TimeTillHiddenMs: 727191 }, EncounterBackground: null, EncounterStatus: 1 }

ameyer commented 7 years ago

To enable CaptureAward I just went into pokemon.proto and enabled it. It is commented out for some reason.

ameyer commented 7 years ago

Thanks for this!