P0-2 镜牢简单键盘寻路改为按节点类型选方向

Browse Source
config 开着 mirror_keyboard_simple_pathfinding 时 AALC 每步只按 ↑ 进
最上面的节点(11-14:3 层只进过 1 次商店)。常规寻路要 mouse_drag 拖
地图,第二段拖动只受超时限制且超时会退回主界面;连线识别还依赖本机
坐标不对的 my_crop,所以不改用常规寻路(BACKLOG 方案 B)。

install_typed_keyboard_road() 替换 search_road/mirror 两处的简单键盘
寻路:仍只按键不拖地图,用 AALC 自带 ONNX 模型整屏识别巴士右侧一列
节点,按上游 all_node_weight 从低到高按 up/right/down,每次用原
_keyboard_enter_succeeded 确认,最多 3 次,都不行调用原函数按 ↑。
每步记录下一列候选和进入的方向、类型、理由。LCP_TYPED_ROAD=0 关闭。

README 同时补上 P0-1 商店清单与本补丁的说明。

验证:排序、方向映射、逐个回退、识别失败与开关均有单测,复制的权重
表和网格参数与上游源码比对一致;全套 529 项通过。方向上无连线时按键
不会进错节点这一点需实机确认,BACKLOG 已写明对照方法。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
yws
2026-11-14 05:51:36 +00:00
co-authored by Claude Opus 5.5
parent baa362808c
commit 4c0038d657
5 changed files with 299 additions and 1 deletions
+3 -1
View File
@@ -14,7 +14,8 @@ from .aalc_engine import bootstrap
from .aalc_patches import (WindowGuard, driver_click_tasks, headless_hdr_warning, from .aalc_patches import (WindowGuard, driver_click_tasks, headless_hdr_warning,
install_default_battle_team, install_exact_team_match, install_default_battle_team, install_exact_team_match,
install_robust_set_foreground, install_shop_lists, install_robust_set_foreground, install_shop_lists,
install_system_team_selection, mirror_progress, stop_driver_click) install_system_team_selection, install_typed_keyboard_road,
mirror_progress, stop_driver_click)
from .game_lock import GameBusyError, exclusive_game from .game_lock import GameBusyError, exclusive_game
# 任务 -> {参数名: AALC 配置项}; 参数只在本次运行内生效 # 任务 -> {参数名: AALC 配置项}; 参数只在本次运行内生效
@@ -128,6 +129,7 @@ def _run(task, params):
if task in ('mirror', 'all'): if task in ('mirror', 'all'):
install_system_team_selection(log=log) install_system_team_selection(log=log)
install_shop_lists(log=log) install_shop_lists(log=log)
install_typed_keyboard_road(log=log)
guard = WindowGuard(screen, cfg, log=log) guard = WindowGuard(screen, cfg, log=log)
guard.start() guard.start()
restore_path = os.environ.get(RESTORE_ENV) restore_path = os.environ.get(RESTORE_ENV)