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,6 +1,6 @@
import time
import math
import pydirectinput
from hardware_control import hw_ctrl
class DeathManager:
@@ -46,7 +46,7 @@ class DeathManager:
self.corpse_pos = (state['x'], state['y'])
self.is_running_to_corpse = True
print(f">>> [系统] 记录死亡坐标: {self.corpse_pos},准备释放灵魂...")
pydirectinput.press(self.release_spirit_key)
hw_ctrl.press(self.release_spirit_key)
time.sleep(5) # 等待加载界面
def run_to_corpse(self, state, get_state=None):
@@ -74,9 +74,8 @@ class DeathManager:
# 如果距离尸体很近0.005 约等于 10-20 码)
if is_arrived:
print(">>> 已到达尸体附近,尝试复活...")
pydirectinput.press(self.resurrect_key)
hw_ctrl.press(self.resurrect_key)
time.sleep(5)
self.is_running_to_corpse = False
self.corpse_pos = None
return