mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-08 14:00:27 +08:00
Compare commits
15 Commits
ci/AppImag
...
feat/Copil
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a30f9a7dd | ||
|
|
61345d8126 | ||
|
|
07e01367e7 | ||
|
|
b9274e1904 | ||
|
|
9dcfeb28fd | ||
|
|
e21a6630f4 | ||
|
|
fccaf06d6d | ||
|
|
c99f05fbd9 | ||
|
|
4ed401f1f4 | ||
|
|
c9c8e9751d | ||
|
|
6119232486 | ||
|
|
c9085e7d23 | ||
|
|
5814f1a6ca | ||
|
|
c59397b377 | ||
|
|
cccbef1637 |
29
.claude/skills/maa-issue-log-analysis/KNOWLEDGE.md
Normal file
29
.claude/skills/maa-issue-log-analysis/KNOWLEDGE.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# MAA Issue Log Analysis Knowledge Base
|
||||
|
||||
## Stateful UI Automation Checks
|
||||
|
||||
- 分析 issue 时,先区分三层东西,不要混为一谈:
|
||||
- 游戏规则
|
||||
- MAA 当前自动化流程
|
||||
- 用户对最终状态的预期
|
||||
- 遇到“一键/快捷/批量”按钮时,先看资源任务和日志里的真实控制路径,不要只看现象。
|
||||
- 对状态型 UI,重点核对三件事:
|
||||
- 前置条件是什么
|
||||
- 流程中哪些状态会被临时改写
|
||||
- 结束条件满足后应停在哪个状态
|
||||
|
||||
## Reception Clue Analysis
|
||||
|
||||
- 会客室线索问题先对照当前资源任务和日志,不要只凭体感下结论。
|
||||
- 取下线索 -> 赠送重复线索 -> 当前线索数量够开启线索交流时才统一放置,这是 by design。
|
||||
- 因此,“送完重复线索后线索板暂时为空”或“用户自己放的线索被统一取下”本身不能直接判成 bug。
|
||||
- 真正需要继续确认的是:
|
||||
- 日志里的控制路径是否和资源任务定义一致
|
||||
- 明明已经满足开启线索交流的条件,却没有触发统一放置
|
||||
- 流程是否停在了不该停的位置,或提前退出
|
||||
|
||||
## Guardrails For Future Analysis
|
||||
|
||||
- 不要把维护者评论、机器人评论、或单张截图当成最终结论;必须回到日志和代码确认状态是怎么变化的。
|
||||
- 对状态型 UI,先回答“日志里的行为是否符合设计”,再回答“这个设计是否符合用户预期”。
|
||||
- 不要只看最终现象;要结合配置、`gui.log`、`asst.log`、资源任务和当前代码一起判断。
|
||||
@@ -5,6 +5,11 @@ description: 分析 MaaAssistantArknights 上游仓库公开 Issue(`https://gi
|
||||
|
||||
# MAA Issue Log Analysis
|
||||
|
||||
## Required Reading
|
||||
|
||||
- 开始分析前,先读取同目录的 `KNOWLEDGE.md`,先用其中的通用误判规则校正自己的分析路径,再读 issue 和日志。
|
||||
- 如果 issue 涉及会客室、线索、快捷按钮、批量按钮、自动领取/赠送/放置这类“会先改变界面状态再继续执行”的流程,必须先套用 `KNOWLEDGE.md` 中的 `Stateful UI Automation Checks` 与 `Reception Clue Analysis`。
|
||||
|
||||
## Scope
|
||||
|
||||
- 仅用于上游公开仓库 `https://github.com/MaaAssistantArknights/MaaAssistantArknights`。
|
||||
@@ -25,6 +30,7 @@ description: 分析 MaaAssistantArknights 上游仓库公开 Issue(`https://gi
|
||||
- 读取正文和评论。
|
||||
- 提取这些信息:UI/Core/Resource 版本、资源时间、模拟器类型、分辨率、截图增强、GPU 推理、任务名、关卡名、是否有 `-hard`、用户现象、复现步骤、维护者或机器人评论。
|
||||
- 不要把评论结论当成唯一证据;仍要用日志和代码自行验证。
|
||||
- 如果 issue 文本或评论里已经有人下了“这是游戏设计 / 不是 bug / 本来就这样”的结论,先暂存,不要直接复述成最终判断;先核对日志、资源任务和当前代码是否真的支持这个结论。
|
||||
|
||||
3. 提取报告附件。
|
||||
|
||||
@@ -60,6 +66,10 @@ description: 分析 MaaAssistantArknights 上游仓库公开 Issue(`https://gi
|
||||
- 先在 `gui.log` 确认 `AttachWindow: Found window`
|
||||
- 再在 `asst.log` 里看 `Win32Controller::screencap`、`Win32Controller::click`
|
||||
- 不要再按 ADB 端口或 `ConnectionInfo.ConnectFailed` 的思路分析
|
||||
- 如果问题属于状态型 UI 自动化(例如会客室线索、批量按钮、快捷按钮、先拆后放一类流程),时间线里必须单独标出:
|
||||
- 自动化在什么时刻先修改了用户原状态
|
||||
- 后续进入下一步或恢复终态由哪个条件控制
|
||||
- 条件不满足时流程是停止、跳过,还是按设计停在别的状态
|
||||
|
||||
6. 区分 issue 当时环境和当前分支。
|
||||
|
||||
@@ -245,6 +255,12 @@ description: 分析 MaaAssistantArknights 上游仓库公开 Issue(`https://gi
|
||||
- 摘几十行足够支撑结论的片段即可。
|
||||
- 不要把整份日志倾倒进回复。
|
||||
|
||||
8. 对状态型 UI 问题,结论前先做一次“设计一致性检查”。
|
||||
|
||||
- 先判断日志中的状态变化是否符合游戏规则、资源任务定义和当前实现。
|
||||
- 如果流程与设计一致,不要把用户不喜欢的中间状态直接归为 bug。
|
||||
- 只有当日志、资源任务和代码彼此冲突,或流程没有达到设计要求的终态时,再归类为实现缺陷。
|
||||
|
||||
## Common Patterns
|
||||
|
||||
- `gui.log` 只显示“连接失败”,但 `asst.log` 里已经给出 `adb devices`、`adb connect`、端口轮询和 `ConnectionInfo`。连接类问题必须以 `asst.log` 为准。
|
||||
@@ -254,6 +270,8 @@ description: 分析 MaaAssistantArknights 上游仓库公开 Issue(`https://gi
|
||||
- `part02` 可以是空包,也可以只包含图片;不要因为没有文本日志就把它判成“无用分卷”。
|
||||
- issue 机器人评论“日志没有上传成功”时,不要自动当真;先验证正文附件是否仍可下载。
|
||||
- 如果 `gui.log` 说“任务出错”,但对应 `taskid` 的 `asst.log` 实际 `AllTasksCompleted`,要明确写“本次日志未复现用户描述的问题”。
|
||||
- 对会客室 / 线索 issue,如果 `asst.log` 里出现 `InfrastClueQuickInsert`、`remove_clue`、`SendClues` 或 `InfrastClueQuickSendDuplicates`,先对照资源任务判断这是不是当前设计流程,不要只看线索板中途是否为空。
|
||||
- 如果线索流程里出现“取下线索 -> 赠送重复线索 -> 条件满足后统一放置”,默认先按 by design 处理;只有当日志显示本应统一放置却没有发生时,再继续追实现问题。
|
||||
- 用户日志里的任务流程与当前主线代码明显不一致,且当前代码看起来已经修掉了该问题:
|
||||
|
||||
- 先确认用户版本,必要时切到对应 tag(例如 `git checkout vXXX`)核对旧逻辑。
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -421,7 +421,7 @@ FodyWeavers.xsd
|
||||
.history/
|
||||
|
||||
# Claude Code
|
||||
.claude/
|
||||
.claude/*
|
||||
!.claude/skills/
|
||||
|
||||
# Windows Installer files from build outputs
|
||||
|
||||
51
CHANGELOG.md
51
CHANGELOG.md
@@ -1,4 +1,4 @@
|
||||
## v6.9.3
|
||||
## v6.9.4
|
||||
|
||||
### 许愿墙前挂满愿签,牛牛顺手把更新器、作战流程和海外服体验都打磨了一遍 | Highlights
|
||||
|
||||
@@ -42,6 +42,55 @@ This update adapts to the 7th anniversary wishing wall, the “Reclamation” in
|
||||
|
||||
以下是详细内容:
|
||||
|
||||
## v.6.9.4
|
||||
|
||||
### 新增 | New
|
||||
|
||||
* 手动输入关卡名支持使用 -Normal/-Hard 切换 常规/险地 难度 @ABA2396
|
||||
* use v2 version of icons (#16556) @Constrat @ABA2396
|
||||
|
||||
### 改进 | Improved
|
||||
|
||||
* optimize templates @Constrat
|
||||
|
||||
### 修复 | Fix
|
||||
|
||||
* 調整繁中服部分幹員名稱 OCR (#16561) @momomochi987
|
||||
* 繁中服肉鴿薩卡滋事件辨識 聚思成塔 (#16541) @CC-creator2026
|
||||
* LogWarn 等宏在 Release 下依旧输出 scope 导致额外间隔 @status102
|
||||
* 修复通宝交换/投钱任务链以适配交换通宝/投钱后获得藏品的情况 (#16553) @travellerse
|
||||
* 外部通知设置界面调整 (#16552) @2436238575
|
||||
* 界园肉鸽投资模式也启用通宝插件 (#16551) @travellerse
|
||||
* 修复窗体关闭过程中再次启动时报“关闭期间无法设置可见性或调用 Show/Close”的异常 @ABA2396
|
||||
* 繁中服肉鴿辨識 (#16535) @CC-creator2026
|
||||
* 修复删除 debug 截图时因文件被占用导致应用闪退的问题 @ABA2396
|
||||
* 远程控制启动任务未记录开始时间 (#16522) @March7th-OvO
|
||||
* 部分成就分期错误 @ABA2396
|
||||
* IS6 encounter trailing `o` and `-` fix #16525 @Constrat
|
||||
|
||||
### 文档 | Docs
|
||||
|
||||
* 更新 wiki 文档,增强内容结构与描述 @AnnAngela
|
||||
* update zh-tw preview image (#16517) @momomochi987
|
||||
|
||||
### 其他 | Other
|
||||
|
||||
* 繁中服「快速放入線索」與「一鍵贈送重複線索」 (#16562) @momomochi987
|
||||
* Lucky 的概率改为 0.0799% @ABA2396
|
||||
* 使用 PC 端时不传账号 @ABA2396
|
||||
* 增加 issue 分析知识库 @ABA2396
|
||||
* 修改手动输入关卡名的悬浮描述 @ABA2396
|
||||
* 生成日志压缩包时的缓存目录改为本地 reports 目录 @ABA2396
|
||||
* 提前最小截图间隔的检查,小于间隔时跳过识别 @ABA2396
|
||||
* 繁中服界園肉鴿 DLC1 & sss 9 炭火安保派駐 (#16516) @momomochi987
|
||||
* 繁中服「界園」主題與「齊聚」主題 (#16515) @momomochi987
|
||||
* restore JP StageAnnihilation.png @Manicsteiner
|
||||
* YostarKR PV minigame @HX3N
|
||||
* fix JP time ocr (#16557) @Manicsteiner
|
||||
* YostarJP PV templates and ocr (#16505) @Manicsteiner
|
||||
* EN PV minigame @Constrat
|
||||
* Add context7.json with URL and public key @AnnAngela
|
||||
|
||||
## v6.9.3
|
||||
|
||||
### 新增 | New
|
||||
|
||||
@@ -314,7 +314,7 @@
|
||||
["干擾波長", "干扰波长"],
|
||||
["劣質閃光彈", "劣质闪光弹"],
|
||||
["無需增調.+員", "无需增调干员"],
|
||||
["截雲", "截云"],
|
||||
["截(雲|雪)", "截云"],
|
||||
["地形增傷控制", "地形增伤控制"],
|
||||
["山海密語儀", "山海密语仪"],
|
||||
[".*(麒|麟).+夜刀$", "麒麟R夜刀"],
|
||||
@@ -420,7 +420,7 @@
|
||||
["“二踢腳”型數據收集裝置", "“二踢脚”型数据收集装置"],
|
||||
["勘察用自走車", "勘察用自走车"],
|
||||
["喚血祭壇", "唤血祭坛"],
|
||||
["維(荻|茨)", "维荻"],
|
||||
["維(荻|茨|茲)", "维荻"],
|
||||
["瀝血王座", "沥血王座"],
|
||||
["炸彈載荷點", "炸弹载荷点"],
|
||||
["創生之相", "创生之相"],
|
||||
@@ -555,7 +555,7 @@
|
||||
["靈活架設模組", "灵活架设模块"],
|
||||
["荒蕪拉普蘭德", "荒芜拉普兰德"],
|
||||
[".*君者", "弑君者"],
|
||||
["雲跡", "云迹"],
|
||||
["(雲|雪)跡", "云迹"],
|
||||
["菲萊", "菲莱"],
|
||||
["軍工廠指令平台", "军工厂指令平台"],
|
||||
["煙火發射器", "烟花发射器"],
|
||||
@@ -911,10 +911,6 @@
|
||||
"InfrastClueSelfFull": {
|
||||
"text": ["已達線索上限", "無法獲取新的線索", "上限", "無法"]
|
||||
},
|
||||
"SendClues": {
|
||||
"doc": "待「快速放入線索」與「一鍵贈送重複線索」功能實裝後再移除 (#14966)",
|
||||
"roi": [1160, 350, 80, 80]
|
||||
},
|
||||
"InfrastTrainingIdle": {
|
||||
"text": ["空閒中"]
|
||||
},
|
||||
|
||||
@@ -3685,11 +3685,13 @@
|
||||
"next": ["EndOfPlot"]
|
||||
},
|
||||
"BattleAvatarDialog": {
|
||||
"doc": "战斗中带头像对话框, 类似于 SkipThePreBattlePlot(可见于画中人关卡) 的, 但是缺少 跳过 按钮",
|
||||
"doc": "战斗中带头像对话框, 类似于 SkipThePreBattlePlot(可见于画中人关卡, 17章主线TR28) 的, 但是缺少 跳过 按钮",
|
||||
"action": "ClickSelf",
|
||||
"roi": [70, 30, 120, 30],
|
||||
"maxTimes": 5,
|
||||
"next": ["BattleAvatarDialog", "Stop"],
|
||||
"rectMove": [125, 20, 200, 60]
|
||||
"rectMove": [125, 20, 200, 60],
|
||||
"specialParams": [98]
|
||||
},
|
||||
"EndOfPlot": {
|
||||
"roi": [520, 0, 243, 206],
|
||||
@@ -4761,8 +4763,8 @@
|
||||
"Doc": "20260109 YJWL更新后暂停按钮向右移动约8像素, 且暂停后亮度上限245 (不知道以前是不是也有这个问题)",
|
||||
"template": "empty.png",
|
||||
"roi": [1178, 33, 53, 39],
|
||||
"specialParams_Doc": "亮度阈值;点的数量",
|
||||
"specialParams": [235, 200]
|
||||
"specialParams_Doc": "亮度阈值; 暂停时阈值; 运行时阈值",
|
||||
"specialParams": [235, 200, 450]
|
||||
},
|
||||
"BattleSpeedButton": {
|
||||
"template": "empty.png",
|
||||
|
||||
@@ -601,7 +601,7 @@ bool asst::BattleHelper::check_pause_button(const cv::Mat& reusable)
|
||||
|
||||
BattlefieldMatcher battle_flag_analyzer_2(image);
|
||||
auto battle_result_opt = battle_flag_analyzer_2.analyze();
|
||||
ret &= battle_result_opt && battle_result_opt->pause_button;
|
||||
ret &= battle_result_opt && battle_result_opt->pause_button != BattlefieldMatcher::PauseStatus::Unknown;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -621,14 +621,39 @@ bool asst::BattleHelper::check_skip_plot_button(const cv::Mat& reusable)
|
||||
bool asst::BattleHelper::check_avatar_dialog(const cv::Mat& reusable)
|
||||
{
|
||||
cv::Mat image = reusable.empty() ? m_inst_helper.ctrler()->get_image() : reusable;
|
||||
|
||||
const static auto& task = Task.get("BattleAvatarDialog");
|
||||
const static double threshold = task->special_params[0] / 100.0;
|
||||
Matcher battle_plot_analyzer(image);
|
||||
battle_plot_analyzer.set_task_info("BattleAvatarDialog");
|
||||
battle_plot_analyzer.set_task_info(task);
|
||||
bool ret = battle_plot_analyzer.analyze().has_value();
|
||||
if (ret) {
|
||||
ProcessTask(this_task(), { "BattleAvatarDialog" }).run();
|
||||
if (!ret) {
|
||||
return false;
|
||||
}
|
||||
return ret;
|
||||
|
||||
ProcessTask(this_task(), { "BattleAvatarDialog" }).run();
|
||||
const auto match_rect = battle_plot_analyzer.get_result().rect.move(task->rect_move);
|
||||
|
||||
cv::Mat image2 = m_inst_helper.ctrler()->get_image();
|
||||
int retry = 100;
|
||||
while (!m_inst_helper.need_exit() && retry > 0) {
|
||||
Matcher matcher(image2);
|
||||
matcher.set_templ(make_roi(image, match_rect));
|
||||
matcher.set_roi(match_rect);
|
||||
matcher.set_threshold(threshold);
|
||||
matcher.set_method(MatchMethod::Ccoeff);
|
||||
if (matcher.analyze()) {
|
||||
LogInfo << __FUNCTION__ << "still in dialog, but not detected change, maybe need deploy or skill";
|
||||
break;
|
||||
}
|
||||
--retry;
|
||||
ret = ProcessTask(this_task(), { "BattleAvatarDialog" }).run();
|
||||
if (!ret) {
|
||||
break;
|
||||
}
|
||||
image = image2;
|
||||
image2 = m_inst_helper.ctrler()->get_image();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool asst::BattleHelper::check_in_speedup(const cv::Mat& reusable)
|
||||
@@ -646,7 +671,7 @@ bool asst::BattleHelper::check_in_battle(const cv::Mat& reusable, bool weak)
|
||||
BattlefieldMatcher analyzer(image);
|
||||
auto result = analyzer.analyze();
|
||||
m_in_battle = result.has_value();
|
||||
if (m_in_battle && !result->pause_button) {
|
||||
if (m_in_battle && result->pause_button == BattlefieldMatcher::PauseStatus::Unknown) {
|
||||
if (check_skip_plot_button(image)) {
|
||||
if (m_in_speedup && !check_in_speedup()) {
|
||||
speed_up(); // 跳过剧情会退出2倍速
|
||||
@@ -655,13 +680,13 @@ bool asst::BattleHelper::check_in_battle(const cv::Mat& reusable, bool weak)
|
||||
else if (check_avatar_dialog(image)) {
|
||||
if (m_in_speedup && !check_in_speedup()) {
|
||||
speed_up(); // 跳过剧情会退出2倍速
|
||||
m_inst_helper.sleep(Config.get_options().task_delay);
|
||||
int times = 0;
|
||||
while (times < 20 && !m_inst_helper.need_exit() && !check_in_speedup()) {
|
||||
speed_up(); // 跳过剧情会退出2倍速
|
||||
m_inst_helper.sleep(Config.get_options().task_delay);
|
||||
times++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_in_battle && result->pause_button == BattlefieldMatcher::PauseStatus::Pausing) {
|
||||
if (check_avatar_dialog(image)) {
|
||||
if (m_in_speedup && !check_in_speedup()) {
|
||||
speed_up(); // 跳过剧情会退出2倍速
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ bool asst::CombatRecordRecognitionTask::analyze_deployment()
|
||||
|
||||
oper_analyzer.set_image(frame);
|
||||
auto oper_result_opt = oper_analyzer.analyze();
|
||||
bool analyzed = oper_result_opt && oper_result_opt->pause_button;
|
||||
bool analyzed = oper_result_opt && oper_result_opt->pause_button != BattlefieldMatcher::PauseStatus::Unknown;
|
||||
if (analyzed) {
|
||||
m_battle_start_frame = i;
|
||||
deployment = std::move(oper_result_opt->deployment);
|
||||
@@ -390,7 +390,7 @@ bool asst::CombatRecordRecognitionTask::slice_video()
|
||||
pre_distance = distance;
|
||||
}
|
||||
|
||||
bool oper_is_clicked = !result_opt->speed_button || !result_opt->pause_button;
|
||||
bool oper_is_clicked = !result_opt->speed_button || result_opt->pause_button == BattlefieldMatcher::PauseStatus::Unknown;
|
||||
bool oper_auto_retreat =
|
||||
in_segment && continuity && !m_clips.empty() && cur_opers.size() != m_clips.back().deployment.size();
|
||||
|
||||
|
||||
@@ -462,6 +462,9 @@ bool asst::BattleProcessTask::wait_condition(const Action& action)
|
||||
const std::string& name = get_name_from_group(action.name);
|
||||
update_image_if_empty();
|
||||
while (!need_exit()) {
|
||||
if (!check_in_battle(image)) {
|
||||
return false;
|
||||
}
|
||||
if (!update_deployment(false, image)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -36,12 +36,7 @@ bool asst::MultiCopilotTaskPlugin::_run()
|
||||
callback(AsstMsg::SubTaskExtraInfo, info);
|
||||
|
||||
bool ret = true;
|
||||
Task.get<OcrTaskInfo>(config.nav_name + "@Copilot@ClickStageName")->text = { config.nav_name };
|
||||
std::string replace_navigate_name = config.nav_name;
|
||||
utils::string_replace_all_in_place(replace_navigate_name, { { "-", "" } });
|
||||
Task.get<OcrTaskInfo>(config.nav_name + "@Copilot@ClickedCorrectStage")->text = { config.nav_name,
|
||||
replace_navigate_name };
|
||||
ret = ret && ProcessTask(*this, { config.nav_name + "@Copilot@StageNavigationBegin" }).set_retry_times(20).run();
|
||||
ret = ret && navigate_to_stage(config.nav_name);
|
||||
|
||||
ProcessTask(*this, { "NotUsePrts" }).set_ignore_error(true).set_retry_times(0).run();
|
||||
if (config.is_raid) {
|
||||
@@ -51,3 +46,12 @@ bool asst::MultiCopilotTaskPlugin::_run()
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool asst::MultiCopilotTaskPlugin::navigate_to_stage(const std::string& stage_name)
|
||||
{
|
||||
Task.get<OcrTaskInfo>(stage_name + "@Copilot@ClickStageName")->text = { stage_name };
|
||||
std::string replace_navigate_name = stage_name;
|
||||
utils::string_replace_all_in_place(replace_navigate_name, { { "-", "" } });
|
||||
Task.get<OcrTaskInfo>(stage_name + "@Copilot@ClickedCorrectStage")->text = { stage_name, replace_navigate_name };
|
||||
return ProcessTask(*this, { stage_name + "@Copilot@StageNavigationBegin" }).set_retry_times(20).run();
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ public:
|
||||
|
||||
private:
|
||||
virtual bool _run() override;
|
||||
bool navigate_to_stage(const std::string& stage_name);
|
||||
|
||||
std::vector<MultiCopilotConfig> m_copilot_configs;
|
||||
int m_index_current = 0; // 当前执行的索引
|
||||
|
||||
@@ -37,7 +37,7 @@ BattlefieldMatcher::ResultOpt BattlefieldMatcher::analyze() const
|
||||
|
||||
if (m_object_of_interest.flag) {
|
||||
result.pause_button = pause_button_analyze();
|
||||
if (!result.pause_button && !hp_flag_analyze() && !kills_flag_analyze() && !cost_symbol_analyze()) {
|
||||
if (result.pause_button == PauseStatus::Unknown && !hp_flag_analyze() && !kills_flag_analyze() && !cost_symbol_analyze()) {
|
||||
// flag 表明当前画面是在战斗场景的,不在的就没必要识别了
|
||||
return std::nullopt;
|
||||
}
|
||||
@@ -440,7 +440,7 @@ bool asst::BattlefieldMatcher::hit_costs_cache() const
|
||||
return mark > threshold;
|
||||
}
|
||||
|
||||
bool BattlefieldMatcher::pause_button_analyze() const
|
||||
asst::BattlefieldMatcher::PauseStatus BattlefieldMatcher::pause_button_analyze() const
|
||||
{
|
||||
auto task_ptr = Task.get("BattleHasStarted");
|
||||
cv::Mat roi = m_image(make_rect<cv::Rect>(task_ptr->roi));
|
||||
@@ -450,14 +450,22 @@ bool BattlefieldMatcher::pause_button_analyze() const
|
||||
const int value_threshold = task_ptr->special_params[0];
|
||||
cv::threshold(roi_gray, bin, value_threshold, 255, cv::THRESH_BINARY);
|
||||
int count = cv::countNonZero(bin);
|
||||
const int count_threshold = task_ptr->special_params[1];
|
||||
Log.trace(__FUNCTION__, "count", count, "threshold", count_threshold);
|
||||
const int threshold_base = task_ptr->special_params[1];
|
||||
const int threshold_high = task_ptr->special_params[2];
|
||||
Log.trace(__FUNCTION__, "count", count, "threshold", threshold_base, ",", threshold_high);
|
||||
|
||||
PauseStatus status = PauseStatus::Unknown;
|
||||
if (count >= threshold_high) {
|
||||
status = PauseStatus::Running;
|
||||
}
|
||||
else if (count >= threshold_base) {
|
||||
status = PauseStatus::Pausing;
|
||||
}
|
||||
#ifdef ASST_DEBUG
|
||||
cv::rectangle(m_image_draw, make_rect<cv::Rect>(task_ptr->roi), cv::Scalar(0, 0, 255), 2);
|
||||
cv::putText(
|
||||
m_image_draw,
|
||||
std::to_string(count) + "/" + std::to_string(count_threshold),
|
||||
std::to_string(count) + "/" + std::to_string(threshold_base) + "," + std::to_string(threshold_high),
|
||||
cv::Point(task_ptr->roi.x, task_ptr->roi.y + task_ptr->roi.height + 10),
|
||||
cv::FONT_HERSHEY_PLAIN,
|
||||
1.2,
|
||||
@@ -465,7 +473,7 @@ bool BattlefieldMatcher::pause_button_analyze() const
|
||||
2);
|
||||
#endif
|
||||
|
||||
return count > count_threshold;
|
||||
return status;
|
||||
}
|
||||
|
||||
bool BattlefieldMatcher::in_detail_analyze() const
|
||||
|
||||
@@ -26,6 +26,13 @@ public:
|
||||
HitCache = 2, // 图像命中缓存, 不进行识别
|
||||
};
|
||||
|
||||
enum PauseStatus
|
||||
{
|
||||
Unknown = 0, // 没有找到暂停按钮
|
||||
Pausing = 1, // 暂停中
|
||||
Running = 2, // 运行中
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct MatchResult
|
||||
{
|
||||
@@ -42,7 +49,7 @@ public:
|
||||
|
||||
// bool in_detail = false;
|
||||
bool speed_button = false;
|
||||
bool pause_button = false;
|
||||
asst::BattlefieldMatcher::PauseStatus pause_button = PauseStatus::Unknown;
|
||||
};
|
||||
|
||||
using ResultOpt = std::optional<Result>;
|
||||
@@ -59,7 +66,7 @@ public:
|
||||
protected:
|
||||
bool hp_flag_analyze() const;
|
||||
bool kills_flag_analyze() const;
|
||||
bool pause_button_analyze() const;
|
||||
asst::BattlefieldMatcher::PauseStatus pause_button_analyze() const;
|
||||
|
||||
std::vector<battle::DeploymentOper> deployment_analyze() const; // 识别干员
|
||||
battle::Role oper_role_analyze(const Rect& roi) const;
|
||||
|
||||
@@ -323,7 +323,7 @@ public static class ConfigFactory
|
||||
_debounceTimer.Change(PendingDelayMs, Timeout.Infinite);
|
||||
|
||||
ConfigurationUpdateEvent?.Invoke(key, oldValue, newValue);
|
||||
_logger.Debug("Configuration {Key} has been set: `{OldValue}` -> `{NewValue}`, save scheduled", key, oldValue, newValue);
|
||||
_logger.Information("Configuration {Key} has been set: `{OldValue}` -> `{NewValue}`, save scheduled", key, oldValue, newValue);
|
||||
}
|
||||
|
||||
private static void CreateSaveTask(object? state)
|
||||
|
||||
@@ -788,8 +788,8 @@ public class AchievementTrackerHelper : PropertyChangedBase
|
||||
Instance.Unlock(AchievementIds.Pioneer2);
|
||||
}
|
||||
|
||||
// 0.066% 概率触发
|
||||
if (new Random().NextDouble() < 0.00066)
|
||||
// 0.0799% 概率触发
|
||||
if (new Random().NextDouble() < 0.000799)
|
||||
{
|
||||
Instance.Unlock(AchievementIds.Lucky);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class BarkNotificationProvider(IHttpService httpService) : IExternalNotif
|
||||
public string Group { get; } = "MaaAssistantArknights";
|
||||
|
||||
[JsonPropertyName("icon")]
|
||||
public static string Icon { get => "https://cdn.jsdelivr.net/gh/MaaAssistantArknights/design@main/logo/maa-logo_256x256.png"; }
|
||||
public static string Icon { get => "https://cdn.jsdelivr.net/gh/MaaAssistantArknights/design@main/v2/icons/maa-logo_256x256.png"; }
|
||||
|
||||
// ReSharper restore UnusedAutoPropertyAccessor.Local
|
||||
// ReSharper restore UnusedMember.Local
|
||||
|
||||
@@ -86,10 +86,10 @@ public class StartUpSettingsUserControlModel : TaskSettingsViewModel, StartUpSet
|
||||
}
|
||||
|
||||
var clientType = SettingsViewModel.GameSettings.ClientType;
|
||||
var accountName = clientType switch {
|
||||
ClientType.Official or ClientType.Bilibili => startUp.AccountName,
|
||||
_ => string.Empty,
|
||||
};
|
||||
var accountName = !SettingsViewModel.ConnectSettings.UseAttachWindow &&
|
||||
clientType is ClientType.Official or ClientType.Bilibili
|
||||
? startUp.AccountName
|
||||
: string.Empty;
|
||||
|
||||
var task = new AsstStartUpTask() {
|
||||
ClientType = clientType,
|
||||
|
||||
Submodule src/maa-cli updated: 8ab8dcea05...9cf2e2efe6
Reference in New Issue
Block a user