Skip to content

Comments

Items cleaner#1143

Closed
Surceis wants to merge 11 commits intoPokemonGoF:devfrom
Surceis:items_cleaner
Closed

Items cleaner#1143
Surceis wants to merge 11 commits intoPokemonGoF:devfrom
Surceis:items_cleaner

Conversation

@Surceis
Copy link
Contributor

@Surceis Surceis commented Jul 27, 2016

Short Description:
inventory cleaner and show more items at start

@elicwhite
Copy link
Contributor

This looks much better, thanks for putting it up again.

I think this should be enabled behind a config flag.

self.max_storage = max_storage
self.items = items

def check(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

The entry points to all workers needs to be called work. You can have your work function call something else though if you'd like.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@fredrik-hellmangroup
Copy link
Contributor

If its a item cleaner function, it should defintly use the already existing item_filter config @TheSavior don't you agree?

@elicwhite
Copy link
Contributor

elicwhite commented Jul 27, 2016

Yes, if that exists, I definitely agree.

Looks like in SeenFortWorker we have:

id_filter = self.config.item_filter.get(str(item_id), 0)
                        if id_filter is not 0:
                            id_filter_keep = id_filter.get('keep',20)

We can probably use that logic, and by having a DropItemsWorker inside the event loop, we will be able to remove all logic about recycling items from the SeenFortWorker. That is very exciting.

@elicwhite
Copy link
Contributor

elicwhite commented Jul 27, 2016

👍

Approved with PullApprove

@fredrik-hellmangroup
Copy link
Contributor

still some problems

Traceback (most recent call last):
File "D:\Pokemon stuff\PokemonGo-Bot\pokecli.py", line 40, in
from pokemongo_bot import PokemonGoBot
File "D:\Pokemon stuff\PokemonGo-Bot\pokemongo_bot__init__.py", line 17, in
from cell_workers import CatchVisiblePokemonWorker, PokemonCatchWorker, SeenFortWorker, MoveToFortWorker, InitialTransferWorker, EvolveAllWorker, DropItemsWorker
ImportError: cannot import name DropItemsWorker

@elicwhite
Copy link
Contributor

elicwhite commented Jul 27, 2016

👍

Approved with PullApprove

@ZgrK
Copy link
Contributor

ZgrK commented Jul 27, 2016

I started now and my inventory is this

screen shot 2016-07-27 at 11 24 42 am

but not started cleaning.

i'm waiting now until full

because 311/350 = 0 in v2 and 0.888 in v3
if self.items[Item.ITEM_REVIVE.value] > 25:
how_many = self.items[Item.ITEM_REVIVE.value] - 25
items_to_remove.append([Item.ITEM_REVIVE.value, how_many, '{} Revive'.format(how_many)])
self.items[Item.ITEM_REVIVE.value] = self.items[Item.ITEM_REVIVE.value] - (how_many)
Copy link
Member

@douglascamata douglascamata Jul 27, 2016

Choose a reason for hiding this comment

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

This GIGANTIC block of IFs makes me wanna cry. Why are you not using the item_filter? It's easy to add support to item names there, instead of IDs to make it more simple to the user. There is no way this PR is being merged with this craziness here. Check my PR for a very very simple DropItemWorker (I call it RecycleItemWorker, but whatever): #1156

@ZgrK
Copy link
Contributor

ZgrK commented Jul 27, 2016

After last update working
screen shot 2016-07-27 at 11 47 07 am

Still i'm testing

@ZgrK
Copy link
Contributor

ZgrK commented Jul 27, 2016

This branch has conflicts that must be resolved

@elicwhite
Copy link
Contributor

@Zgrkaralar, the basics of this functionality were added in #1156. @Surceis said he'd look into adding these changes on top of that.

@Surceis Surceis closed this Jul 27, 2016
@Surceis Surceis deleted the items_cleaner branch July 27, 2016 09:39
hoanghuynh pushed a commit to hoanghuynh/PokemonGo-Bot that referenced this pull request Sep 28, 2016
Revert "gevent hotfixes" (aka, hell naw gevent)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants