pokeminer icon indicating copy to clipboard operation
pokeminer copied to clipboard

Getting name with new update

Open SapitoSucio opened this issue 8 years ago • 2 comments

Any idea how can I obtain names with the newest update ?

This is the code that obtain names:


    def get_pokemon_name(pokemon_id):
        if not hasattr(get_pokemon_name, 'names'):
            file_path = os.path.join(os.getcwd()+'/pokemon.json')

            with open(file_path, 'r') as f:
                get_pokemon_name.names = json.loads(f.read())

        return get_pokemon_name.names[int(pokemon_id)]

    with open(pokenamelanguage, 'r') as f:
        mydict = eval(f.read())
        inv_map = dict(zip(mydict.values(), mydict.keys()))

    pokename = inv_map.keys()[inv_map.values().index(str(Pokemon_ID))]

    print pokename

#Here you can filter what to show:
    goodlist = [131,134,135,136,137,139,141,142,143,147,148,149,150,151]
    print int(Pokemon_ID)

    if int(Pokemon_ID) in goodlist:
        print 'IN GOODLIST'

I attached the complete file if someone wants it notifyme.zip

SapitoSucio avatar Aug 08 '16 23:08 SapitoSucio

check the web.py for all ocurences of POKEMON_NAMES and you will understand how it can be done

Aiyubi avatar Aug 09 '16 06:08 Aiyubi

If you don't feel like changing code you could just grab the locales folder from a previous release (it was removed in 0.5) and place it in your pokeminer directory. Names should work fine with the notify script then.

metawurx avatar Aug 09 '16 08:08 metawurx