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

added config to ignore item count for Spin and MoveToFort #3160

Merged
merged 1 commit into from
Aug 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions pokemongo_bot/cell_workers/move_to_fort.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@ class MoveToFort(BaseTask):

def initialize(self):
self.lure_distance = 0
self.lure_attraction = True #self.config.get("lure_attraction", True)
self.lure_max_distance = 2000 #self.config.get("lure_max_distance", 2000)
self.lure_attraction = self.config.get("lure_attraction", True)
self.lure_max_distance = self.config.get("lure_max_distance", 2000)
self.ignore_item_count = self.config.get("ignore_item_count", False)

def should_run(self):
has_space_for_loot = self.bot.has_space_for_loot()
if not has_space_for_loot:
self.emit_event(
'inventory_full',
formatted="Not moving to any forts as there aren't enough space. You might want to change your config to recycle more items if this message appears consistently."
formatted="Inventory is full. You might want to change your config to recycle more items if this message appears consistently."
)
return has_space_for_loot or self.bot.softban
return has_space_for_loot or self.ignore_item_count or self.bot.softban

def is_attracted(self):
return (self.lure_distance > 0)
Expand Down
8 changes: 5 additions & 3 deletions pokemongo_bot/cell_workers/spin_fort.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
class SpinFort(BaseTask):
SUPPORTED_TASK_API_VERSION = 1

def initialize(self):
self.ignore_item_count = self.config.get("ignore_item_count", False)

def should_run(self):
if not self.bot.has_space_for_loot():
self.emit_event(
'inventory_full',
formatted="Not moving to any forts as there aren't enough space. You might want to change your config to recycle more items if this message appears consistently."
formatted="Inventory is full. You might want to change your config to recycle more items if this message appears consistently."
)
return False
return True
return self.ignore_item_count or self.bot.has_space_for_loot()

def work(self):
fort = self.get_fort_in_range()
Expand Down