Closed dnsBlah closed 8 years ago
You can either use Pokedex and Items classes from this library:
from pokedex import Pokedex
from inventory import Items
print(getattr(Pokedex, 'PIDGEY'))
print(getattr(Pokedex, 'RATTATA'))
print(getattr(Items, 'POKE_BALL'))
print(getattr(Items, 'INCUBATOR_BASIC_UNLIMITED'))
Or you can use the protobufs directly:
import POGOProtos.Enums.PokemonId_pb2 as PokemonId_pb2
import POGOProtos.Inventory.ItemId_pb2 as ItemId_pb2
print(PokemonId_pb2.PokemonId.Value('PIDGEY'))
print(PokemonId_pb2.PokemonId.Value('RATTATA'))
print(ItemId_pb2.ItemId.Value('ITEM_POKE_BALL'))
print(ItemId_pb2.ItemId.Value('ITEM_INCUBATOR_BASIC_UNLIMITED'))
# You can also do that in reverse:
print(PokemonId_pb2.PokemonId.Name(16))
print(ItemId_pb2.ItemId.Name(1))
I knew it was possible to do it reversed :) I'm not so very well known in Python, but doing good. Thanks!
Hi all,
i would like to get the ID's using names (pokemon and items) That will make it a bit easier to put some config settings.
Like a argument, ignorepokemon ["pidgey","rattata"] etc.
But I'll need to get the ID from that string name.
Can we do that without making a new dictionary?