mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 02:23:01 +08:00
fix: 线索板上有线索时无法一键放置线索
This commit is contained in:
@@ -3148,15 +3148,16 @@
|
||||
},
|
||||
"InfrastClueQuickInsert": {
|
||||
"Doc": "快速置入:官服新增的批量置入线索按钮模板占位",
|
||||
"roi": [1058, 572, 148, 148],
|
||||
"next": ["InfrastClueQuickInsertConfirm", "Stop"]
|
||||
"roi": [1058, 572, 148, 148]
|
||||
},
|
||||
"InfrastClueQuickInsertConfirm": {
|
||||
"baseTask": "NumberOcrReplace",
|
||||
"Doc": "满线索再放",
|
||||
"action": "ClickSelf",
|
||||
"maskRange": [1, 255],
|
||||
"roi": [1200, 610, 80, 40],
|
||||
"rectMove": [-110, 30, 110, 20]
|
||||
"fullMatch": true,
|
||||
"binThreshold": [180, 255],
|
||||
"useRaw": false,
|
||||
"roi": [1250, 615, 28, 28],
|
||||
"rectMove": [-110, 30, 110, 10]
|
||||
},
|
||||
"InfrastClueQuickSendDuplicates": {
|
||||
"Doc": "快速传递重复线索:批量传递重复线索按钮模板占位",
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 972 B |
@@ -6,9 +6,11 @@
|
||||
#include "Controller/Controller.h"
|
||||
#include "Task/ProcessTask.h"
|
||||
#include "Utils/Logger.hpp"
|
||||
#include "Utils/StringMisc.hpp"
|
||||
#include "Vision/Infrast/InfrastClueVacancyImageAnalyzer.h"
|
||||
#include "Vision/Matcher.h"
|
||||
#include "Vision/MultiMatcher.h"
|
||||
#include "Vision/RegionOCRer.h"
|
||||
|
||||
bool asst::InfrastReceptionTask::_run()
|
||||
{
|
||||
@@ -156,9 +158,27 @@ bool asst::InfrastReceptionTask::proc_clue_vacancy()
|
||||
|
||||
cv::Mat image = ctrler()->get_image();
|
||||
|
||||
// 优先检测官服新增的“快捷置入”按钮,如果存在则点击一次执行批量置入,跳过逐个置入流程
|
||||
// 优先检测官服新增的“快捷置入”按钮,如果存在则尝试根据数字与空位一致时批量置入
|
||||
if (ProcessTask(*this, { "InfrastClueQuickInsert" }).set_retry_times(3).run()) {
|
||||
return true;
|
||||
InfrastClueVacancyImageAnalyzer vacancy_analyzer(image);
|
||||
vacancy_analyzer.set_to_be_analyzed(clue_suffix);
|
||||
vacancy_analyzer.analyze();
|
||||
const int vacancy_cnt = static_cast<int>(vacancy_analyzer.get_vacancy().size());
|
||||
|
||||
const auto confirm_task = Task.get("InfrastClueQuickInsertConfirm");
|
||||
if (vacancy_cnt > 0 && confirm_task != nullptr) {
|
||||
RegionOCRer ocr_analyzer(image);
|
||||
ocr_analyzer.set_task_info(confirm_task);
|
||||
|
||||
if (auto ocr_res = ocr_analyzer.analyze()) {
|
||||
int available = 0;
|
||||
if (utils::chars_to_number(ocr_res->text, available) && available == vacancy_cnt) {
|
||||
Rect click_rect = confirm_task->roi.move(confirm_task->rect_move);
|
||||
ctrler()->click(click_rect);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const std::string& clue : clue_suffix) {
|
||||
|
||||
Reference in New Issue
Block a user