Make turn recovery action configurable
This commit is contained in:
@@ -250,6 +250,8 @@ class AutoBotMove:
|
||||
release_spirit_key=None,
|
||||
resurrect_key=None,
|
||||
enable_mouse_loot=True,
|
||||
turn_error_key=None,
|
||||
turn_error_hold_sec=None,
|
||||
):
|
||||
self.last_tab_time = 0
|
||||
self.last_interaction_time = 0 # 记录上一次按互动键的时间
|
||||
@@ -271,7 +273,8 @@ class AutoBotMove:
|
||||
self._eating_started_at = None
|
||||
self.last_turn_signal_time = 0.0
|
||||
self.combat_signal_retry_sec = 1.0
|
||||
self.turn_error_hold_sec = 0.8
|
||||
self.turn_error_key = (turn_error_key or 's').strip().lower() or 's'
|
||||
self.turn_error_hold_sec = float(turn_error_hold_sec) if turn_error_hold_sec is not None else 0.8
|
||||
self._last_mouse_path_scale_signature = None
|
||||
# stop_check: 返回 True 表示需要立即停止(用于中断阻塞中的后勤/路线导航)
|
||||
self._stop_check = stop_check if callable(stop_check) else (lambda: False)
|
||||
@@ -710,9 +713,9 @@ class AutoBotMove:
|
||||
combat_error_signal == 50
|
||||
and (now - self.last_turn_signal_time) >= self.combat_signal_retry_sec
|
||||
):
|
||||
hw_ctrl.keyDown('s')
|
||||
hw_ctrl.keyDown(self.turn_error_key)
|
||||
time.sleep(self.turn_error_hold_sec)
|
||||
hw_ctrl.keyUp('s')
|
||||
hw_ctrl.keyUp(self.turn_error_key)
|
||||
self.last_turn_signal_time = now
|
||||
|
||||
self.last_target_hp = target_hp
|
||||
|
||||
Reference in New Issue
Block a user