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

How to increase the CP level of greatball?

Open harsh1412 opened this issue 10 years ago • 10 comments

So i saw in the bot that its using the greatballs even on low level CP pokemons. How do i increase the amount of CP which a greatball triggers?

harsh1412 avatar Jul 22 '16 12:07 harsh1412

I missed this section of the implementation. @douglascamata could you help on this one?

eggins avatar Jul 22 '16 12:07 eggins

Currently it does look for the best pokeball available:

for i in range(3):
                                for item in self.inventory:
                                    if item['item'] is not i:
                                        continue
                                    if item['count'] is 0:
                                        continue
                                    pokeball = i
                                    item['count'] -= 1
                                    break

@eggins We can use something like this:

            if (masterBallsCount > 0 && pokemonCp >= 1000)
              MASTER_BALL;
            else if (ultraBallsCount > 0 && pokemonCp >= 1000)
               ULTRA_BALL;
            else if (greatBallsCount > 0 && pokemonCp >= 1000)
                GREAT_BALL;

            if (ultraBallsCount > 0 && pokemonCp >= 600)
                ULTRA_BALL;
            else if (greatBallsCount > 0 && pokemonCp >= 600)
                GREAT_BALL;

            if (greatBallsCount > 0 && pokemonCp >= 350)
                GREAT_BALL;

Need a PR ;)?

brantje avatar Jul 22 '16 12:07 brantje

@brantje @eggins isn't this set at line 65 of pokemon_catch_worker.py??

RetroEngineering avatar Jul 22 '16 12:07 RetroEngineering

Nope, see this. On line 42-51 it looks for the strongest ball. Already working on a fix

brantje avatar Jul 22 '16 12:07 brantje

@brantje weird, mine seems to be working.

[#] A Wild Rattata appeared! [CP68] [x] Using Pokeball... [x] Captured Rattata! [CP68] - exchanging for candy [x] Exchanged successfully! [x] Found pokemon at distance 329.249950733m [#] Walking from (30.511562712141007, -97.67613412729037) to (30.511319456121722, -97.6757101444806) for approx. 3.0 seconds [#] Finished walking to (30.511319456121722, -97.6757101444806) [x] Walked to Pokemon [#] A Wild Pidgey appeared! [CP266] [x] Using Greatball... [x] Captured Pidgey! [CP266]

RetroEngineering avatar Jul 22 '16 12:07 RetroEngineering

Can't debug right now, servers are down -_-

brantje avatar Jul 22 '16 12:07 brantje

@brantje nope its off the master

I think 42-51 is if your out of balls it switches

RetroEngineering avatar Jul 22 '16 12:07 RetroEngineering

Can you also add a check to see if the pokemon has already been caught before? I'd only like to use great balls on new pokemons above a certain level.

jasonleeraert avatar Jul 22 '16 13:07 jasonleeraert

capture_probability = response_dict['responses']['ENCOUNTER']['capture_probability']['capture_probability']

 if self.ballstock[1] > 0:
                                #DEBUG - Hide
                                #print 'use Poke Ball'
                                pokeball = 1
                            else:
                                #DEBUG - Hide
                                #print 'no Poke Ball'
                                pokeball = 0

                            if self.ballstock[2] > 0 and capture_probability[0] < 0.5:
                                #DEBUG - Hide
                                #print 'use Great Ball'
                                pokeball = 2

                            if self.ballstock[3] > 0 and capture_probability[1] < 0.5:
                                #DEBUG - Hide
                                #print 'use Utra Ball'
                                pokeball = 3

Would it make more sense? I don't think wasting a great ball on a pokemon that has a capture probability > 0.5 for a pokeball is a good thing.

fsegouin avatar Jul 22 '16 14:07 fsegouin

good function added with probability in PR #618

fredrik-hellmangroup avatar Jul 24 '16 22:07 fredrik-hellmangroup