-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Only work on forts when there is space in the bag. Do not switch mode #1237
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,9 +44,9 @@ def start(self): | |
random.seed() | ||
|
||
def take_step(self): | ||
self.process_cells(work_on_forts=True) | ||
self.process_cells() | ||
|
||
def process_cells(self, work_on_forts=True): | ||
def process_cells(self): | ||
location = self.position[0:2] | ||
cells = self.find_close_cells(*location) | ||
|
||
|
@@ -64,7 +64,7 @@ def process_cells(self, work_on_forts=True): | |
|
||
# Have the worker treat the whole area as a single cell. | ||
self.work_on_cell({"forts": forts, "wild_pokemons": wild_pokemons, | ||
"catchable_pokemons": catchable_pokemons}, location, work_on_forts) | ||
"catchable_pokemons": catchable_pokemons}, location) | ||
|
||
def update_web_location(self, cells=[], lat=None, lng=None, alt=None): | ||
# we can call the function with no arguments and still get the position and map_cells | ||
|
@@ -156,7 +156,7 @@ def find_close_cells(self, lat, lng): | |
) | ||
return map_cells | ||
|
||
def work_on_cell(self, cell, position, work_on_forts=1): | ||
def work_on_cell(self, cell, position): | ||
# Check if session token has expired | ||
self.check_session(position) | ||
|
||
|
@@ -174,8 +174,11 @@ def work_on_cell(self, cell, position, work_on_forts=1): | |
if worker.work() == WorkerResult.RUNNING: | ||
return | ||
|
||
if ((self.config.mode == "all" or | ||
self.config.mode == "farm") and work_on_forts): | ||
|
||
number_of_things_gained_by_stop = 5 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this variable do? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just make it clear why the number is there. |
||
|
||
if ((self.get_inventory_count('item') < self._player['max_item_storage'] - 5) and | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's actually possible for stops to give out more than 5 items. I've seen it give out 6 in the actual game. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I think I've seen someone say 7 on reddit. I'd be happy to set it to that, but I was kinda trying to go with the average case instead of the best case. |
||
(self.config.mode == "all" or self.config.mode == "farm")): | ||
if 'forts' in cell: | ||
# Only include those with a lat/long | ||
forts = [fort | ||
|
@@ -273,7 +276,8 @@ def _print_character_info(self): | |
currency_2 = "0" | ||
|
||
if response_dict: | ||
player = response_dict['responses']['GET_PLAYER']['player_data'] | ||
self._player = response_dict['responses']['GET_PLAYER']['player_data'] | ||
player = self._player | ||
else: | ||
logger.log("The API didn't return player info, servers are unstable - retrying.", 'red') | ||
sleep(5) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
work_on_forts was no longer set to False anywhere, since some of the changes yesterday.