Author SHA1 Message Date
ywsandClaude Opus 5.5 dd4259d41b 实验: 编队列表滑动补丁重写 (默认关闭, LCP_TEAM_SCROLL_PATCH=1 启用)
替代 66418dc 中的版本, 只验证"Windows 缺少队伍拖拽规避"这一假设:
- 几何/行程沿用 AALC build_windows_scroll_swipe_plan, 不改变 Windows 翻页标定
  (原版两端各加 60px escape);
- 参照 MuMu 在脱离段后保持 0.1s、松手前停稳 0.5s;
- 显式等待驱动分段移动: 原版后台每段 duration<0.01s, AALC _mouse_move_to
  步数为 0, 一个移动事件都不发; 前台关闭 pyautogui 默认 0.1s 停顿
  (原版单次滑动约 4.4s);
- 默认不安装, 需实机在编队界面验证后再决定是否默认开启。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 03:58:35 +00:00
ywsandClaude Opus 5.5 95ae060118 task_status 在退出码为 0 但日志有报错时附上 errors
取自 codex/story-test-20261003 的 66418dc (DSH) 中 tasks.py 部分及其两项测试:
AALC 每日流程单次战斗失败("未能进入战斗")后仍 exit 0, 只看 succeeded 会误判。
同一提交里的编队滑动补丁未合入: 后台模式分段移动时长 <0.01s 时 AALC 的
_mouse_move_to 步数为 0 不发移动事件, 前台每段受 pyautogui 默认 0.1s 停顿
影响单次滑动约 4.4s, 且行程比 AALC 的 Windows 标定多 60px; 另行重写后实测。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 03:56:16 +00:00
ywsandClaude Opus 5.5 a993210760 合并 codex/mcp-runtime-reliability: 运行可靠性、局状态与决策交接
与 main 上的审查修复及 2131f89 (story-test) 合并, 冲突处理:
- mcp_session: 保留超时/取消客户端, 补回 raise_on_error
- 执行器: 局状态改用 run_state (run_id 绑定), 取代完成后归档 context;
  Jev 请求统一经 jev_client.request_answer (支持 baseUrl/curl, 返回置信度与概率);
  保留截图解码缓存、地图模板缓存、按坐标点按钮、use_last_error 单实例互斥;
  刷新计数与开战标记只在动作成功后更新
- battle_batch: 取消/预算框架 + 只在看到胜率按钮时点胜率再回车;
  回合标签改为包含匹配 (OCR 常输出 'wave1')
- 文档采用 reliability 版本 (已是仓库相对路径), 注明 jev_client
- 测试: 互斥量桩改为 WinDLL/get_last_error, 战斗批次测试按胜率语义重写,
  Jev 测试改为对 jev_client 打桩, 生命周期测试改为轮询; 145 项通过

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 03:12:48 +00:00
Codex 2131f89e62 记录 4-48 实测失败与耗时复盘,修复前台输入及 Jev 配置 2026-10-03 10:56:19 +08:00
ywsandClaude Opus 5.5 030527f5de 审查修复: 任务配置恢复、执行器容错与续局状态、识别性能
正确性
- stop_task 强杀后 run_task 的临时次数会残留在 config.yaml (AALC 中途整份存盘);
  任务启动时先落盘原值, 强停/异常退出后由 TaskRunner 用 --restore 写回,
  写回失败时拒绝启动新任务并在 task_status 显示 pending_restore
- Jev 执行器: 工具失败不再抛异常导致整局退出 (Session raise_on_error=False),
  原有的"截图暂不可用"等降级分支终于生效; 刷新计数/开战标记只在动作成功后更新
- 一局完成后归档 jev_shop_context.json, 否则 claim_requested 让下一局一启动就判定完成
- 通用按钮直接点已核对的坐标, 不再 click_text 重新搜索 (可能点到背景同名按钮)
- 认证行按字节比较, 非 ASCII 输入不再让 compare_digest 抛 TypeError
- 单实例互斥改用 use_last_error 读取 ERROR_ALREADY_EXISTS

性能
- find_image 只在窗口尺寸变化时清模板缓存 (原来每次两次全量 gc); 模板列表只扫描一次
- 截图 PNG 压缩级别 1: 1080p 存图 0.66s -> 0.19s
- 执行器每帧截图只解码一次 (button_enabled 75ms -> 0.3ms); 地图模板与 ORB 描述子按比例缓存
- 箭头模板用 imdecode 读取, 支持中文路径 (输出与 imread 逐像素一致)

测试 73 -> 84, 修改前的识别输出与修改后逐项比对一致。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 00:31:21 +00:00
ywsandClaude Opus 5.5 5ab5fd9508 文档路径改为仓库相对路径, 去掉个人用户目录
笔记/skill/Jev 说明里指向 C:/Users/<用户名>/.codex 和 D:/codex/limbus_tools
的链接改为仓库内路径; docs/feedback 下的实测记录登记了哈希, 保持原样。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 00:02:37 +00:00
29 changed files with 1657 additions and 173 deletions
+2 -2
View File
@@ -12,7 +12,7 @@
- Python:`D:\codex\lc-mcp\vendor\aalc\.venv\Scripts\python.exe`。 - Python:`D:\codex\lc-mcp\vendor\aalc\.venv\Scripts\python.exe`。
- 登录任务:`LcMCPServer`,普通权限,后台 `pythonw.exe` 服务,监听 `127.0.0.1:8765`。 - 登录任务:`LcMCPServer`,普通权限,后台 `pythonw.exe` 服务,监听 `127.0.0.1:8765`。
- 已向 Codex 注册 stdio MCP `limbus`,由 `lc_mcp\bridge.py` 连接常驻服务。 - 已向 Codex 注册 stdio MCP `limbus`,由 `lc_mcp\bridge.py` 连接常驻服务。
- 服务日志:`C:\Users\Dainsleif\lc_mcp\server.log`。认证凭据未写入报告。 - 服务日志:`%USERPROFILE%\lc_mcp\server.log`。认证凭据未写入报告。
## 修复 ## 修复
@@ -53,7 +53,7 @@
复测命令: 复测命令:
```powershell ```powershell
cd D:\codex\lc-mcp cd <仓库目录>
$env:PYTHONUTF8='1' $env:PYTHONUTF8='1'
& vendor\aalc\.venv\Scripts\python.exe -m unittest discover -s tests -v & vendor\aalc\.venv\Scripts\python.exe -m unittest discover -s tests -v
& vendor\aalc\.venv\Scripts\python.exe -X utf8 scripts\mcp_probe.py task_status & vendor\aalc\.venv\Scripts\python.exe -X utf8 scripts\mcp_probe.py task_status
+41 -1
View File
@@ -81,7 +81,21 @@ codex mcp add limbus --env PYTHONUTF8=1 -- D:\lc-mcp\vendor\aalc\.venv\Scripts\p
| `task_status(lines)` / `stop_task` | 任务状态、日志尾部(`~/lc_mcp/runs`)、强制停止 | | `task_status(lines)` / `stop_task` | 任务状态、日志尾部(`~/lc_mcp/runs`)、强制停止 |
任务运行期间,点击/按键类工具会被拒绝(防止打乱 AALC 的流程),只读工具仍可用。 任务运行期间,点击/按键类工具会被拒绝(防止打乱 AALC 的流程),只读工具仍可用。
`run_task` 传入的次数只对本次运行生效,结束后恢复 `config.yaml` 原值。 `run_task` 传入的次数只对本次运行生效,结束后恢复 `config.yaml` 原值。AALC 运行中会整份保存配置,
所以任务启动时先把原值写到 `~/lc_mcp/runs/*.restore.json`;`stop_task` 强停或任务进程异常退出后,
服务会据此写回。写回失败时 `task_status` 显示 `pending_restore`,并在写回成功前拒绝启动新任务。
`state` 只反映任务子进程的退出码。AALC 在单次战斗失败(例如日志里的
`超出最大尝试次数,未能进入战斗`)后仍会继续跑完并正常退出,所以 `task_status`
会把日志尾部的 `[ERROR]`/异常行放进 `errors` 字段:**看到 `succeeded` 也要先看 `errors`。**
### 实验:编队列表滑动补丁(默认关闭)
AALC 基类允许适配器覆盖 `mouse_swipe_for_team_scroll`“以规避队伍拖拽判定”,上游只有 MuMu 实现了。
`lc_mcp/aalc_input_patch.py` 在 Windows 前台/后台适配器上补了一个最小版本:几何与行程沿用 AALC 的
`build_windows_scroll_swipe_plan`(不改变 Windows 翻页标定),脱离段后保持 0.1 秒、松手前停稳 0.5 秒。
是否真有队伍被拖乱的问题尚无实机证据,所以默认不启用。验证方法:给常驻服务设置环境变量
`LCP_TEAM_SCROLL_PATCH=1` 后重启服务,跑一次需要选队的日常任务,核对选中的队伍、编队人数以及 `task_status` 的 `errors`。
## 环境变量 ## 环境变量
@@ -90,9 +104,32 @@ codex mcp add limbus --env PYTHONUTF8=1 -- D:\lc-mcp\vendor\aalc\.venv\Scripts\p
| `AALC_DIR` | `vendor/aalc` | 使用其他位置的 AALC 源码 | | `AALC_DIR` | `vendor/aalc` | 使用其他位置的 AALC 源码 |
| `LCP_PORT` | 8765 | 服务/bridge 端口 | | `LCP_PORT` | 8765 | 服务/bridge 端口 |
| `LCP_KEEP_SHOTS` | 30 | 截图保留张数 | | `LCP_KEEP_SHOTS` | 30 | 截图保留张数 |
| `LCP_TEAM_SCROLL_PATCH` | 未设置 | 设为 `1` 启用实验性的编队列表滑动补丁 |
## 开发 / 测试 ## 开发 / 测试
### Jev 决策接口
`scripts/jev_mirror_agent.py` 使用 `scripts/jev_client.py` 读取本地配置中的
`model`、`baseUrl`、`sessionId`、`transport` 和 `timeoutSeconds`。
Jev 默认地址为 `https://opencode.ai/zen/v1/systemone`;`baseUrl` 填到 `/v1`,
客户端会追加 `/systemone`。Go 网关的模型列表与 Jev 原生接口不同,不能仅替换地址就假设支持相同模型。
从 `scripts/jev_config.example.json` 创建仓库外的私有配置,API key 使用
`OPENCODE_API_KEY` 环境变量或私有配置中的 `apiKey`。不要把凭据提交到仓库。
Windows 上若 Python HTTPS 遇到握手中断,可用 `"transport": "curl"`,
并把超时提高到 20 秒;认证头通过 stdin 交给 curl,保留证书验证。
通用客户端也支持主线等其他场景的候选决策,不会发送游戏输入:
```powershell
vendor\aalc\.venv\Scripts\python.exe -X utf8 scripts\jev_client.py <private-config.json> <observation.json>
```
`observation.json` 提供 `state`(当前画面观察文本)、`criteria`(候选名到描述的映射)
和 `instructions`(当前任务规则)。返回候选名和耗时,候选之外的响应会被拒绝。
镜牢执行器的场景规则只适用于镜牢,推进主线时应提供主线观察和规则。
```bash ```bash
python -m unittest discover -s tests # 不需要 Windows/AALC (FakeEngine) python -m unittest discover -s tests # 不需要 Windows/AALC (FakeEngine)
python -m lc_mcp.server --stdio --fake # 假引擎手动调试协议 python -m lc_mcp.server --stdio --fake # 假引擎手动调试协议
@@ -119,6 +156,7 @@ vendor\aalc\.venv\Scripts\python.exe -X utf8 scripts\jev_mirror_agent.py scripts
``` ```
运行数据默认写到 `~/lc_mcp/jev`,可用 `LC_JEV_HOME` 指定其他目录。创建该目录下的 `JEV_STOP` 文件即可停止;续跑前移除它。不要与 AALC 完整任务或另一个游戏执行器同时操作。 运行数据默认写到 `~/lc_mcp/jev`,可用 `LC_JEV_HOME` 指定其他目录。创建该目录下的 `JEV_STOP` 文件即可停止;续跑前移除它。不要与 AALC 完整任务或另一个游戏执行器同时操作。
工具调用失败(截图暂不可用、按钮已消失等)会记入日志并重新观察画面,同一画面上同一动作最多尝试两次,不会因单次失败整局退出。
每局运行现在有独立标识。默认续跑尚未结束且上下文一致的当前局;已完成或没有运行记录时建立新局。重新开一局时使用 `--new-run`,明确要求续跑时使用 `--resume`。旧版本未完成记录会保留楼层和强化进度,但旧的领取及战斗标记不会作为本局完成证据;只有上下文而没有运行记录时会重置它。领取截图和返回大厅截图必须属于当前局,才能记录完成。 每局运行现在有独立标识。默认续跑尚未结束且上下文一致的当前局;已完成或没有运行记录时建立新局。重新开一局时使用 `--new-run`,明确要求续跑时使用 `--resume`。旧版本未完成记录会保留楼层和强化进度,但旧的领取及战斗标记不会作为本局完成证据;只有上下文而没有运行记录时会重置它。领取截图和返回大厅截图必须属于当前局,才能记录完成。
@@ -151,6 +189,8 @@ Jev 与 AALC 配置复用方案、离线页面样例及实测耗时统计见 [20
本次修复、实际失败反馈、操作日志、截图清单、修改源码快照和速通 skill 见 [2026-10-02 实测记录](docs/feedback/2026-10-02/README.md);安装与测试说明见 [INSTALL_TEST_REPORT.md](INSTALL_TEST_REPORT.md)。这些是开发中的真实记录,包含失败和仍未验证的步骤。 本次修复、实际失败反馈、操作日志、截图清单、修改源码快照和速通 skill 见 [2026-10-02 实测记录](docs/feedback/2026-10-02/README.md);安装与测试说明见 [INSTALL_TEST_REPORT.md](INSTALL_TEST_REPORT.md)。这些是开发中的真实记录,包含失败和仍未验证的步骤。
[2026-10-03 主线实测与耗时复盘](docs/feedback/2026-10-03/README.md)记录了 4-48 未通关、三次 Jev 抉择耗时、混合操作限制、输入修复的验证边界及 94 项回归结果。
## 许可证 ## 许可证
AALC 使用 AGPL-3.0。本项目会导入并运行 AALC 的代码,分发时需遵守 AGPL-3.0。 AALC 使用 AGPL-3.0。本项目会导入并运行 AALC 的代码,分发时需遵守 AGPL-3.0。
+58
View File
@@ -0,0 +1,58 @@
# 2026-10-03 主线实测与耗时复盘
## 结果先说明
- **4-48 Bud(东柏/Spicebush)未通关,没有主线推进成果。** 不能把进入战斗、压低敌方血量或单元测试通过当成通关。
- lc-mcp 已拉取安装,AALC 子模块使用仓库固定版本;本机服务与 MCP bridge 已实际连接游戏。
- Jev 请求已实测成功,但**没有运行完整的 Jev 主线自动执行器**。仅三次候选抉择调用,后续由 Codex 分步操作。
- 用户随后确认也在手动操作游戏。因此部分回合推进、菜单变化和重试结果存在混合操作,不能全部归因于 MCP。
- 用户改为要求练角色、查攻略后,检查了养成界面并进入经验本菜单;**尚未购买/消耗经验票升级,也没有开始经验本刷取**。收到“先上传测试数据与慢的原因”后停止游戏操作。
## 本次环境与实际证据
Windows / Python 3.12.14;基础提交 `030527f5de5c83dd8ea6e53288c1c52f3b4a85bb`;AALC 提交 `7452fad5a45a0fadb59a753fafbf40434d987c19`。游戏客户区 1276×717,前台输入,后台截图。登录/进入关卡时遇到服务器重试提示。
账号当时等级 36,当前未通关主线为 4-48。战斗实测队伍包含 W 堂吉诃德 35/同步 IV、W 良秀 35/IV、六协会以实玛利 35/III、G 格里高尔 34/III、剑契理想 34/II、W 浮士德 35/III、W 鸿璐 35/II。支援检查的理想与良秀列表未显示可借角色;不能据此断言所有罪人都没有支援。
三次 Jev 调用的实际耗时:1484、1282、1312 ms,均值约 1359 ms。原始三条 JSONL 经凭据、账号号段和本地路径清理后保留于 [logs/story_decisions.jsonl](logs/story_decisions.jsonl)。第二条选择进入编队,第三条建议补到七人;提示没有完整给出东柏机制,后者不能当成正确攻略决策。
截图仅选择没有账号底栏的四张,保留原始 PNG 字节:
| 截图 | 能证明什么 | 不能证明什么 |
| --- | --- | --- |
| [七人队第 1 回合](captures/turn1-winrate.png) | 已真实进入 4-48,选择过 Win Rate | 通关/自动执行器已运行 |
| [第 3 回合开花](captures/turn3-blooming.png) | 多名罪人被困,自动配置没有妥善处理机制 | 单一操作者下输入故障的因果 |
| [失败画面](captures/defeat.png) | 这一轮出现 DEFEAT | 主线已推进 |
| [经验票库存](captures/training-ticket-inventory.png) | 升级窗口显示 IV 0、III 0、II 7 | 已经使用这些票/完成养成 |
截图只保留最近 30 张,较早的安装和首轮战斗截图已经轮转删除。操作时间线是根据本次可见工具输出整理的**人工复盘**,不是完整机器动作日志。服务日志只记录部分 OCR 与启动信息,不能补造为全量点击轨迹。文件哈希见 [manifest.json](manifest.json)。
## 为什么慢
1. **安装排错过度串行。** 初次 Git 拉取受大体积反馈资产与下载问题影响,反复处理环境、依赖、服务焦点及 Jev 路由;没有尽早缩小下载范围并完成最小连接验证。之后 sparse clone 才解决安装路径问题。这里没有足够完整计时数据,不能编造各阶段分钟数。
2. **主要操作循环仍由大模型逐步驱动。** 一个普通动作常经过 shell 启动 bridge、MCP 调用、截图+OCR、再次读 PNG,再由模型决定下一步。近期这类工具组合本身约需 3–9 秒;动作间又有几十秒推理间隔,多个简单菜单操作被拆成多轮,用户实际等待远高于工具耗时。
3. **把简单操作也当成复杂决策。** 对已确认的菜单、剧情跳过、编队选择没有建立短路径;重复解释、读图、试坐标,耗费模型额度。该问题属于本次执行方式,不能甩给 Jev:三次 Jev 返回仅约 1.3 秒,且未接管持续推进。
4. **坐标与战斗 UI 变化处理不当。** 选择技能后镜头/HUD 会移动,使用选择前坐标继续拖动无法可靠验证目标。后来“点击技能 → 读新画面 → 点击敌方槽位”确实选中过目标。把所有失败都称为拖动输入 bug 证据不足。
5. **没有及时明确唯一操作者。** 看到无指令时回合推进后,先继续排查按键和自动战斗;用户后来明确“我操作的”。这使若干重试和回合记录无法独立归因,排错时间也被浪费。应先确认操作权并停止竞争输入。
6. **攻略检索太晚。** 前几轮主要依赖自动配技能和满员队伍,直到失败后才查东柏的开花、召唤物及决斗机制。实际阵容含同步 II 角色,七人铺开又限制主力多槽,不能仅按等级接近推荐值判断足够。
## 已落地修改与验证范围
- 前台输入先检查游戏焦点,必要时附加输入线程;激活失败时拒绝发送输入。按键/鼠标释放置于 `finally`。
- 前台拖动先移动到起点并等待,支持同点按住;实际同点按住已打开人格详情。**复杂战斗拖动重定向仍未在唯一操作者条件下完成验证。**
- 较短点击在本机多次未产生可见界面变化;同点按住 0.4 秒成功打开升级窗口。前台点击按住时长由 0.12 改为 0.35 秒。此调整仍需单操作者对照复测,不能声称已彻底修复掉点击。
- Jev 客户端尊重配置的 `baseUrl`/`model`/稳定 session,校验候选结果,支持 curl transport;密钥经 stdin header 传递,不放入 curl 命令行。用户提供的 Go 路由未成功提供 Jev 抉择,原生 Zen `/systemone` 路由实测成功;未用其他模型冒充 Jev。
- `battle_batch.py` 改为只在当前战斗 UI 显示 Win Rate 时点击该控件,不再反复 P 切换 Win Rate/Damage。该脚本不是东柏策略执行器,**不得当成 4-48 自动通关方案**。
- 本次回归:94 项单元/传输测试通过,输出见 [test-results.txt](test-results.txt)。这些测试不能证明实战通关;普通点击时长、复杂拖动和批次脚本需要进一步实测。
## 攻略结论与后续短路径
结合本机已有高练度角色,优先 W 堂吉诃德、W 良秀,再检查六协会以实玛利和可用的恢复精神力角色。先筹经验票,将主力补至游戏当前允许的等级;没有领取或购买新人格,也没有使用狂气抽卡。准备五人队并让前两位主力获得额外技能槽;前两回合避免丢失关键拼点,及时清除小花、用防御抵消回避,避开给同一角色连续叠开花,留 E.G.O 资源处理强力群攻与决斗。
参考来源(社区攻略,具体技能效果仍以当局游戏说明为准):[4-48 详细实战攻略](https://www.reddit.com/r/limbuscompany/comments/1ef3czm/)、[逐回合视频攻略摘要](https://vortexgaming.io/en/postdetail/562569)、[人格等级规则](https://limbuscompany.wiki.gg/wiki/Identity)。
降低下一次耗时的具体办法:固定唯一操作者;把确定的菜单动作批成有状态检查的短脚本;只在新阶段、失效或 Boss 机制节点读完整图片;记录每步 observation/action/result/latency;把候选抉择交给 Jev,仅异常交给主模型;把“装好了、测试通过、实际打过”分别记录。
## 导出边界
仅包含本次报告、人工时间线、清理后的三条 Jev 日志、本次时段的服务日志片段、四张游戏截图及测试输出。未包含 API key、MCP token、私有配置、Codex 聊天文件或其他桌面应用截图。代码修复随本反馈分支提供,未推送到默认分支。
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 976 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

@@ -0,0 +1,202 @@
[DEBUG] 2026-10-03 09:41:01,651 [AALC] module\ocr\ocr.py:72: OCR识别结果:('fmod.', 'FACE THE SIN,SAVE THE E.G.0', 'Clear all caches', '1.116.1', 'STEAI', '[ACCOUNT_REDACTED]')
[DEBUG] 2026-10-03 09:41:50,246 [AALC] module\ocr\ocr.py:72: OCR识别结果:('fMod.', 'Aservererrorhasoccurred.', 'Please try again in a moment.', 'Close', 'Retry 5', 'Clear all caches', '.1.116.1', 'STEAM', '[ACCOUNT_REDACTED]')
[WARNING] 2026-10-03 09:42:26,492 [AALC] ..\..\lc_mcp\aalc_engine.py:105: 窗口句柄无效,可能窗口已关闭,重新获取, 当前句柄为 3476014
[INFO] 2026-10-03 09:42:26,497 [AALC] ..\..\lc_mcp\aalc_engine.py:105: 重新获取窗口句柄成功, 新句柄为 918882
[DEBUG] 2026-10-03 09:42:29,507 [AALC] module\ocr\ocr.py:72: OCR识别结果:('FACETHE SINSSUE THE EGO', "Clear'alfcachey", '[ACCOUNT_REDACTED]')
[DEBUG] 2026-10-03 09:46:46,218 [AALC] module\ocr\ocr.py:72: OCR识别结果:('2026.9.1', 'TARGETE', 'Greg', "Hmmm...'m growing restless.When the hell can we getto work?", 'AHANDY-DANDYGUIDE', 'LTHE NEWEXECUTIVEMANAGERSOFLIMBU', 'DIGESTBEFOREGETTINGTOWORK', '[ACCOUNT_REDACTED]', '960,', '193', 'UNACY', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', '2646', 'Dispense', 'Inventory')
[DEBUG] 2026-10-03 09:47:32,066 [AALC] module\ocr\ocr.py:72: OCR识别结果:('2026.9.1', 'TARGETE', 'Greg', "Hmmm...'m growing restless.When the hell can we getto work?", 'AHANDY-DANDY GUIDE', 'THENEWEXECUTIVEMANAGEROFLMBU', 'DIGESTBEFOREGETINGTWORK', '[ACCOUNT_REDACTED]', '036', '193', 'UNACY', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', '2646', 'Dispense', 'Inventory')
[DEBUG] 2026-10-03 09:47:36,340 [AALC] module\ocr\ocr.py:72: OCR识别结果:('SSHSOENITBKOSS', '2026.9.1', 'TARGETE', 'Greg', "Hmmm...'m growing restless.When the hell can we get to work?", 'AHANDY-DANDYGUIDE', 'LTHE NEWEXECUTIVEMANAGERSOFLIMBU', 'ODIGESTBEFOREGETTINGTOWORK', '[ACCOUNT_REDACTED]', '036', '193', 'UNACY', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', '2646', 'Dispense', 'Inventory')
[DEBUG] 2026-10-03 09:48:03,601 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Inferno', 'Luxca', 'MIRROROF', 'NAMESAND', 'R', '21.51m', '[ACCOUNT_REDACTED]', '036', '193', 'UNACY', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '2646', 'Inventory')
[DEBUG] 2026-10-03 09:48:06,908 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Inferno', 'Luxca', 'MIRROROF', 'NAMESAND', '21.50m', '[ACCOUNT_REDACTED]', '036', '193', 'UNACY', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '2646', 'Inventory')
[DEBUG] 2026-10-03 09:48:25,003 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Inferno', 'Luxca', 'MIRROROF', 'NAMESAND', 'ER', '21.51m', '[ACCOUNT_REDACTED]', '036', '193', 'UNACY', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '2646', 'Inventory')
[DEBUG] 2026-10-03 09:48:28,990 [AALC] module\ocr\ocr.py:72: OCR识别结果:('0:', 'Inferno', 'uxca', 'MIRROROF', 'NAMESAND', "CANTO'I", 'The Unconfronting', '21.51m', '[ACCOUNT_REDACTED]', '036', '193', 'UNACY', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '2646', 'Inventory')
[DEBUG] 2026-10-03 09:48:41,219 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Inferno', 'Luxca', '985-03', 'MIRROROF', 'TheGaze Bearing', 'NAMESAND', 'R', '984-05', 'Corrit', '21.51m', '[ACCOUNT_REDACTED]', '036', '193', 'UNACY', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '2646', 'Inventory')
[WARNING] 2026-10-03 09:48:50,175 [RapidOCR] main.py:118: The text detection result is empty
[DEBUG] 2026-10-03 09:48:50,176 [AALC] module\ocr\ocr.py:72: OCR识别结果:None
[DEBUG] 2026-10-03 09:49:53,668 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Progress', 'EX Cleared', '42', 'Talent and Genius', 'Off the Bus', 'Drones and Abnormal', '[ACCOUNT_REDACTED]', '036', '10', '193', 'LUNACY', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '120/120', '2646', 'Inventory')
[DEBUG] 2026-10-03 09:50:09,279 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Progress', 'EX Cleared', 'Hole', '[ACCOUNT_REDACTED]', '193', '9E0,', '10', 'LUNACY', 'LV', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '120/120', '2646', 'Inventory')
[DEBUG] 2026-10-03 09:50:26,828 [AALC] module\ocr\ocr.py:72: OCR识别结果:('[ACCOUNT_REDACTED]', '036', '10', '193', 'LUNACY', 'LV', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '120/120', '2646', 'Inventory')
[DEBUG] 2026-10-03 09:50:49,488 [AALC] module\ocr\ocr.py:72: OCR识别结果:('-h', 'Constellations', '4-31', 'Seized', '[ACCOUNT_REDACTED]', '036', '10', '193', 'LUNACY', 'LV', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '120/120', '2646', 'Inventory')
[DEBUG] 2026-10-03 09:51:05,871 [AALC] module\ocr\ocr.py:72: OCR识别结果:('l Clear Statistics', '4-31Seized', '4-31', 'Seized', 'Difficulty', 'EX Objectives', 'LV.30', 'Clearwithin10turns', 'Effective Affinities', 'Enemy Info', 'Enter -20', '[ACCOUNT_REDACTED]', '10', '193', '036', 'LUNACY', 'LV', '120/120', '2646', 'Inventory')
[DEBUG] 2026-10-03 09:51:19,323 [AALC] module\ocr\ocr.py:72: OCR识别结果:('EX Cleared', '4-31', 'Seized', '[ACCOUNT_REDACTED]', '036', '10', '193', 'LUNACY', 'LV', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '120/120', '2646', 'Inventory')
[DEBUG] 2026-10-03 09:51:31,814 [AALC] module\ocr\ocr.py:72: OCR识别结果:('EXClearel', '4-32', 'Seized2', '[ACCOUNT_REDACTED]', '036', '193', 'LUNACY', 'LV', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '2646', 'Inventory')
[DEBUG] 2026-10-03 09:51:46,853 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Progress', 'EXCleare', 'Class12', '4-39', 'Glorious Past 2', '4-40', 'Glorious Past 3', '[ACCOUNT_REDACTED]', '036', '10', '193', 'LUNACY', '2646', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '120/120', 'Inventory')
[DEBUG] 2026-10-03 09:52:04,908 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Progress', 'rer', 'Class12', 'GloriousPast3', '[ACCOUNT_REDACTED]', '036', '10', '193', 'LUNACY', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', '2646', 'Dispense', '120/120', 'Inventory')
[DEBUG] 2026-10-03 09:52:26,130 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Progress', 'EX Cleared', '4-44 An Age Without', 'Class', '[ACCOUNT_REDACTED]', '036', '10', '193', 'LUNACY', '2646', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '120/120', 'Inventory')
[DEBUG] 2026-10-03 09:52:43,442 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Progress', 'EX Cleared', '4-43 AnAge Without Tec', 'Class12', '[ACCOUNT_REDACTED]', '036', '193', 'LUNACY', '2646', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', 'Inventory')
[DEBUG] 2026-10-03 09:53:01,266 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Progress', 'EX Cleared', '紫', '4-45', 'Offer to Join', 'mabyuEhh', 'Tel', '[ACCOUNT_REDACTED]', '036', '193', 'LUNACY', 'LV', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '120/120', '2646', 'Inventory')
[DEBUG] 2026-10-03 09:53:20,326 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Progress', 'EX Cleared', '4-46', 'Offer to Join 2', '[ACCOUNT_REDACTED]', '193', '036', '10', 'LUNACY', 'LV', '2646', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '120/120', 'Inventory')
[DEBUG] 2026-10-03 09:53:36,674 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Progress', 'EXCleared', 'NO.[ACCOUNT_REDACTED]', '193', '036', 'LUNACY', 'LV', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '2646', 'Inventory')
[DEBUG] 2026-10-03 09:54:06,196 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Progress', '[ACCOUNT_REDACTED]', '193', '036', 'LUNACY', 'LV', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '120/120', '2646', 'Inventory')
[DEBUG] 2026-10-03 09:54:22,212 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Progress', 'EX Cleared', 'Bud', 'Screening', 'Rod', '[ACCOUNT_REDACTED]', '036', '193', 'LUNACY', 'LV', '2646', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '120', '120', 'Inventory')
[DEBUG] 2026-10-03 09:54:37,687 [AALC] module\ocr\ocr.py:72: OCR识别结果:('CONNECTING', '4-47', 'Sereening Room', '[ACCOUNT_REDACTED]', '036', '10', '193', 'LUNACY', 'LV', '120/120', '2646', 'Inventory')
[DEBUG] 2026-10-03 09:55:15,721 [AALC] module\ocr\ocr.py:72: OCR识别结果:('l Clear Statistics', '4-48 Bud', '4-48', 'Bud', 'Difficulty', 'EX Objeetives', 'LV.35', 'Clearwithin15turns', 'Effective Affinities', 'Enemy lnfo', 'Clear Rewards', 'Enter -20', '[ACCOUNT_REDACTED]', '193', 'Screening', 'Room', '9E0,', '10', 'LUNACY', 'LV', '120/120', '2646', 'Inventory')
[DEBUG] 2026-10-03 09:55:18,242 [AALC] module\ocr\ocr.py:72: OCR识别结果:('l Clear Statistics', '4-48 Bud', '4-48', 'Bud', 'Difficulty', 'EX Objeetives', 'LV.35', 'Clearwithin15turns', 'Effective Affinities', 'Enemy lnfo', 'Clear Rewards', 'Enter -20', '[ACCOUNT_REDACTED]', '193', 'Screening', 'Room', '9E0,', '10', 'LUNACY', 'LV', '120/120', '2646', 'Inventory')
[DEBUG] 2026-10-03 09:55:54,093 [AALC] module\ocr\ocr.py:72: OCR识别结果:('l Clear Statistics', '4-48 Bud', '4-48', 'Bud', 'Difficulty', 'EX Objeetives', 'LV.35', 'Clearwithin15turns', 'Effective Affinities', 'Enemy lnfo', 'Clear Rewards', 'Enter -20', '[ACCOUNT_REDACTED]', '193', 'Screening', 'Room', '9E0,', '10', 'LUNACY', 'LV', '120/120', '2646', 'Inventory')
[DEBUG] 2026-10-03 09:55:58,219 [AALC] module\ocr\ocr.py:72: OCR识别结果:('l Clear Statistics', '4-48 Bud', '4-48', 'Bud', 'Difficulty', 'EX Objeetives', 'LV.35', 'Clearwithin15turns', 'Effective Affinities', 'Enemy lnfo', 'Clear Rewards', 'Enter', '-20', '[ACCOUNT_REDACTED]', '193', 'Screening', 'Room', '9E0,', '10', 'LUNACY', 'LV', '120/120', '2646', 'Inventory')
[DEBUG] 2026-10-03 09:56:24,257 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Creating your Team', 'LV.55', 'Lv.55', 'LV.50', 'LV.55', 'LV.55', 'LV.55', 'LCB', 'LCB', 'Sinner', 'LCB', 'LCB', 'LCB', 'LCB', 'Sinner', 'Sinner', 'Sinner', 'Sinner', 'Details', 'Lv.55', 'LV.55', 'LV.50', 'LV.50', 'LV.55', 'LV.50', 'Sinners(Team)', 'LCB', 'LCB', 'LCB', 'LCB', 'LCB', 'LCB', 'Sinner', 'Sinner', 'Sinner', 'Sinner', 'YoucanconfigurevariousTeamsfromyour', '12LimbusCompanySinnersandtheir', 'Identities.')
[DEBUG] 2026-10-03 09:56:28,615 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Creating your Team', 'LV.55', 'Lv.55', 'LV.50', 'LV.55', 'LV.55', 'LV.55', 'LCB', 'LCB', 'Sinner', 'LCB', 'LCB', 'LCB', 'LCB', 'Sinner', 'Sinner', 'Sinner', 'Sinner', 'Details', 'Lv.55', 'LV.55', 'LV.50', 'LV.50', 'LV.55', 'LV.50', 'Sinners(Team)', 'LCB', 'LCB', 'LCB', 'LCB', 'LCB', 'LCB', 'Sinner', 'Sinner', 'Sinner', 'Sinner', 'YoucanconfigurevariousTeamsfromyour', '12LimbusCompanySinnersandtheir', 'Identities.')
[DEBUG] 2026-10-03 09:57:02,402 [AALC] module\ocr\ocr.py:72: OCR识别结果:('TEAMS #1', '《', 'Details', 'Preset#1', 'Dante', 'SELECTED', 'SELECTED', 'SELECTED', 'All E.6.0', 'TEAMS', 'LV.35', 'LV.35', 'LV.35', 'LV.04', 'LV.35', 'WCorp.L2', 'WCorp.L3', 'WCorp.L3', 'Rosespanner', 'WCorp.L2', 'TEAMS#1', 'Salsu', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Fagades', 'TEAMS#2', 'TEAMS#3', 'Support', 'TEAMS#4', 'SELECTED', 'SELECTED', 'Details', 'TEAMS#5', 'LV.34', 'LV.17', 'LV.35', 'LV.14', 'LV.14', 'LV.17', 'GCorp.', 'CClear Selection', 'TEAMS#6', 'LCB', 'Liu Assoc.', ' Corp.', 'Zwei Assoc.', 'LCB', 'Manager', 'outhSection4', 'Mittelhammer', 'South Section G', 'Sinner', 'Corporal', 'Participant', 'TEALS#7', 'Limit', 'To Battle!')
[DEBUG] 2026-10-03 09:57:55,092 [AALC] module\config\config.py:420: teams_active_queue change to: []
[DEBUG] 2026-10-03 09:57:55,103 [AALC] module\config\config.py:421: teams_be_select change to: [False]
[DEBUG] 2026-10-03 09:57:55,104 [AALC] module\config\config.py:422: teams_order change to: [0]
[DEBUG] 2026-10-03 09:57:55,104 [AALC] module\config\config.py:423: teams_be_select_num change to: 0
[DEBUG] 2026-10-03 09:57:55,140 [AALC] module\config\config.py:51: 配置文件已加载,版本号:DEFAULT VERSION, 配置版本: [ACCOUNT_REDACTED]
[INFO] 2026-10-03 09:57:55,674 [RapidOCR] base.py:22: Using engine_name: onnxruntime
[INFO] 2026-10-03 09:57:55,870 [RapidOCR] download_file.py:60: File exists and is valid: {repo}\vendor\aalc\.venv\Lib\site-packages\rapidocr\models\ch_PP-OCRv4_det_infer.onnx
[INFO] 2026-10-03 09:57:55,871 [RapidOCR] main.py:55: Using {repo}\vendor\aalc\.venv\Lib\site-packages\rapidocr\models\ch_PP-OCRv4_det_infer.onnx
[INFO] 2026-10-03 09:57:55,970 [RapidOCR] base.py:22: Using engine_name: onnxruntime
[INFO] 2026-10-03 09:57:55,976 [RapidOCR] download_file.py:60: File exists and is valid: {repo}\vendor\aalc\.venv\Lib\site-packages\rapidocr\models\ch_ppocr_mobile_v2.0_cls_infer.onnx
[INFO] 2026-10-03 09:57:55,976 [RapidOCR] main.py:55: Using {repo}\vendor\aalc\.venv\Lib\site-packages\rapidocr\models\ch_ppocr_mobile_v2.0_cls_infer.onnx
[INFO] 2026-10-03 09:57:56,017 [RapidOCR] base.py:22: Using engine_name: onnxruntime
[INFO] 2026-10-03 09:57:56,114 [RapidOCR] download_file.py:60: File exists and is valid: {repo}\vendor\aalc\.venv\Lib\site-packages\rapidocr\models\ch_PP-OCRv4_rec_infer.onnx
[INFO] 2026-10-03 09:57:56,115 [RapidOCR] main.py:55: Using {repo}\vendor\aalc\.venv\Lib\site-packages\rapidocr\models\ch_PP-OCRv4_rec_infer.onnx
[DEBUG] 2026-10-03 09:57:56,370 [AALC] module\automation\automation.py:88: 使用前台点击模块
[DEBUG] 2026-10-03 09:57:56,376 [AALC] utils\path_manager.py:44: 路径管理器初始化完成,路径: ['dark/zh_cn', 'dark/en', 'dark/share', 'default/zh_cn', 'default/en', 'default/share']
[DEBUG] 2026-10-03 09:58:50,189 [AALC] module\ocr\ocr.py:72: OCR识别结果:('TEAMS #1', '《', 'Details', 'Preset#1', 'Dante', 'SELECTED', 'SELECTED', 'SELECTED', 'All E.6.0', 'TEAMS', 'LV.35', 'LV.35', 'LV.35', 'LV.04', 'LV.35', 'WCorp.L2', 'WCorp.L3', 'WCorp.L3', 'Rosespanner', 'WCorp.L2', 'TEAMS#1', 'Salsu', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Fagades', 'TEAMS#2', 'TEAMS#3', 'Support', 'TEAMS#4', 'SELECTED', 'SELECTED', 'Details', 'TEAMS#5', 'LV.34', 'LV.17', 'LV.35', 'LV.14', 'LV.14', 'LV.17', 'GCorp.', 'CClear Selection', 'TEAMS#6', 'LCB', 'Liu Assoc.', ' Corp.', 'Zwei Assoc.', 'LCB', 'Manager', 'outhSection4', 'Mittelhammer', 'South Section G', 'Sinner', 'Corporal', 'Participant', 'TEALS#7', 'Limit', 'To Battle!')
[DEBUG] 2026-10-03 09:59:12,559 [AALC] module\ocr\ocr.py:72: OCR识别结果:('TEAMS #1', 'K', 'Details', '7', 'Preset#1', 'MlI lidestities', 'Dante', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'All E.6.0', 'TEAMS', 'LV.35', 'LV.35', 'LV.35', 'LV.04', 'Lv.35', 'Blade Lineage', 'WCorp.L2', 'WCorp.L3', 'WCorp.L3', 'Rosespanner', 'WCorp.L2', 'TEAMS#1', 'Salsu', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Fagades', 'TEAMS#2', 'TEAMS#3', 'Support', 'TEAMS#4', 'SELECTED', 'SELECTED', 'Details', 'TEAMS#5', 'LV.34', 'LV.17', 'LV.35', 'LV.14', 'LV.14', 'LV.17', 'GCorp.', 'CClear Selection', 'TEAMS#6', 'LCB', 'Liu Assoc.', ' Corp.', 'Zwei Assoc.', 'LCB', 'Manager', 'outhSection4', 'Mittelhammer', 'South Section G', 'Sinner', 'Corporal', 'Participant', 'TEALS#7', 'Limit', 'To Battle!')
[DEBUG] 2026-10-03 09:59:33,635 [AALC] module\ocr\ocr.py:72: OCR识别结果:('TEAMS #1', 'K', 'Details', '7', 'Preset#1', 'MlI lidestities', 'Dante', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'All E.6.0', 'TEAMS', 'LV.35', 'LV.35', 'LV.35', 'LV.04', 'Lv.35', 'Blade Lineage', 'WCorp.L2', 'WCorp.L3', 'WCorp.L3', 'Rosespanner', 'WCorp.L2', 'TEAMS#1', 'Salsu', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Fagades', 'TEAMS#2', '00', 'TEAMS#3', 'Support', 'TEAMS#4', 'SELECTED', 'SELECTED', 'Details', 'TEAMS#5', 'LV.34', 'LV.17', 'LV.35', 'LV.14', 'LV.14', 'LV.17', 'G Corp.', 'CClear Selection', 'TEAMS#6', 'LCB', 'Liu Assoc.', ' Corp.', 'Zwei Assoc.', 'LCB', 'Manager', 'outhSection4', 'Mittelhammer', 'South Section G', 'Sinner', 'Corporal', 'Participant', 'TEALS#7', 'Limit', 'To Battle!')
[DEBUG] 2026-10-03 09:59:40,240 [AALC] module\ocr\ocr.py:72: OCR识别结果:('CONNECTING', 'TEAMS #1', 'K', 'Details', 'Preset#1', '7', 'MlI lidestities', 'Dante', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'All E.6.0', 'TEAMS', 'LV.35', 'LV.35', 'LV.35', 'LV.04', 'Lv.35', 'Blade Lineage', 'WCorp.L2', 'WCorp.L3', 'WCorp.L3', 'Rosespanner', 'WCorp.L2', 'TEAMS#1', 'Salsu', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Fagades', 'TEAMS#2', 'TEAMS#3', 'Support', 'TEAMS#4', 'SELECTED', 'SELECTED', 'Details', 'TEAMS#5', 'LV.34', 'LV.17', 'LV.35', 'LV.14', 'LV.14', 'LV.17', 'G Corp.', 'CClear Selection', 'TEAMS#6', 'LCB', 'Liu Assoc.', ' Corp.', 'Zwei Assoc.', 'LCB', 'Manager', 'outhSection4', 'Mittelhammer', 'South Section G', 'Sinner', 'Corporal', 'Partieipant', 'TEALS#7', 'Limit', 'To Battle!')
[DEBUG] 2026-10-03 10:00:22,481 [AALC] module\ocr\ocr.py:72: OCR识别结果:('?', 'TEAMS #1', 'Details', 'SINICOST', '07', 'Preset#I', 'Dante', 'SELECTEI', 'Thecurrentaveragelevel ofyourdeployedldentities', 'CTED', 'islowerthantherecommendedlevel forthisStage.', 'All E.6.0', 'TEAMS', 'LV', 'Lv. 35', 'Blade Line', 'StarttheEncounteranyway?', 'TEAMS#1', 'Corp.L2', 'SE', 'up Agent', 'Fagades', 'TEAMS#2', 'CurrentAvg.Level:34', 'TEAMS#3', 'Recommended Level:35', 'Support', 'TEAMS#4', 'CTED', 'Details', 'TEAMS#5', 'LN.34', 'G Corp.', 'CClearSelection', 'TEAMS#6', 'X Cancel', 'Enter', 'Mlanager', 'Sin', 'TEAL*S#7', 'Partieipant', 'Limit', 'To Battle!')
[DEBUG] 2026-10-03 10:00:40,736 [AALC] module\ocr\ocr.py:72: OCR识别结果:('?', 'TEAMS #1', 'Details', 'SINICOST', '07', 'Preset#I', 'Dante', 'SELECTEI', 'Thecurrentaveragelevel ofyourdeployedldentities', 'CTED', 'islowerthantherecommendedlevel forthisStage.', 'All E.6.0', 'TEAMS', 'LV', 'Lv. 35', 'Blade Line', 'StarttheEncounteranyway?', 'TEAMS#1', 'Corp.L2', 'SE', 'up Agent', 'Fagades', 'TEAMS#2', 'CurrentAvg.Level:34', 'TEAMS#3', 'Recommended Level:35', 'Support', 'TEAMS#4', 'CTED', 'Details', 'TEAMS#5', 'LN.34', 'G Corp.', 'CClearSelection', 'TEAMS#6', 'X Cancel', 'Enter', 'Mlanager', 'Sin', 'TEAL*S#7', 'Partieipant', 'Limit', 'To Battle!')
[DEBUG] 2026-10-03 10:00:48,850 [AALC] module\ocr\ocr.py:72: OCR识别结果:('X Cancel', 'Enter', 'CONNECTING', 'TEAMS #1', 'K', 'Details', 'SINICOST', '37', 'Preset#1', 'Dante', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'All E.6.0', 'TEAMS', 'Lv. 34', 'Lv.35', 'LV.35', 'LV.35', 'LV.04', 'Lv. 35', 'Blade Lineage', 'WCorp.L2', 'WCorp.L3', 'WCorp.L3', 'Rosespanner', 'WCorp.L2', 'TEAMS#1', 'Salsu', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Fagades', 'TEAMS#2', '00', 'TEAMS#3', 'Support', 'TEAMS#4', 'SELECTED', 'SELECTED', 'Details', 'TEAMS#5', 'LV.17', 'Lv.35', 'LV.14', 'LV.14', 'LV.17', 'G Corp.', 'Clear Selection', 'TEAMS#6', 'LCB', 'Liu Assoc.', 'NCorp.', 'Zwei Assoe.', 'LCB', 'Manager', 'Sinner', 'outh Section4', 'Mittelhammer', 'South Section G', 'Sinner', 'Corporal', 'Participant', 'TEAS#7', 'Limit', 'To Battle!')
[DEBUG] 2026-10-03 10:01:45,052 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Screening Room', 'Technology', 'Liberation Alliance', 'Dongbaek', 'Kaff.. Kof..')
[DEBUG] 2026-10-03 10:03:01,378 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Screening Room', 'Technology', 'Liberation Alliance', 'Dongbaek', 'Kaff.. Kof...')
[DEBUG] 2026-10-03 10:03:17,159 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Screening Room', 'Technology', 'Liberation Alliance', 'Dongbaek', 'Kaff.. Kof..')
[DEBUG] 2026-10-03 10:03:50,691 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Screening Room', 'D', 'Are you sure you want to skip?', 'X Cancel', 'Confirm', 'Technology', 'Liberation Alliance', 'Dongbaek', 'Kaff... Kof...')
[DEBUG] 2026-10-03 10:04:14,658 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Screening Room', 'Are you sure you want to skip?', 'X Cancel', 'Confirm', 'Technology', 'Liberation Alliance', 'Dongbaek', 'Kaff...Kof....')
[DEBUG] 2026-10-03 10:04:18,167 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Screening Room', 'Are you sure you want to skip?', 'X Cancel', 'Confirm', 'Dongbaek', 'Kaff... Koff.')
[DEBUG] 2026-10-03 10:04:42,313 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'TURN', 'Win', 'Rate', 'Damage')
[DEBUG] 2026-10-03 10:05:17,792 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'TURN', 'Win', 'Rate', 'Damage')
[DEBUG] 2026-10-03 10:05:53,887 [AALC] module\ocr\ocr.py:72: OCR识别结果:('I', 'Frontal Assault', 'Body', '1353')
[DEBUG] 2026-10-03 10:06:29,418 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'TURN', 'Win', 'Rate', 'Damage')
[DEBUG] 2026-10-03 10:07:10,750 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Cleanup Support', 'Like Flowers in Full Blo', '181', 'DONGBAEKE.G.O::SPICEBUSH')
[DEBUG] 2026-10-03 10:07:14,211 [AALC] module\ocr\ocr.py:72: OCR识别结果:('FC', '12', 'Like Flowers in Ful', 'Normal', 'Blooni', '59', '1277', '??-??-77', 'DONGBAEK E.G.O.:SPICEBUSH')
[DEBUG] 2026-10-03 10:07:17,320 [AALC] module\ocr\ocr.py:72: OCR识别结果:('+2', 'E.C.', 'Body', '1257', 'ACDAEn.Cm', '18', '5')
[DEBUG] 2026-10-03 10:07:19,943 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Poise +3', 'Poise Count+1')
[DEBUG] 2026-10-03 10:07:23,520 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Bip', '[OnHit] Inflict 1Rupture', '[Heads Hit] Gain+4*Charge Count', '*Charge+1', 'C', 'Charge Count +4', 'Body', '1228', 'MCDAFI/ C C', '21')
[DEBUG] 2026-10-03 10:07:25,988 [AALC] module\ocr\ocr.py:72: OCR识别结果:('103', 'ody', '1224')
[DEBUG] 2026-10-03 10:07:28,167 [AALC] module\ocr\ocr.py:72: OCR识别结果:None
[DEBUG] 2026-10-03 10:07:59,508 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'TURN', 'Win', 'Rate', 'Damage', 'STAGGER', 'STAgGER', '195', '150', '1030')
[DEBUG] 2026-10-03 10:08:39,579 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'TURN', 'Win', 'Rate', 'STAGGER', 'STAGGER', '195', '150', '1030', '12')
[DEBUG] 2026-10-03 10:09:41,994 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Flowering Buds', '[On Hit] Inflict +3Rupture Count', '[On Hit] Inflict 3Blooming', '22-22-22-271', '1203', 'DONGBAEKE.G.O:SPICEBUSH')
[DEBUG] 2026-10-03 10:09:44,763 [AALC] module\ocr\ocr.py:72: OCR识别结果:('I', 'Hack', 'Body', '1190')
[DEBUG] 2026-10-03 10:09:47,108 [AALC] module\ocr\ocr.py:72: OCR识别结果:None
[DEBUG] 2026-10-03 10:09:49,298 [AALC] module\ocr\ocr.py:72: OCR识别结果:None
[DEBUG] 2026-10-03 10:09:54,366 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', "Doagain whatyoujustdid.You'veanother crushingblow", 'inyou,right?', 'URN', 'Dante', '園', 'Cleanup', 'Win', 'Rate', 'Damage', 'STAGGER', 'STAGGER', 'STAgGER', '195', '103', '12', '150')
[DEBUG] 2026-10-03 10:09:57,884 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', "Do again whatyoujustdid.You'veanother crushingblow", 'in you,right?', 'TURN', 'Dante', 'SOON-TO-BLOON FLOWER', 'Win', 'Rate', 'STAGGER', 'STAGGER', 'STAGGER', '195', '103', '12', '50')
[DEBUG] 2026-10-03 10:11:07,987 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAV', 'MAX', '10', 'Details', '20', 'Details', '2', 'Details', 'To Eqrrnie', '0%', '小', '2', '带', '?', 'Suddenly, Dne Day', 'Lantern', 'AEDD', '33', 'E', '20', 'E', 'AkWeigit', 'AKWelghnt ', 'Atk Wel(gnit ', '1 [On Hit] Inflet6 of a', ' [On Hit] Heal 40% of', '[Before Attack] Galn +5 XCharge', 'random statuschosen from', 'leep efewep', 'Count', 'Burn, * Bleed', 'Tremor,', ' [0n Hig infiet 5 Spark', 'Resistances', '1.0001.00', '0.75', '1.002.00 1.00', '2.00', 'Suddenly, One Day')
[DEBUG] 2026-10-03 10:12:26,404 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAW', 'MAX', '10', 'Details', '20', 'Details', '2', 'Details', 'To Eqrrnie', '0%', '2', '2', 'Suddenly, Dne Day', 'Lantern', 'AEDD', 'X33', 'AikWeigi', 'E', 'Ak Woigit', 'AKWelghnt ', ' [on Hit] Inflet of a', '[Before Attack] Gain +5 XCharge', 'random status,chosen from', ' [On Hit] Heal 40% of', 'Count', 'Burn,BleedTremor,', 'leep efewep', '[0n Hig Inflet 5 Spark', '$Rupture, ana Sinking', 'Resistances', '1.000 1.00', '0.75', '1.002.001.00', '2.00', 'Suddenly,One Day')
[DEBUG] 2026-10-03 10:12:57,290 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'TURN', 'SOON-TO-BLOON RLOWER', 'TART', 'Win', 'Rate', 'Damage', 'STAGGER', 'STAGGER', 'STAGGER', '103', '12', '50')
[DEBUG] 2026-10-03 10:13:19,633 [AALC] module\ocr\ocr.py:72: OCR识别结果:('MAX', '10', 'Details', 'To Corrnile', '0%', '2', '?', 'La Sangee de Saneho', 'LEX', 'WWelgm', '[On Hig inflet B Bleed', '[Heads Hit] Heal by 50% of ', 'damage dealt', 'Resistances', '2.008 0.75 ', '1.00', '1.002.01 1.00', '1.00', 'La Sangre de Sancho')
[DEBUG] 2026-10-03 10:16:09,500 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'Win', 'Rate', 'Damag', 'STAGGER', 'STAGGER', 'STAgGER', '103', '12', '50')
[DEBUG] 2026-10-03 10:17:11,323 [AALC] module\ocr\ocr.py:72: OCR识别结果:('BudLy35', '3032)', 'Skill Effects', 'L', 'Keywords', '[On Hit]Inflict1Blooming', 'Blooming', 'Turn End:At5+Count,take', 'Sloth damage by (Count)% of', 'MaxHP,and become Fully', 'Bloomed', 'At less than 5 Count, lose', '(Count *5) SP, then reduce', 'Count by1', 'Win', 'Rate', 'Damage', 'STAgGER', 'STAGGER', 'STAGGER', '195', '103', '12', '150')
[DEBUG] 2026-10-03 10:18:32,236 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'TURN', '3', 'START', 'Win', 'Rate', 'Damage', 'STAGGER', 'STAGGER', 'STAGGER', '195', '103', '12', '150')
[DEBUG] 2026-10-03 10:20:10,036 [AALC] module\config\config.py:420: teams_active_queue change to: []
[DEBUG] 2026-10-03 10:20:10,049 [AALC] module\config\config.py:421: teams_be_select change to: [False]
[DEBUG] 2026-10-03 10:20:10,051 [AALC] module\config\config.py:422: teams_order change to: [0]
[DEBUG] 2026-10-03 10:20:10,051 [AALC] module\config\config.py:423: teams_be_select_num change to: 0
[DEBUG] 2026-10-03 10:20:10,094 [AALC] module\config\config.py:51: 配置文件已加载,版本号:DEFAULT VERSION, 配置版本: [ACCOUNT_REDACTED]
[INFO] 2026-10-03 10:20:10,700 [RapidOCR] base.py:22: Using engine_name: onnxruntime
[INFO] 2026-10-03 10:20:10,902 [RapidOCR] download_file.py:60: File exists and is valid: {repo}\vendor\aalc\.venv\Lib\site-packages\rapidocr\models\ch_PP-OCRv4_det_infer.onnx
[INFO] 2026-10-03 10:20:10,904 [RapidOCR] main.py:55: Using {repo}\vendor\aalc\.venv\Lib\site-packages\rapidocr\models\ch_PP-OCRv4_det_infer.onnx
[INFO] 2026-10-03 10:20:11,018 [RapidOCR] base.py:22: Using engine_name: onnxruntime
[INFO] 2026-10-03 10:20:11,025 [RapidOCR] download_file.py:60: File exists and is valid: {repo}\vendor\aalc\.venv\Lib\site-packages\rapidocr\models\ch_ppocr_mobile_v2.0_cls_infer.onnx
[INFO] 2026-10-03 10:20:11,025 [RapidOCR] main.py:55: Using {repo}\vendor\aalc\.venv\Lib\site-packages\rapidocr\models\ch_ppocr_mobile_v2.0_cls_infer.onnx
[INFO] 2026-10-03 10:20:11,074 [RapidOCR] base.py:22: Using engine_name: onnxruntime
[INFO] 2026-10-03 10:20:11,168 [RapidOCR] download_file.py:60: File exists and is valid: {repo}\vendor\aalc\.venv\Lib\site-packages\rapidocr\models\ch_PP-OCRv4_rec_infer.onnx
[INFO] 2026-10-03 10:20:11,168 [RapidOCR] main.py:55: Using {repo}\vendor\aalc\.venv\Lib\site-packages\rapidocr\models\ch_PP-OCRv4_rec_infer.onnx
[DEBUG] 2026-10-03 10:20:11,442 [AALC] module\automation\automation.py:88: 使用前台点击模块
[DEBUG] 2026-10-03 10:20:11,449 [AALC] utils\path_manager.py:44: 路径管理器初始化完成,路径: ['dark/zh_cn', 'dark/en', 'dark/share', 'default/zh_cn', 'default/en', 'default/share']
[DEBUG] 2026-10-03 10:20:37,259 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'TURN', '式', 'Win', 'Rate', 'Damage', 'STAgGER-', 'STAGGER-', 'STAGGER')
[DEBUG] 2026-10-03 10:21:22,806 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'TURN', 'SOON-TO-BLOON FLOWER', 'START', 'Win', 'Rate', 'Damage', 'STAGGER-', 'STAGGER', 'STAGGER')
[DEBUG] 2026-10-03 10:21:52,567 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'TURN', 'Win', 'Rate', 'Damage', 'STAgGER', 'STAgGER', 'STAGGER')
[DEBUG] 2026-10-03 10:22:34,973 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'TURN', ' Settings', '← Resume', 'Q Retry Stage', 'X Give Up', 'Win', 'Rate', 'Damage', 'STAGGER', 'STAGGER', 'STAGGER', '889')
[DEBUG] 2026-10-03 10:22:58,359 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'TURN', ' Settings', '← Resume', 'Q Retry Stage', 'X Give Up', 'Win', 'Rate', 'Damage', 'STAGGER-', 'STAGGER', 'STAGGER', '889')
[DEBUG] 2026-10-03 10:23:01,377 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'TURN', 'START', 'Win', 'Rate', 'Damage', 'STAGGER-', 'STAGGER', 'STAGGER', '88')
[DEBUG] 2026-10-03 10:23:31,100 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'TURN', 'Win', 'Rate', 'Damage')
[DEBUG] 2026-10-03 10:24:17,138 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'TURN', 'Win', 'Rate', 'Damage')
[DEBUG] 2026-10-03 10:24:36,062 [AALC] module\ocr\ocr.py:72: OCR识别结果:('ngent Fragrance', '[On Hit] Inflict 2 Blooming', '77-77-77-21', '1436', 'DONGBAEK E.G.OSPICEBUSH', '162')
[DEBUG] 2026-10-03 10:24:38,792 [AALC] module\ocr\ocr.py:72: OCR识别结果:('I', 'Leap', '27-7-2-21436', 'G1', '22?', 'DONGBAEK E.G.O:SPICEBUSH')
[DEBUG] 2026-10-03 10:24:41,585 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Leap', '[Heads Hit] Inflict 2Fragile', 'Charge', 'ody')
[DEBUG] 2026-10-03 10:24:43,950 [AALC] module\ocr\ocr.py:72: OCR识别结果:('ormal', '148', '0')
[DEBUG] 2026-10-03 10:24:46,456 [AALC] module\ocr\ocr.py:72: OCR识别结果:('+3', 'Hack', 'Body', '1368')
[DEBUG] 2026-10-03 10:24:48,713 [AALC] module\ocr\ocr.py:72: OCR识别结果:None
[DEBUG] 2026-10-03 10:24:51,129 [AALC] module\ocr\ocr.py:72: OCR识别结果:('2Pse+3', 'Poise Count +', '195')
[DEBUG] 2026-10-03 10:24:53,573 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Leap',)
[DEBUG] 2026-10-03 10:24:57,810 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'Trytobea bit more careful withyourhealth.No,', "mean...'mjustworried foryou isall.", 'TURN', 'Dante', 'Win', 'Rate', 'Damage')
[DEBUG] 2026-10-03 10:25:01,269 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'Trytobea bit more careful withyourhealth.No,', "mean...'m just worried foryou is all.", 'TURN', 'Dante', 'Win', 'Rate', 'Damage')
[DEBUG] 2026-10-03 10:26:11,281 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'TURN', ' Settings', '← Resume', 'Q Retry Stage', 'X Give Up', 'Win', 'Rate', 'Damage', '95')
[DEBUG] 2026-10-03 10:26:13,861 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'TURN', 'Win', 'Rate', 'Damage')
[DEBUG] 2026-10-03 10:26:53,461 [AALC] module\ocr\ocr.py:72: OCR识别结果:('h-h', 'Defeat', 'When anenemyruns outofSanity andfallsintoPanic,', 'theyll suffernegativeeffects,givingyouanadvantage.', 'Check the E.G.Oyour Sinners have equipped and their required', 'resourcestoform a teamof ldentitiesthatcan efficiently gather', 'theminbattle.', 'E.G.O canshiftthebattle inyourfavorif usedwhenyour', 'Sinnershave enoughSanity.', 'DEFEAT', 'Return', "I'll need...more experience and training, it seems...", 'Confirm')
[DEBUG] 2026-10-03 10:27:23,047 [AALC] module\ocr\ocr.py:72: OCR识别结果:('h-h', 'Defeat', 'When anenemyruns outofSanity andfallsintoPanic,', 'theyll suffernegativeeffects,givingyouanadvantage.', 'Check the E.G.Oyour Sinners have equipped and their required', 'resourcestoform a teamof ldentitiesthatcan efficiently gather', 'theminbattle.', 'E.G.O canshiftthebattle inyourfavorif usedwhenyour', 'Sinnershave enoughSanity.', 'DEFEAT', 'Return', "I'll need...more experience and training, it seems.", 'Confirm')
[DEBUG] 2026-10-03 10:27:26,201 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Progress', 'EX Cleared', '米', 'Bud', 'Screening', 'NO.[ACCOUNT_REDACTED]', '036', '10', '193', 'LUNACY', 'LV', '124/120', '2646', 'Inventory')
[DEBUG] 2026-10-03 10:27:29,897 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Progress', 'EX Cleared', '米', 'Bud', 'Screening', 'Room', '[ACCOUNT_REDACTED]', '193', '036', 'LUNACY', 'LV', '2646', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', 'Inventory')
[DEBUG] 2026-10-03 10:27:34,142 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Progress', 'EX Cleared', '米', 'Bud', 'Screening', 'Room', '[ACCOUNT_REDACTED]', '193', '036', 'LUNACY', 'LV', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '124', '120', '2646', 'Inventory')
[DEBUG] 2026-10-03 10:27:38,177 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Progress', 'EX Cleared', '米', '4-48', 'Bud', 'Screening', 'Room', '[ACCOUNT_REDACTED]', '193', '036', 'LUNACY', 'LV', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '24', '2646', 'Inventory')
[DEBUG] 2026-10-03 10:27:41,817 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Progress', 'EX Cleared', '米', 'Bud', 'Screening', 'Room', '[ACCOUNT_REDACTED]', '193', '036', 'LUNACY', 'LV', '2646', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', 'Inventory')
[DEBUG] 2026-10-03 10:27:45,417 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Progress', 'EX Cleared', '米', 'Bud', 'Screening', 'Room', '[ACCOUNT_REDACTED]', '193', '036', 'LUNACY', 'LV', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '1242', '2646', 'Inventory')
[DEBUG] 2026-10-03 10:27:48,140 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Progress', 'EX Cleared', '米', '4-48', 'Bud', 'Screening', 'Room', '[ACCOUNT_REDACTED]', '193', '036', '10', 'LUNACY', 'LV', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '2646', '120', 'Inventory')
[DEBUG] 2026-10-03 10:29:12,564 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Progress', 'EX Cleared', '米', 'h', 'Bud', 'Screening', 'Room', '[ACCOUNT_REDACTED]', '10', '193', '036', 'LUNACY', 'LV', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '124/120', '2646', 'Inventory')
[DEBUG] 2026-10-03 10:29:15,755 [AALC] module\ocr\ocr.py:72: OCR识别结果:('CONNECTING', 'hh', 'Screening Room', '[ACCOUNT_REDACTED]', '036', '10', '193', 'LUNACY', 'LV', '124/120', '2646', 'Inventory', 'Theater', 'Extract', 'Jispens')
[DEBUG] 2026-10-03 10:29:20,154 [AALC] module\ocr\ocr.py:72: OCR识别结果:('4-48', 'Bud', 'Aservererrorhasoccurred.', 'Pleasetry again in a moment.', 'Close', 'Retry 2', 'Screening Room', '[ACCOUNT_REDACTED]', '9E0,', '10', '193', 'LUNACY', 'LV', '124/120', '2646', 'Inventory')
[DEBUG] 2026-10-03 10:29:23,953 [AALC] module\ocr\ocr.py:72: OCR识别结果:('4-48', 'Bud', 'Aservererrorhasoccurred.', 'Pleasetry again in a moment.', 'Close', 'Retry 4', 'Screening Room', '[ACCOUNT_REDACTED]', '9E0,', '10', '193', 'LUNACY', 'LV', '124/120', '2646', 'Inventory')
[DEBUG] 2026-10-03 10:29:27,683 [AALC] module\ocr\ocr.py:72: OCR识别结果:('#4-48', 'Bud', 'Aservererrorhasoccurred.', 'Pleasetry again in a moment.', 'Close', 'Retry 5', 'Screening Room', '[ACCOUNT_REDACTED]', '9E0,', '10', '193', 'LUNACY', 'LV', '124/120', '2646', 'Inventory')
[DEBUG] 2026-10-03 10:29:30,471 [AALC] module\ocr\ocr.py:72: OCR识别结果:('4-48', 'Bud', 'Aservererrorhasoccurred.', 'Pleasetry again in a moment.', 'Close', 'Retry 3', 'Screening Room', '[ACCOUNT_REDACTED]', '9E0,', '10', '193', 'LUNACY', 'LV', '1244', '2646', 'Inventory')
[DEBUG] 2026-10-03 10:30:47,939 [AALC] module\ocr\ocr.py:72: OCR识别结果:('TEAMS #1', 'K', 'Details', '7', 'Preset#1', 'Dante', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'All E.6.0', 'TEAMS', 'LV.35', 'LV.35', 'LV.35', 'LV.04', 'Lv.35', 'Blade Lineage', 'WCorp.L2', 'WCorp.L3', 'WCorp.L3', 'Rosespanner', 'WCorp.L2', 'TEAMS#1', 'Salsu', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Fagades', 'TEAMS#2', 'TEAMS#3', 'Support', 'TEAMS#4', 'SELECTED', 'SELECTED', 'Details', 'TEAMS#5', 'LV.34', 'LV.17', 'LV.35', 'LV.14', 'LV.14', 'LV.17', 'GCorp.', 'CClear Selection', 'TEAMS#6', 'LCB', 'Liu Assoc.', ' Corp.', 'Zwei Assoc.', 'LCB', 'Manager', 'outhSection4', 'Mittelhammer', 'South Section G', 'Sinner', 'Participant', 'TEALS#7', 'Limit', 'To Battle!')
[DEBUG] 2026-10-03 10:30:53,816 [AALC] module\ocr\ocr.py:72: OCR识别结果:('TEAMS #1', 'K', 'Details', '7', 'Preset#1', 'MlI lidestities', 'Dante', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'All E.6.0', 'TEAMS', 'LV.35', 'LV.35', 'LV.35', 'LV.04', 'Lv.35', 'Blade Lineage', 'WCorp.L2', 'WCorp.L3', 'WCorp.L3', 'Rosespanner', 'WCorp.L2', 'TEAMS#1', 'Salsu', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Fagades', 'TEAMS#2', 'TEAMS#3', 'Support', 'TEAMS#4', 'SELECTED', 'SELECTED', 'Details', 'TEAMS#5', 'LV.34', 'LV.17', 'LV.35', 'LV.14', 'LV.14', 'LV.17', 'GCorp.', 'CClear Selection', 'TEAMS#6', 'LCB', 'Liu Assoc.', ' Corp.', 'Zwei Assoc.', 'LCB', 'Manager', 'outhSection4', 'Mittelhammer', 'South Section G', 'Sinner', 'Corporal', 'Partieipant', 'TEALS#7', 'Limit', 'To Battle!')
[DEBUG] 2026-10-03 10:31:00,431 [AALC] module\ocr\ocr.py:72: OCR识别结果:('TEAMS #1', 'K', 'Details', '7', 'Preset#1', 'Dante', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'All E.6.0', 'TEAMS', 'LV.35', 'LV.35', 'LV.35', 'LV.04', 'Lv.35', 'Blade Lineage', 'WCorp.L2', 'WCorp.L3', 'WCorp.L3', 'Rosespanner', 'WCorp.L2', 'TEAMS#1', 'Salsu', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Fagades', 'TEAMS#2', 'TEAMS#3', 'Support', 'TEAMS#4', 'SELECTED', 'SELECTED', 'Details', 'TEAMS#5', 'LV.34', 'LV.17', 'LV.35', 'LV.14', 'LV.14', 'LV.17', 'GCorp.', 'CClear Selection', 'TEAMS#6', 'LCB', 'Liu Assoc.', ' Corp.', 'Zwei Assoc.', 'LCB', 'Manager', 'outhSection4', 'Mittelhammer', 'South Section G', 'Sinner', 'Corporal', 'Partieipant', 'TEALS#7', 'Limit', 'To Battle!')
[DEBUG] 2026-10-03 10:31:07,266 [AALC] module\ocr\ocr.py:72: OCR识别结果:('TEAMS #1', 'K', 'Details', '7', 'Preset#1', 'Dante', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'All E.6.0', 'TEAMS', 'LV.35', 'LV.35', 'LV.35', 'LV.04', 'Lv.35', 'Blade Lineage', 'WCorp.L2', 'WCorp.L3', 'WCorp.L3', 'Rosespanner', 'WCorp.L2', 'TEAMS#1', 'Salsu', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Fagades', 'TEAMS#2', 'TEAMS#3', 'Support', 'TEAMS#4', 'SELECTED', 'SELECTED', 'Details', 'TEAMS#5', 'LV.34', 'LV.17', 'LV.35', 'LV.14', 'LV.14', 'LV.17', 'GCorp.', 'CClear Selection', 'TEAMS#6', 'LCB', 'Liu Assoc.', ' Corp.', 'Zwei Assoc.', 'LCB', 'Manager', 'outhSection4', 'Mittelhammer', 'South Section G', 'Sinner', 'Corporal', 'Partieipant', 'TEALS#7', 'Limit', 'To Battle!')
[DEBUG] 2026-10-03 10:31:12,891 [AALC] module\ocr\ocr.py:72: OCR识别结果:('TEAMS #1', 'K', 'Details', '7', 'Preset#1', 'Dante', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'All E.6.0', 'TEAMS', 'LV.35', 'LV.35', 'LV.35', 'LV.04', 'Lv.35', 'Blade Lineage', 'WCorp.L2', 'WCorp.L3', 'WCorp.L3', 'Rosespanner', 'WCorp.L2', 'TEAMS#1', 'Salsu', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Fagades', 'TEAMS#2', 'TEAMS#3', 'Support', 'TEAMS#4', 'SELECTED', 'SELECTED', 'Details', 'TEAMS#5', 'LV.34', 'LV.17', 'LV.35', 'LV.14', 'LV.14', 'LV.17', 'GCorp.', 'CClear Selection', 'TEAMS#6', 'LCB', 'Liu Assoc.', ' Corp.', 'Zwei Assoc.', 'LCB', 'Manager', 'outhSection4', 'Mittelhammer', 'South Section G', 'Sinner', 'Corporal', 'Participant', 'TEALS#7', 'Limit', 'To Battle!')
[DEBUG] 2026-10-03 10:31:19,612 [AALC] module\ocr\ocr.py:72: OCR识别结果:('TEAMS #1', 'K', 'Details', '7', 'Preset#1', 'MlI lidestities', 'Dante', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'All E.6.0', 'TEAMS', 'LV.35', 'LV.35', 'LV.35', 'LV.04', 'Lv.35', 'Blade Lineage', 'WCorp.L2', 'WCorp.L3', 'WCorp.L3', 'Rosespanner', 'WCorp.L2', 'TEAMS#1', 'Salsu', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Fagades', 'TEAMS#2', '00', 'TEAMS#3', 'Support', 'TEAMS#4', 'SELECTED', 'SELECTED', 'Details', 'TEAMS#5', 'LV.34', 'LV.17', 'LV.35', 'LV.14', 'LV.14', 'LV.17', 'G Corp.', 'CClear Selection', 'TEAMS#6', 'LCB', 'Liu Assoc.', ' Corp.', 'Zwei Assoc.', 'LCB', 'Manager', 'outhSection4', 'Mittelhammer', 'South Section G', 'Sinner', 'Partieipant', 'TEALS#7', 'Limit', 'To Battle!')
[DEBUG] 2026-10-03 10:31:26,017 [AALC] module\ocr\ocr.py:72: OCR识别结果:('TEAMS #1', 'K', 'Details', '7', 'Preset#1', 'MlI lidestities', 'Dante', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'All E.6.0', 'TEAMS', 'LV.35', 'LV.35', 'LV.35', 'LV.04', 'Lv.35', 'Blade Lineage', 'WCorp.L2', 'WCorp.L3', 'WCorp.L3', 'Rosespanner', 'WCorp.L2', 'TEAMS#1', 'Salsu', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Fagades', 'TEAMS#2', '00', 'TEAMS#3', 'Support', 'TEAMS#4', 'SELECTED', 'SELECTED', 'Details', 'TEAMS#5', 'LV.34', 'LV.17', 'LV.35', 'LV.14', 'LV.14', 'LV.17', 'G Corp.', 'CClear Selection', 'TEAMS#6', 'LCB', 'Liu Assoc.', ' Corp.', 'Zwei Assoc.', 'LCB', 'Manager', 'outhSection4', 'Mittelhammer', 'South Section G', 'Sinner', 'Corporal', 'Participant', 'TEALS#7', 'Limit', 'To Battle!')
[DEBUG] 2026-10-03 10:32:49,008 [AALC] module\ocr\ocr.py:72: OCR识别结果:('TEAMS#1', 'SUPPORTIDENTITIES:YISANG', '人', 'Details', 'Selected Identity', 'TEAIIS', 'Details', 'ALL', "Crow'sEyeViev", 'TETH', 'HE', 'No Support Identities for this Sinner.', 'ALEPH', 'South')
[DEBUG] 2026-10-03 10:35:49,464 [AALC] module\ocr\ocr.py:72: OCR识别结果:('TEAMS#1', 'SUPPORTIDENTITIES:YISANG', '人', 'Details', 'Selected Identity', 'TEAIIS', 'Details', 'ALL', "Crow'sEyeViev", 'TETH', 'HE', 'No Support Identities for this Sinner.', 'ALEPH', 'South')
[DEBUG] 2026-10-03 10:36:08,033 [AALC] module\ocr\ocr.py:72: OCR识别结果:('TEAMS #1', 'SUPPORTIDENTITIES:RYOSHU', '人', 'Details', 'Selected Identity', 'Details', 'ALL', 'ForestfortheHame', 'TETH', 'HE', 'No Support Identities for this Sinner.', 'ALEPH')
[DEBUG] 2026-10-03 10:36:38,687 [AALC] module\ocr\ocr.py:72: OCR识别结果:('TEAMS #1', 'K', 'Details', '7', 'Preset#1', 'Dante', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'SELECTED', 'All E.6.0', 'TEAMS', 'LV.35', 'LV.35', 'LV.35', 'LV.04', 'Lv.35', 'Blade Lineage', 'WCorp.L2', 'WCorp.L3', 'WCorp.L3', 'Rosespanner', 'WCorp.L2', 'TEAMS#1', 'Salsu', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'Fagades', 'TEAMS#2', 'TEAMS#3', 'Support', 'TEAMS#4', 'SELECTED', 'SELECTED', 'Details', 'TEAMS#5', 'LV.34', 'LV.17', 'LV.35', 'LV.14', 'LV.14', 'LV.17', 'GCorp.', 'CClear Selection', 'TEAMS#6', 'LCB', 'Liu Assoc.', ' Corp.', 'Zwei Assoc.', 'LCB', 'Manager', 'outhSection4', 'Mittelhammer', 'South Section G', 'Sinner', 'Partieipant', 'TEALS#7', 'Limit', 'To Battle!')
[DEBUG] 2026-10-03 10:37:01,500 [AALC] module\ocr\ocr.py:72: OCR识别结果:None
[DEBUG] 2026-10-03 10:37:15,588 [AALC] module\ocr\ocr.py:72: OCR识别结果:('DCQ@O目', 'Screening Room', 'Technology', 'Liberation Alliance', 'Dongbaek', 'Kaff.. Koff..')
[DEBUG] 2026-10-03 10:37:30,144 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'Trytobea bit more careful withyourhealth.No,', "mean...'mjust worried foryou is all.", 'TURN', 'Dante', 'Win', 'Rate', 'Damage', '46')
[DEBUG] 2026-10-03 10:37:55,431 [AALC] module\ocr\ocr.py:72: OCR识别结果:('MAX', '5.5', 'Skill Effects', 'Reywords', '[On Use] Spend 10XCharge', '*Charge', 'Count to gain +4 Coin Power', 'Atlessthan10XCharge', 'Rip Space', 'Resource used by certain skills', 'Count, lose 20% HP', 'for additional effects.Its Count', 'can go up to 20.Count lowers', '[HeadsHit] Inflict5', 'by1at the end ofeach turn.', 'Rupture', 'Rupture', 'Whenhitbyanattack,take', "fixed damage bythe effect's", 'Potency.', 'Then, reduce its Count by 1.')
[DEBUG] 2026-10-03 10:38:11,152 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'TURN', 'Win', 'Rate', 'Damage', '14G')
[DEBUG] 2026-10-03 10:38:27,060 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'TURN', 'Win', 'Rate', 'Damage', '6')
[DEBUG] 2026-10-03 10:38:29,451 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'TURN', 'Win', 'Rate', 'Damage')
[DEBUG] 2026-10-03 10:39:00,853 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Pungent Fragrance', '27-7--211392', '???', 'DONGBAEK E.G.O:SPICEBUSH')
[DEBUG] 2026-10-03 10:39:29,723 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Dismember', '[On Hit] Inflict 5Rupture', 'HeadsHit]Heal by50%ofdamagedealt', 'Body', '1265', 'MODAFI/ F')
[DEBUG] 2026-10-03 10:39:54,615 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Thatwasgreatworkyoudidthere.Keepitrolling,will', 'you?', 'Dante')
[DEBUG] 2026-10-03 10:40:28,320 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'TURN', 'Win', 'Rate', 'Damage', 'TAGGER-', 'STAGGER')
[DEBUG] 2026-10-03 10:40:30,101 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'TURN', 'Win', 'Rate', 'Damage', 'TAGGER-', 'STAGGER')
[DEBUG] 2026-10-03 10:40:32,886 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'MAX', 'TURN', 'FJLLY BLDONEO FLOWER', 'Win', 'Rate', 'Damage', 'STAGGER')
[DEBUG] 2026-10-03 10:41:46,689 [AALC] module\ocr\ocr.py:72: OCR识别结果:(' Settings', '←Resume', 'Q Retry Stage', 'X Give Up')
[DEBUG] 2026-10-03 10:42:22,868 [AALC] module\ocr\ocr.py:72: OCR识别结果:('MAX', 'TURN', ' Settings', '← Resume', 'Q Retry Stage', 'X Give Up', 'Win', 'Rate', 'Damage', 'STAGGER', 'STAGGER', 'STAGGER', '-15')
[DEBUG] 2026-10-03 10:42:27,722 [AALC] module\ocr\ocr.py:72: OCR识别结果:('WAVE', 'TURN', '3', 'Win', 'Rate', 'Damage', 'STAgGER', 'STAGGER', 'STAGGER', '82', '-15')
[DEBUG] 2026-10-03 10:44:12,948 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Progress', 'EX Cleared', '米', 'Bud', 'Screening', 'Room', '[ACCOUNT_REDACTED]', '193', '036', 'LUNACY', 'LV', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '2646', '120', 'Inventory')
[DEBUG] 2026-10-03 10:44:36,557 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Progress', 'EX Cleared', '米', '4-48', 'Bud', 'Screening', 'Room', '[ACCOUNT_REDACTED]', '193', '036', '10', 'LUNACY', 'LV', '2646', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '24', 'Inventory')
[DEBUG] 2026-10-03 10:44:40,085 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Progress', 'EX Cleared', '米', 'Bud', 'Screening', 'Room', '[ACCOUNT_REDACTED]', '193', '036', '10', 'LUNACY', 'LV', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '124/120', '2646', 'Inventory')
[DEBUG] 2026-10-03 10:45:16,084 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Preset #1', 'TEAMS #1', '《', 'Details', '311', '11', 'Dante', '13', 'TEAMS', 'TEAMS#1', 'All E.6.0', 'TEAMS#2', 'Lv.35', 'LV.35', 'LV.35', 'LV.04', 'LV.35', '12', 'Blade Lineage', 'WCorp.L2', 'wCorp.L3', 'WCorp.L3', 'Rosespanner', 'WCorp.L2', 'Salsu', 'Cleanup Agent', 'Cleanup Agent', 'Cleanup Agent', 'WorkshopFixer', 'Cleanup Agent', 'TEAMS#3', '18', 'Fagades', 'TEAMS#4', 'TEAMS#5', '0!', 'Support', 'TEAMS#6', 'Details', 'TEAMS#7', 'LV.34', 'LV.17', 'LV.35', 'LV.14', 'LV.14', 'Lv.17', 'G Corp.', 'TEAMS#8', 'LCB', 'Liu Assoe.', ' Corp.', 'Zwei Assoe.', 'LCB', 'Manager', 'outhSection4', 'Mittelhammer', 'South Section G', 'Sinner', '[ACCOUNT_REDACTED]', '193', '036', 'UNACY', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '2646', 'Inventory')
[DEBUG] 2026-10-03 10:45:35,791 [AALC] module\ocr\ocr.py:72: OCR识别结果:('TEAMS#1', 'IDENTITIES:DONQUIXOTE', 'Identities', 'E.G.0', 'Facades', 'Details', 'Selected Identity', 'Details', 'ALL', 'SELECTED', 'Lv35', 'Lv-30', 'W Corp.L3', 'NCorp.', 'LaSangredeSan', 'ACleanug Agent', 'Mittelhammer', 'LCB', 'Sinner', 'TETH', 'HE', 'ALEPH')
[DEBUG] 2026-10-03 10:45:56,711 [AALC] module\ocr\ocr.py:72: OCR识别结果:('TEAMS#1', 'IDENTITIES:DONQUIXOTE', 'Identities', 'E.G.0', 'Facades', 'Details', 'Selected Identity', 'Details', 'ALL', 'SELECTED', 'Lv35', 'Lv-30', 'LV.', 'W Corp.L3', 'NCorp.', 'LCB', 'LaSangredeSan', 'ACleanug Agent', 'nittelhammer', 'TETH', 'HE', 'ALEPH')
[DEBUG] 2026-10-03 10:46:17,329 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Don', 'awCorp.', 'Ixnte', 'W Corp. L3 Cleanup Agent', 'LV35', '0/4899', 'Level UpA', 'MAX', 'Summary', 'Skill', 'E.G.0', 'Sanity', 'ALEPH', 'La Sangre', 'de Sancho', 'Status', 'Resistances', '16113-634', 'Normal', 'Ineff.', 'Fatal', '川', 'DEFENSE', '-C', '[x1]', '[X0.5]', '[x2]')
[DEBUG] 2026-10-03 10:46:41,212 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Don', 'awCorp.', 'Ixnte', 'W Corp. L3 Cleanup Agent', 'LV35', '0/4899', 'Level UpA', 'MAX', 'Summary', 'Skill', 'E.G.0', 'Sanity', 'ALEPH', 'La Sangre', 'de Sancho', 'Status', 'Resistances', '16113-634', 'Ineff.', 'Fatal', '川', 'DEFENSE', 'C', '[x1]', '[X.5]', '[x2]')
[DEBUG] 2026-10-03 10:46:45,905 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Don', 'awCorp.', 'xnte', 'W Corp. L3 Cleanup Agent', 'LV35', '0/4899', 'Level UpA', 'MAX', 'Summary', 'Skill', 'E.G.0', 'Sanity', 'ALEPH', 'La Sangre', 'de Sancho', 'Status', 'Resistances', '16113-634', 'Normal', 'Ineff.', 'Fatal', '川', 'DEFENSE', 'C', '[x1]', '[x0.5]', '[x2]')
[DEBUG] 2026-10-03 10:47:14,280 [AALC] module\ocr\ocr.py:72: OCR识别结果:('D', 'D', 'awCorp.', 'Power-up', 'leanup Agent', 'MAX', 'Items.', '35·35', 'Identity Training TicketIV (Owned:0)', 'Sanity', 'EXP0/4899', 'Status', 'Identity Training Ticketll (Owned:0)', 'HP', '161161', '0', 'ALEPH', 'Defense Level 34 34', 'Identity Training Ticketll(owned:7)', 'Skill1Skil12Skill3 Defense', '8X383835', 'X Cancel', 'Confirm', 'Status', '16113-67', 'DEFENSE')
[DEBUG] 2026-10-03 10:48:24,629 [AALC] module\config\config.py:420: teams_active_queue change to: []
[DEBUG] 2026-10-03 10:48:24,638 [AALC] module\config\config.py:421: teams_be_select change to: [False]
[DEBUG] 2026-10-03 10:48:24,639 [AALC] module\config\config.py:422: teams_order change to: [0]
[DEBUG] 2026-10-03 10:48:24,641 [AALC] module\config\config.py:423: teams_be_select_num change to: 0
[DEBUG] 2026-10-03 10:48:24,687 [AALC] module\config\config.py:51: 配置文件已加载,版本号:DEFAULT VERSION, 配置版本: [ACCOUNT_REDACTED]
[INFO] 2026-10-03 10:48:25,173 [RapidOCR] base.py:22: Using engine_name: onnxruntime
[INFO] 2026-10-03 10:48:25,321 [RapidOCR] download_file.py:60: File exists and is valid: {repo}\vendor\aalc\.venv\Lib\site-packages\rapidocr\models\ch_PP-OCRv4_det_infer.onnx
[INFO] 2026-10-03 10:48:25,321 [RapidOCR] main.py:55: Using {repo}\vendor\aalc\.venv\Lib\site-packages\rapidocr\models\ch_PP-OCRv4_det_infer.onnx
[INFO] 2026-10-03 10:48:25,414 [RapidOCR] base.py:22: Using engine_name: onnxruntime
[INFO] 2026-10-03 10:48:25,416 [RapidOCR] download_file.py:60: File exists and is valid: {repo}\vendor\aalc\.venv\Lib\site-packages\rapidocr\models\ch_ppocr_mobile_v2.0_cls_infer.onnx
[INFO] 2026-10-03 10:48:25,417 [RapidOCR] main.py:55: Using {repo}\vendor\aalc\.venv\Lib\site-packages\rapidocr\models\ch_ppocr_mobile_v2.0_cls_infer.onnx
[INFO] 2026-10-03 10:48:25,458 [RapidOCR] base.py:22: Using engine_name: onnxruntime
[INFO] 2026-10-03 10:48:25,472 [RapidOCR] download_file.py:60: File exists and is valid: {repo}\vendor\aalc\.venv\Lib\site-packages\rapidocr\models\ch_PP-OCRv4_rec_infer.onnx
[INFO] 2026-10-03 10:48:25,472 [RapidOCR] main.py:55: Using {repo}\vendor\aalc\.venv\Lib\site-packages\rapidocr\models\ch_PP-OCRv4_rec_infer.onnx
[DEBUG] 2026-10-03 10:48:25,713 [AALC] module\automation\automation.py:88: 使用前台点击模块
[DEBUG] 2026-10-03 10:48:25,719 [AALC] utils\path_manager.py:44: 路径管理器初始化完成,路径: ['dark/zh_cn', 'dark/en', 'dark/share', 'default/zh_cn', 'default/en', 'default/share']
[DEBUG] 2026-10-03 10:48:58,149 [AALC] module\ocr\ocr.py:72: OCR识别结果:('CONNECTING', 'TEAMS #1', 'Details', '面', 'SINICOST', 'Preset#1', 'Dante', 'MlI lidestities', 'TEAMS', 'TEAMS#1', 'hEN', 'Lv.35', 'LV.35', 'LV.04', 'Lv.35', 'Blade Lineage', 'WCorp.L2', 'WCorp.L3', 'WCorp.L3', 'Rosespanner', 'WCorp.L2', 'All E.6.0', 'TEAMS#2', 'Salsu', 'Cleanup Agent', 'Cleanup Agent', 'Ceanup Agent', 'WorkshopFixer', 'Cleanup Agent', 'TEAMS#3', 'Fagades', 'TEAMS#4', '梦9', 'TEAMS#5', 'Details', 'Support', 'TEAMS#6', 'LV.34', 'LV.35', "hL'7", 'LV.17', 'TEAMS#7', 'LCB', 'Liu Assoc.', 'N Corp.', 'Zwei Assoc.', 'LCB', 'Manager', 'outh Section', 'Mittelhammer', 'South Section 6', 'Sinner', 'TEAMS#8', '[ACCOUNT_REDACTED]', '193', '036', 'NACY', 'Window', 'Theater', 'Sinners', 'Drive', 'Extract', 'Dispense', '2646', 'Inventory')
[DEBUG] 2026-10-03 10:49:41,479 [AALC] module\ocr\ocr.py:72: OCR识别结果:('Inferno', 'Luxca', 'MIRROROF', 'NAMESAND', 'R', '21.50m', '[ACCOUNT_REDACTED]', '036', '193', 'UNACY', 'Window', 'Sinners', 'Drive', 'Theater', 'Extract', 'Dispense', '2646', 'Inventory')
[DEBUG] 2026-10-03 10:50:03,482 [AALC] module\ocr\ocr.py:72: OCR识别结果:('STAGE', 'STAGE', 'STAGE', 'Luxcavation', '01', 'EXP Luxcavation #1', '02', 'EXP Luxcavation #2', '03', 'EXP Luxcavation #3', 'EXP', 'Consecutive Battle x1', 'ConsecutiveBattle x1', 'Consecutive Battle x1', 'Thread', 'Useful Types', 'UsefulTypes', 'UsefulTypes', 'Difficulty:Ly8', 'Difficulty: Lv 18', 'Difficulty:Lv28', 'Rewards', '福', 'Rewards', 'Rewards', 'Enter', 'Enter', ' 2', 'Enter', '2', ' Skip Battle', 'P', 'Skip Battle', 'Skip Battle', '[ACCOUNT_REDACTED]', '9E0,', '10', '193', 'LUNACY', 'LV', '124/120', '2646', 'Inventory')
[DEBUG] 2026-10-03 10:50:33,489 [AALC] module\ocr\ocr.py:72: OCR识别结果:('STAGE', 'STAGE', 'Luxcavation', 'STAGE', '01', 'EXPLuxcavation #1', '02', 'EXP Luxcavation #2', '03', 'EXP Luxcavation #3', 'EXP', 'Consecutive Battle x1', 'Consecutive Battle 1', 'ConsecutiveBattlex1', 'Thread', 'UsefulTypes', 'UsefulTypes', 'Useful Types', 'Difficulty: Lv 8', 'Difficulty:LV18', 'Difficulty: Lv.28', 'Rewards', 'P', 'Rewards', 'Rewards', 'Enter', 'Enter', '2', '吧', 'Skip Battle', 'Skip Battle', 'Skip Battle', '[ACCOUNT_REDACTED]', '9E0,', '10', '193', 'LUNACY', 'LV', '124/120', '2646', 'Inventory')
@@ -0,0 +1,3 @@
{"choice": "requires_analysis", "jev_ms": 1484, "screen": {"path": "{user_home}/lc_mcp/shots/shot_20261003_094641_436.png", "w": 1276, "h": 717}, "ocr": "2026.9.1\nTARGETE\nGreg\nHmmm...'m growing restless.When the hell can we getto work?\nAHANDY-DANDYGUIDE\nLTHE NEWEXECUTIVEMANAGERSOFLIMBU\nDIGESTBEFOREGETTINGTOWORK\nV894413125\n960,\n193\nUNACY\nWindow\nSinners\nDrive\nTheater\nExtract\n2646\nDispense\nInventory"}
{"choice": "enter_deployment", "jev_ms": 1282, "stage": "4-48", "state": "用户希望推进主线并跳过剧情。地图已确认4-47绿色已通关,4-48 Bud 棕色未通关。关卡详情等级35,EX要求15回合内通关,Enter消耗20普通体力;当前120/120体力、2646狂气。Enter后是战前编队,可先检查队伍。"}
{"choice": "fill_seven", "jev_ms": 1312, "stage": "4-48", "state": "4-48战前编队,参加上限7人,当前仅选5人:W唐35、W良秀35、刘以实玛利35、G格里高尔34、剑契理想34。还有W浮士德35和W鸿璐35可选,其他人格4到17级。七名等级接近关卡35级,三阶同步。"}
+66
View File
@@ -0,0 +1,66 @@
{
"exported_at_utc": "2026-10-03T02:55:31.845399+00:00",
"base_commit": "030527f5de5c83dd8ea6e53288c1c52f3b4a85bb",
"test_exit_code": 0,
"tests_passed": 94,
"main_story_cleared": false,
"jev_calls_logged": 3,
"simultaneous_human_input_confirmed": true,
"game_input_stopped_for_export": true,
"timeline_provenance": "manual reconstruction, not a complete action trace",
"screenshots": 4,
"excluded": [
"API keys",
"MCP token",
"private configurations",
"Codex transcripts",
"account-bottom-bar screenshots"
],
"files": [
{
"path": "captures/defeat.png",
"bytes": 1620164,
"sha256": "21f4712a3f3f215c72bfc941903faa272d9cc991dbb8eafc8e9ce86ff1582e0d"
},
{
"path": "captures/training-ticket-inventory.png",
"bytes": 999470,
"sha256": "6fc05740962e2a2fa471f43d41a88965b6b6dc217f21d799257d2936197fffae"
},
{
"path": "captures/turn1-winrate.png",
"bytes": 1355703,
"sha256": "99ce5b7f623bb4a336c342cfbbbc3262fabec67e1f8f61279d025b98867311e5"
},
{
"path": "captures/turn3-blooming.png",
"bytes": 1724843,
"sha256": "30a4f3924dca2c2ec3bb1950a85be80a6dedcd3c5b32c9e7abdc7c2f3fa16386"
},
{
"path": "logs/server-excerpt.txt",
"bytes": 56113,
"sha256": "da7c47598f38b0bac4bc4918b503d9bfbc641c812754089af9de7e46df2d78d3"
},
{
"path": "logs/story_decisions.jsonl",
"bytes": 1081,
"sha256": "b363b444dd3e18fc589f35b22fa19ff922953745a9e2cfaab2acbfe7b7c61d57"
},
{
"path": "README.md",
"bytes": 7606,
"sha256": "518dea5f19e2dd3beec627a173e86337f2a31e4e8020dab523cd407cf1bb33cc"
},
{
"path": "test-results.txt",
"bytes": 14030,
"sha256": "0e1fd946db3376cd7b727b2f28edfd8955c2e6427895f5a339593589f3c262a0"
},
{
"path": "timeline.jsonl",
"bytes": 3103,
"sha256": "965f2195f3af3e554b89089cc4735ee3cfcc656f31065a72e7ce59027e58fc83"
}
]
}
+107
View File
@@ -0,0 +1,107 @@
{"step": 0, "choice": "run_complete", "action": {"tool": "run_complete", "args": {}}, "jev_ms": 0, "ocr_ms": 0, "screen": null, "at": "2026-10-03T10:55:22", "state": "completed"}
{"step": 0, "choice": "wait", "action": {"tool": "wait", "args": {"seconds": 0.7}}, "jev_ms": 0, "ocr_ms": 0, "screen": null, "at": "2026-10-03T10:55:22", "action_ms": 0, "finished_at": "2026-10-03T10:55:22", "result": {"ok": true, "waited": 0.7}, "state": "running", "battle_context": false}
{"step": 1, "choice": "wait", "action": {"tool": "wait", "args": {"seconds": 0.7}}, "jev_ms": 0, "ocr_ms": 0, "screen": null, "at": "2026-10-03T10:55:22", "action_ms": 0, "finished_at": "2026-10-03T10:55:22", "result": {"ok": true, "waited": 0.7}, "state": "running", "battle_context": false}
test_choice_outside_permitted_actions_is_rejected (test_jev_client.JevClientTest.test_choice_outside_permitted_actions_is_rejected) ... ok
test_configured_model_endpoint_session_and_instructions_reach_api (test_jev_client.JevClientTest.test_configured_model_endpoint_session_and_instructions_reach_api) ... ok
test_curl_credentials_only_on_stdin_and_http_errors_not_retried (test_jev_client.JevClientTest.test_curl_credentials_only_on_stdin_and_http_errors_not_retried) ... ok
test_session_id_stays_stable_across_decisions (test_jev_client.JevClientTest.test_session_id_stays_stable_across_decisions) ... ok
test_completed_run_archives_context_for_next_run (test_jev_mirror_agent.MainLoopTest.test_completed_run_archives_context_for_next_run) ... ok
test_tool_errors_are_observed_instead_of_aborting (test_jev_mirror_agent.MainLoopTest.test_tool_errors_are_observed_instead_of_aborting) ... ok
test_ambiguous_event_is_not_assumed_free (test_jev_mirror_agent.SceneRegressionTest.test_ambiguous_event_is_not_assumed_free) ... ok
test_battle_cinematic_keeps_macro_available (test_jev_mirror_agent.SceneRegressionTest.test_battle_cinematic_keeps_macro_available) ... ok
test_battle_entry_uses_enter_without_party_changes (test_jev_mirror_agent.SceneRegressionTest.test_battle_entry_uses_enter_without_party_changes) ... ok
test_battle_macro_continues_through_empty_ocr_and_stops_at_reward (test_jev_mirror_agent.SceneRegressionTest.test_battle_macro_continues_through_empty_ocr_and_stops_at_reward) ... ok
test_battle_macro_stops_at_judgement_before_more_inputs (test_jev_mirror_agent.SceneRegressionTest.test_battle_macro_stops_at_judgement_before_more_inputs) ... ok
test_battle_macro_stops_on_party_death (test_jev_mirror_agent.SceneRegressionTest.test_battle_macro_stops_on_party_death) ... ok
test_claim_confirmation_only_uses_modal (test_jev_mirror_agent.SceneRegressionTest.test_claim_confirmation_only_uses_modal) ... ok
test_claimed_rewards_stop_at_lobby_without_entering_again (test_jev_mirror_agent.SceneRegressionTest.test_claimed_rewards_stop_at_lobby_without_entering_again) ... ok
test_confirmation_blocks_background_leave (test_jev_mirror_agent.SceneRegressionTest.test_confirmation_blocks_background_leave) ... ok
test_death_screen_stops_battle_candidates_without_accepting_deaths (test_jev_mirror_agent.SceneRegressionTest.test_death_screen_stops_battle_candidates_without_accepting_deaths) ... ok
test_disabled_selection_is_not_clickable_candidate (test_jev_mirror_agent.SceneRegressionTest.test_disabled_selection_is_not_clickable_candidate) ... ok
test_event_dialog_skip_precedes_judgement_and_options (test_jev_mirror_agent.SceneRegressionTest.test_event_dialog_skip_precedes_judgement_and_options) ... ok
test_event_encounter_result_clicks_start_battle (test_jev_mirror_agent.SceneRegressionTest.test_event_encounter_result_clicks_start_battle) ... ok
test_event_fallback_does_not_treat_encounter_trigger_as_free_reward (test_jev_mirror_agent.SceneRegressionTest.test_event_fallback_does_not_treat_encounter_trigger_as_free_reward) ... ok
test_event_gift_outcome_does_not_become_startup_selection (test_jev_mirror_agent.SceneRegressionTest.test_event_gift_outcome_does_not_become_startup_selection) ... ok
test_event_result_uses_visible_continue_button (test_jev_mirror_agent.SceneRegressionTest.test_event_result_uses_visible_continue_button) ... ok
test_explicit_extra_observation_can_be_declined (test_jev_mirror_agent.SceneRegressionTest.test_explicit_extra_observation_can_be_declined) ... ok
test_fallback_judgement_precedes_reselecting_sinner (test_jev_mirror_agent.SceneRegressionTest.test_fallback_judgement_precedes_reselecting_sinner) ... ok
test_final_claim_click_is_followed_by_enter (test_jev_mirror_agent.SceneRegressionTest.test_final_claim_click_is_followed_by_enter) ... ok
test_floor_pack_rules_are_enforced_before_decision (test_jev_mirror_agent.SceneRegressionTest.test_floor_pack_rules_are_enforced_before_decision) ... ok
test_floor_three_sinclair_cannot_choose_first_floor_swap (test_jev_mirror_agent.SceneRegressionTest.test_floor_three_sinclair_cannot_choose_first_floor_swap) ... ok
test_generic_button_clicks_the_checked_item (test_jev_mirror_agent.SceneRegressionTest.test_generic_button_clicks_the_checked_item) ... ok
test_gift_damage_description_is_not_battle (test_jev_mirror_agent.SceneRegressionTest.test_gift_damage_description_is_not_battle) ... ok
test_in_battle_judgement_overrides_previous_battle (test_jev_mirror_agent.SceneRegressionTest.test_in_battle_judgement_overrides_previous_battle) ... ok
test_jev_rate_limit_fails_without_sleep_or_second_request (test_jev_mirror_agent.SceneRegressionTest.test_jev_rate_limit_fails_without_sleep_or_second_request) ... ok
test_layer_confirmation_requires_full_selection_then_batches_enter (test_jev_mirror_agent.SceneRegressionTest.test_layer_confirmation_requires_full_selection_then_batches_enter) ... ok
test_loading_ocr_missing_n_blocks_input (test_jev_mirror_agent.SceneRegressionTest.test_loading_ocr_missing_n_blocks_input) ... ok
test_loading_offers_wait_and_never_auto_escalates (test_jev_mirror_agent.SceneRegressionTest.test_loading_offers_wait_and_never_auto_escalates) ... ok
test_map_templates_are_loaded_once (test_jev_mirror_agent.SceneRegressionTest.test_map_templates_are_loaded_once) ... ok
test_nested_reward_confirmation_excludes_background_cards (test_jev_mirror_agent.SceneRegressionTest.test_nested_reward_confirmation_excludes_background_cards) ... ok
test_pending_thunderbranch_cannot_leave_shop (test_jev_mirror_agent.SceneRegressionTest.test_pending_thunderbranch_cannot_leave_shop) ... ok
test_purple_shop_is_reachable_by_lit_arrow (test_jev_mirror_agent.SceneRegressionTest.test_purple_shop_is_reachable_by_lit_arrow) ... ok
test_real_white_event_routes_work_without_map_heading_ocr (test_jev_mirror_agent.SceneRegressionTest.test_real_white_event_routes_work_without_map_heading_ocr) ... ok
test_reward_stops_battle_candidates (test_jev_mirror_agent.SceneRegressionTest.test_reward_stops_battle_candidates) ... ok
test_route_enters_without_a_second_snapshot (test_jev_mirror_agent.SceneRegressionTest.test_route_enters_without_a_second_snapshot) ... ok
test_screenshot_decoded_once_for_repeated_checks (test_jev_mirror_agent.SceneRegressionTest.test_screenshot_decoded_once_for_repeated_checks) ... ok
test_server_error_blocks_shop_and_retries_modal (test_jev_mirror_agent.SceneRegressionTest.test_server_error_blocks_shop_and_retries_modal) ... ok
test_shop_cannot_leave_with_party_swap_or_remaining_refresh (test_jev_mirror_agent.SceneRegressionTest.test_shop_cannot_leave_with_party_swap_or_remaining_refresh) ... ok
test_shop_leave_modal_without_ocr_question_mark (test_jev_mirror_agent.SceneRegressionTest.test_shop_leave_modal_without_ocr_question_mark) ... ok
test_shop_loading_blocks_stale_stock_refresh_and_leave (test_jev_mirror_agent.SceneRegressionTest.test_shop_loading_blocks_stale_stock_refresh_and_leave) ... ok
test_shop_refresh_is_capped_and_only_for_missing_party_swap (test_jev_mirror_agent.SceneRegressionTest.test_shop_refresh_is_capped_and_only_for_missing_party_swap) ... ok
test_single_extra_gift_decline_preserves_core_and_multi_cards (test_jev_mirror_agent.SceneRegressionTest.test_single_extra_gift_decline_preserves_core_and_multi_cards) ... ok
test_sinner_very_high_precedes_high_and_generic_gold (test_jev_mirror_agent.SceneRegressionTest.test_sinner_very_high_precedes_high_and_generic_gold) ... ok
test_sold_swap_is_not_offered_again (test_jev_mirror_agent.SceneRegressionTest.test_sold_swap_is_not_offered_again) ... ok
test_special_shop_cannot_leave_before_core_upgrade (test_jev_mirror_agent.SceneRegressionTest.test_special_shop_cannot_leave_before_core_upgrade) ... ok
test_startup_three_gifts_selects_battery_and_cannot_decline (test_jev_mirror_agent.SceneRegressionTest.test_startup_three_gifts_selects_battery_and_cannot_decline) ... ok
test_success_condition_in_event_option_is_not_result (test_jev_mirror_agent.SceneRegressionTest.test_success_condition_in_event_option_is_not_result) ... ok
test_takeover_interrupts_between_p_and_enter (test_jev_mirror_agent.SceneRegressionTest.test_takeover_interrupts_between_p_and_enter) ... ok
test_takeover_stops_remaining_dialog_confirmations (test_jev_mirror_agent.SceneRegressionTest.test_takeover_stops_remaining_dialog_confirmations) ... ok
test_thunderbranch_observation_exception_keeps_startup_battery_priority (test_jev_mirror_agent.SceneRegressionTest.test_thunderbranch_observation_exception_keeps_startup_battery_priority) ... ok
test_two_card_reward_uses_observed_anchor (test_jev_mirror_agent.SceneRegressionTest.test_two_card_reward_uses_observed_anchor) ... ok
test_unrecognized_gift_choice_is_never_declined (test_jev_mirror_agent.SceneRegressionTest.test_unrecognized_gift_choice_is_never_declined) ... ok
test_tool_errors_can_be_returned_instead_of_raised (test_jev_mirror_agent.SessionTest.test_tool_errors_can_be_returned_instead_of_raised) ... ok
test_originals_saved_before_override_and_restored (test_lc_mcp.AalcTaskArgsTest.test_originals_saved_before_override_and_restored) ... ok
test_rejects_unknown_params (test_lc_mcp.AalcTaskArgsTest.test_rejects_unknown_params) ... unknown params for mirror: exp
usage: python -m lc_mcp.aalc_task <all|daily|reward|enkephalin|mirror> [json]
ok
test_empty_matches_nothing (test_lc_mcp.MatchTest.test_empty_matches_nothing) ... ok
test_exact_first (test_lc_mcp.MatchTest.test_exact_first) ... ok
test_ignores_spaces_and_case (test_lc_mcp.MatchTest.test_ignores_spaces_and_case) ... ok
test_bad_arguments_are_tool_errors (test_lc_mcp.ProtocolTest.test_bad_arguments_are_tool_errors) ... ok
test_click_text (test_lc_mcp.ProtocolTest.test_click_text) ... ok
test_drag_duration_and_rejected_arguments (test_lc_mcp.ProtocolTest.test_drag_duration_and_rejected_arguments) ... ok
test_engine_unavailable (test_lc_mcp.ProtocolTest.test_engine_unavailable) ... ok
test_images (test_lc_mcp.ProtocolTest.test_images) ... ok
test_initialize_and_list (test_lc_mcp.ProtocolTest.test_initialize_and_list) ... ok
test_task_exit_codes (test_lc_mcp.ProtocolTest.test_task_exit_codes) ... ok
test_task_lifecycle_blocks_manual_input (test_lc_mcp.ProtocolTest.test_task_lifecycle_blocks_manual_input) ... ok
test_wait_for_text (test_lc_mcp.ProtocolTest.test_wait_for_text) ... ok
test_background_click_holds_and_releases_without_moving_window (test_lc_mcp.RuntimeTest.test_background_click_holds_and_releases_without_moving_window) ... ok
test_background_keypress_holds_and_releases_on_error (test_lc_mcp.RuntimeTest.test_background_keypress_holds_and_releases_on_error) ... ok
test_drag_checks_bounds_before_sending_input (test_lc_mcp.RuntimeTest.test_drag_checks_bounds_before_sending_input) ... ok
test_focus_retry_detaches_threads_even_on_failure (test_lc_mcp.RuntimeTest.test_focus_retry_detaches_threads_even_on_failure) ... ok
test_foreground_drag_targets_current_client_and_releases_on_failure (test_lc_mcp.RuntimeTest.test_foreground_drag_targets_current_client_and_releases_on_failure) ... ok
test_foreground_focus_failure_does_not_send_input (test_lc_mcp.RuntimeTest.test_foreground_focus_failure_does_not_send_input) ... ok
test_foreground_input_activates_game_before_sending (test_lc_mcp.RuntimeTest.test_foreground_input_activates_game_before_sending) ... ok
test_foreground_input_releases_on_interruption (test_lc_mcp.RuntimeTest.test_foreground_input_releases_on_interruption) ... ok
test_foreground_move_settle_failure_sends_no_button_press (test_lc_mcp.RuntimeTest.test_foreground_move_settle_failure_sends_no_button_press) ... ok
test_pythonw_streams_are_redirected_to_log (test_lc_mcp.RuntimeTest.test_pythonw_streams_are_redirected_to_log) ... ok
test_stdio_isolates_bootstrap_output_and_uses_utf8 (test_lc_mcp.RuntimeTest.test_stdio_isolates_bootstrap_output_and_uses_utf8) ... ok
test_template_list_is_scanned_once (test_lc_mcp.RuntimeTest.test_template_list_is_scanned_once) ... ok
test_template_scale_tracks_client_and_restores_config_on_error (test_lc_mcp.RuntimeTest.test_template_scale_tracks_client_and_restores_config_on_error) ... ok
test_leftover_restored_before_next_start_or_start_refused (test_lc_mcp.TaskRestoreTest.test_leftover_restored_before_next_start_or_start_refused) ... ok
test_stop_restores_overridden_config (test_lc_mcp.TaskRestoreTest.test_stop_restores_overridden_config) ... ok
test_bridge_end_to_end (test_lc_mcp.TransportTest.test_bridge_end_to_end) ... ok
test_bridge_offline (test_lc_mcp.TransportTest.test_bridge_offline) ... ok
test_client_disconnect_is_not_a_server_error (test_lc_mcp.TransportTest.test_client_disconnect_is_not_a_server_error) ... ok
test_non_ascii_token_is_denied_not_crashed (test_lc_mcp.TransportTest.test_non_ascii_token_is_denied_not_crashed) ... [lc_mcp] rejected connection from ('127.0.0.1', 56231)
ok
test_stdio_server (test_lc_mcp.TransportTest.test_stdio_server) ... ok
test_wrong_token_rejected (test_lc_mcp.TransportTest.test_wrong_token_rejected) ... [lc_mcp] rejected connection from ('127.0.0.1', 56234)
ok
----------------------------------------------------------------------
Ran 94 tests in 8.693s
OK
+12
View File
@@ -0,0 +1,12 @@
{"at_local": "2026-10-03T09:46:41+08:00", "kind": "jev_decision", "result": "requires_analysis", "latency_ms": 1484, "note": "first sanitized Jev record; login scene had already changed", "provenance": "manual_reconstruction_from_observed_tool_outputs"}
{"at_local": "2026-10-03T10:26:48+08:00", "kind": "observed_result", "result": "defeat_return_20", "latency_ms": null, "note": "earlier screenshot observed during session, now rotated; timeline is a manual reconstruction", "provenance": "manual_reconstruction_from_observed_tool_outputs"}
{"at_local": "2026-10-03T10:37:26+08:00", "kind": "battle_observation", "result": "turn1_seven_sinners", "latency_ms": null, "note": "7 sinners still present; attempted removal was not confirmed", "provenance": "manual_reconstruction_from_observed_tool_outputs"}
{"at_local": "2026-10-03T10:37:50+08:00", "kind": "input_observation", "result": "skill_selected_camera_changed", "latency_ms": null, "note": "Don Rip Space selected; HUD and camera moved", "provenance": "manual_reconstruction_from_observed_tool_outputs"}
{"at_local": "2026-10-03T10:38:09+08:00", "kind": "input_observation", "result": "target_selected", "latency_ms": null, "note": "selected enemy slot after re-observing camera", "provenance": "manual_reconstruction_from_observed_tool_outputs"}
{"at_local": "2026-10-03T10:40:30+08:00", "kind": "battle_observation", "result": "turn3_blooming", "latency_ms": null, "note": "multiple fully bloomed sinners; simultaneous human input later confirmed", "provenance": "manual_reconstruction_from_observed_tool_outputs"}
{"at_local": "2026-10-03T10:42:25+08:00", "kind": "battle_observation", "result": "defeat", "latency_ms": null, "note": "DEFEAT image retained; retry menu action cannot be independently attributed", "provenance": "manual_reconstruction_from_observed_tool_outputs"}
{"at_local": "2026-10-03T10:44:10+08:00", "kind": "map_observation", "result": "4-48_uncleared", "latency_ms": null, "note": "4-47 green, 4-48 brown; 124/120 energy, 193 modules, 2646 lunacy", "provenance": "manual_reconstruction_from_observed_tool_outputs"}
{"at_local": "2026-10-03T10:46:13+08:00", "kind": "training_observation", "result": "w_don_level35_uptie4", "latency_ms": null, "note": "same-point hold opened identity details", "provenance": "manual_reconstruction_from_observed_tool_outputs"}
{"at_local": "2026-10-03T10:47:09+08:00", "kind": "inventory_observation", "result": "training_tickets_IV0_III0_II7", "latency_ms": null, "note": "no ticket spent", "provenance": "manual_reconstruction_from_observed_tool_outputs"}
{"at_local": "2026-10-03T10:49:57+08:00", "kind": "menu_observation", "result": "exp_luxcavation_menu", "latency_ms": null, "note": "visible EXP 1/2/3; no sweep or combat result", "provenance": "manual_reconstruction_from_observed_tool_outputs"}
{"at_local": "2026-10-03T10:50:27+08:00", "kind": "menu_observation", "result": "exp_menu_still_visible", "latency_ms": null, "note": "no EXP run started; user then requested export and slowdown report", "provenance": "manual_reconstruction_from_observed_tool_outputs"}
+5 -5
View File
@@ -115,7 +115,7 @@
- **炸鸡对决选第一项**,直接获得鸡胸与鸡翅;第三项也给鸡胸,第二项仅鸡翅。 - **炸鸡对决选第一项**,直接获得鸡胸与鸡翅;第三项也给鸡胸,第二项仅鸡翅。
- 当前游戏译名:鸡胸为**干巴柴涩鸡胸肉**,鸡腿为**火热多汁琵琶腿**。 - 当前游戏译名:鸡胸为**干巴柴涩鸡胸肉**,鸡腿为**火热多汁琵琶腿**。
- 商店符咒强化可直接选 **++**,本局一次支付 **150 经费**完成;以当前报价为准。 - 商店符咒强化可直接选 **++**,本局一次支付 **150 经费**完成;以当前报价为准。
- 可复用 skill:[$limbus-mirror-speedrun](C:/Users/Dainsleif/.codex/skills/limbus-mirror-speedrun/SKILL.md)。[事件速查表](C:/Users/Dainsleif/.codex/skills/limbus-mirror-speedrun/references/event-choices.md)按名称查询,以当前选项文字核对编号。 - 可复用 skill:[$limbus-mirror-speedrun](skills/limbus-mirror-speedrun/SKILL.md)。[事件速查表](skills/limbus-mirror-speedrun/references/event-choices.md)按名称查询,以当前选项文字核对编号。
## 游戏内快捷键(用户操作指南截图) ## 游戏内快捷键(用户操作指南截图)
@@ -127,12 +127,12 @@
- **快捷键未生效时立即改用鼠标点按钮**,不反复尝试(用户补充)。 - **快捷键未生效时立即改用鼠标点按钮**,不反复尝试(用户补充)。
- **地图 ↑/↓/→ 或 W/S/D**:移至下个节点后直接回车进入;**←/A**:取消节点选择;**Q/E**:地图左右平移。 - **地图 ↑/↓/→ 或 W/S/D**:移至下个节点后直接回车进入;**←/A**:取消节点选择;**Q/E**:地图左右平移。
- 战斗 **方向键/WASD** 移动视角,**滚轮/Q/E** 缩放,**Tab** 显示拼点箭头。 - 战斗 **方向键/WASD** 移动视角,**滚轮/Q/E** 缩放,**Tab** 显示拼点箭头。
- **F1** 打开操作指南;**Esc** 随界面关闭弹窗、取消、返回或退出。完整表见 [快捷键速查](C:/Users/Dainsleif/.codex/skills/limbus-mirror-speedrun/references/shortcuts.md)。 - **F1** 打开操作指南;**Esc** 随界面关闭弹窗、取消、返回或退出。完整表见 [快捷键速查](skills/limbus-mirror-speedrun/references/shortcuts.md)。
## Jev 接入(用户授权) ## Jev 接入(用户授权)
- 已实测 `jev-1.13-free` 决策接口返回 HTTP 200,耗时约 1.3–1.5 秒;端点为 `https://opencode.ai/zen/v1/systemone`。 - 已实测 `jev-1.13-free` 决策接口返回 HTTP 200,耗时约 1.3–1.5 秒;端点为 `https://opencode.ai/zen/v1/systemone`。
- 客户端:[jev_decision_client.mjs](D:/codex/limbus_tools/jev_decision_client.mjs)。凭据由环境变量或未跟踪的本地配置提供,上传源码与反馈时排除凭据和配置文件。 - 客户端:[jev_decision_client.mjs](../scripts/jev_decision_client.mjs)。凭据由环境变量或未跟踪的本地配置提供,上传源码与反馈时排除凭据和配置文件。
- 用户更新(2026-10-02):固定场景、路线与常规动作均交给 Jev;仅在它返回 `requires_analysis` 或具体接口故障时由主助手排查。执行器只执行已核对的候选动作,不运行模型任意代码。 - 用户更新(2026-10-02):固定场景、路线与常规动作均交给 Jev;仅在它返回 `requires_analysis` 或具体接口故障时由主助手排查。执行器只执行已核对的候选动作,不运行模型任意代码。
- 最新战斗指令:开战后仅 P+回车循环到结算,不逐批请求 Jev。批次末只识别是否已结束,战斗特写没有 OCR 文字也继续;结算后交回 Jev。 - 最新战斗指令:开战后仅 P+回车循环到结算,不逐批请求 Jev。批次末只识别是否已结束,战斗特写没有 OCR 文字也继续;结算后交回 Jev。
@@ -156,14 +156,14 @@
- 日志确认第二局 14:34:59 执行了“拒绝饰品”;决策提示漏写电池且通用按钮开放了拒绝。这是执行错误,不是用户没有配置。 - 日志确认第二局 14:34:59 执行了“拒绝饰品”;决策提示漏写电池且通用按钮开放了拒绝。这是执行错误,不是用户没有配置。
- 本地及仓库执行器已补必选电池规则、按卡名选取及确认候选;未知三选一不暴露拒绝,只有明确额外观测才允许拒绝。新增三选一选择/确认、未知卡名禁止拒绝、额外观测及事件结果不误判等回归检查,当前共 **51 项通过**。尚未重新实机验证电池领取,也没有恢复用户接管的游戏。 - 本地及仓库执行器已补必选电池规则、按卡名选取及确认候选;未知三选一不暴露拒绝,只有明确额外观测才允许拒绝。新增三选一选择/确认、未知卡名禁止拒绝、额外观测及事件结果不误判等回归检查,当前共 **51 项通过**。尚未重新实机验证电池领取,也没有恢复用户接管的游戏。
- 2 号线固定事件、事件、商店、玫瑰标牌,共 4 节点;仍按用户要求只留第五层。拒绝层末奖励不能规避随机苦难。符咒 ++ 的低伤害门槛与斩击补层数是必需强化原因。 - 2 号线固定事件、事件、商店、玫瑰标牌,共 4 节点;仍按用户要求只留第五层。拒绝层末奖励不能规避随机苦难。符咒 ++ 的低伤害门槛与斩击补层数是必需强化原因。
- 其余鸡胸当前触发限制、最后商店恢复、替代头目与版本差异见 [机制参考](C:/Users/Dainsleif/.codex/skills/limbus-mirror-speedrun/references/mechanics.md)。速度判断属于流程推断,未实测为更短整局用时。 - 其余鸡胸当前触发限制、最后商店恢复、替代头目与版本差异见 [机制参考](skills/limbus-mirror-speedrun/references/mechanics.md)。速度判断属于流程推断,未实测为更短整局用时。
## 第二至第四层选包优先级(初步,未逐包计时) ## 第二至第四层选包优先级(初步,未逐包计时)
- 第二层缺鸡胸时优先地狱鸡;地狱鸡只在第二层出现,不在三四层反复寻找。已有鸡胸或当前没出现时,从现有候选比较纯 P 可通过性、战斗与头目耗时,不为无关奖励运营。 - 第二层缺鸡胸时优先地狱鸡;地狱鸡只在第二层出现,不在三四层反复寻找。已有鸡胸或当前没出现时,从现有候选比较纯 P 可通过性、战斗与头目耗时,不为无关奖励运营。
- 第三、四层核心齐全且长度相同时,初步优先考察 Addicting Lust(因而无人哭泣/长腿精灵)和 Degraded Gloom(悲泣蟾蜍/无头鱼)。两者没有实测固定先后,仅作为机制筛选候选组。 - 第三、四层核心齐全且长度相同时,初步优先考察 Addicting Lust(因而无人哭泣/长腿精灵)和 Degraded Gloom(悲泣蟾蜍/无头鱼)。两者没有实测固定先后,仅作为机制筛选候选组。
- 压抑的暴怒、空转的怠惰作为次选比较,不能因为上局打过就自动列首选。多波、阶段复杂、未验证纯 P 可通过的头目降低优先级;四节点长线包不自动优于普通包。 - 压抑的暴怒、空转的怠惰作为次选比较,不能因为上局打过就自动列首选。多波、阶段复杂、未验证纯 P 可通过的头目降低优先级;四节点长线包不自动优于普通包。
- 旧笔记中的 Bearable 尚未对应当前正式卡包名称,暂停作为第三层固定首选。当前 Wiki 卡包总表与旧赛季表存在楼层/头目差异,以当前难度的可用卡包及游戏详情为准。完整条件表见 [楼层规划](C:/Users/Dainsleif/.codex/skills/limbus-mirror-speedrun/references/rupture-route.md)。 - 旧笔记中的 Bearable 尚未对应当前正式卡包名称,暂停作为第三层固定首选。当前 Wiki 卡包总表与旧赛季表存在楼层/头目差异,以当前难度的可用卡包及游戏详情为准。完整条件表见 [楼层规划](skills/limbus-mirror-speedrun/references/rupture-route.md)。
- 第一层仍选带符纸的卡包;第一至第四层禁止二号线,第五层按用户要求优先二号线。以上暂定排序不修改游戏或启动执行器。 - 第一层仍选带符纸的卡包;第一至第四层禁止二号线,第五层按用户要求优先二号线。以上暂定排序不修改游戏或启动执行器。
## 来源 ## 来源
@@ -4,7 +4,7 @@
- 官方接口:`https://opencode.ai/zen/v1/systemone`;用户给的 Go 模型列表中没有 Jev,不把 Go chat/completions 当作 Jev 接口。 - 官方接口:`https://opencode.ai/zen/v1/systemone`;用户给的 Go 模型列表中没有 Jev,不把 Go chat/completions 当作 Jev 接口。
- 历史实测 `jev-1.13-free` 返回 HTTP 200,结构为 `answers.action.choice`,当时请求耗时约 1.3–1.5 秒。这不代表当前接口已连接,也不是整局速度保证。 - 历史实测 `jev-1.13-free` 返回 HTTP 200,结构为 `answers.action.choice`,当时请求耗时约 1.3–1.5 秒。这不代表当前接口已连接,也不是整局速度保证。
- 当前 Python 执行路径为仓库 [jev_mirror_agent.py](../../../../scripts/jev_mirror_agent.py),通过 [decision_router.py](../../../../scripts/decision_router.py) 选择 Jev 或执行模型,并返回候选 ID、概率及耗时。仓库另有独立的 `scripts/jev_decision_client.mjs`,Python 主循环不调用它。 - 当前 Python 执行路径为仓库 [jev_mirror_agent.py](../../../../scripts/jev_mirror_agent.py),通过 [decision_router.py](../../../../scripts/decision_router.py) 选择 Jev 或执行模型,并返回候选 ID、概率及耗时;Jev 请求由 [jev_client.py](../../../../scripts/jev_client.py) 发出(支持 `baseUrl`、`transport: curl`)。仓库另有独立的 `scripts/jev_decision_client.mjs`,Python 主循环不调用它。
- 密钥从 `options.apiKey`、`OPENCODE_API_KEY` 或用户已有本机配置注入;不把密钥复制到脚本、笔记、skill 或日志,也不打印配置全文。重启后若没有凭据,不能假装已接通。 - 密钥从 `options.apiKey`、`OPENCODE_API_KEY` 或用户已有本机配置注入;不把密钥复制到脚本、笔记、skill 或日志,也不打印配置全文。重启后若没有凭据,不能假装已接通。
- 只发送精简游戏状态和选项文字,避免整段聊天、其他窗口、完整桌面截图等无关内容。 - 只发送精简游戏状态和选项文字,避免整段聊天、其他窗口、完整桌面截图等无关内容。
- 先按用户规则排除不合适的选项,再将候选交给模型。当前界面和用户新指令优先;不把模型置信度当作游戏事实。 - 先按用户规则排除不合适的选项,再将候选交给模型。当前界面和用户新指令优先;不把模型置信度当作游戏事实。
+108 -10
View File
@@ -43,6 +43,9 @@ def bootstrap():
from module.logger.my_log import Logger from module.logger.my_log import Logger
Logger() Logger()
_booted = d _booted = d
# 实验: 编队列表滑动补丁, 仅在 LCP_TEAM_SCROLL_PATCH=1 时安装 (见 aalc_input_patch)
from . import aalc_input_patch
aalc_input_patch.install()
return d return d
@@ -57,6 +60,9 @@ def prune(directory, pattern, keep):
class AalcEngine(Engine): class AalcEngine(Engine):
_templates = None # 模板相对路径集合; assets 运行中不变, 只扫描一次磁盘
_template_size = None # 当前 AALC 模板缓存对应的缩放尺寸
def __init__(self, shot_dir, keep_shots=30): def __init__(self, shot_dir, keep_shots=30):
self.shot_dir = os.path.abspath(shot_dir) self.shot_dir = os.path.abspath(shot_dir)
os.makedirs(self.shot_dir, exist_ok=True) os.makedirs(self.shot_dir, exist_ok=True)
@@ -90,7 +96,8 @@ class AalcEngine(Engine):
def _save(self, img): def _save(self, img):
stamp = time.strftime('%Y%m%d_%H%M%S') + '_%03d' % (int(time.time() * 1000) % 1000) stamp = time.strftime('%Y%m%d_%H%M%S') + '_%03d' % (int(time.time() * 1000) % 1000)
path = os.path.join(self.shot_dir, 'shot_%s.png' % stamp) path = os.path.join(self.shot_dir, 'shot_%s.png' % stamp)
img.save(path) # 每次 get_state 都存图: 1080p 下默认压缩级别 6 约 0.66s, 级别 1 约 0.19s, 文件只大 ~17%
img.save(path, compress_level=1)
prune(self.shot_dir, 'shot_*.png', self.keep_shots) prune(self.shot_dir, 'shot_*.png', self.keep_shots)
return {'path': path.replace('\\', '/'), 'w': img.width, 'h': img.height} return {'path': path.replace('\\', '/'), 'w': img.width, 'h': img.height}
@@ -114,13 +121,15 @@ class AalcEngine(Engine):
return shot, items return shot, items
def list_images(self, prefix=''): def list_images(self, prefix=''):
names = set() if self._templates is None:
for theme in ('dark', 'default'): names = set()
for lang in ('zh_cn', 'en', 'share'): for theme in ('dark', 'default'):
base = os.path.join(self.images_root, theme, lang) for lang in ('zh_cn', 'en', 'share'):
for p in glob.glob(os.path.join(base, '**', '*.png'), recursive=True): base = os.path.join(self.images_root, theme, lang)
names.add(os.path.relpath(p, base).replace('\\', '/')) for p in glob.glob(os.path.join(base, '**', '*.png'), recursive=True):
return sorted(n for n in names if n.startswith(prefix)) names.add(os.path.relpath(p, base).replace('\\', '/'))
self._templates = frozenset(names)
return sorted(n for n in self._templates if n.startswith(prefix))
def find_image(self, name, threshold=0.8, model='normal'): def find_image(self, name, threshold=0.8, model='normal'):
if name not in self.list_images(name): if name not in self.list_images(name):
@@ -132,20 +141,68 @@ class AalcEngine(Engine):
# 保留亚像素比例:例如 1278 宽对应 718.875 高,取整会改变 # 保留亚像素比例:例如 1278 宽对应 718.875 高,取整会改变
# 缩放采样,使小图标的匹配置信度明显下降。 # 缩放采样,使小图标的匹配置信度明显下降。
match_size = max(1, min(img.height, img.width * 9 / 16)) match_size = max(1, min(img.height, img.width * 9 / 16))
# AALC 的模板缓存按加载时的 set_win_size 缩放, 键里不含尺寸; 尺寸变了才清空。
# 本进程只有这里用模板, 缓存可以一直保持当前客户区的比例
# (clear_img_cache 每次都会全量 gc, 不能每次调用都清)。
if match_size != self._template_size:
self.auto.clear_img_cache()
self._template_size = match_size
changed = match_size != old_size changed = match_size != old_size
try: try:
if changed: if changed:
self.auto.clear_img_cache()
self.cfg.unsaved_set_value('set_win_size', match_size) self.cfg.unsaved_set_value('set_win_size', match_size)
pos = self.auto.find_image_element(name, threshold, model=model) pos = self.auto.find_image_element(name, threshold, model=model)
finally: finally:
if changed: if changed:
self.cfg.unsaved_set_value('set_win_size', old_size) self.cfg.unsaved_set_value('set_win_size', old_size)
self.auto.clear_img_cache()
return (int(pos[0]), int(pos[1])) if pos else None return (int(pos[0]), int(pos[1])) if pos else None
# ---- 动手 (AALC 输入后端,由 config.yaml 决定后台消息/前台输入) ---- # ---- 动手 (AALC 输入后端,由 config.yaml 决定后台消息/前台输入) ----
def _focus_game(self):
handle = self.screen.handle
try:
handle.setForeground()
except Exception:
pass # Windows 可拒绝后台服务直接切换前台;下面通过输入线程重试。
if handle.isActive:
return
import win32api
import win32gui
import win32process
current = win32api.GetCurrentThreadId()
foreground = win32gui.GetForegroundWindow()
if not foreground:
return
threads = {win32process.GetWindowThreadProcessId(foreground)[0],
win32process.GetWindowThreadProcessId(handle.hwnd)[0]} - {current}
attached = []
try:
for target in sorted(threads):
win32process.AttachThreadInput(current, target, True)
attached.append(target)
win32gui.BringWindowToTop(handle.hwnd)
win32gui.SetActiveWindow(handle.hwnd)
win32gui.SetFocus(handle.hwnd)
handle.setForeground()
finally:
for target in reversed(attached):
win32process.AttachThreadInput(current, target, False)
def _prepare_input(self):
# 前台后端将输入发给系统当前窗口;服务启动后不一定仍是游戏。
# 先确认焦点,获取失败时停止,避免把点击或按键发送到其他应用。
if not self.cfg.simulator and self.cfg.win_input_type == 'foreground':
handle = self.screen.handle
if not handle.hwnd or handle.isMinimized:
raise RuntimeError('前台输入需要可见的游戏窗口')
if not handle.isActive:
self._focus_game()
time.sleep(0.15)
if not handle.isActive:
raise RuntimeError('无法激活游戏窗口,未发送输入')
def click(self, x, y, times=1): def click(self, x, y, times=1):
self._prepare_input()
if not self.cfg.simulator and self.cfg.win_input_type == 'background': if not self.cfg.simulator and self.cfg.win_input_type == 'background':
handler = self.auto.input_handler handler = self.auto.input_handler
self.auto.wait_pause() self.auto.wait_pause()
@@ -159,6 +216,21 @@ class AalcEngine(Engine):
handler.mouse_up(int(x), int(y)) handler.mouse_up(int(x), int(y))
# Let Unity consume the release before another target is selected. # Let Unity consume the release before another target is selected.
time.sleep(0.12) time.sleep(0.12)
elif not self.cfg.simulator and self.cfg.win_input_type == 'foreground':
import pyautogui
px, py = self.auto.input_handler.pos_offset(int(x), int(y))
pyautogui.moveTo(px, py)
# Give Unity a frame to update the pointer target before pressing.
time.sleep(0.12)
for _ in range(int(times)):
pyautogui.mouseDown(px, py)
try:
# Slow Unity frames can miss a shorter foreground press.
# Keep this below the game's long-press detail threshold.
time.sleep(0.35)
finally:
pyautogui.mouseUp(px, py)
time.sleep(0.12)
else: else:
self.auto.mouse_click(int(x), int(y), times=int(times)) self.auto.mouse_click(int(x), int(y), times=int(times))
@@ -166,6 +238,7 @@ class AalcEngine(Engine):
k = str(key).lower() k = str(key).lower()
if k not in self.key_names: if k not in self.key_names:
raise ValueError('AALC 不支持按键 %r, 可用: %s' % (key, ' '.join(self.key_names))) raise ValueError('AALC 不支持按键 %r, 可用: %s' % (key, ' '.join(self.key_names)))
self._prepare_input()
if not self.cfg.simulator and self.cfg.win_input_type == 'background': if not self.cfg.simulator and self.cfg.win_input_type == 'background':
# Unity 可能在同一帧收到 down/up,导致快捷键被吞掉。 # Unity 可能在同一帧收到 down/up,导致快捷键被吞掉。
handler = self.auto.input_handler handler = self.auto.input_handler
@@ -176,6 +249,13 @@ class AalcEngine(Engine):
time.sleep(0.12) time.sleep(0.12)
finally: finally:
handler.key_up(k) handler.key_up(k)
elif not self.cfg.simulator and self.cfg.win_input_type == 'foreground':
import pyautogui
pyautogui.keyDown(k)
try:
time.sleep(0.12)
finally:
pyautogui.keyUp(k)
else: else:
self.auto.key_press(k) self.auto.key_press(k)
@@ -184,8 +264,26 @@ class AalcEngine(Engine):
for x, y in ((from_x, from_y), (to_x, to_y)): for x, y in ((from_x, from_y), (to_x, to_y)):
if not (0 <= x < img.width and 0 <= y < img.height): if not (0 <= x < img.width and 0 <= y < img.height):
raise ValueError('拖动坐标超出游戏客户区 %sx%s' % (img.width, img.height)) raise ValueError('拖动坐标超出游戏客户区 %sx%s' % (img.width, img.height))
self._prepare_input()
if not self.cfg.simulator and self.cfg.win_input_type == 'foreground':
import pyautogui
start = self.auto.input_handler.pos_offset(int(from_x), int(from_y))
end = self.auto.input_handler.pos_offset(int(to_x), int(to_y))
pyautogui.moveTo(*start)
time.sleep(0.12)
pyautogui.mouseDown(*start)
try:
if start == end:
time.sleep(float(duration))
else:
pyautogui.moveTo(*end, duration=float(duration))
time.sleep(0.12)
finally:
pyautogui.mouseUp(*end)
return
self.auto.mouse_drag(int(from_x), int(from_y), drag_time=float(duration), self.auto.mouse_drag(int(from_x), int(from_y), drag_time=float(duration),
dx=int(to_x) - int(from_x), dy=int(to_y) - int(from_y)) dx=int(to_x) - int(from_x), dy=int(to_y) - int(from_y))
def type_text(self, text): def type_text(self, text):
self._prepare_input()
self.auto.input_text(str(text)) self.auto.input_text(str(text))
+100
View File
@@ -0,0 +1,100 @@
# -*- coding: utf-8 -*-
"""编队列表滑动补丁 (实验, 默认关闭; LCP_TEAM_SCROLL_PATCH=1 启用)。
AALC 基类注释说 ``mouse_swipe_for_team_scroll`` 可由适配器覆盖"以规避队伍拖拽判定",
上游只有 MuMu 覆盖了它, Windows 前台/后台沿用普通列表手势。是否因此误触发队伍拖拽
尚无实机证据 (2026-10-03 的记录未在编队界面复测), 所以这里只做最小改动来验证:
- 几何与行程完全沿用 AALC 的 ``build_windows_scroll_swipe_plan``,
不改变 AALC 为 Windows 标定的翻页距离;
- 参照 MuMu, 脱离段后保持 0.1s 让游戏先认定为滚动, 松手前停稳 0.5s;
- 分段移动用显式等待驱动, 不经过适配器的 duration 参数
(BackgroundInput 在 duration < 0.01s 时步数为 0, 不发任何移动事件),
前台关闭 pyautogui 每次调用后默认的 0.1s 停顿。
"""
import os
import time
ENV_FLAG = 'LCP_TEAM_SCROLL_PATCH'
ESCAPE_HOLD_SECONDS = 0.1 # MUMU_TEAM_SCROLL_ESCAPE_HOLD_DURATION
SETTLE_SECONDS = 0.5 # MUMU_TEAM_SCROLL_SETTLE_DURATION
STEP_SECONDS = 0.01 # 与 AALC _mouse_move_to 的步长一致
def _plan(x, y, dx, dy, duration):
from module.automation.input_handlers.scroll_swipe import build_windows_scroll_swipe_plan
plan, settle = build_windows_scroll_swipe_plan(x, y, dx, dy, duration)
return plan, max(settle, SETTLE_SECONDS) if len(plan) > 1 else 0
def run_plan(plan, settle, press, move, release, sleep=None):
"""按计划拖动: 每段按耗时均匀插值, 每个插值点之间显式等待。
plan 元素为 (终点, 到达该点前的耗时); 第一段之后(脱离段)保持一小会儿。"""
sleep = sleep or time.sleep
position = plan[0][0]
press(position)
try:
for index, (point, duration) in enumerate(plan[1:]):
steps = max(1, round(duration / STEP_SECONDS))
for k in range(1, steps + 1):
ratio = k / steps
move((position[0] + (point[0] - position[0]) * ratio,
position[1] + (point[1] - position[1]) * ratio))
if duration > 0:
sleep(duration / steps)
position = point
if index == 0 and len(plan) > 2:
sleep(ESCAPE_HOLD_SECONDS)
if settle:
sleep(settle)
finally:
release(position)
def _foreground_team_scroll(self, x, y, duration=0.3, dx=0, dy=0, move_back=True):
import pyautogui
restore = self.get_mouse_position() if move_back else None
plan, settle = _plan(x, y, dx, dy, duration)
def screen(point):
return tuple(int(round(v)) for v in self.pos_offset(*point))
def press(point):
pyautogui.moveTo(*screen(point), _pause=False)
pyautogui.mouseDown(_pause=False)
run_plan(plan, settle, press,
lambda point: pyautogui.moveTo(*screen(point), _pause=False),
lambda point: pyautogui.mouseUp(*screen(point), _pause=False))
if restore:
self.mouse_move(restore)
def _background_team_scroll(self, x, y, duration=0.3, dx=0, dy=0, move_back=True):
restore = self.get_mouse_position() if move_back else None
plan, settle = _plan(x, y, dx, dy, duration)
def press(point):
self.set_mouse_pos(*point)
self.set_active()
self.mouse_down(*point)
run_plan(plan, settle, press,
lambda point: self.set_mouse_pos(*point),
lambda point: self.mouse_up(*point))
if restore:
self.mouse_move(restore)
def install(force=False):
"""给 Windows 前台/后台适配器装上编队滑动 (幂等)。未设 LCP_TEAM_SCROLL_PATCH=1 时不做任何事。"""
if not force and os.environ.get(ENV_FLAG) != '1':
return []
from module.automation.input_handlers import input as input_module
patched = []
for name, impl in (('Input', _foreground_team_scroll), ('BackgroundInput', _background_team_scroll)):
cls = getattr(input_module, name, None)
if cls is not None and cls.__dict__.get('mouse_swipe_for_team_scroll') is not impl:
cls.mouse_swipe_for_team_scroll = impl
patched.append(name)
return patched
+45 -10
View File
@@ -2,9 +2,11 @@
"""子进程入口: 跑 AALC 现成的任务流程。 """子进程入口: 跑 AALC 现成的任务流程。
用法: python -m lc_mcp.aalc_task <task> [json_params] 用法: python -m lc_mcp.aalc_task <task> [json_params]
python -m lc_mcp.aalc_task --restore <file> 写回被强杀任务临时覆盖的配置
放在子进程里跑, 停止 = 杀进程树; 不会像 QThread.terminate 那样留下被占用的锁。 放在子进程里跑, 停止 = 杀进程树; 不会像 QThread.terminate 那样留下被占用的锁。
""" """
import json import json
import os
import sys import sys
from .aalc_engine import bootstrap from .aalc_engine import bootstrap
@@ -17,6 +19,42 @@ TASKS = {
'enkephalin': {'times': 'set_lunacy_to_enkephalin'}, 'enkephalin': {'times': 'set_lunacy_to_enkephalin'},
'mirror': {'count': 'set_mirror_count'}, 'mirror': {'count': 'set_mirror_count'},
} }
RESTORE_ENV = 'LCP_RESTORE_FILE'
def apply_overrides(cfg, task, params, restore_path=None):
"""临时覆盖本次运行的次数, 返回原值。
AALC 运行中会整份保存配置(如镜牢后 rotate_team_queue), 覆盖值会被写进 config.yaml。
所以先把原值落盘: 进程被 stop_task 强杀、finally 来不及执行时, TaskRunner 据此写回。
"""
originals = {TASKS[task][name]: cfg.get_value(TASKS[task][name]) for name in params}
if originals and restore_path:
tmp = restore_path + '.tmp'
with open(tmp, 'w', encoding='utf-8') as f:
json.dump(originals, f, ensure_ascii=False)
os.replace(tmp, restore_path)
for name, value in params.items():
cfg.unsaved_set_value(TASKS[task][name], int(value))
return originals
def restore(cfg, originals, restore_path=None):
for key, value in originals.items():
cfg.set_value(key, value)
if originals:
cfg.flush()
if restore_path and os.path.exists(restore_path):
os.remove(restore_path)
def restore_file(path, cfg=None):
with open(path, encoding='utf-8') as f:
originals = json.load(f)
if cfg is None:
bootstrap()
from module.config import cfg
restore(cfg, originals, path)
def run(task, params): def run(task, params):
@@ -28,11 +66,8 @@ def run(task, params):
from tasks.battle import battle from tasks.battle import battle
from utils.path_manager import path_manager from utils.path_manager import path_manager
originals = {} restore_path = os.environ.get(RESTORE_ENV)
for name, value in params.items(): originals = apply_overrides(cfg, task, params, restore_path)
key = TASKS[task][name]
originals[key] = cfg.get_value(key)
cfg.unsaved_set_value(key, int(value))
try: try:
if task == 'all': if task == 'all':
scheme.script_task() scheme.script_task()
@@ -54,14 +89,14 @@ def run(task, params):
}[task]() }[task]()
finally: finally:
retry_monitor.stop() retry_monitor.stop()
# AALC 运行中会自行保存配置(换队伍队列等), 把临时覆盖的次数写回原值 restore(cfg, originals, restore_path)
for key, value in originals.items():
cfg.set_value(key, value)
if originals:
cfg.flush()
def main(argv): def main(argv):
if len(argv) == 3 and argv[1] == '--restore':
restore_file(argv[2])
print('[lc_mcp] restored config from %s' % argv[2], flush=True)
return 0
if len(argv) < 2 or argv[1] not in TASKS: if len(argv) < 2 or argv[1] not in TASKS:
print('usage: python -m lc_mcp.aalc_task <%s> [json]' % '|'.join(TASKS), file=sys.stderr) print('usage: python -m lc_mcp.aalc_task <%s> [json]' % '|'.join(TASKS), file=sys.stderr)
return 2 return 2
+3 -2
View File
@@ -95,8 +95,9 @@ class _Handler(socketserver.StreamRequestHandler):
def _handle_session(self): def _handle_session(self):
rfile, wfile = self.rfile, self.wfile rfile, wfile = self.rfile, self.wfile
first = rfile.readline(256).decode('utf-8', 'replace').strip() # 按字节比较: compare_digest 对含非 ASCII 字符的 str 会抛 TypeError
if not (first.startswith('AUTH ') and hmac.compare_digest(first[5:], self.server.token)): first = rfile.readline(256).strip()
if not (first.startswith(b'AUTH ') and hmac.compare_digest(first[5:], self.server.token.encode('ascii'))):
wfile.write(b'DENIED\n') wfile.write(b'DENIED\n')
log('rejected connection from %s' % (self.client_address,)) log('rejected connection from %s' % (self.client_address,))
return return
+100 -36
View File
@@ -9,14 +9,21 @@ import sys
import threading import threading
import time import time
from .aalc_task import RESTORE_ENV
REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
IS_WIN = sys.platform.startswith('win') IS_WIN = sys.platform.startswith('win')
RESTORE_SUFFIX = '.restore.json'
def default_argv(task, params): def default_argv(task, params):
return [sys.executable, '-m', 'lc_mcp.aalc_task', task, json.dumps(params)] return [sys.executable, '-m', 'lc_mcp.aalc_task', task, json.dumps(params)]
def default_restore_argv(path):
return [sys.executable, '-m', 'lc_mcp.aalc_task', '--restore', path]
def tail(path, n): def tail(path, n):
try: try:
with open(path, 'rb') as f: with open(path, 'rb') as f:
@@ -28,12 +35,29 @@ def tail(path, n):
return [] return []
ERROR_MARKERS = ('[ERROR]', 'Traceback (most recent call last)')
ERROR_SCAN_LINES = 400
def log_errors(path, limit=3):
"""挑出日志尾部的报错行。
AALC 的每日流程在单次战斗失败后会继续跑完并正常退出(exit 0), 只看退出码
会把"超出最大尝试次数,未能进入战斗"这类失败当成成功, 所以状态里额外附上
日志里的报错行。
"""
hits = [line for line in tail(path, ERROR_SCAN_LINES)
if any(marker in line for marker in ERROR_MARKERS)]
return hits[-limit:]
class TaskRunner: class TaskRunner:
def __init__(self, run_dir, argv_factory=default_argv, keep_logs=20): def __init__(self, run_dir, argv_factory=default_argv, keep_logs=20, restore_argv=default_restore_argv):
self.run_dir = os.path.abspath(run_dir) self.run_dir = os.path.abspath(run_dir)
os.makedirs(self.run_dir, exist_ok=True) os.makedirs(self.run_dir, exist_ok=True)
self.argv_factory = argv_factory self.argv_factory = argv_factory
self.restore_argv = restore_argv
self.keep_logs = keep_logs self.keep_logs = keep_logs
self._lock = threading.Lock() self._lock = threading.Lock()
self.proc = None self.proc = None
@@ -42,61 +66,101 @@ class TaskRunner:
def running(self): def running(self):
return self.proc is not None and self.proc.poll() is None return self.proc is not None and self.proc.poll() is None
def _env(self):
return dict(os.environ, PYTHONPATH=REPO + os.pathsep + os.environ.get('PYTHONPATH', ''),
PYTHONIOENCODING='utf-8', PYTHONUNBUFFERED='1')
def _pending_restores(self):
"""被强杀/崩溃的任务留下的原值文件(不含正在运行的任务自己的)。新的在前:
有多份时最后写回的是最早一份, 也就是真正的原值。"""
current = self.info.get('restore') if self.info and self.running() else None
return [p for p in sorted(glob.glob(os.path.join(self.run_dir, '*' + RESTORE_SUFFIX)), reverse=True)
if p != current]
def _restore_leftovers(self):
"""把遗留的原值写回 config.yaml。成功返回 None, 否则返回原因。"""
for path in self._pending_restores():
name = os.path.basename(path)
try:
r = subprocess.run(self.restore_argv(path), cwd=REPO, env=self._env(),
stdin=subprocess.DEVNULL, capture_output=True, timeout=120)
except (OSError, subprocess.TimeoutExpired) as e:
return 'config restore from %s failed: %s' % (name, e)
if r.returncode != 0 or os.path.exists(path):
out = (r.stdout + r.stderr).decode('utf-8', 'replace').strip().splitlines()[-3:]
return 'config restore from %s failed (exit %s): %s' % (name, r.returncode, ' | '.join(out))
return None
def start(self, task, params): def start(self, task, params):
with self._lock: with self._lock:
if self.running(): if self.running():
return {'ok': False, 'error': '已有任务在跑: %s (先 stop_task)' % self.info['task']} return {'ok': False, 'error': '已有任务在跑: %s (先 stop_task)' % self.info['task']}
err = self._restore_leftovers()
if err:
# 否则新任务会把残留的覆盖值当成原值记下, 真正的原值就丢了
return {'ok': False, 'error': err + '; 写回 config.yaml 之前不启动新任务'}
stamp = time.strftime('%Y%m%d_%H%M%S') stamp = time.strftime('%Y%m%d_%H%M%S')
log_path = os.path.join(self.run_dir, 'task_%s_%s.log' % (stamp, task)) base = os.path.join(self.run_dir, 'task_%s_%s' % (stamp, task))
env = dict(os.environ, PYTHONPATH=REPO + os.pathsep + os.environ.get('PYTHONPATH', ''), env = self._env()
PYTHONIOENCODING='utf-8', PYTHONUNBUFFERED='1') env[RESTORE_ENV] = base + RESTORE_SUFFIX
kw = {'creationflags': subprocess.CREATE_NEW_PROCESS_GROUP} if IS_WIN else {'start_new_session': True} kw = {'creationflags': subprocess.CREATE_NEW_PROCESS_GROUP} if IS_WIN else {'start_new_session': True}
with open(log_path, 'wb') as logf: with open(base + '.log', 'wb') as logf:
self.proc = subprocess.Popen(self.argv_factory(task, params), cwd=REPO, env=env, self.proc = subprocess.Popen(self.argv_factory(task, params), cwd=REPO, env=env,
stdin=subprocess.DEVNULL, stdout=logf, stderr=subprocess.STDOUT, **kw) stdin=subprocess.DEVNULL, stdout=logf, stderr=subprocess.STDOUT, **kw)
self.info = {'task': task, 'params': params, 'log': log_path.replace('\\', '/'), self.info = {'task': task, 'params': params, 'log': (base + '.log').replace('\\', '/'),
'started': time.time(), 'stopped_by_user': False} 'restore': env[RESTORE_ENV], 'started': time.time(), 'stopped_by_user': False}
self._prune() self._prune()
return {'ok': True, 'task': task, 'pid': self.proc.pid, 'log': self.info['log']} return {'ok': True, 'task': task, 'pid': self.proc.pid, 'log': self.info['log']}
def status(self, lines=30): def status(self, lines=30):
with self._lock: with self._lock:
if self.info is None: if self.info is None:
return {'ok': True, 'state': 'idle'} r = {'ok': True, 'state': 'idle'}
code = self.proc.poll()
if code is None:
state = 'running'
elif self.info['stopped_by_user']:
state = 'stopped'
else: else:
state = 'succeeded' if code == 0 else 'failed' code = self.proc.poll()
r = {'ok': True, 'state': state, 'task': self.info['task'], 'params': self.info['params'], if code is None:
'elapsed_s': int((self.info.get('ended') or time.time()) - self.info['started']), state = 'running'
'log': self.info['log'], 'log_tail': tail(self.info['log'], max(1, min(int(lines), 200)))} else:
if code is not None: self.info.setdefault('ended', time.time())
r['exit_code'] = code state = 'stopped' if self.info['stopped_by_user'] else 'succeeded' if code == 0 else 'failed'
self.info.setdefault('ended', time.time()) r = {'ok': True, 'state': state, 'task': self.info['task'], 'params': self.info['params'],
'elapsed_s': int((self.info.get('ended') or time.time()) - self.info['started']),
'log': self.info['log'], 'log_tail': tail(self.info['log'], max(1, min(int(lines), 200)))}
if code is not None:
r['exit_code'] = code
errors = log_errors(self.info['log'])
if errors:
r['errors'] = errors
pending = self._pending_restores()
if pending:
r['pending_restore'] = [os.path.basename(p) for p in pending]
return r return r
def stop(self): def stop(self):
with self._lock: with self._lock:
if not self.running(): if self.running():
return {'ok': True, 'state': 'idle', 'note': '没有在跑的任务'} self.info['stopped_by_user'] = True
self.info['stopped_by_user'] = True pid = self.proc.pid
pid = self.proc.pid if IS_WIN:
if IS_WIN: subprocess.run(['taskkill', '/PID', str(pid), '/T', '/F'], capture_output=True)
subprocess.run(['taskkill', '/PID', str(pid), '/T', '/F'], capture_output=True) else:
else: try:
os.killpg(pid, signal.SIGKILL)
except ProcessLookupError:
pass
try: try:
os.killpg(pid, signal.SIGKILL) self.proc.wait(timeout=10)
except ProcessLookupError: except subprocess.TimeoutExpired:
pass return {'ok': False, 'error': '进程 %d 10 秒内没退出' % pid}
try: self.info['ended'] = time.time()
self.proc.wait(timeout=10) r = {'ok': True, 'state': 'stopped', 'task': self.info['task']}
except subprocess.TimeoutExpired: else:
return {'ok': False, 'error': '进程 %d 10 秒内没退出' % pid} r = {'ok': True, 'state': 'idle', 'note': '没有在跑的任务'}
self.info['ended'] = time.time() # 强杀时任务的 finally 不会执行, 由这里把临时覆盖的次数写回
return {'ok': True, 'state': 'stopped', 'task': self.info['task']} err = self._restore_leftovers()
if err:
r.update(ok=False, error=err)
return r
def _prune(self): def _prune(self):
logs = sorted(glob.glob(os.path.join(self.run_dir, 'task_*.log')), key=os.path.getmtime) logs = sorted(glob.glob(os.path.join(self.run_dir, 'task_*.log')), key=os.path.getmtime)
+17 -8
View File
@@ -1,4 +1,4 @@
"""Bounded P/Enter batches through MCP; stop when the battle UI disappears.""" """Bounded Win Rate batches through MCP, with a fresh UI check per turn."""
import argparse import argparse
import json import json
import math import math
@@ -30,20 +30,29 @@ def main():
try: try:
if cancelled(): if cancelled():
raise SessionCancelled('Battle batch stopped before connecting') raise SessionCancelled('Battle batch stopped before connecting')
with Session(cancelled=cancelled) as client: with Session(cancelled=cancelled, raise_on_error=False) as client:
state = client.call('get_state') state = client.call('get_state')
active = args.battle_confirmed or battle_is_visible(state) active = args.battle_confirmed or battle_is_visible(state)
while not cancelled(): while not cancelled():
# Cinematics hide the HUD; explicit scene boundaries end combat. # Cinematics hide the HUD; explicit scene boundaries end combat.
if not state.get('ok') or not active or is_terminal(state): if not state.get('ok') or not active or is_terminal(state):
break break
for _ in range(2): # P cycles between Win Rate and Damage in current game versions.
for key in ('p', 'enter'): # Only start a turn when its explicit Win Rate control is visible.
items = state.get('items', [])
labels = [item['text'].replace(' ', '').lower() for item in items]
target = next((item['text'] for item, label in zip(items, labels)
if label in ('win', 'winrate', '胜率')), None)
# OCR 常把回合数连在一起(如 'WAVE 1' -> 'wave1'), 用包含匹配
if target and any(m in label for label in labels for m in ('turn', 'wave', '回合', '波次')):
selected = client.call('click_text', {'text': target})
if selected.get('ok'):
time.sleep(.5)
if cancelled(): if cancelled():
raise SessionCancelled('Battle batch stopped between keys') raise SessionCancelled('Battle batch stopped between Win Rate and Enter')
client.call('keypress', {'key': key}) client.call('keypress', {'key': 'enter'})
pairs += 1 pairs += 1
time.sleep(min(1.5, max(0, deadline - time.monotonic()))) time.sleep(min(2.5, max(0, deadline - time.monotonic())))
if cancelled(): if cancelled():
break break
state = client.call('get_state') state = client.call('get_state')
+111
View File
@@ -0,0 +1,111 @@
"""Jev choice API shared by scene agents; credentials never enter curl argv."""
import argparse
import json
import os
import subprocess
import time
import urllib.error
import urllib.request
import uuid
from pathlib import Path
DEFAULT_BASE_URL = 'https://opencode.ai/zen/v1'
def _post(cfg, body):
url = cfg.get('baseUrl', DEFAULT_BASE_URL).rstrip('/') + '/systemone'
headers = {
'Authorization': 'Bearer ' + cfg['apiKey'],
'Content-Type': 'application/json',
'User-Agent': 'lc-mcp/0.1',
'x-opencode-session': cfg.setdefault('sessionId', str(uuid.uuid4())),
}
payload = json.dumps(body, ensure_ascii=False)
timeout = float(cfg.get('timeoutSeconds', 7))
transport = cfg.get('transport', 'urllib')
if transport == 'urllib':
request = urllib.request.Request(url, data=payload.encode('utf-8'),
headers=headers, method='POST')
with urllib.request.urlopen(request, timeout=timeout) as response:
return json.load(response)
if transport != 'curl':
raise ValueError('Unsupported Jev transport')
if any('\r' in value or '\n' in value for value in headers.values()):
raise ValueError('Jev headers must be single-line values')
config = '\n'.join('header = ' + json.dumps(key + ': ' + value)
for key, value in headers.items()) + '\n'
result = subprocess.run(
['curl.exe' if os.name == 'nt' else 'curl', '-sS', '--config', '-',
'--connect-timeout', str(min(timeout, 10)), '--max-time', str(timeout),
'--data-raw', payload, '--write-out', '\n%{http_code}', url],
input=config, capture_output=True, text=True, encoding='utf-8',
timeout=timeout + 2,
)
if result.returncode:
# Curl diagnostics may contain request details; expose only its exit code.
raise OSError('Jev transport failed (curl exit %d)' % result.returncode)
content, separator, status = result.stdout.rpartition('\n')
if not separator or not status.isdigit():
raise ValueError('Invalid Jev HTTP response')
code = int(status)
if not 200 <= code < 300:
raise urllib.error.HTTPError(url, code, 'Jev HTTP %d' % code, {}, None)
return json.loads(content)
def request_answer(cfg, state, criteria, instructions):
"""返回 {'choice', 'latency_ms', 'confidence', 'probabilities', 'model'}; 候选之外的结果会被拒绝。"""
if not cfg.get('apiKey'):
raise ValueError('Jev API key is required')
if not criteria:
raise ValueError('Jev requires permitted choices')
model = cfg.get('model', 'jev-1.13-free')
body = {
'model': model,
'state': state,
'questions': {'action': {'type': 'choice', 'instructions': instructions,
'criteria': criteria}},
}
started = time.monotonic()
for attempt in range(2):
try:
result = _post(cfg, body)
break
except urllib.error.HTTPError as error:
if error.code in (401, 403, 429) or attempt:
raise
time.sleep(.3)
except (OSError, TimeoutError):
if attempt:
raise
time.sleep(.3)
answer = result.get('answers', {}).get('action', {})
choice = answer.get('choice')
if answer.get('type') != 'choice' or choice not in criteria:
raise ValueError('Jev returned an unsupported candidate')
return {'choice': choice, 'latency_ms': round((time.monotonic() - started) * 1000),
'confidence': answer.get('confidence'), 'probabilities': answer.get('probabilities'),
'model': result.get('model') or model}
def request_decision(cfg, state, criteria, instructions):
answer = request_answer(cfg, state, criteria, instructions)
return answer['choice'], answer['latency_ms']
def main():
parser = argparse.ArgumentParser(description='Choose from an observed game scene; sends no game input.')
parser.add_argument('config', type=Path)
parser.add_argument('observation', type=Path)
args = parser.parse_args()
cfg = json.loads(args.config.read_text(encoding='utf-8-sig'))
cfg['apiKey'] = os.environ.get('OPENCODE_API_KEY') or cfg.get('apiKey')
observation = json.loads(args.observation.read_text(encoding='utf-8-sig'))
choice, latency = request_decision(cfg, observation['state'], observation['criteria'],
observation['instructions'])
print(json.dumps({'choice': choice, 'jev_ms': latency}, ensure_ascii=False))
if __name__ == '__main__':
main()
+4 -1
View File
@@ -1,4 +1,7 @@
{ {
"decisionEngine": "jev", "decisionEngine": "jev",
"model": "jev-1.13-free" "model": "jev-1.13-free",
"baseUrl": "https://opencode.ai/zen/v1",
"transport": "urllib",
"timeoutSeconds": 7
} }
+89 -77
View File
@@ -1,22 +1,20 @@
"""Validated scene actions for Jev decisions and fixed speedrun macros.""" """Validated scene actions for Jev decisions and fixed speedrun macros."""
import argparse import argparse
import functools
import json import json
import math
import os import os
import re import re
import subprocess
import sys
import time import time
import urllib.error
import urllib.request
from pathlib import Path from pathlib import Path
from mcp_session import Session as Bridge, SessionCancelled, SessionTimeout from mcp_session import Session as Bridge, SessionCancelled, SessionTimeout
from game_scenes import battle_is_terminal, battle_is_visible, death_retry_screen from game_scenes import battle_is_terminal, battle_is_visible, death_retry_screen
from run_state import prepare_run, save_json, record_claim, claim_is_current, complete_run from run_state import prepare_run, save_json, record_claim, claim_is_current, complete_run
from decision_router import DecisionRouter, DecisionRequired from decision_router import DecisionRouter, DecisionRequired
from jev_client import request_answer
REPO_ROOT = Path(__file__).resolve().parents[1] REPO_ROOT = Path(__file__).resolve().parents[1]
MIRROR_ASSETS = REPO_ROOT / 'vendor' / 'aalc' / 'assets' / 'images' / 'default' / 'share' / 'mirror'
RUNTIME_HOME = Path(os.environ.get('LC_JEV_HOME', str(Path.home() / 'lc_mcp' / 'jev'))) RUNTIME_HOME = Path(os.environ.get('LC_JEV_HOME', str(Path.home() / 'lc_mcp' / 'jev')))
STOP_FILE = RUNTIME_HOME / 'JEV_STOP' STOP_FILE = RUNTIME_HOME / 'JEV_STOP'
@@ -43,31 +41,65 @@ def text_items(state):
return state.get('items') or [] return state.get('items') or []
_SCREEN_CACHE = {}
def screen_image(path, mode):
"""按模式解码当前截图并缓存: 一帧里多次判色/裁剪只解码一次整张 PNG (1080p 约 75ms/次)。
键含修改时间和大小, 同路径写入新内容时不会命中旧图。"""
from PIL import Image
st = os.stat(path)
key = (str(path), st.st_mtime_ns, st.st_size, mode)
image = _SCREEN_CACHE.get(key)
if image is None:
if len(_SCREEN_CACHE) >= 4:
_SCREEN_CACHE.clear()
with Image.open(path) as source:
image = source.convert(mode)
_SCREEN_CACHE[key] = image
return image
def button_enabled(state, item): def button_enabled(state, item):
try: try:
from PIL import Image
import numpy as np import numpy as np
x, y, w, h = (int(item[k]) for k in ('x', 'y', 'w', 'h')) x, y, w, h = (int(item[k]) for k in ('x', 'y', 'w', 'h'))
with Image.open(state['screen']['path']) as image: crop = np.array(screen_image(state['screen']['path'], 'L').crop((x, y, x + w, y + h)))
crop = np.array(image.convert('L').crop((x, y, x + w, y + h)))
return float(np.quantile(crop, 0.9)) > 85 return float(np.quantile(crop, 0.9)) > 85
except (OSError, KeyError, ImportError): except (OSError, KeyError, ImportError):
return False return False
@functools.lru_cache(maxsize=64)
def _map_template(kind, name, scale):
"""地图识别模板, 按截图比例缩放; 窗口尺寸不变时每帧复用, 不再重复读盘和计算特征点。
返回的数组是共享缓存, 调用方不能原地修改。"""
import cv2
import numpy as np
from PIL import Image
path = MIRROR_ASSETS / name
if kind == 'bus':
with Image.open(path) as image:
gray = cv2.cvtColor(np.array(image.convert('RGB')), cv2.COLOR_RGB2GRAY)
return cv2.resize(gray, None, fx=scale, fy=scale, interpolation=cv2.INTER_AREA)
if kind == 'arrow':
# 等价于 cv2.imread(path, 0); imread 在 Windows 上打不开含中文的路径
gray = cv2.imdecode(np.fromfile(str(path), dtype=np.uint8), cv2.IMREAD_GRAYSCALE)
return cv2.resize(gray, None, fx=scale, fy=scale, interpolation=cv2.INTER_AREA)
# 节点图标: ORB 描述子只取决于模板和参数
with Image.open(path) as image:
gray = cv2.resize(np.array(image.convert('L')), None, fx=2*scale, fy=2*scale)
return cv2.ORB_create(nfeatures=1000, scaleFactor=1.2, edgeThreshold=10).detectAndCompute(gray, None)[1]
def map_candidates(state): def map_candidates(state):
"""Only observe reachable nodes; Jev chooses their route.""" """Only observe reachable nodes; Jev chooses their route."""
import cv2 import cv2
import numpy as np import numpy as np
from PIL import Image rgb = np.array(screen_image(state['screen']['path'], 'RGB'))
assets = REPO_ROOT / 'vendor' / 'aalc' / 'assets' / 'images' / 'default' / 'share' / 'mirror'
with Image.open(state['screen']['path']) as image:
rgb = np.array(image.convert('RGB'))
gray = cv2.cvtColor(rgb, cv2.COLOR_RGB2GRAY) gray = cv2.cvtColor(rgb, cv2.COLOR_RGB2GRAY)
scale = min(rgb.shape[0] / 1440, rgb.shape[1] / 2560) scale = min(rgb.shape[0] / 1440, rgb.shape[1] / 2560)
with Image.open(assets / 'mybus_default_distance.png') as image: bus = _map_template('bus', 'mybus_default_distance.png', scale)
bus = cv2.cvtColor(np.array(image.convert('RGB')), cv2.COLOR_RGB2GRAY)
bus = cv2.resize(bus, None, fx=scale, fy=scale, interpolation=cv2.INTER_AREA)
_, confidence, _, location = cv2.minMaxLoc(cv2.matchTemplate(gray, bus, cv2.TM_CCOEFF_NORMED)) _, confidence, _, location = cv2.minMaxLoc(cv2.matchTemplate(gray, bus, cv2.TM_CCOEFF_NORMED))
if confidence < 0.88: if confidence < 0.88:
return {} return {}
@@ -85,8 +117,7 @@ def map_candidates(state):
arrow_roi = gray[max(0,ay-radius):min(gray.shape[0],ay+radius), arrow_roi = gray[max(0,ay-radius):min(gray.shape[0],ay+radius),
max(0,ax-radius):min(gray.shape[1],ax+radius)] max(0,ax-radius):min(gray.shape[1],ax+radius)]
arrow_name = {'w':'up','d':'mid','s':'down'}[key] arrow_name = {'w':'up','d':'mid','s':'down'}[key]
template = cv2.imread(str(assets / 'road_in_mir' / (arrow_name+'.png')), 0) template = _map_template('arrow', 'road_in_mir/%s.png' % arrow_name, scale)
template = cv2.resize(template, None, fx=scale, fy=scale, interpolation=cv2.INTER_AREA)
arrow_reachable = False arrow_reachable = False
if arrow_roi.shape[0] >= template.shape[0] and arrow_roi.shape[1] >= template.shape[1]: if arrow_roi.shape[0] >= template.shape[0] and arrow_roi.shape[1] >= template.shape[1]:
_, arrow_score, _, arrow_pos = cv2.minMaxLoc(cv2.matchTemplate(arrow_roi, template, cv2.TM_CCOEFF_NORMED)) _, arrow_score, _, arrow_pos = cv2.minMaxLoc(cv2.matchTemplate(arrow_roi, template, cv2.TM_CCOEFF_NORMED))
@@ -108,10 +139,7 @@ def map_candidates(state):
if target_desc is not None: if target_desc is not None:
for name, label in (('shop','商店'),('event','事件'),('battle','普通战斗'), for name, label in (('shop','商店'),('event','事件'),('battle','普通战斗'),
('risky_encounter','精英战斗'),('focused_encounter','集中战斗')): ('risky_encounter','精英战斗'),('focused_encounter','集中战斗')):
with Image.open(assets / 'road_in_mir' / (name + '.png')) as image: desc = _map_template('icon', 'road_in_mir/%s.png' % name, scale)
template = np.array(image.convert('L'))
template = cv2.resize(template, None, fx=2*scale, fy=2*scale)
_, desc = orb.detectAndCompute(template, None)
if desc is not None: if desc is not None:
matches = cv2.BFMatcher(cv2.NORM_HAMMING).knnMatch(desc, target_desc, k=2) matches = cv2.BFMatcher(cv2.NORM_HAMMING).knnMatch(desc, target_desc, k=2)
score = sum(len(pair) == 2 and pair[0].distance < 0.7*pair[1].distance for pair in matches) score = sum(len(pair) == 2 and pair[0].distance < 0.7*pair[1].distance for pair in matches)
@@ -267,10 +295,8 @@ def candidates(state, previous_battle=False, refresh_used=0):
try: try:
import cv2 import cv2
import numpy as np import numpy as np
from PIL import Image border = np.array(screen_image(state['screen']['path'], 'RGB').crop(
with Image.open(state['screen']['path']) as image: (int(cx-width*.12), int(height*.31), int(cx-width*.107), int(height*.69))))
border = np.array(image.convert('RGB').crop((int(cx-width*.12), int(height*.31),
int(cx-width*.107), int(height*.69))))
hsv = cv2.cvtColor(border, cv2.COLOR_RGB2HSV) hsv = cv2.cvtColor(border, cv2.COLOR_RGB2HSV)
target_selected = float(((hsv[:,:,0] > 8) & (hsv[:,:,0] < 35) & target_selected = float(((hsv[:,:,0] > 8) & (hsv[:,:,0] < 35) &
(hsv[:,:,1] > 200) & (hsv[:,:,2] > 220)).mean()) > .18 (hsv[:,:,1] > 200) & (hsv[:,:,2] > 220)).mean()) > .18
@@ -489,8 +515,10 @@ def candidates(state, previous_battle=False, refresh_used=0):
if label in known_buttons and button_enabled(state, item): if label in known_buttons and button_enabled(state, item):
options['button_%d' % index] = { options['button_%d' % index] = {
'description': '当前可见且非灰色按钮:%s;点击 OCR 中心。' % label, 'description': '当前可见且非灰色按钮:%s;点击 OCR 中心。' % label,
# 直接点已核对过的这一项: 重新按文字搜索要多一次截图+OCR, 还可能命中背景里的同名按钮
'action': ({'tool': 'keypress', 'args': {'key': 'enter'}} if label in ('进入', '开始战斗') 'action': ({'tool': 'keypress', 'args': {'key': 'enter'}} if label in ('进入', '开始战斗')
else {'tool': 'click_text', 'args': {'text': item['text']}}), else {'tool': 'click', 'args': {'x': item['x'] + item['w']//2,
'y': item['y'] + item['h']//2}}),
} }
if (not battle and not in_shop and state.get('screen', {}).get('path') if (not battle and not in_shop and state.get('screen', {}).get('path')
and Path(state['screen']['path']).is_file() and Path(state['screen']['path']).is_file()
@@ -508,9 +536,7 @@ def candidates(state, previous_battle=False, refresh_used=0):
try: try:
import cv2 import cv2
import numpy as np import numpy as np
from PIL import Image rgb = np.array(screen_image(state['screen']['path'], 'RGB'))
with Image.open(state['screen']['path']) as image:
rgb = np.array(image.convert('RGB'))
for number in range(12): for number in range(12):
cx = round(width*(.061 + number*.0542)) cx = round(width*(.061 + number*.0542))
crop = rgb[round(height*.841):round(height*.878), max(0,cx-round(width*.026)):cx+round(width*.026)] crop = rgb[round(height*.841):round(height*.878), max(0,cx-round(width*.026)):cx+round(width*.026)]
@@ -541,41 +567,14 @@ def candidates(state, previous_battle=False, refresh_used=0):
def decide(cfg, state, options, recent): def decide(cfg, state, options, recent):
body = {'model': cfg['model'], description = ('目标:按用户已配置的队伍和速通规则推进当前镜牢。当前楼层:%s\n当前游戏 OCR(坐标仅供辨识):\n' % state.get('floor', '尚未识别') +
'state': '目标:按用户已配置的队伍和速通规则推进当前镜牢。当前楼层:%s\n当前游戏 OCR(坐标仅供辨识):\n' % state.get('floor', '尚未识别') + '\n'.join('%s @%d,%d' % (i['text'], i['x'], i['y']) for i in text_items(state)
'\n'.join('%s @%d,%d' % (i['text'], i['x'], i['y']) for i in text_items(state) if not i['text'].upper().startswith('STEAM')) +
if not i['text'].upper().startswith('STEAM')) + '\n截图视觉与可用控件观察(不是预先做出的决定):\n' +
'\n截图视觉与可用控件观察(不是预先做出的决定):\n' + '\n'.join(val['description'] for key,val in options.items() if key != 'requires_analysis') +
'\n'.join(val['description'] for key,val in options.items() if key != 'requires_analysis') + '\n最近动作和执行结果:' + json.dumps(recent[-4:], ensure_ascii=False))
'\n最近动作和执行结果:' + json.dumps(recent[-4:], ensure_ascii=False), return request_answer(cfg, description,
'questions': {'action': {'type': 'choice', 'instructions': SYSTEM_RULES, {key: val['description'] for key, val in options.items()}, SYSTEM_RULES)
'criteria': {key: val['description'] for key, val in options.items()}}}}
request = urllib.request.Request(
'https://opencode.ai/zen/v1/systemone',
data=json.dumps(body, ensure_ascii=False).encode('utf-8'),
headers={'Authorization': 'Bearer ' + cfg['apiKey'], 'Content-Type': 'application/json',
'User-Agent': 'Mozilla/5.0'}, method='POST')
start = time.monotonic()
for attempt in range(2):
try:
with urllib.request.urlopen(request, timeout=7) as response:
result = json.load(response)
break
except urllib.error.HTTPError as error:
if error.code in (401,403,429) or attempt:
raise
time.sleep(.3)
except (OSError, TimeoutError):
if attempt:
raise
time.sleep(.3)
answer = result.get('answers', {}).get('action', {})
choice = answer.get('choice')
if answer.get('type') != 'choice' or choice not in options:
raise ValueError('Jev returned an unsupported candidate')
return {'choice': choice, 'latency_ms': round((time.monotonic() - start) * 1000),
'confidence': answer.get('confidence'), 'probabilities': answer.get('probabilities'),
'model': result.get('model') or cfg['model']}
def fixed_fallback(options): def fixed_fallback(options):
@@ -680,6 +679,24 @@ def execute(bridge, action, deadline=None):
return call(action['tool'], action.get('args')) return call(action['tool'], action.get('args'))
def acquire_single_instance():
"""Windows 命名互斥量, 防止另一个终端重复启动同一个游戏的执行器。
返回释放函数; 已有实例在跑(或创建失败)时返回 None。"""
import ctypes
# use_last_error: 直接调 GetLastError 可能读到 ctypes 自身调用留下的值
kernel = ctypes.WinDLL('kernel32', use_last_error=True)
kernel.CreateMutexW.restype = ctypes.c_void_p
kernel.CreateMutexW.argtypes = [ctypes.c_void_p, ctypes.c_int, ctypes.c_wchar_p]
kernel.CloseHandle.argtypes = [ctypes.c_void_p]
lease = kernel.CreateMutexW(None, False, 'Local\\LimbusMirrorJevController')
if not lease:
return None
if ctypes.get_last_error() == 183: # ERROR_ALREADY_EXISTS
kernel.CloseHandle(lease)
return None
return lambda: kernel.CloseHandle(lease)
def main(executor_decider=None): def main(executor_decider=None):
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('config', nargs='?', help='Optional Jev JSON config; omit for execution-model handoff') parser.add_argument('config', nargs='?', help='Optional Jev JSON config; omit for execution-model handoff')
@@ -692,16 +709,9 @@ def main(executor_decider=None):
args = parser.parse_args() args = parser.parse_args()
if args.steps <= 0 or args.seconds <= 0: if args.steps <= 0 or args.seconds <= 0:
parser.error('--steps and --seconds must be positive') parser.error('--steps and --seconds must be positive')
# 防止另一个终端重复启动同一个游戏的执行器。 release = acquire_single_instance()
import ctypes if release is None:
kernel = ctypes.windll.kernel32
kernel.CreateMutexW.restype = ctypes.c_void_p
kernel.CreateMutexW.argtypes = [ctypes.c_void_p, ctypes.c_int, ctypes.c_wchar_p]
lease = kernel.CreateMutexW(None, False, 'Local\\LimbusMirrorJevController')
if not lease or kernel.GetLastError() == 183:
print(json.dumps({'state':'already_running'}), flush=True) print(json.dumps({'state':'already_running'}), flush=True)
if lease:
kernel.CloseHandle(ctypes.c_void_p(lease))
return return
log = RUNTIME_HOME / 'jev_mirror_log.jsonl' log = RUNTIME_HOME / 'jev_mirror_log.jsonl'
status = RUNTIME_HOME / 'jev_mirror_status.json' status = RUNTIME_HOME / 'jev_mirror_status.json'
@@ -728,7 +738,9 @@ def main(executor_decider=None):
return return
run, context = prepare_run(RUNTIME_HOME, args.new_run, args.resume) run, context = prepare_run(RUNTIME_HOME, args.new_run, args.resume)
previous_battle = context.get('battle_context', False) previous_battle = context.get('battle_context', False)
bridge = Bridge(cancelled=lambda: STOP_FILE.exists() or time.monotonic() >= deadline) # 工具失败按 {'ok': False} 返回: 截图暂不可用、按钮已消失等情况观察后继续, 而不是整局退出
bridge = Bridge(cancelled=lambda: STOP_FILE.exists() or time.monotonic() >= deadline,
raise_on_error=False)
for step in range(args.steps): for step in range(args.steps):
if STOP_FILE.exists() or time.monotonic() > deadline: if STOP_FILE.exists() or time.monotonic() > deadline:
run['status'] = 'stopped' run['status'] = 'stopped'
@@ -867,10 +879,10 @@ def main(executor_decider=None):
if choice=='modal_confirm' and result.get('ok') and any(i['text'].replace(' ','')=='快感' for i in text_items(state)) and any('获得E.G.O' in i['text'].replace(' ','') for i in text_items(state)): if choice=='modal_confirm' and result.get('ok') and any(i['text'].replace(' ','')=='快感' for i in text_items(state)) and any('获得E.G.O' in i['text'].replace(' ','') for i in text_items(state)):
context['thrill_obtained']=True context['thrill_obtained']=True
save_json(context_path, context) save_json(context_path, context)
if choice == 'shop_refresh': if choice == 'shop_refresh' and result.get('ok'):
context['refresh_used'] += 1 context['refresh_used'] += 1
save_json(context_path, context) save_json(context_path, context)
started_battle = choice.startswith('button_') and any( started_battle = choice.startswith('button_') and bool(result.get('ok')) and any(
i['text'].replace(' ', '') == '开始战斗' for i in text_items(state)) i['text'].replace(' ', '') == '开始战斗' for i in text_items(state))
previous_battle = ((action['tool'] == 'battle' and not result.get('terminal')) or started_battle previous_battle = ((action['tool'] == 'battle' and not result.get('terminal')) or started_battle
or (previous_battle and action['tool'] == 'wait')) or (previous_battle and action['tool'] == 'wait'))
@@ -905,7 +917,7 @@ def main(executor_decider=None):
if bridge is not None: if bridge is not None:
bridge.close() bridge.close()
finally: finally:
kernel.CloseHandle(ctypes.c_void_p(lease)) release()
if __name__ == '__main__': if __name__ == '__main__':
+4 -2
View File
@@ -24,11 +24,13 @@ class SessionTimeout(TimeoutError):
class Session: class Session:
def __init__(self, timeout=30, cancelled=None): def __init__(self, timeout=30, cancelled=None, raise_on_error=True):
self.timeout = float(timeout) self.timeout = float(timeout)
if not math.isfinite(self.timeout) or self.timeout <= 0: if not math.isfinite(self.timeout) or self.timeout <= 0:
raise ValueError('MCP timeout must be finite and positive') raise ValueError('MCP timeout must be finite and positive')
self.cancelled = cancelled or (lambda: False) self.cancelled = cancelled or (lambda: False)
# False: 工具失败按 {'ok': False, ...} 返回, 由调用方观察后继续; 协议层错误仍抛异常
self.raise_on_error = raise_on_error
self._closed = False self._closed = False
self._lock = threading.Lock() self._lock = threading.Lock()
self._responses = queue.Queue() self._responses = queue.Queue()
@@ -150,7 +152,7 @@ class Session:
pass # The server reports invalid tool arguments. pass # The server reports invalid tool arguments.
result = self.request('tools/call', {'name': name, 'arguments': arguments}, timeout) result = self.request('tools/call', {'name': name, 'arguments': arguments}, timeout)
data = json.loads(result['content'][0]['text']) data = json.loads(result['content'][0]['text'])
if result.get('isError'): if result.get('isError') and self.raise_on_error:
raise RuntimeError(data) raise RuntimeError(data)
return data return data
+20 -9
View File
@@ -43,27 +43,37 @@ class BattleBatchTest(unittest.TestCase):
self.assertEqual(result['pairs'], 0) self.assertEqual(result['pairs'], 0)
self.assertEqual(client.call.call_args_list, [mock.call('get_state')]) self.assertEqual(client.call.call_args_list, [mock.call('get_state')])
def test_stop_after_p_prevents_enter(self): def test_stop_after_win_rate_prevents_enter(self):
client = mock.Mock() client = mock.Mock()
def call(tool, args=None): def call(tool, args=None):
if tool == 'get_state': if tool == 'get_state':
return {'ok': True, 'items': [{'text': 'WAVE 1'}]} return {'ok': True, 'items': [{'text': 'WAVE 1'}, {'text': 'Win Rate'}]}
self.stop.touch() self.stop.touch()
return {'ok': True} return {'ok': True}
client.call.side_effect = call client.call.side_effect = call
result = self.run_helper(client) result = self.run_helper(client)
self.assertTrue(result['stopped']) self.assertTrue(result['stopped'])
self.assertFalse(result['outcome_unknown']) self.assertFalse(result['outcome_unknown'])
self.assertEqual(client.call.call_args_list, [mock.call('get_state'), mock.call('keypress', {'key': 'p'})]) self.assertEqual(client.call.call_args_list,
[mock.call('get_state'), mock.call('click_text', {'text': 'Win Rate'})])
def test_judgement_after_one_batch_ends_without_a_second_batch(self): def test_judgement_after_one_turn_ends_without_more_input(self):
client = mock.Mock() client = mock.Mock()
frames = iter(['WAVE 1', '选择一位罪人来进行判定']) frames = iter([[{'text': 'WAVE 1'}, {'text': '胜率'}], [{'text': '选择一位罪人来进行判定'}]])
client.call.side_effect = lambda tool, args=None: ( client.call.side_effect = lambda tool, args=None: (
{'ok': True, 'items': [{'text': next(frames)}]} if tool == 'get_state' else {'ok': True}) {'ok': True, 'items': next(frames)} if tool == 'get_state' else {'ok': True})
result = self.run_helper(client) result = self.run_helper(client)
self.assertEqual(result['pairs'], 2) self.assertEqual(result['pairs'], 1)
self.assertEqual(sum(call.args[0] == 'keypress' for call in client.call.call_args_list), 4) self.assertEqual([c.args[0] for c in client.call.call_args_list],
['get_state', 'click_text', 'keypress', 'get_state'])
def test_cinematic_without_win_rate_sends_no_input(self):
# P 会在胜率/伤害之间切换, 看不到胜率按钮(特写)时只重新观察
client = mock.Mock()
client.call.return_value = {'ok': True, 'items': [{'text': 'TURN 2'}]}
result = self.run_helper(client)
self.assertEqual(result['pairs'], 0)
self.assertTrue(all(c.args[0] == 'get_state' for c in client.call.call_args_list))
class AgentRuntimeTest(unittest.TestCase): class AgentRuntimeTest(unittest.TestCase):
@@ -84,7 +94,8 @@ class AgentRuntimeTest(unittest.TestCase):
with mock.patch.object(agent, 'RUNTIME_HOME', self.home), \ with mock.patch.object(agent, 'RUNTIME_HOME', self.home), \
mock.patch.object(agent, 'STOP_FILE', self.home / 'JEV_STOP'), \ mock.patch.object(agent, 'STOP_FILE', self.home / 'JEV_STOP'), \
mock.patch.object(agent, 'Bridge', return_value=bridge, side_effect=constructor_error) as factory, \ mock.patch.object(agent, 'Bridge', return_value=bridge, side_effect=constructor_error) as factory, \
mock.patch.object(ctypes, 'windll', mock.Mock(kernel32=self.kernel), create=True), \ mock.patch.object(ctypes, 'WinDLL', return_value=self.kernel, create=True), \
mock.patch.object(ctypes, 'get_last_error', side_effect=lambda: self.kernel.GetLastError(), create=True), \
mock.patch.object(sys, 'argv', ['jev_mirror_agent.py', str(self.config), '--steps', '1', *extra_args]), \ mock.patch.object(sys, 'argv', ['jev_mirror_agent.py', str(self.config), '--steps', '1', *extra_args]), \
mock.patch.dict(os.environ, environment, clear=True), \ mock.patch.dict(os.environ, environment, clear=True), \
mock.patch.object(agent.time, 'sleep'), \ mock.patch.object(agent.time, 'sleep'), \
+57
View File
@@ -0,0 +1,57 @@
import io
import json
import sys
import unittest
import urllib.error
from pathlib import Path
from unittest import mock
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / 'scripts'))
import jev_client as client
class JevClientTest(unittest.TestCase):
def test_configured_model_endpoint_session_and_instructions_reach_api(self):
cfg = {'apiKey': 'test-key', 'model': 'test-model',
'baseUrl': 'https://example.test/go/v1/', 'sessionId': 'session-1'}
response = io.StringIO(json.dumps({'answers': {'action': {'type': 'choice', 'choice': 'inspect'}}}))
with mock.patch.object(client.urllib.request, 'urlopen', return_value=response) as post:
choice, _ = client.request_decision(cfg, 'main story map', {'inspect': 'inspect team'}, 'story rules')
request = post.call_args.args[0]
self.assertEqual(request.full_url, 'https://example.test/go/v1/systemone')
self.assertEqual(request.get_header('X-opencode-session'), 'session-1')
self.assertEqual(request.get_header('User-agent'), 'lc-mcp/0.1')
body = json.loads(request.data)
self.assertEqual(body['model'], 'test-model')
self.assertEqual(body['questions']['action']['instructions'], 'story rules')
self.assertEqual(choice, 'inspect')
def test_curl_credentials_only_on_stdin_and_http_errors_not_retried(self):
cfg = {'apiKey': 'private-test-key', 'transport': 'curl', 'sessionId': 'session-1'}
response = mock.Mock(returncode=0, stdout='{"error":"rate limit"}\n429')
with mock.patch.object(client.subprocess, 'run', return_value=response) as run, \
mock.patch.object(client.time, 'sleep') as sleep:
with self.assertRaises(urllib.error.HTTPError) as error:
client.request_decision(cfg, 'state', {'wait': 'wait'}, 'choose')
self.assertEqual(error.exception.code, 429)
self.assertNotIn('private-test-key', ' '.join(run.call_args.args[0]))
self.assertIn('Authorization: Bearer private-test-key', run.call_args.kwargs['input'])
self.assertEqual(run.call_count, 1)
sleep.assert_not_called()
def test_choice_outside_permitted_actions_is_rejected(self):
with mock.patch.object(client, '_post', return_value={
'answers': {'action': {'type': 'choice', 'choice': 'spend_currency'}}}):
with self.assertRaisesRegex(ValueError, 'unsupported candidate'):
client.request_decision({'apiKey': 'test'}, 'state', {'wait': 'wait'}, 'choose')
def test_session_id_stays_stable_across_decisions(self):
cfg = {'apiKey': 'test'}
def response(*args, **kwargs):
return io.StringIO('{"answers":{"action":{"type":"choice","choice":"wait"}}}')
with mock.patch.object(client.urllib.request, 'urlopen', side_effect=response) as post:
client.request_decision(cfg, 'state', {'wait': 'wait'}, 'choose')
client.request_decision(cfg, 'state', {'wait': 'wait'}, 'choose')
ids = [call.args[0].get_header('X-opencode-session') for call in post.call_args_list]
self.assertTrue(ids[0])
self.assertEqual(ids[0], ids[1])
+83 -5
View File
@@ -1,3 +1,5 @@
import json
import os
import tempfile import tempfile
import sys import sys
import unittest import unittest
@@ -5,6 +7,7 @@ from pathlib import Path
from unittest import mock from unittest import mock
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / 'scripts')) sys.path.insert(0, str(Path(__file__).resolve().parents[1] / 'scripts'))
import jev_mirror_agent as agent import jev_mirror_agent as agent
import jev_client # noqa: E402 Jev 请求经由 jev_client 发出
class SceneRegressionTest(unittest.TestCase): class SceneRegressionTest(unittest.TestCase):
@@ -90,9 +93,9 @@ class SceneRegressionTest(unittest.TestCase):
self.assertEqual(agent.fixed_fallback(options),'prepare_thunderbranch') self.assertEqual(agent.fixed_fallback(options),'prepare_thunderbranch')
def test_jev_rate_limit_fails_without_sleep_or_second_request(self): def test_jev_rate_limit_fails_without_sleep_or_second_request(self):
error=agent.urllib.error.HTTPError('https://example.test',429,'rate limit',{},None) error=jev_client.urllib.error.HTTPError('https://example.test',429,'rate limit',{},None)
with mock.patch.object(agent.urllib.request,'urlopen',side_effect=error) as request, mock.patch.object(agent.time,'sleep') as sleep: with mock.patch.object(jev_client.urllib.request,'urlopen',side_effect=error) as request, mock.patch.object(jev_client.time,'sleep') as sleep:
with self.assertRaises(agent.urllib.error.HTTPError): with self.assertRaises(jev_client.urllib.error.HTTPError):
agent.decide({'apiKey':'test','model':'jev-test'}, {'items':[]},{'wait':{'description':'wait'}},[]) agent.decide({'apiKey':'test','model':'jev-test'}, {'items':[]},{'wait':{'description':'wait'}},[])
self.assertEqual(request.call_count,1) self.assertEqual(request.call_count,1)
sleep.assert_not_called() sleep.assert_not_called()
@@ -104,7 +107,7 @@ class SceneRegressionTest(unittest.TestCase):
state = {'screen': {'path': 'LOCAL_SCREENSHOT_ONLY.png'}, state = {'screen': {'path': 'LOCAL_SCREENSHOT_ONLY.png'},
'items': [{'text': 'EVENT', 'x': 10, 'y': 20}]} 'items': [{'text': 'EVENT', 'x': 10, 'y': 20}]}
options = {'wait': {'description': 'wait'}, 'inspect': {'description': 'inspect'}} options = {'wait': {'description': 'wait'}, 'inspect': {'description': 'inspect'}}
with mock.patch.object(agent.urllib.request, 'urlopen', return_value=response) as request: with mock.patch.object(jev_client.urllib.request, 'urlopen', return_value=response) as request:
result = agent.decide({'apiKey': 'test', 'model': 'jev-test'}, state, options, []) result = agent.decide({'apiKey': 'test', 'model': 'jev-test'}, state, options, [])
payload = agent.json.loads(request.call_args.args[0].data.decode('utf-8')) payload = agent.json.loads(request.call_args.args[0].data.decode('utf-8'))
self.assertEqual(payload['model'], 'jev-test') self.assertEqual(payload['model'], 'jev-test')
@@ -451,7 +454,38 @@ class SceneRegressionTest(unittest.TestCase):
def test_disabled_selection_is_not_clickable_candidate(self): def test_disabled_selection_is_not_clickable_candidate(self):
state = {'items': [{'text': '选择', 'x': 100, 'y': 10, 'w': 80, 'h': 40}]} state = {'items': [{'text': '选择', 'x': 100, 'y': 10, 'w': 80, 'h': 40}]}
self.assertFalse(any(o['action']['tool'] == 'click_text' for o in agent.candidates(state).values())) self.assertFalse(any(k.startswith('button_') for k in agent.candidates(state)))
@mock.patch.object(agent, 'button_enabled', return_value=True)
def test_generic_button_clicks_the_checked_item(self, _enabled):
# 重新按文字搜索会多一次截图+OCR, 且可能点到背景里同名的另一个按钮
state = {'items': [{'text': '继续', 'x': 100, 'y': 200, 'w': 80, 'h': 40}]}
self.assertEqual(agent.candidates(state)['button_0']['action'],
{'tool': 'click', 'args': {'x': 140, 'y': 220}})
def test_screenshot_decoded_once_for_repeated_checks(self):
from PIL import Image
with tempfile.TemporaryDirectory() as folder:
shot = Path(folder) / 'shot.png'
Image.new('L', (200, 100), 200).save(shot)
state = {'screen': {'path': str(shot)}}
item = {'x': 10, 'y': 10, 'w': 50, 'h': 20}
with mock.patch.object(Image, 'open', wraps=Image.open) as opened:
self.assertTrue(agent.button_enabled(state, item))
self.assertTrue(agent.button_enabled(state, dict(item, x=100)))
self.assertEqual(opened.call_count, 1)
Image.new('L', (200, 101), 0).save(shot) # 同路径的新内容不能命中旧缓存
self.assertFalse(agent.button_enabled(state, item))
def test_map_templates_are_loaded_once(self):
screenshot = Path(__file__).resolve().parent / 'fixtures' / 'floor4_white_events.png'
if not (agent.REPO_ROOT / 'vendor' / 'aalc' / 'assets').is_dir():
self.skipTest('AALC submodule assets unavailable')
state = {'screen': {'path': str(screenshot)}}
first = agent.map_candidates(state)
loads = agent._map_template.cache_info().misses
self.assertEqual(agent.map_candidates(state), first)
self.assertEqual(agent._map_template.cache_info().misses, loads)
def test_battle_cinematic_keeps_macro_available(self): def test_battle_cinematic_keeps_macro_available(self):
state = {'items': [{'text': '破裂+5', 'x': 100, 'y': 10, 'w': 80, 'h': 40}]} state = {'items': [{'text': '破裂+5', 'x': 100, 'y': 10, 'w': 80, 'h': 40}]}
@@ -480,5 +514,49 @@ class SceneRegressionTest(unittest.TestCase):
self.assertNotIn('battle', agent.candidates(state, previous_battle=True)) self.assertNotIn('battle', agent.candidates(state, previous_battle=True))
class MainLoopTest(unittest.TestCase):
def run_main(self, home, bridge, steps=3):
config = home / 'cfg.json'
config.write_text('{}', encoding='utf-8')
with mock.patch.object(agent, 'RUNTIME_HOME', home), \
mock.patch.object(agent, 'STOP_FILE', home / 'JEV_STOP'), \
mock.patch.object(agent, 'Bridge', return_value=bridge) as make_bridge, \
mock.patch.object(agent, 'acquire_single_instance', return_value=lambda: None), \
mock.patch.object(agent.time, 'sleep'), \
mock.patch.dict(os.environ, {'OPENCODE_API_KEY': 'test-key', 'LC_FIXED_FALLBACK': '1'}), \
mock.patch.object(sys, 'argv', ['agent', str(config), '--steps', str(steps)]):
agent.main()
return make_bridge
def test_tool_errors_are_observed_instead_of_aborting(self):
with tempfile.TemporaryDirectory() as folder:
home = Path(folder)
bridge = mock.Mock()
bridge.call.return_value = {'ok': False, 'error': '截图失败'}
make_bridge = self.run_main(home, bridge, steps=2)
make_bridge.assert_called_once()
self.assertIs(make_bridge.call_args.kwargs['raise_on_error'], False)
status = json.loads((home / 'jev_mirror_status.json').read_text())
# 没有因异常退出, 而是按“截图暂不可用”等待到步数用完
self.assertEqual((status['state'], status.get('reason')), ('stopped', 'step_limit'))
records = [json.loads(line) for line in (home / 'jev_mirror_log.jsonl').read_text().splitlines()]
self.assertEqual([r['choice'] for r in records], ['wait', 'wait'])
class SessionTest(unittest.TestCase):
def test_tool_errors_can_be_returned_instead_of_raised(self):
import mcp_session
session = mcp_session.Session.__new__(mcp_session.Session)
session.request = mock.Mock(return_value={'isError': True, 'content': [
{'type': 'text', 'text': json.dumps({'ok': False, 'error': 'text not found'})}]})
session.raise_on_error, session.timeout = False, 30
self.assertEqual(session.call('click_text', {'text': 'x'}), {'ok': False, 'error': 'text not found'})
session.raise_on_error = True
with self.assertRaises(RuntimeError):
session.call('click_text', {'text': 'x'})
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
+267 -4
View File
@@ -173,8 +173,13 @@ class ProtocolTest(unittest.TestCase):
self.assertIn('stop_task', call(self.s, 'drag', from_x=1, from_y=2, self.assertIn('stop_task', call(self.s, 'drag', from_x=1, from_y=2,
to_x=3, to_y=4)['error']) to_x=3, to_y=4)['error'])
self.assertTrue(call(self.s, 'get_state')['ok']) # 只读工具仍可用 self.assertTrue(call(self.s, 'get_state')['ok']) # 只读工具仍可用
time.sleep(0.5) # 轮询等子进程输出, 不用固定等待 (机器负载高时 0.5s 不够)
st = call(self.s, 'task_status') deadline = time.time() + 10
while True:
st = call(self.s, 'task_status')
if st['log_tail'] or time.time() > deadline:
break
time.sleep(0.05)
self.assertEqual(st['state'], 'running') self.assertEqual(st['state'], 'running')
self.assertEqual(st['params'], {'count': 2}) self.assertEqual(st['params'], {'count': 2})
self.assertIn("child ['mirror', '{\"count\": 2}']", '\n'.join(st['log_tail'])) self.assertIn("child ['mirror', '{\"count\": 2}']", '\n'.join(st['log_tail']))
@@ -203,9 +208,212 @@ class AalcTaskArgsTest(unittest.TestCase):
self.assertEqual(aalc_task.main(['x', 'mirror', '{"exp": 1}']), 2) self.assertEqual(aalc_task.main(['x', 'mirror', '{"exp": 1}']), 2)
self.assertEqual(aalc_task.main(['x', 'nope']), 2) self.assertEqual(aalc_task.main(['x', 'nope']), 2)
def test_originals_saved_before_override_and_restored(self):
from lc_mcp import aalc_task
class Cfg:
def __init__(self):
self.values, self.saved, self.flushes = {'set_mirror_count': 1}, {}, 0
def get_value(self, key):
return self.values[key]
def unsaved_set_value(self, key, value):
self.values[key] = value
def set_value(self, key, value):
self.values[key] = self.saved[key] = value
def flush(self):
self.flushes += 1
cfg = Cfg()
with tempfile.TemporaryDirectory() as d:
path = os.path.join(d, 'x.restore.json')
originals = aalc_task.apply_overrides(cfg, 'mirror', {'count': 5}, path)
self.assertEqual(cfg.values['set_mirror_count'], 5)
with open(path, encoding='utf-8') as f:
self.assertEqual(json.load(f), {'set_mirror_count': 1})
self.assertEqual(originals, {'set_mirror_count': 1})
# 任务进程被强杀后, TaskRunner 用 --restore 读文件写回
aalc_task.restore_file(path, cfg)
self.assertEqual((cfg.saved, cfg.flushes), ({'set_mirror_count': 1}, 1))
self.assertFalse(os.path.exists(path))
self.assertEqual(aalc_task.apply_overrides(cfg, 'reward', {}, path), {})
self.assertFalse(os.path.exists(path)) # 没有覆盖就不留恢复文件
class TaskRestoreTest(unittest.TestCase):
"""run_task 的临时次数会随 AALC 中途存盘写进 config.yaml; 强杀后必须写回原值。"""
CHILD = ('import json, os, time; p = os.environ["LCP_RESTORE_FILE"]; '
'open(p, "w").write(json.dumps({"set_mirror_count": 1})); time.sleep(30)')
def setUp(self):
self.tmp = tempfile.TemporaryDirectory()
self.marker = os.path.join(self.tmp.name, 'restored.txt')
self.runs = os.path.join(self.tmp.name, 'runs')
self.restore_code = 'import os, sys; open(sys.argv[2], "a").write(open(sys.argv[1]).read()); os.remove(sys.argv[1])'
self.runner = TaskRunner(self.runs, argv_factory=lambda t, p: [sys.executable, '-c', self.CHILD],
restore_argv=lambda path: [sys.executable, '-c', self.restore_code, path, self.marker])
def tearDown(self):
self.runner.stop()
self.tmp.cleanup()
def _wait_for_restore_file(self):
deadline = time.time() + 10
while time.time() < deadline:
if any(n.endswith('.restore.json') for n in os.listdir(self.runs)):
return
time.sleep(0.05)
self.fail('child never wrote its restore file')
def test_stop_restores_overridden_config(self):
self.assertTrue(self.runner.start('mirror', {'count': 5})['ok'])
self._wait_for_restore_file()
r = self.runner.stop()
self.assertEqual((r['ok'], r['state']), (True, 'stopped'), r)
with open(self.marker) as f:
self.assertEqual(json.load(f), {'set_mirror_count': 1})
self.assertFalse([n for n in os.listdir(self.runs) if n.endswith('.restore.json')])
def test_leftover_restored_before_next_start_or_start_refused(self):
leftover = os.path.join(self.runs, 'task_20260101_000000_mirror.restore.json')
with open(leftover, 'w') as f:
json.dump({'set_mirror_count': 2}, f)
self.runner.restore_argv = lambda path: [sys.executable, '-c', 'import sys; sys.exit(1)', path]
r = self.runner.start('mirror', {'count': 5})
self.assertFalse(r['ok'])
self.assertIn('restore', r['error'])
self.assertFalse(self.runner.running())
self.assertEqual(self.runner.status()['pending_restore'], [os.path.basename(leftover)])
self.runner.restore_argv = lambda path: [sys.executable, '-c', self.restore_code, path, self.marker]
self.assertTrue(self.runner.start('mirror', {'count': 5})['ok'])
with open(self.marker) as f:
self.assertEqual(json.load(f), {'set_mirror_count': 2})
self.assertFalse(os.path.exists(leftover))
class RuntimeTest(unittest.TestCase): class RuntimeTest(unittest.TestCase):
def test_foreground_drag_targets_current_client_and_releases_on_failure(self):
from lc_mcp.aalc_engine import AalcEngine
engine = AalcEngine.__new__(AalcEngine)
engine.cfg = mock.Mock(simulator=False, win_input_type='foreground')
engine.auto, engine.screen = mock.Mock(), mock.Mock()
engine._grab = mock.Mock(return_value=mock.Mock(width=1600, height=720))
engine.screen.handle.hwnd = 123
engine.screen.handle.isMinimized = False
engine.screen.handle.isActive = True
engine.auto.input_handler.pos_offset.side_effect = [(500, 500), (900, 400)]
pointer = mock.Mock()
pointer.moveTo.side_effect = [None, RuntimeError('move interrupted')]
with mock.patch.dict(sys.modules, pyautogui=pointer), mock.patch('lc_mcp.aalc_engine.time.sleep'):
with self.assertRaises(RuntimeError):
engine.drag(300, 300, 700, 200, .5)
pointer.mouseDown.assert_called_once_with(500, 500)
pointer.mouseUp.assert_called_once_with(900, 400)
engine.auto.mouse_drag.assert_not_called()
def test_foreground_input_activates_game_before_sending(self):
from lc_mcp.aalc_engine import AalcEngine
engine = AalcEngine.__new__(AalcEngine)
engine.cfg = mock.Mock(simulator=False, win_input_type='foreground')
engine.auto, engine.screen = mock.Mock(), mock.Mock()
engine.auto.input_handler.pos_offset.return_value = (580, 657)
engine.screen.handle.hwnd = 123
engine.screen.handle.isMinimized = False
engine.screen.handle.isActive = False
def activate():
engine.screen.handle.isActive = True
engine.screen.handle.setForeground.side_effect = activate
pointer = mock.Mock()
with mock.patch('lc_mcp.aalc_engine.time.sleep') as sleep, mock.patch.dict(sys.modules, pyautogui=pointer):
engine.click(100, 200)
engine.screen.handle.setForeground.assert_called_once_with()
pointer.moveTo.assert_called_once_with(580, 657)
self.assertEqual(sleep.call_args_list, [mock.call(.15), mock.call(.12), mock.call(.35), mock.call(.12)])
pointer.mouseDown.assert_called_once_with(580, 657)
pointer.mouseUp.assert_called_once_with(580, 657)
engine.auto.mouse_click.assert_not_called()
def test_foreground_focus_failure_does_not_send_input(self):
from lc_mcp.aalc_engine import AalcEngine
engine = AalcEngine.__new__(AalcEngine)
engine.cfg = mock.Mock(simulator=False, win_input_type='foreground')
engine.auto, engine.screen = mock.Mock(), mock.Mock()
engine.screen.handle.hwnd = 123
engine.screen.handle.isMinimized = False
engine.screen.handle.isActive = False
engine.key_names = ['enter']
engine._focus_game = mock.Mock()
with mock.patch('lc_mcp.aalc_engine.time.sleep'):
for action in (lambda: engine.click(100, 200),
lambda: engine.keypress('enter'),
lambda: engine.type_text('test')):
with self.assertRaises(RuntimeError):
action()
engine.auto.mouse_click.assert_not_called()
engine.auto.key_press.assert_not_called()
engine.auto.input_text.assert_not_called()
def test_foreground_input_releases_on_interruption(self):
from lc_mcp.aalc_engine import AalcEngine
engine = AalcEngine.__new__(AalcEngine)
engine.cfg = mock.Mock(simulator=False, win_input_type='foreground')
engine.auto, engine.screen = mock.Mock(), mock.Mock()
engine.screen.handle.hwnd = 123
engine.screen.handle.isMinimized = False
engine.screen.handle.isActive = True
engine.auto.input_handler.pos_offset.return_value = (580, 657)
engine.key_names = ['enter']
pointer = mock.Mock()
with mock.patch.dict(sys.modules, pyautogui=pointer), \
mock.patch('lc_mcp.aalc_engine.time.sleep', side_effect=[None, RuntimeError('interrupted')]):
with self.assertRaises(RuntimeError):
engine.click(100, 200)
with mock.patch.dict(sys.modules, pyautogui=pointer), \
mock.patch('lc_mcp.aalc_engine.time.sleep', side_effect=RuntimeError('interrupted')):
with self.assertRaises(RuntimeError):
engine.keypress('enter')
pointer.mouseUp.assert_called_once_with(580, 657)
pointer.keyUp.assert_called_once_with('enter')
def test_foreground_move_settle_failure_sends_no_button_press(self):
from lc_mcp.aalc_engine import AalcEngine
engine = AalcEngine.__new__(AalcEngine)
engine.cfg = mock.Mock(simulator=False, win_input_type='foreground')
engine.auto, engine.screen = mock.Mock(), mock.Mock()
engine.screen.handle.hwnd = 123
engine.screen.handle.isMinimized = False
engine.screen.handle.isActive = True
engine.auto.input_handler.pos_offset.return_value = (580, 657)
pointer = mock.Mock()
with mock.patch.dict(sys.modules, pyautogui=pointer), \
mock.patch('lc_mcp.aalc_engine.time.sleep', side_effect=RuntimeError('interrupted')):
with self.assertRaises(RuntimeError):
engine.click(100, 200)
pointer.mouseDown.assert_not_called()
def test_focus_retry_detaches_threads_even_on_failure(self):
from lc_mcp.aalc_engine import AalcEngine
engine = AalcEngine.__new__(AalcEngine)
engine.screen = mock.Mock()
engine.screen.handle.hwnd = 123
engine.screen.handle.isActive = False
engine.screen.handle.setForeground.side_effect = RuntimeError('focus refused')
api, gui, process = mock.Mock(), mock.Mock(), mock.Mock()
api.GetCurrentThreadId.return_value = 1
gui.GetForegroundWindow.return_value = 456
process.GetWindowThreadProcessId.side_effect = [(2, 200), (3, 300)]
with mock.patch.dict(sys.modules, win32api=api, win32gui=gui, win32process=process):
with self.assertRaises(RuntimeError):
engine._focus_game()
self.assertEqual(process.AttachThreadInput.call_args_list,
[mock.call(1, 2, True), mock.call(1, 3, True),
mock.call(1, 3, False), mock.call(1, 2, False)])
def test_background_click_holds_and_releases_without_moving_window(self): def test_background_click_holds_and_releases_without_moving_window(self):
from lc_mcp.aalc_engine import AalcEngine from lc_mcp.aalc_engine import AalcEngine
engine = AalcEngine.__new__(AalcEngine) engine = AalcEngine.__new__(AalcEngine)
@@ -287,6 +495,7 @@ server.main(['--stdio'])
def test_drag_checks_bounds_before_sending_input(self): def test_drag_checks_bounds_before_sending_input(self):
from lc_mcp.aalc_engine import AalcEngine from lc_mcp.aalc_engine import AalcEngine
engine = AalcEngine.__new__(AalcEngine) engine = AalcEngine.__new__(AalcEngine)
engine.cfg = mock.Mock(simulator=False, win_input_type='background')
engine._grab = mock.Mock(return_value=mock.Mock(width=800, height=600)) engine._grab = mock.Mock(return_value=mock.Mock(width=800, height=600))
engine.auto = mock.Mock() engine.auto = mock.Mock()
with self.assertRaises(ValueError): with self.assertRaises(ValueError):
@@ -311,13 +520,30 @@ server.main(['--stdio'])
engine.auto.find_image_element.side_effect = match engine.auto.find_image_element.side_effect = match
self.assertEqual(engine.find_image('battle/setting_assets.png'), (1233, 42)) self.assertEqual(engine.find_image('battle/setting_assets.png'), (1233, 42))
self.assertEqual(engine.cfg.set_win_size, 1080) self.assertEqual(engine.cfg.set_win_size, 1080)
self.assertEqual(engine.auto.clear_img_cache.call_count, 2) self.assertEqual(engine.auto.clear_img_cache.call_count, 1)
engine.auto.find_image_element.side_effect = RuntimeError('match failed') engine.auto.find_image_element.side_effect = RuntimeError('match failed')
with self.assertRaises(RuntimeError): with self.assertRaises(RuntimeError):
engine.find_image('battle/setting_assets.png') engine.find_image('battle/setting_assets.png')
self.assertEqual(engine.cfg.set_win_size, 1080) self.assertEqual(engine.cfg.set_win_size, 1080)
self.assertEqual(engine.auto.clear_img_cache.call_count, 4) # 同一窗口尺寸复用已缩放的模板缓存 (clear_img_cache 每次都会全量 gc)
self.assertEqual(engine.auto.clear_img_cache.call_count, 1)
engine.cfg.set_value.assert_not_called() engine.cfg.set_value.assert_not_called()
engine.auto.find_image_element.side_effect = lambda *a, **k: (10, 10)
engine._grab.return_value = mock.Mock(width=1920, height=1080)
engine.find_image('battle/setting_assets.png')
self.assertEqual(engine.auto.clear_img_cache.call_count, 2)
def test_template_list_is_scanned_once(self):
from lc_mcp import aalc_engine
engine = aalc_engine.AalcEngine.__new__(aalc_engine.AalcEngine)
with tempfile.TemporaryDirectory() as root:
os.makedirs(os.path.join(root, 'default', 'share', 'battle'))
open(os.path.join(root, 'default', 'share', 'battle', 'turn_assets.png'), 'wb').close()
engine.images_root = root
with mock.patch.object(aalc_engine.glob, 'glob', wraps=aalc_engine.glob.glob) as scan:
self.assertEqual(engine.list_images('battle/'), ['battle/turn_assets.png'])
self.assertEqual(engine.list_images(), ['battle/turn_assets.png'])
self.assertEqual(scan.call_count, 6) # 2 主题 x 3 语言, 只扫一轮
def free_port(): def free_port():
@@ -358,6 +584,11 @@ class TransportTest(unittest.TestCase):
s.sendall(b'AUTH wrong\n') s.sendall(b'AUTH wrong\n')
self.assertEqual(s.makefile('rb').readline().strip(), b'DENIED') self.assertEqual(s.makefile('rb').readline().strip(), b'DENIED')
def test_non_ascii_token_is_denied_not_crashed(self):
with socket.create_connection(('127.0.0.1', self.port)) as s:
s.sendall('AUTH 密码\n'.encode('utf-8'))
self.assertEqual(s.makefile('rb').readline().strip(), b'DENIED')
def test_bridge_end_to_end(self): def test_bridge_end_to_end(self):
env = dict(os.environ, LCP_PORT=str(self.port), HOME=self.tmp.name, USERPROFILE=self.tmp.name) env = dict(os.environ, LCP_PORT=str(self.port), HOME=self.tmp.name, USERPROFILE=self.tmp.name)
os.makedirs(os.path.join(self.tmp.name, 'lc_mcp')) os.makedirs(os.path.join(self.tmp.name, 'lc_mcp'))
@@ -404,5 +635,37 @@ class TransportTest(unittest.TestCase):
self.assertEqual((state['ok'], state['items']), (True, [])) self.assertEqual((state['ok'], state['items']), (True, []))
class TaskErrorSurfaceTest(unittest.TestCase):
"""AALC 每日流程单次战斗失败后仍 exit 0; 状态里必须带出日志报错。"""
CHILD = ('import sys; '
'sys.stdout.write("[ERROR] [AALC] tasks\\\\battle\\\\battle.py:83: '
'超出最大尝试次数,未能进入战斗\\n"); '
'sys.stdout.write("[lc_mcp] task daily done\\n"); '
'sys.stdout.flush()')
def test_exit_zero_with_battle_error_is_reported(self):
with tempfile.TemporaryDirectory() as d:
runner = TaskRunner(d, argv_factory=lambda t, p: [sys.executable, '-c', self.CHILD])
self.assertTrue(runner.start('daily', {'exp': 1})['ok'])
deadline = time.time() + 15
while time.time() < deadline and runner.running():
time.sleep(0.05)
status = runner.status()
self.assertEqual((status['state'], status['exit_code']), ('succeeded', 0), status)
self.assertIn('未能进入战斗', status['errors'][-1])
def test_clean_log_has_no_errors_field(self):
with tempfile.TemporaryDirectory() as d:
runner = TaskRunner(d, argv_factory=lambda t, p: [sys.executable, '-c', 'print("[lc_mcp] ok")'])
self.assertTrue(runner.start('daily', {})['ok'])
deadline = time.time() + 15
while time.time() < deadline and runner.running():
time.sleep(0.05)
status = runner.status()
self.assertEqual(status['state'], 'succeeded')
self.assertNotIn('errors', status)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
+152
View File
@@ -0,0 +1,152 @@
# -*- coding: utf-8 -*-
"""编队滑动补丁: 几何用 AALC 真实的 scroll_swipe.py, 适配器/pyautogui 用记录调用的假对象。"""
import importlib.util
import os
import sys
import types
import unittest
from unittest import mock
REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, REPO)
from lc_mcp import aalc_input_patch as patch # noqa: E402
SCROLL_SWIPE = os.path.join(REPO, 'vendor', 'aalc', 'module', 'automation', 'input_handlers', 'scroll_swipe.py')
def aalc_modules(input_module=None):
"""只装入 AALC 的 scroll_swipe (纯 math) 和可选的假 input 模块, 不触发 AALC 包初始化。"""
spec = importlib.util.spec_from_file_location('module.automation.input_handlers.scroll_swipe', SCROLL_SWIPE)
scroll_swipe = importlib.util.module_from_spec(spec)
spec.loader.exec_module(scroll_swipe)
mods = {name: types.ModuleType(name) for name in
('module', 'module.automation', 'module.automation.input_handlers')}
for m in mods.values():
m.__path__ = []
handlers = mods['module.automation.input_handlers']
handlers.scroll_swipe = scroll_swipe
mods['module.automation.input_handlers.scroll_swipe'] = scroll_swipe
if input_module is not None:
handlers.input = input_module
mods['module.automation.input_handlers.input'] = input_module
mods['module.automation'].input_handlers = handlers
mods['module'].automation = mods['module.automation']
return mods, scroll_swipe
class FakeBackground:
def __init__(self):
self.calls = []
def get_mouse_position(self):
return (5, 5)
def set_active(self):
self.calls.append(('active',))
def set_mouse_pos(self, x, y, **kwargs):
self.calls.append(('pos', x, y, kwargs))
def mouse_down(self, x, y):
self.calls.append(('down', x, y))
def mouse_up(self, x, y):
self.calls.append(('up', x, y))
def mouse_move(self, coordinate):
self.calls.append(('restore', coordinate))
@unittest.skipUnless(os.path.isfile(SCROLL_SWIPE), 'AALC submodule unavailable')
class TeamScrollPatchTest(unittest.TestCase):
def setUp(self):
self.mods, self.scroll_swipe = aalc_modules()
self.sleeps = []
for p in (mock.patch.dict(sys.modules, self.mods),
mock.patch.object(patch.time, 'sleep', side_effect=self.sleeps.append)):
p.start()
self.addCleanup(p.stop)
def test_background_keeps_aalc_geometry_and_actually_moves(self):
dy = -385 * 1080 / 1440 # AALC 按名称翻页的距离
adapter = FakeBackground()
patch._background_team_scroll(adapter, 500, 600, duration=0.3, dy=dy)
moves = [c for c in adapter.calls if c[0] == 'pos']
down = next(c for c in adapter.calls if c[0] == 'down')
up = next(c for c in adapter.calls if c[0] == 'up')
self.assertEqual(down[1:], (500, 600))
self.assertAlmostEqual(up[2] - down[2], dy) # 行程与 AALC 的 Windows 标定一致
self.assertGreater(len(moves), 50) # 原补丁在此为 0 个移动事件
self.assertTrue(all(not c[3] for c in moves)) # 不经过适配器的 duration 参数
plan, settle = self.scroll_swipe.build_windows_scroll_swipe_plan(500, 600, 0, dy, 0.3)
visited = {(round(c[1], 6), round(c[2], 6)) for c in moves}
for point, _ in plan:
self.assertIn((round(point[0], 6), round(point[1], 6)), visited)
self.assertIn(patch.ESCAPE_HOLD_SECONDS, self.sleeps)
self.assertEqual(self.sleeps[-1], patch.SETTLE_SECONDS)
moving = sum(d for _, d in plan)
self.assertAlmostEqual(sum(self.sleeps), moving + patch.ESCAPE_HOLD_SECONDS + patch.SETTLE_SECONDS)
self.assertEqual(adapter.calls[-1], ('restore', (5, 5)))
def test_foreground_disables_pyautogui_pause(self):
calls = []
fake = types.SimpleNamespace(
moveTo=lambda *a, **k: calls.append(('move', a, k)),
mouseDown=lambda *a, **k: calls.append(('down', a, k)),
mouseUp=lambda *a, **k: calls.append(('up', a, k)))
adapter = FakeBackground()
adapter.pos_offset = lambda x, y: (x + 100, y + 200)
with mock.patch.dict(sys.modules, {'pyautogui': fake}):
patch._foreground_team_scroll(adapter, 500, 600, duration=0.3, dy=-288, move_back=False)
self.assertTrue(all(k.get('_pause') is False for _, _, k in calls))
self.assertEqual([c[0] for c in calls].count('down'), 1)
self.assertEqual(calls[-1][:2], ('up', (600, 512))) # 终点 (500, 312) 加窗口偏移
# pyautogui 默认每次调用后停 0.1s; 关掉后总耗时只由计划决定
self.assertLess(sum(self.sleeps), 2.0)
def test_zero_distance_presses_and_releases_in_place(self):
adapter = FakeBackground()
patch._background_team_scroll(adapter, 10, 20, dy=0, move_back=False)
self.assertEqual([c[0] for c in adapter.calls], ['pos', 'active', 'down', 'up'])
self.assertEqual(self.sleeps, [])
def test_release_happens_even_if_moving_fails(self):
adapter = FakeBackground()
adapter.set_mouse_pos = mock.Mock(side_effect=[None, RuntimeError('lost window')])
with self.assertRaises(RuntimeError):
patch._background_team_scroll(adapter, 10, 20, dy=-200)
self.assertEqual(adapter.calls[-1][0], 'up')
class InstallTest(unittest.TestCase):
def test_opt_in_and_idempotent(self):
class Input:
pass
class BackgroundInput:
pass
fake_input = types.ModuleType('module.automation.input_handlers.input')
fake_input.Input, fake_input.BackgroundInput = Input, BackgroundInput
mods = {name: types.ModuleType(name) for name in
('module', 'module.automation', 'module.automation.input_handlers')}
for m in mods.values():
m.__path__ = []
mods['module.automation.input_handlers'].input = fake_input
mods['module.automation.input_handlers.input'] = fake_input
with mock.patch.dict(sys.modules, mods):
with mock.patch.dict(os.environ, {}, clear=True):
self.assertEqual(patch.install(), []) # 默认关闭
self.assertFalse(hasattr(Input, 'mouse_swipe_for_team_scroll'))
with mock.patch.dict(os.environ, {'LCP_TEAM_SCROLL_PATCH': '1'}):
self.assertEqual(patch.install(), ['Input', 'BackgroundInput'])
self.assertIs(Input.mouse_swipe_for_team_scroll, patch._foreground_team_scroll)
self.assertIs(BackgroundInput.mouse_swipe_for_team_scroll, patch._background_team_scroll)
self.assertEqual(patch.install(), []) # 幂等
if __name__ == '__main__':
unittest.main()