Skip to content

Comments

Now bot can use berries. Yeah! + Fix #660, #666#655

Merged
solderzzc merged 15 commits intoPokemonGoF:devfrom
earthchie:dev
Jul 25, 2016
Merged

Now bot can use berries. Yeah! + Fix #660, #666#655
solderzzc merged 15 commits intoPokemonGoF:devfrom
earthchie:dev

Conversation

@earthchie
Copy link
Contributor

@earthchie earthchie commented Jul 24, 2016

@earthchie
Copy link
Contributor Author

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))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

success_percentage,self.item_list[str(pokeball)],berries_count-1)
[x] Catch Rate is low ({}%). Throwing Pokeball...
Typo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@earthchie
Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing whitespace

@earthchie
Copy link
Contributor Author

@TheSavior updated. review again please.

@earthchie earthchie changed the title Now bot can use berries. Yeah! Now bot can use berries. Yeah! + Fix #666 Jul 24, 2016
@Nihisil
Copy link
Contributor

Nihisil commented Jul 24, 2016

Would like to have it merged 👍

@earthchie earthchie changed the title Now bot can use berries. Yeah! + Fix #666 Now bot can use berries. Yeah! + Fix #660, #666 Jul 24, 2016
@mercuriete
Copy link
Contributor

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']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

@Nihisil Nihisil Jul 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@solderzzc
Copy link
Contributor

solderzzc commented Jul 24, 2016

👍

Approved with PullApprove

@solderzzc
Copy link
Contributor

But need solve CI failed and another +1 need.

@fredrik-hellmangroup
Copy link
Contributor

do a new push and CI check will trigger re-run.

@ProjectBarks
Copy link

@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
@earthchie
Copy link
Contributor Author

don't pull yet. Testing in progress.

@earthchie
Copy link
Contributor Author

Alright. tested!

ready to pull

image

@eggins
Copy link
Contributor

eggins commented Jul 25, 2016

Testing this now...

@earthchie earthchie mentioned this pull request Jul 25, 2016
@solderzzc solderzzc merged commit 335a0aa into PokemonGoF:dev Jul 25, 2016
earthchie pushed a commit to earthchie/PokemonGo-Bot that referenced this pull request Jul 25, 2016
MFizz pushed a commit to MFizz/PokemonGo-Bot that referenced this pull request Jul 29, 2016
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants