Now bot can use berries. Yeah! + Fix #660, #666#655
Now bot can use berries. Yeah! + Fix #660, #666#655solderzzc merged 15 commits intoPokemonGoF:devfrom
Conversation
|
don't pull yet. resolve conflicts and fux bugs now. |
| berries_count = self.bot.item_inventory_count(berry_id) | ||
| if(catch_rate[pokeball-1] < 0.5 and berries_count > 0): # and potion is in stock | ||
| success_percentage = '{0:.2f}'.format(catch_rate[pokeball-1]*100) | ||
| logger.log('[x] Catch Rate is low ({}%). Throwing {}... ({} left!)'.format(success_percentage,self.item_list[str(pokeball)],berries_count-1)) |
There was a problem hiding this comment.
success_percentage,self.item_list[str(pokeball)],berries_count-1)
[x] Catch Rate is low ({}%). Throwing Pokeball...
Typo
|
This should be fine now. please merge it! |
| pokeball = 0 # player doesn't have any of pokeballs, great balls or ultra balls | ||
|
|
||
| ## Use berry to increase success chance. | ||
| berry_id = 701 # @ TODO: use better berries if possible |
There was a problem hiding this comment.
You should reference the constant from item_list.py
- remove extras log on capture - display IV on capture
| self.config.mode = 'farm' | ||
| return PokemonCatchWorker.NO_POKEBALLS | ||
|
|
||
|
@TheSavior updated. review again please. |
|
Would like to have it merged 👍 |
|
I like it too! 👍 |
| if response_dict and response_dict['status_code'] is 1: | ||
|
|
||
| for i in range(len(catch_rate)): | ||
| catch_rate[i] = catch_rate[i] * response_dict['responses']['USE_ITEM_CAPTURE']['item_capture_mult'] |
There was a problem hiding this comment.
Been testing this for a while and at times, item_capture_mult doesn't exist in USE_ITEM_CAPTURE, so it throws an error and crashes the bot.
Should add a if statement to prevent it from happen.
There was a problem hiding this comment.
I tested this PR long time too and it have been working without issues to me.
item_capture_mult exists in USE_ITEM_CAPTURE.
https://github.com/PokemonGoF/PokemonGo-Bot/blob/dev/proto/RpcSub.proto#L436
There was a problem hiding this comment.
It should exist in USE_ITEM_CAPTURE, yes, but as I said, it sometimes at rare occasions doesn't, which is why an IF statement would at least prevent a crash.
|
But need solve CI failed and another +1 need. |
|
do a new push and CI check will trigger re-run. |
|
@earthchie Please do a git rebase and then push so the travis CI can run and I will merge in |
…o dev # Conflicts: # pokemongo_bot/cell_workers/pokemon_catch_worker.py
|
don't pull yet. Testing in progress. |
- fix typo
|
Testing this now... |
…oF#666 (PokemonGoF#655)" This reverts commit 335a0aa.
…okemonGoF#655) * now bot can use berries * improve berry logic. apply berry before chosing the type of ball * fix bug * fix wrong item id * fix error * improve log message * - add blue color log - remove extras log on capture - display IV on capture * fix bug PokemonGoF#660 * improve code as comments * fix PokemonGoF#666 * show amount of Razz berries on start * fix error * - improve code as comments in PR - fix typo

If catch rate is low (under 50%). Thrown the berry to its face. Make them know who is the boss!
Fix