Make turn recovery action configurable
This commit is contained in:
17
auto_bot.py
17
auto_bot.py
@@ -199,7 +199,15 @@ def load_attack_loop(path):
|
||||
|
||||
|
||||
class AutoBot:
|
||||
def __init__(self, waypoints=None, attack_loop_path=None, skinning_wait_sec=None, enable_mouse_loot=True):
|
||||
def __init__(
|
||||
self,
|
||||
waypoints=None,
|
||||
attack_loop_path=None,
|
||||
skinning_wait_sec=None,
|
||||
enable_mouse_loot=True,
|
||||
turn_error_key=None,
|
||||
turn_error_hold_sec=None,
|
||||
):
|
||||
self.last_tab_time = 0
|
||||
self.last_interaction_time = 0
|
||||
self.last_target_hp = 0
|
||||
@@ -215,8 +223,9 @@ class AutoBot:
|
||||
self.enable_mouse_loot = enable_mouse_loot
|
||||
self.cursor_mgr = CursorManager()
|
||||
self.last_turn_signal_time = 0.0
|
||||
self.turn_error_key = (turn_error_key or 's').strip().lower() or 's'
|
||||
self.combat_signal_retry_sec = 1.0
|
||||
self.turn_error_hold_sec = 0.8
|
||||
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
|
||||
|
||||
def execute_disengage_loot(self):
|
||||
@@ -525,9 +534,9 @@ class AutoBot:
|
||||
combat_error_signal == 50
|
||||
and (current_time - 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 = current_time
|
||||
self.last_target_hp = target_hp
|
||||
if state['combat']:
|
||||
|
||||
Reference in New Issue
Block a user