diff --git a/tasks/map/control/control.py b/tasks/map/control/control.py index 9e7ddd0ca..9f9ee6210 100644 --- a/tasks/map/control/control.py +++ b/tasks/map/control/control.py @@ -16,6 +16,8 @@ from tasks.map.resource.const import diff_to_180_180 class MapControl(Combat, AimDetectorMixin): + waypoint: Waypoint + @cached_property def minimap(self) -> Minimap: return Minimap() @@ -116,6 +118,7 @@ class MapControl(Combat, AimDetectorMixin): """ logger.hr('Goto', level=2) logger.info(f'Goto {waypoint}') + self.waypoint = waypoint self.device.stuck_record_clear() self.device.click_record_clear() @@ -203,7 +206,7 @@ class MapControl(Combat, AimDetectorMixin): return result # Arrive - if near :=self.minimap.is_position_near(waypoint.position, threshold=waypoint.get_threshold(end_opt)): + if near := self.minimap.is_position_near(waypoint.position, threshold=waypoint.get_threshold(end_opt)): near_queue.append(near) if not waypoint.expected_end or waypoint.match_results(result): logger.info(f'Arrive waypoint: {waypoint}') @@ -214,7 +217,6 @@ class MapControl(Combat, AimDetectorMixin): return result else: near_queue.append(near) - logger.info(near_queue) if np.mean(near_queue) < 0.6: waypoint.unexpected_confirm.reset() diff --git a/tasks/rogue/route/base.py b/tasks/rogue/route/base.py index 91b9926b1..1adf33426 100644 --- a/tasks/rogue/route/base.py +++ b/tasks/rogue/route/base.py @@ -191,8 +191,9 @@ class RouteBase(RouteBase_, RogueUI, RogueExit): if self.handle_popup_confirm(): return False - if self.handle_combat_interact(): - return False + if self.minimap.position_diff(self.waypoint.position) < 7: + if self.handle_combat_interact(): + return False return False @@ -244,6 +245,7 @@ class RouteBase(RouteBase_, RogueUI, RogueExit): end_point = waypoints[-1] end_point.end_rotation = end_rotation end_point.endpoint_threshold = 1.5 + end_point.end_rotation_threshold = 10 result = self.goto(*waypoints) # TODO: Domain exit detection