diff --git a/resource/tasks.json b/resource/tasks.json index 2ecdd29246..98692c2370 100644 --- a/resource/tasks.json +++ b/resource/tasks.json @@ -5695,7 +5695,7 @@ }, "BattleOperCooling": { "template": "empty.png", - "specialThreshold": 6000, + "specialThreshold": 1000, "specialThreshold_Doc": "这个任务中作为符合range的像素点数量阈值", "rectMove": [ -45, @@ -5703,9 +5703,17 @@ 75, 120 ], + "maskRange_Doc": "拿来做H通道的范围", "maskRange": [ 0, 10 + ], + "specificRect_Doc": "拿来做S、V通道的范围", + "specificRect": [ + 200, + 255, + 0, + 255 ] }, "BattleOperRoleRange": { diff --git a/src/MeoAssistant/AutoRecruitTask.cpp b/src/MeoAssistant/AutoRecruitTask.cpp index bbd89d7384..47aa89eb9d 100644 --- a/src/MeoAssistant/AutoRecruitTask.cpp +++ b/src/MeoAssistant/AutoRecruitTask.cpp @@ -132,14 +132,16 @@ bool asst::AutoRecruitTask::_run() } if (!m_use_expedited) { // analyze once only - if (!analyze_start_buttons()) return false; + if (!analyze_start_buttons()) return true; } static constexpr size_t slot_retry_limit = 3; // m_cur_times means how many times has the confirm button been pressed, NOT expedited plan used while ((m_use_expedited || !m_pending_recruit_slot.empty()) && m_cur_times != m_max_times) { + if (m_force_discard_flag) { return false; } if (m_slot_fail >= slot_retry_limit) { return false; } + if (!check_recruit_home_page()) { return false; } if (m_use_expedited) { Log.info("ready to use expedited"); if (need_exit()) return false; @@ -244,6 +246,7 @@ bool asst::AutoRecruitTask::recruit_one() if (!confirm()) { // ran out of recruit permit? Log.info("Failed to confirm current recruit config."); m_force_discard_flag = true; + click_return_button(); return false; } diff --git a/src/MeoAssistant/BattleImageAnalyzer.cpp b/src/MeoAssistant/BattleImageAnalyzer.cpp index 720e9894ab..ae6cf5ae32 100644 --- a/src/MeoAssistant/BattleImageAnalyzer.cpp +++ b/src/MeoAssistant/BattleImageAnalyzer.cpp @@ -228,19 +228,24 @@ bool asst::BattleImageAnalyzer::oper_cooling_analyze(const Rect& roi) { const auto cooling_task_ptr = Task.get("BattleOperCooling"); + auto img_roi = m_image(utils::make_rect(roi)); cv::Mat hsv; - cv::cvtColor(m_image(utils::make_rect(roi)), hsv, cv::COLOR_BGR2HSV); - std::vector channels; - cv::split(hsv, channels); - int mask_lowb = cooling_task_ptr->mask_range.first; - int mask_uppb = cooling_task_ptr->mask_range.second; + cv::cvtColor(img_roi, hsv, cv::COLOR_BGR2HSV); + int h_low = cooling_task_ptr->mask_range.first; + int h_up = cooling_task_ptr->mask_range.second; + int s_low = cooling_task_ptr->specific_rect.x; + int s_up = cooling_task_ptr->specific_rect.y; + int v_low = cooling_task_ptr->specific_rect.width; + int v_up = cooling_task_ptr->specific_rect.height; + + cv::Mat bin; + cv::inRange(hsv, cv::Scalar(h_low, s_low, v_low), cv::Scalar(h_up, s_up, v_up), bin); int count = 0; - auto& h_channel = channels.at(0); - for (int i = 0; i != h_channel.rows; ++i) { - for (int j = 0; j != h_channel.cols; ++j) { - cv::uint8_t value = h_channel.at(i, j); - if (mask_lowb < value && value < mask_uppb) { + for (int i = 0; i != bin.rows; ++i) { + for (int j = 0; j != bin.cols; ++j) { + cv::uint8_t value = bin.at(i, j); + if (value) { ++count; } } diff --git a/src/MeoAssistant/TaskData.cpp b/src/MeoAssistant/TaskData.cpp index 22190fd73a..e98bc9e1df 100644 --- a/src/MeoAssistant/TaskData.cpp +++ b/src/MeoAssistant/TaskData.cpp @@ -9,7 +9,6 @@ #include "TemplResource.h" #include "Logger.hpp" - const std::unordered_set& asst::TaskData::get_templ_required() const noexcept { return m_templ_required; @@ -113,12 +112,6 @@ bool asst::TaskData::parse(const json::value& json) } else if (action == "clickrect") { task_info_ptr->action = ProcessTaskAction::ClickRect; - const json::value& rect_json = task_json.at("specificRect"); - task_info_ptr->specific_rect = Rect( - rect_json[0].as_integer(), - rect_json[1].as_integer(), - rect_json[2].as_integer(), - rect_json[3].as_integer()); } else if (action == "swipetotheleft") { task_info_ptr->action = ProcessTaskAction::SwipeToTheLeft; @@ -198,6 +191,18 @@ bool asst::TaskData::parse(const json::value& json) task_info_ptr->rect_move = Rect(); } + if (auto opt = task_json.find("specificRect")) { + auto& rect_arr = opt.value(); + task_info_ptr->specific_rect = Rect( + rect_arr[0].as_integer(), + rect_arr[1].as_integer(), + rect_arr[2].as_integer(), + rect_arr[3].as_integer()); + } + else { + task_info_ptr->specific_rect = Rect(); + } + m_all_tasks_info[name] = task_info_ptr; } #ifdef ASST_DEBUG diff --git a/src/MeoAsstGui/Helper/AsstProxy.cs b/src/MeoAsstGui/Helper/AsstProxy.cs index bd6a1b8fb0..72667bec30 100644 --- a/src/MeoAsstGui/Helper/AsstProxy.cs +++ b/src/MeoAsstGui/Helper/AsstProxy.cs @@ -452,7 +452,7 @@ namespace MeoAsstGui case "AutoRecruitTask": { - var why_str = details.TryGetValue("why", out var why) ? why.ToString() : Localization.GetString("出现错误"); + var why_str = details.TryGetValue("why", out var why) ? why.ToString() : Localization.GetString("ErrorOccurred"); mainModel.AddLog(why_str + "," + Localization.GetString("HasReturned"), "darkred"); break; } diff --git a/src/MeoAsstGui/Resources/Localizations/en-us.xaml b/src/MeoAsstGui/Resources/Localizations/en-us.xaml index 8f73558f54..9703bab899 100644 --- a/src/MeoAsstGui/Resources/Localizations/en-us.xaml +++ b/src/MeoAsstGui/Resources/Localizations/en-us.xaml @@ -119,6 +119,7 @@ Tip: It will be automatically detected here. If there is an error, you can try to modify it again, otherwise you do not need to fill in it yourself ADB path (rel/abs) Connection address + It will be filled in automatically when you use it for the first time. If you encounter any problems, you can try to manually modify it Connection Preset @@ -327,9 +328,10 @@ MAA Website Source: GitHub Copilot Json sharing QQ group - QQ group1(Full) + QQ group1 QQ group2 QQ group3 + (Full) Q&A Issue diff --git a/src/MeoAsstGui/Resources/Localizations/ja-jp.xaml b/src/MeoAsstGui/Resources/Localizations/ja-jp.xaml index a263ef6d09..5aa7b71939 100644 --- a/src/MeoAsstGui/Resources/Localizations/ja-jp.xaml +++ b/src/MeoAsstGui/Resources/Localizations/ja-jp.xaml @@ -119,6 +119,7 @@ ヒント:ここで自動的に検出されます。エラーが発生した場合は、もう一度変更を試みることができます。それ以外の場合は、自分で入力する必要はありません。 adbパス (相対/絶対) 接続先アドレス + はじめて使うと自動で記入されるので、問題があれば手動で修正してみる 接続構成 @@ -327,9 +328,10 @@ MAA公式サイト ソースコード:GitHub 自動攻略ファイルシェアQQグループ - グループ1(フル) + グループ1 グループ2 グループ3 + (フル) よくある質問 フィードバック diff --git a/src/MeoAsstGui/Resources/Localizations/ko-kr.xaml b/src/MeoAsstGui/Resources/Localizations/ko-kr.xaml index d0d3c438e6..08b622a4a5 100644 --- a/src/MeoAsstGui/Resources/Localizations/ko-kr.xaml +++ b/src/MeoAsstGui/Resources/Localizations/ko-kr.xaml @@ -119,6 +119,7 @@ 팁: 여기에서 자동으로 감지됩니다. 오류가 있는 경우 다시 수정을 시도할 수 있습니다. 그렇지 않으면 직접 입력할 필요가 없습니다. adb 경로 (상대/절대) 연결 주소 + 처음 사용할 때는 자동으로 작성되며, 문제가 있으면 수동으로 수정하십시오 연결 사전 설정 @@ -327,9 +328,10 @@ MAA 공식 웹사이트 소스 코드: GitHub 자동 작전 작업 공유 QQ그룹 - QQ그룹1 (만원) + QQ그룹1 QQ그룹2 QQ그룹3 + (만원) 자주 묻는 질문 문제 피드백 diff --git a/src/MeoAsstGui/Resources/Localizations/pallas.xaml b/src/MeoAsstGui/Resources/Localizations/pallas.xaml index 2ac7a0dfb0..f796b526f4 100644 --- a/src/MeoAsstGui/Resources/Localizations/pallas.xaml +++ b/src/MeoAsstGui/Resources/Localizations/pallas.xaml @@ -119,6 +119,7 @@ 🍸🍻🍻🍸🍸🍻💃🍻🍸🍷🍸🍷🍷💃🍸🍻💃🍷🍺🍺🍸🍷🕺🍷🍷🍷🕺🍻🍷🍸💃🕺🍸🍷🍺 🕺💃🍸🍷🍸💃🍸 🍻🕺🍻 + 🍷🍷🍷🍺🍺🍻💃🍻🍺🍺🍷🍻🕺🍻🕺💃🕺🍸💃🍸🍷🍷🍺🕺🍸 🍸🍷🍻 @@ -327,9 +328,10 @@ 🍸🍷🍺🍺 💃🍺💃🍻💃 🕺🍷🍸🍺🍷🕺🍺 - 🍻🍺🍻🍷 + 🍻🍺 🍷💃 🍺🍻 + 🍻🍷 🍷💃🕺 🍺💃🕺 diff --git a/src/MeoAsstGui/Resources/Localizations/zh-cn.xaml b/src/MeoAsstGui/Resources/Localizations/zh-cn.xaml index 39b0bd8cca..ac50701ad2 100644 --- a/src/MeoAsstGui/Resources/Localizations/zh-cn.xaml +++ b/src/MeoAsstGui/Resources/Localizations/zh-cn.xaml @@ -119,6 +119,7 @@ 小提示:这里会自动检测的,若出现问题可再尝试修改,否则不需要自行填写 adb 路径 (相对/绝对) 连接地址 + 第一次使用会自动填写,若遇到问题可尝试手动修改 连接配置 @@ -327,9 +328,10 @@ MAA 官网 源码:GitHub 自动战斗作业分享 Q 群 - 一群(已满) + 一群 二群 三群 + (已满) 常见问题 问题反馈 diff --git a/src/MeoAsstGui/Resources/Localizations/zh-tw.xaml b/src/MeoAsstGui/Resources/Localizations/zh-tw.xaml index b15b1ea77e..64a92df639 100644 --- a/src/MeoAsstGui/Resources/Localizations/zh-tw.xaml +++ b/src/MeoAsstGui/Resources/Localizations/zh-tw.xaml @@ -119,6 +119,7 @@ 小提示:這裡會自動檢測的,若出現問題可再嘗試修改,否則不需要自行填寫 adb 路徑 (相對/絕對) 連接地址 + 第一次使用會自動填寫,若遇到問題可嘗試手動修改 連接配置 @@ -327,9 +328,10 @@ MAA 官網 源碼:GitHub 自動戰鬥作業分享 Q 群 - 一群(已滿) + 一群 二群 三群 + (已滿) 常見問題 問題回饋 diff --git a/src/MeoAsstGui/UserControl/AboutUserControl.xaml b/src/MeoAsstGui/UserControl/AboutUserControl.xaml index 1a38f38791..6771b59b4a 100644 --- a/src/MeoAsstGui/UserControl/AboutUserControl.xaml +++ b/src/MeoAsstGui/UserControl/AboutUserControl.xaml @@ -48,13 +48,20 @@ HorizontalAlignment="Center" VerticalAlignment="Center" Style="{StaticResource TextBlockDefault}"> - + + + + +