add 硬件控制模块 (hardware_control.py) 并修复游戏状态扫描区域宽度

- 新增 wyhkm.dll 硬件盒子 COM 接口封装,支持键盘鼠标控制
- 修复 game_state_config.json 中 scan_region_width 过小导致截图越界的问题
- 添加鼠标路径录制器、硬件测试脚本等工具
- 更新多项配置默认值

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
王鹏
2026-04-15 12:15:00 +08:00
parent b4de5278ed
commit 33dc741fd9
203 changed files with 12197 additions and 247 deletions

View File

@@ -1,10 +1,9 @@
"""
任务跟随:按固定间隔向游戏发送「跟随」与「交互」按键(pydirectinput与 auto_bot 一致)。
任务跟随:按固定间隔向游戏发送「跟随」与「交互」按键(使用 hw_ctrl 硬件盒子)。
"""
import time
import pydirectinput
from hardware_control import hw_ctrl
class QuestFollowBot:
@@ -30,9 +29,9 @@ class QuestFollowBot:
return
self._last_cycle = now
try:
pydirectinput.press(self.follow_key)
hw_ctrl.press(self.follow_key)
time.sleep(0.08)
pydirectinput.press(self.interact_key)
hw_ctrl.press(self.interact_key)
self._log(f"➡️ 任务跟随: {self.follow_key}{self.interact_key}")
except Exception as e:
self._log(f"❌ 任务跟随按键失败: {e}")