PokemonGo-Bot icon indicating copy to clipboard operation
PokemonGo-Bot copied to clipboard

[Suggestion] Pokeball Farm if no pokeball.

Open necrozis opened this issue 10 years ago • 5 comments

    if pokeballs = 0:
        farm pokestops until pokeballs >= [some number] then continue hunting

necrozis avatar Jul 21 '16 09:07 necrozis

I've come in to go through and remove all massive JSON dumps - this is still a WIP and no where near ready.

I'm slowly going through and doing what I can. More than welcome to help out! I can merge updates in if you have done anything :)

eggins avatar Jul 21 '16 10:07 eggins

Add Pokemon Names code to Pull. Edit this to "[Suggestion] Pokeball Farm if no pokeball."

necrozis avatar Jul 21 '16 11:07 necrozis

@necrozis just merged the pokemon name pulling.

Currently working on company website. Will come back to pokemon shortly.

eggins avatar Jul 21 '16 11:07 eggins

@eggins, this code store how many balls of each type in your inventory.

    api.get_player().get_inventory()

    inventory_req = api.call()

    inventory_dict = inventory_req['responses']['GET_INVENTORY']['inventory_delta']['inventory_items']

    pokeBalls = {1:0,2:0,3:0}

    #print('Response dictionary: \n\r{}'.format(json.dumps(response_dict['responses']['GET_INVENTORY']['inventory_delta'])))
    for item in inventory_dict:
        try:
            if item['inventory_item_data']['item']['item'] == 1:
                #print('Poke Ball count: ' + str(item['inventory_item_data']['item']['count']))
                pokeBalls[1] = item['inventory_item_data']['item']['count']
            if item['inventory_item_data']['item']['item'] == 2:
                #print('Great Ball count: ' + str(item['inventory_item_data']['item']['count']))
                pokeBalls[2] = item['inventory_item_data']['item']['count']
            if item['inventory_item_data']['item']['item'] == 3:
                #print('Ultra Ball count: ' + str(item['inventory_item_data']['item']['count']))
                pokeBalls[3] = item['inventory_item_data']['item']['count']
        except:
            continue

    print(pokeBalls)

necrozis avatar Jul 21 '16 14:07 necrozis

There will be the need to discard potions/revives/berries as well as the inventory might fill with these.

CharlesVu avatar Jul 21 '16 15:07 CharlesVu