Skip to content

Commit

Permalink
Merge pull request #5 from MerlionRock/MerlionRock-FollowPath
Browse files Browse the repository at this point in the history
FollowPath changes
  • Loading branch information
MerlionRock authored May 19, 2017
2 parents d51c234 + f02af6f commit 6b3c48c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
32 changes: 18 additions & 14 deletions pokemongo_bot/cell_workers/follow_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,29 @@ class FollowPath(BaseTask):

def initialize(self):
self._process_config()
self.points = self.load_path()
self.status = STATUS_MOVING
self.waiting_end_time = 0
self.distance_unit = self.bot.config.distance_unit
self.append_unit = False
if self.enable:
self.points = self.load_path()
self.status = STATUS_MOVING
self.waiting_end_time = 0
self.distance_unit = self.bot.config.distance_unit
self.append_unit = False

if self.path_start_mode == 'closest':
self.ptr = self.find_closest_point_idx(self.points)
if self.path_start_mode == 'closest':
self.ptr = self.find_closest_point_idx(self.points)

else:
self.ptr = 0
else:
self.ptr = 0

if self.disable_location_output:
self.emit_event(
'followpath_output_disabled',
formatted="Bot in follow path mode, position update disabled. You will not be inform of path taken by bot."
)
if self.disable_location_output:
self.emit_event(
'followpath_output_disabled',
formatted="Bot in follow path mode, position update disabled. You will not be inform of path taken by bot."
)
else:
self.status = STATUS_FINISHED

def _process_config(self):
self.enable = self.config.get("enable", True)
self.path_file = self.config.get("path_file", None)
self.path_mode = self.config.get("path_mode", "linear")
self.path_start_mode = self.config.get("path_start_mode", "first")
Expand Down
1 change: 1 addition & 0 deletions pokemongo_bot/cell_workers/spin_fort.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def work(self):
'items': awards
}
)
#time.sleep(10)
else:
self.emit_event(
'pokestop_empty',
Expand Down

0 comments on commit 6b3c48c

Please sign in to comment.