Skip to content

Commit 3768ed0

Browse files
committed
fix: 修复部分任务中重置角色位置失败导致超时的问题 (#248)
此提交解决了 Issue #248 中提到的重置位置失败问题: 1. 修改了点击重置角色位置按钮的位置偏移参数,并在点击前和点击后增加短暂等待,以提高点击成功率。 2. 优化了 Auto65ArtifactTask_Fast 中的错误处理,在复位失败时不再直接抛出异常,而是记录日志并放弃当前任务准备重试。
1 parent 9f68934 commit 3768ed0

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/tasks/CommissionsTask.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,11 +505,12 @@ def reset_and_transport(self):
505505
post_action=lambda: self.click_box_random(setting_other),
506506
time_out=10,
507507
)
508+
self.sleep(0.5)
508509
confirm_box = self.box_of_screen_scaled(2560, 1440, 1298, 776, 1368, 843, name="confirm_btn", hcenter=True)
509510
safe_box = self.box_of_screen_scaled(2560, 1440, 125, 207, 1811, 1234, name="safe_box", hcenter=True)
510511
self.wait_until(
511512
condition=lambda: self.find_start_btn(box=confirm_box),
512-
post_action=lambda: self.click_relative_random(0.5016, 0.4074, 0.6906, 0.4380, use_safe_move=True, safe_move_box=safe_box),
513+
post_action=lambda: self.click_relative_random(0.5078, 0.4028, 0.6836, 0.4306, after_sleep=0.5, use_safe_move=True, safe_move_box=safe_box),
513514
time_out=10,
514515
)
515516
self.sleep(0.5)

src/tasks/fullauto/Auto65ArtifactTask_Fast.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,9 @@ def walk_to_aim(self, delay=0):
214214
self.send_key_up("lalt")
215215
# 19.97s: 复位并传送到目标位置
216216
if not self.reset_and_transport():
217-
raise Exception("复位失败")
217+
logger.info("复位失败,重开任务...")
218+
self.give_up_mission()
219+
return
218220

219221
# ===== 路径编写结束 =====
220222

0 commit comments

Comments
 (0)