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

Optimized recycling code and removed reduntant entries. #295

Merged
merged 13 commits into from Aug 2, 2016
Merged

Optimized recycling code and removed reduntant entries. #295

merged 13 commits into from Aug 2, 2016

Conversation

Nimryel
Copy link
Contributor

@Nimryel Nimryel commented Aug 1, 2016

There was a bunch of recycle code that did nothing. Improved the already existing optimized recycling of pokeballs, potions and revives as well as added berries to it. I will add incense to it as well in the future.
Tested & working with dev. branch.

@Nimryel
Copy link
Contributor Author

Nimryel commented Aug 1, 2016

Also added potion count to console, although not sure if it is really necessary; perhaps berry count is more relevant.

@DurtyFree
Copy link
Member

I need opinions on that because I actually thought there were ideas for implementing setting the individual amount of items you would keep, actually not just per type

}
}
}

private static async Task removeItems(int itemCount, ItemId item, CancellationToken cancellationToken, ISession session)
Copy link
Member

Choose a reason for hiding this comment

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

Please start functions uppercase:)

@littlemonster1
Copy link
Contributor

wasn't berries recycling fixed in merged PR #255 ?

besides that I am all for the head categories instead of individuals

@Nimryel
Copy link
Contributor Author

Nimryel commented Aug 2, 2016

@DurtyFree Fixed. Realistically, there is no need to do that for pokeballs, potions and berries since they are strictly upgrades (no reason to keep the weaker ones over the stronger ones). Perhaps Incense will be different however when the rest of them are released.

@Nimryel
Copy link
Contributor Author

Nimryel commented Aug 2, 2016

@littlemonster1 That code didn't have any actual RecycleItem calls, so it did nothing in the end.

@DurtyFree
Copy link
Member

@Nimryel You are right for full botting this isn't relevant. But for people just partly botting this might be relevant ( to actually be able configuring it properly )

@Nimryel
Copy link
Contributor Author

Nimryel commented Aug 2, 2016

@DurtyFree You have a point. It comes down to opinion I guess; personally, I feel that the config is getting cluttered enough as is. Perhaps there should be a separate ItemsConfig.json where individual values can be optionally set, but by default the automatic method is used?

@littlemonster1
Copy link
Contributor

littlemonster1 commented Aug 2, 2016

I think even for people partly botting this is not relevant (I am partly botting if at all, just being here since it fascinates me being involved in coding on a fun project for a little)

the arguments presented in #188 are mainly, "it currently does not work but before, while I could choose, it worked". I do agree with Nimryel, there is no reason to keep weaker items unless the algo does not work. No part time botter will be mad to throw a great ball instead of a pokeball as long as he has some type of pokeballs and not 300 berries :).

But Nimryel's proposed solution might be a good option.

@Nimryel
Copy link
Contributor Author

Nimryel commented Aug 2, 2016

It's a very simple algorithm, it just always discards the weakest items first until the defined TotalAmountOfXToKeep is reached, I just cleaned it up a bit and added berries. The deleted stuff is from the old way of doing it when the item counts were individually set in the ItemRecycleFilter (which does nothing now).

@DurtyFree
Copy link
Member

Okay guys, you won:) @Nimryel And also @littlemonster1 I love the reason that your just here because it fascinates you. This also drives me in this project:)

@Nimryel We have already planned on better organizing the configurations and split them in different configs.
Will merge that

@DurtyFree DurtyFree merged commit 4df7374 into MobBotTeam:development Aug 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants