Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keep improving inventory by recycling based on type filter; #3135

Closed
wants to merge 5 commits into from

Conversation

tiagoAnon
Copy link

Short Description:

Enables inventory improving by setting a configuration for how much of each item type to keep and recycling the worst items.

Fixes:

  • Added type_filter config
  • Item filtering logic for berries, balls, potions and revives if type_filter is configured, overriding item_filter logic
  • Added sample json

Notes:
I haven't worked with Python for 5+ years, but I hope it's up to your standards ;)

@jimmywarting
Copy link

#2482 #2465 #2465 #2361

@cmezh
Copy link
Contributor

cmezh commented Aug 9, 2016

It's better not to silently override item_filter, but throw exception. Why to keep config parts that doesn't work (overridden)?

{
"type": "RecycleItems",
"config": {
"type_filter": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps this doesn't need its own config. You could add it to the other one and change this key to

  "// type_filter"

@elicwhite
Copy link
Contributor

This looks great. It seems like you have merge conflicts, can you fix those?

@douglascamata Please review when you get the chance

@douglascamata
Copy link
Member

@tiagoAnon can you solve merge conflicts, please?

@tiagoAnon
Copy link
Author

I did one last change, because the feature was causing a lot of logging noise due to some lack of sync of the inventory somewhere on the bot. Changed it to keep some unallocated space empty (based on the configuration). It seems to merge OK with Dev.

@douglascamata
Copy link
Member

@tiagoAnon please, split your logic in many smaller methods. The way it is now is very complicated to read and understand.

@jimmywarting
Copy link

I want type_filter

@elicwhite
Copy link
Contributor

@BriceSD, is there something we can do here to utilize inventory calls instead of all these checks on the response object?

@BriceSD
Copy link
Contributor

BriceSD commented Aug 13, 2016

@tiagoAnon This feature seems awesome, please update it to use the latest items_recycle. I really want to use it :D

@TheSavior Yes we should use the new inventory here. We should also add methods in the Items class to access to the lowest ball/potion/revive/etc. available, to get every member of the type ball/berry/potion/revive/etc. These could be reuse somewhere else, like in the pokemon_catcher to choose the type of ball that should be thrown.

@jimmywarting
Copy link

Maybe should make a completely new PR? it have been lot of changes to the recycle script

@BriceSD
Copy link
Contributor

BriceSD commented Aug 15, 2016

Merged #4005. We have this feature now.

@BriceSD BriceSD closed this Aug 15, 2016
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.

8 participants