PokemonGo-Bot icon indicating copy to clipboard operation
PokemonGo-Bot copied to clipboard

Can we filter unwanted item with count?

Open tzull opened this issue 10 years ago • 6 comments

Refer from #502 i want ask how we can filter item with count. eg : we want remove 50 potion ( if potion > 50 it will remove 50 potion, else <50 it will keep potion ) and what is ["101","102","103","104"] ? how i can refer char of inventory item?

tzull avatar Jul 24 '16 01:07 tzull

I was just about to request a discard config so I will hack your question to do it since it falls on the same topic. I've checked another bot that checks for items upon spinning a pokestop and will act according to the config file. It allows you to set up which items you want or do not want to discard and the max holding amount of the items. This is how it looks like in the config file:

(##) Items drop (#) should the bot EVER drop items (true/false) drop_items=true

(#) max number of each item that the bot should keep if "drop_items" is enabled (#) use -1 in a item to never drop this specific item item_revive=20 item_max_revive=20 item_potion=0 item_super_potion=0 item_hyper_potion=80 item_max_potion=50 item_poke_ball=80 item_great_ball=-1 item_ultra_ball=-1 item_master_ball=-1 item_razz_berry=50

LostDGod avatar Jul 24 '16 01:07 LostDGod

Hi @LostDGod Thanks for your information, but in this last dev if i'm edit and enable json config i got error like : C:\Python\PokeBot\dev004>pokecli.py Traceback (most recent call last): File "C:\Python\PokeBot\dev004\pokecli.py", line 187, in main() File "C:\Python\PokeBot\dev004\pokecli.py", line 164, in main config = init_config() File "C:\Python\PokeBot\dev004\pokecli.py", line 56, in init_config load.update(json.load(data)) File "C:\Python\lib\json__init__.py", line 291, in load **kw) File "C:\Python\lib\json__init__.py", line 339, in loads return _default_decoder.decode(s) File "C:\Python\lib\json\decoder.py", line 364, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Python\lib\json\decoder.py", line 382, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded

dev commit : 0645743

tzull avatar Jul 24 '16 01:07 tzull

@tzull

what is ["101","102","103","104"] ? how i can refer char of inventory item?

https://github.com/PokemonGoF/PokemonGo-Bot/blob/dev/pokemongo_bot/item_list.py

The devs put together a list

2016-07-23 22:14:49 [+] Loot: 2016-07-23 22:14:49 [+] 50 xp 2016-07-23 22:14:49 [+] 2x Pokeball (Total: 34) 2016-07-23 22:14:49 [+] 1x Super Potion (Total: 35) 2016-07-23 22:14:49 [+] Recycling 1x Super Potion... 2016-07-23 22:14:49 [+] Recycling success

doctor-ew avatar Jul 24 '16 02:07 doctor-ew

Hi @doctor-ew ,

yeah, i'm forgot to read this code, i'm now using -if "101,102,103,201,202"

and got ,

[x] Out of pokeballs, switching to farming mode... 2016-07-24 12:46:23 [#] Now at Pokestop: King Jagiello Statue - Spinning... [#] Inventory is full, switching to catch mode... [x] Out of pokeballs, switching to farming mode... [#] A Wild Pinsir appeared! [CP 941] [Potential 0.58] [#] IV [Stamina/Attack/Defense] = [13/0/13] [x] Out of pokeballs, switching to farming mode...

and this still got looping if inventory full and don't have any pokeball. the question is How we can sent unwanted item at our ba to trash.

tzull avatar Jul 24 '16 05:07 tzull

please see https://github.com/PokemonGoF/PokemonGo-Bot/pull/638

dmateusp avatar Jul 24 '16 10:07 dmateusp

Item_filter works by "item_filter": "101,103,201,701" in commit f1933d3089b340392780da8fc9356e84e2fa2bf8 After PR #638 is merged both "item_filter": "101,103,201,701" and "item_filter": ["101","103","201","701"] will work

fredrik-hellmangroup avatar Jul 24 '16 21:07 fredrik-hellmangroup