301 Commits

Author SHA1 Message Date
Saratoga-Official
78f092f855 fix: YJ暗改用户中心间距 2026-07-13 20:48:44 +08:00
Zian Wen
7746f07fc4 fix: 修正多作业 H 关 OCR 替换 / correct H-stage OCR replacement (#17326)
## 说明

多作业模式进入 H10-1 关卡详情页后,OCR 可能会把关卡名识别为 `H1O-1`。现有替换规则没有将它还原为 `H10-1`,而是处理成了
`-1`,导致关卡校验失败并重新开始导航。

本 PR 将 `ClickStageName` 和 `ClickedCorrectStage` 中的 `$010` 改为
`${1}0`,明确区分捕获组 1 和后面的字符 `0`。

## 原因

原规则的本意是保留捕获组 1,再补一个 `0`:

```json
["(H\\d+)O(?=-)", "$010"],
["(-\\d+)O", "$010"]
```

OCR 后处理使用 `boost::regex_replace`。这里的 `$010` 会被解析为捕获组 10,而不是捕获组 1 后接
`0`。这两个正则都没有第 10 个捕获组,因此 `H1O-1` 最终被处理成 `-1`。

修改后的规则使用无歧义写法:

```json
["(H\\d+)O(?=-)", "${1}0"],
["(-\\d+)O", "${1}0"]
```

## 验证

- `resource/tasks/tasks.json` 可以正常解析。
- 四处相关替换均已改为 `${1}0`,`git diff --check` 通过。
- 使用 MAA `v6.14.1`、明日方舟 PC 端、2560 × 1440 分辨率测试 H10-1 多作业导航。

修复前:

```text
CharOcr: H1O-1
Proceed: -1
confirm stage name failed after retrying 3 times, stage name: H10-1
```

修复后,同样的 OCR 输入可以正确进入编队流程:

```text
[2026-07-12 14:12:08.499][TRC] CharOcr: H1O-1
[2026-07-12 14:12:08.499][TRC] Proceed: H10-1
[2026-07-12 14:12:09.545][INF] task: BattleStartPre, text: 开始行动
[2026-07-12 14:12:11.670][INF] SubTaskStart: BattleFormationTask
```

本次测试中没有再出现 `confirm stage name failed`。

<details>
<summary>English</summary>

## Summary

In multi-copilot mode, the stage name on the H10-1 detail panel may be
recognized as `H1O-1`. The existing replacement rules turn it into `-1`
instead of restoring `H10-1`, so stage confirmation fails and navigation
starts over.

This PR changes `$010` to `${1}0` in both `ClickStageName` and
`ClickedCorrectStage`, making the boundary between capture group 1 and
the literal `0` explicit.

## Root cause

The original rules were intended to preserve capture group 1 and append
a literal `0`:

```json
["(H\\d+)O(?=-)", "$010"],
["(-\\d+)O", "$010"]
```

OCR post-processing uses `boost::regex_replace`, where `$010` is parsed
as capture group 10 rather than capture group 1 followed by `0`. Since
these expressions do not contain a tenth capture group, `H1O-1` is
reduced to `-1`.

The replacement now uses the unambiguous `${1}0` form.

## Verification

- Parsed `resource/tasks/tasks.json` successfully.
- Confirmed all four affected replacements use `${1}0`; `git diff
--check` passes.
- Tested H10-1 multi-copilot navigation with MAA `v6.14.1` on the
Arknights PC client at 2560 × 1440.
- The same `H1O-1` OCR result was corrected to `H10-1`, after which MAA
clicked `BattleStartPre` and entered `BattleFormationTask`.
- No `confirm stage name failed` entry was produced during the post-fix
attempt.

</details>

Refs #16888
2026-07-12 15:18:15 +08:00
Saratoga-Official
3f3a936508 fix: 折桠识别
fix #17317
2026-07-11 12:48:50 +08:00
uye
a5e468a608 feat: 自动战斗多作业模式支持异体字关卡导航(需更新版本) (#16984)
## Summary by Sourcery

通过基于模板的关卡导航来处理活动关卡与支线关卡,当没有可用模板时回退到 OCR。

新功能:
- 添加一个辅助工具,用标准化关卡代码解析活动关卡模板路径,并在资源存在时使用模板匹配进行关卡导航。
- 为多协助作战关卡选择和支线复刻关卡选择启用基于模板的导航,以提升关卡识别的稳定性。

改进:
- 在资源加载阶段,按完整相对路径索引所有模板图片文件,以便在 C++ 代码中动态查找关卡导航模板。

<details>
<summary>Original summary in English</summary>

## Summary by Sourcery

Introduce template-based stage navigation for event and side-story
stages, falling back to OCR when no template is available.

New Features:
- Add a helper to resolve event stage template paths from standardized
stage codes and use template matching for stage navigation when
resources exist.
- Enable template-based navigation for multi-copilot stage selection and
side-story reopen stage selection to improve stage recognition
reliability.

Enhancements:
- Index all template image files by full relative path during resource
loading to allow dynamic lookup of stage navigation templates from C++
code.

</details>

新功能:
- 为事件关卡引入基于模板的导航机制,通过从标准化路径解析每个关卡的截图模板,并在可用时优先使用模板而不是 OCR。
- 将基于模板的导航应用于多协助器(multi-copilot)关卡选择以及支线故事重开关卡选择,以在这些流程中提供更稳健的关卡识别支持。

增强:
- 在加载模板资源时按相对路径索引所有模板图片文件,以便可以从 C++ 代码中动态查找关卡导航模板。

<details>
<summary>Original summary in English</summary>

## Summary by Sourcery

通过基于模板的关卡导航来处理活动关卡与支线关卡,当没有可用模板时回退到 OCR。

新功能:
- 添加一个辅助工具,用标准化关卡代码解析活动关卡模板路径,并在资源存在时使用模板匹配进行关卡导航。
- 为多协助作战关卡选择和支线复刻关卡选择启用基于模板的导航,以提升关卡识别的稳定性。

改进:
- 在资源加载阶段,按完整相对路径索引所有模板图片文件,以便在 C++ 代码中动态查找关卡导航模板。

<details>
<summary>Original summary in English</summary>

## Summary by Sourcery

Introduce template-based stage navigation for event and side-story
stages, falling back to OCR when no template is available.

New Features:
- Add a helper to resolve event stage template paths from standardized
stage codes and use template matching for stage navigation when
resources exist.
- Enable template-based navigation for multi-copilot stage selection and
side-story reopen stage selection to improve stage recognition
reliability.

Enhancements:
- Index all template image files by full relative path during resource
loading to allow dynamic lookup of stage navigation templates from C++
code.

</details>

</details>
2026-07-04 20:02:34 +08:00
Rin
812e764bfb fix: 基建产物收取时因loading遮挡跳过 (#17232)
* fix: 基建产物收取时因loading遮挡跳过

* fix: 修正通知收取后的 loading 分支

Co-authored-by: Status102 <102887808+status102@users.noreply.github.com>

---------

Co-authored-by: Status102 <102887808+status102@users.noreply.github.com>
2026-07-03 23:09:17 +08:00
Rin
0b3f97dea9 fix: 增加贸易站订单切换重试和产物确认逻辑 (#16954) 2026-06-09 11:25:39 +08:00
status102
9b951cbabf perf: 优化部分情况下自动战斗导航OCR结果中会出现误识别的前缀 2026-06-09 01:54:04 +08:00
Status102
353c0ec972 fix: 修正特克诺干员名 OCR 误识别 (#17030)
## 问题与修复
issue 日志中,排序重选阶段 OCR 将“特克诺”识别为“持克诺”,导致后续按精确干员名匹配时无法命中。
在全局干员名 OCR 替换表中加入规则,仅将完整识别结果“持克诺”替换为“特克诺”。

```
15912:[2026-06-06 11:07:15.290][TRC][Px20248][Tx37564] asst::WordOcr [{ text: 褐果, rect: [ 0 (80), 0 (1), 40, 19 ], score: 0.999965 }] by OCR Rec , cost 16 ms
15913:[2026-06-06 11:07:15.290][TRC][Px20248][Tx37564] Proceed [{ text: 褐果, rect: [ 80, 1, 40, 19 ], score: 0.999965 }]
15914:[2026-06-06 11:07:15.290][WRN][Px20248][Tx37564] asst::VisionHelper::correct_rect roi is empty, use whole image
15915:[2026-06-06 11:07:15.307][TRC][Px20248][Tx37564] asst::WordOcr [{ text: 持克诺, rect: [ 0 (60), 0 (1), 60, 19 ], score: 0.881702 }] by OCR Rec , cost 16 ms
15916:[2026-06-06 11:07:15.307][TRC][Px20248][Tx37564] Proceed [{ text: 持克诺, rect: [ 60, 1, 60, 19 ], score: 0.881702 }]
15917:[2026-06-06 11:07:15.307][WRN][Px20248][Tx37564] asst::VisionHelper::correct_rect roi is empty, use whole image
15918:[2026-06-06 11:07:15.354][TRC][Px20248][Tx37564] asst::WordOcr [{ text: 凯尔希思衡托, rect: [ 0 (6), 0 (2), 114, 16 ], score: 0.992512 }] by OCR Rec , cost 45 ms
15919:[2026-06-06 11:07:15.354][TRC][Px20248][Tx37564] Proceed [{ text: 凯尔希·思衡托, rect: [ 6, 2, 114, 16 ], score: 0.992512 }]
```

fixes #17018

## Summary by Sourcery

错误修复:
- 通过在全局替换表中将误识别的“持克诺”映射为“特克诺”,纠正对运营商名称的 OCR 识别。

<details>
<summary>Original summary in English</summary>

## Summary by Sourcery

Bug Fixes:
- Correct OCR recognition of the operator name by mapping the misread
form “持克诺” to “特克诺” in the global replacement table.

</details>
2026-06-07 03:26:53 +08:00
ZiyinLin
4e5a234ece fix: 修正特克诺干员名 OCR 误识别 2026-06-07 00:57:00 +08:00
uye
0a551b95f9 feat: 切换主题时保存当前画面截图 (#16993)
* feat: 切换主题时保存当前画面截图

* chore: SwitchTheme tasks 定义移到子文件夹中
2026-06-07 00:17:54 +08:00
status102
1247e9a308 fix: 绿票商店状态回退错误 2026-06-06 01:35:14 +08:00
status102
0ae5fceb87 fix: 绿票商店2阶段check
Co-authored-by: ZiyinLin <xuanbing1464129430@gmail.com>
2026-06-06 01:35:13 +08:00
Status102
bba3f3281a rft: 基于灰度阈值预处理的自动战斗导航, 适配H关及怪猎2期 (#16990)
* rft: 基于灰度阈值的自动战斗导航, 适配H关及怪猎2期

* perf: 清理

* fix: replace

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* fix: loule

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-04 09:54:16 +08:00
Saratoga-Official
22635a7b60 fix: 御龙装置识别 2026-06-01 14:19:30 +08:00
Rin
9bd27f7968 Revert "fix: 调整基建干员名 OCR 区域" (#16937)
* Revert "fix: 调整基建干员名 OCR 区域 (#16905)"

This reverts commit 89377eba94.

* revert: EN changes no longer needed

---------

Co-authored-by: Constrat <56174894+Constrat@users.noreply.github.com>
2026-05-31 22:34:18 +08:00
Rin
89377eba94 fix: 调整基建干员名 OCR 区域 (#16905)
- 扩大笑脸锚点派生的干员名识别范围
2026-05-30 01:10:32 +08:00
Rin
4b520aaac9 fix: 修复宿舍自定义干员+信赖补位的bug&外服同步修复&提升代码可读性 (#16659)
* fix: 修复宿舍自定义干员+信赖补位的bug

* chore: EN

* fix: 补充宿舍筛选全部按钮的日韩识别文本

补充日服“全て”和韩服“전부”,用于取消宿舍“未进驻”筛选时点击“全部”选项。

* refactor: improve infrast dorm task readability

---------

Co-authored-by: Constrat <56174894+Constrat@users.noreply.github.com>
Co-authored-by: Roland125 <oroland125@outlook.com>
2026-05-30 00:56:57 +08:00
github-actions[bot]
35a92857d1 chore: Auto Update Game Resources - 2026-05-28
https://github.com/MaaAssistantArknights/MaaAssistantArknights/actions/runs/26559057935

[skip changelog]
2026-05-28 06:40:01 +00:00
uye
046459acee fix: 信用收支卡在商店里 2026-05-28 14:05:56 +08:00
uye
a5a237f53f chore: 改漏了——
[skip changelog]
2026-05-28 03:41:42 +08:00
uye
fa11d62642 chore: 增加基建小房子切换兜底 2026-05-28 03:39:36 +08:00
uye
f64a353c14 fix: 使用小房子转跳后无法切换基建设施 2026-05-28 03:18:00 +08:00
status102
93af38fbe4 fix: Roi.height 越界 2026-05-27 16:03:56 +08:00
github-actions[bot]
d5a2e8efb9 chore: Auto Update Game Resources - 2026-05-26
https://github.com/MaaAssistantArknights/MaaAssistantArknights/actions/runs/26464510177

[skip changelog]
2026-05-26 17:34:30 +00:00
uye
753547b5dd feat: 支持部分任务间通过导航栏切换 (#16869) 2026-05-27 00:28:22 +08:00
github-actions[bot]
e06dfaacb8 chore: Auto Update Game Resources - 2026-05-23
https://github.com/MaaAssistantArknights/MaaAssistantArknights/actions/runs/26344701306

[skip changelog]
2026-05-23 22:03:24 +00:00
Rin
60104dbd89 fix: 基建制造站切换产物流程稳定性提升 (#16747)
* fix: 基建制造站切换产物流程稳定性提升

* fix: 切换产物失败时向 GUI/Log报错

* refactor: 换产物失败后仍进入换人步骤,不停止任务链

*fix: 拆分自定义/params 无人机使用变量

* fix: 补充缺失产物任务配置的空指针保护。

---------

Co-authored-by: Roland125 <oroland125@outlook.com>
2026-05-24 05:41:11 +08:00
status102
53f1ac9e07 perf: 剿灭关使用代理卷后网络卡顿等待 2026-05-23 15:59:43 +08:00
status102
7f8f4bdfff fix: 自动战斗结束检测bypass 2026-05-23 11:08:59 +08:00
status102
cfe86445f8 fix: 自动战斗快速编队干员名roi 2026-05-23 01:27:58 +08:00
uye
1e37310c4a feat: 17 章导航 2026-05-15 16:15:33 +08:00
uye
11e0836aa0 feat: 支持使用 -Normal/-Hard 切换 常规/险地 难度 2026-05-09 23:29:19 +08:00
status102
22f3175b42 fix: OF-1战斗后等待过长导致部分后续流程失败
#16444
2026-05-06 02:15:22 +08:00
status102
4bc96d57da perf: 自动战斗结束增加LoadingIcon等待项 2026-05-06 02:15:22 +08:00
github-actions[bot]
469c1e670c chore: Auto update by pre-commit hooks
https://github.com/MaaAssistantArknights/MaaAssistantArknights/actions/runs/25344285069
[skip changelog]
2026-05-04 21:25:03 +00:00
status102
c4c15ef103 rft: 剿灭入口检测支持代理卡耗尽情况 2026-05-05 05:01:59 +08:00
Status102
736bab5427 rft: 重构战斗失败识别, 顺带支持沙盘战斗结束 (#16449) 2026-05-05 01:51:02 +08:00
status102
a8ceb64f16 fix: 理智药识别支持3位数库存 2026-05-05 01:49:52 +08:00
github-actions[bot]
3d4a3eb578 chore: Auto Update Game Resources - 2026-05-04
https://github.com/MaaAssistantArknights/MaaAssistantArknights/actions/runs/25333746690

[skip changelog]
2026-05-04 17:40:48 +00:00
Roland125
a0588e7da6 fix: 绿票商店稳定性提升 (#16369)
fix: 添加1层ocr识别失败时备用逻辑
fix:2层只购买公招券和单抽券
2026-05-05 01:01:56 +08:00
uye
0404959bd1 fix: 调整信用商店识别区域,修复 4 位数信用识别问题
close #16395

Co-authored-by: ZiyinLin <xuanbing1464129430@gmail.com>
2026-05-05 00:55:52 +08:00
Roland125
4a14245283 fix: 修复剿灭结算时,识别不到合成玉基线 (#16460)
<img width="508" height="175" alt="FABI(C}_VIB}7@N5KI51H R"
src="https://github.com/user-attachments/assets/1bb987c5-d0cc-41cd-92da-d31045490028"
/>
这是报告者的掉落图

<img width="630" height="166" alt="628X1BM7GI6$8 4(T%2}Q$0"
src="https://github.com/user-attachments/assets/8ecc8d6d-f44b-4540-93bd-8b73ef18f854"
/>
这是我本机的掉落图

明显看得出我本机的图,报酬二字上方那根线亮一些。

由于在我本机无法复现识别BUG,所以我只能用理论计算值来推断一个阈值。

根据反馈者的图提取出来的RGB值,算法计算出来的灰度是38.7(左)/44(右)。

均低于45的阈值,所以不可能有100像素长的线,于是合成玉基线被过滤掉了。

识别不到基线就不会识别对应的掉落物,就会触发无合成玉掉落导致的退出。

## Summary by Sourcery

将针对湮灭阶段的可选掉落识别处理置于仅调试用的宏之后进行控制,并在启用时将其接入自定义任务。

Enhancements:
- 当启用调试宏时,允许 `StageDropsTaskPlugin` 响应通用的动作结束任务。
- 在 `CustomTask` 中启用可选的 `StageDropsTaskPlugin` 注册,用于调试掉落识别问题。

<details>
<summary>Original summary in English</summary>

## Summary by Sourcery

Gate optional drop-recognition handling for annihilation stages behind a
debug-only macro and wire it into custom tasks when enabled.

Enhancements:
- Allow StageDropsTaskPlugin to respond to generic end-of-action tasks
when a debug macro is enabled.
- Enable optional registration of StageDropsTaskPlugin in CustomTask for
debugging drop recognition issues.

</details>
2026-05-04 19:35:35 +08:00
Saratoga-Official
7cc6cbf5ce fix: 凯尔希识别
fix #16455
2026-05-04 10:05:17 +08:00
status102
0a5b8e66a7 perf: 理智药到期时间OCR高度增加 2026-05-04 00:58:35 +08:00
Saratoga-Official
6d18eaa47c fix: GALLUS²识别 2026-05-03 02:31:23 +08:00
status102
65a5566c9e fix: 理智药剩余日期识别前缀非数字字符移除 2026-05-02 19:41:53 +08:00
github-actions[bot]
2182951ed0 chore: Auto Update Game Resources - 2026-05-01
https://github.com/MaaAssistantArknights/MaaAssistantArknights/actions/runs/25205158187

[skip changelog]
2026-05-01 06:33:13 +00:00
Copilot
2216175e5c feat: 适配七周年许愿墙 2026-05-01 12:24:29 +08:00
uye
b1659e0a70 fix: 升级结算时闪退 2026-04-30 00:22:12 +08:00
Roland125
e9d8f6a844 fix: 修复剿灭后出现升级界面,导致无法继续任务的问题(#16255) (#16370) 2026-04-29 21:20:35 +08:00