From 19284507ee8b0da9a432c27a4a1e502e8438f5cc Mon Sep 17 00:00:00 2001 From: MistEO Date: Mon, 23 May 2022 23:16:23 +0800 Subject: [PATCH] =?UTF-8?q?perf.=E7=AE=80=E5=8D=95=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BA=86=E4=B8=80=E7=82=B9=E8=87=AA=E5=8A=A8=E6=88=98=E6=96=97?= =?UTF-8?q?=E7=9A=84=E9=80=BB=E8=BE=91=EF=BC=8C`=E7=9B=90=E9=A3=8E?= =?UTF-8?q?=E6=BA=B6=E6=B4=9E`=2030=20=E5=86=99=E4=BA=86=E4=B8=80=E5=8D=8A?= =?UTF-8?q?=E6=91=86=E7=83=82=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/copilot/YanFengRongDong-30.json | 170 +++++++++++++++++++++-- resource/tasks.json | 6 +- src/MeoAssistant/BattleProcessTask.cpp | 9 +- 3 files changed, 172 insertions(+), 13 deletions(-) diff --git a/resource/copilot/YanFengRongDong-30.json b/resource/copilot/YanFengRongDong-30.json index 75d9a2c21c..9154a5e614 100644 --- a/resource/copilot/YanFengRongDong-30.json +++ b/resource/copilot/YanFengRongDong-30.json @@ -2,7 +2,7 @@ "minimum_required": "v4.0", "desc": { "title": "《全自动危机合约 30》", - "details": "作业抄自 https://www.bilibili.com/video/BV1mF411L7PF" + "details": "作业抄自 https://www.bilibili.com/video/BV1mF411L7PF。没写完,摆烂了" }, "stage_name": "obt/rune/level_rune_11-01", "opers": [ @@ -33,7 +33,7 @@ }, { "name": "卡夫卡", - "skill": 2 + "skill": 1 }, { "name": "极境", @@ -168,11 +168,6 @@ ], "direction": "左" }, - { - "kills": 15, - "type": "撤退", - "name": "号角" - }, { "name": "风笛", "location": [ @@ -181,14 +176,171 @@ ], "direction": "上" }, + { + "type": "撤退", + "name": "号角" + }, { "pre_delay": 5000, "name": "傀影", "location": [ 9, - 3 + 4 + ], + "direction": "左" + }, + { + "pre_delay": 4000, + "type": "撤退", + "name": "傀影" + }, + { + "name": "银灰", + "location": [ + 7, + 1 ], "direction": "下" + }, + { + "name": "耀骑士临光", + "location": [ + 3, + 5 + ], + "direction": "左" + }, + { + "name": "风笛", + "type": "技能" + }, + { + "pre_delay": 3000, + "name": "极境", + "type": "撤退" + }, + { + "name": "卡夫卡", + "location": [ + 4, + 5 + ], + "direction": "左" + }, + { + "name": "耀骑士临光", + "type": "撤退" + }, + { + "name": "卡夫卡", + "type": "撤退" + }, + { + "name": "傀影", + "location": [ + 4, + 4 + ], + "direction": "下" + }, + { + "name": "温蒂", + "location": [ + 10, + 4 + ], + "direction": "左" + }, + { + "kills": 18, + "name": "风笛", + "type": "撤退" + }, + { + "name": "桃金娘", + "type": "撤退" + }, + { + "name": "傀影", + "location": [ + 3, + 5 + ], + "direction": "左" + }, + { + "pre_delay": 1000, + "name": "傀影", + "type": "撤退" + }, + { + "name": "号角", + "location": [ + 6, + 1 + ], + "direction": "下" + }, + { + "name": "卡夫卡", + "location": [ + 3, + 5 + ], + "direction": "左" + }, + { + "name": "卡夫卡", + "type": "撤退" + }, + { + "name": "阿", + "location": [ + 3, + 1 + ], + "direction": "右" + }, + { + "pre_delay": 18000, + "name": "铃兰", + "type": "技能" + }, + { + "name": "号角", + "type": "技能" + }, + { + "name": "阿", + "type": "技能" + }, + { + "name": "阿", + "type": "技能" + }, + { + "name": "傀影", + "location": [ + 8, + 1 + ], + "direction": "左" + }, + { + "name": "工程蓄水炮", + "location": [ + 9, + 4 + ], + "direction": "左" + }, + { + "name": "温蒂", + "type": "技能" + }, + { + "name": "温蒂", + "type": "技能" } ] -} +} \ No newline at end of file diff --git a/resource/tasks.json b/resource/tasks.json index 2ddcbd0159..2dc1fc36b7 100644 --- a/resource/tasks.json +++ b/resource/tasks.json @@ -4534,13 +4534,15 @@ ], "cache": false, "action": "ClickSelf", - "preDelay": 500, - "rearDelay": 500, "rectMove": [ 0, -110, 90, 90 + ], + "next": [ + "BattleSkillReadyOnClick", + "Stop" ] }, "BattleUseOper": { diff --git a/src/MeoAssistant/BattleProcessTask.cpp b/src/MeoAssistant/BattleProcessTask.cpp index 070e10f8c7..6bf389a627 100644 --- a/src/MeoAssistant/BattleProcessTask.cpp +++ b/src/MeoAssistant/BattleProcessTask.cpp @@ -318,11 +318,12 @@ bool asst::BattleProcessTask::do_action(const BattleAction& action) bool asst::BattleProcessTask::wait_condition(const BattleAction& action) { + cv::Mat image; while (m_kills < action.kills) { if (need_exit()) { return false; } - const auto& image = m_ctrler->get_image(); + image = m_ctrler->get_image(); BattleImageAnalyzer analyzer(image); analyzer.set_target(BattleImageAnalyzer::Target::Kills); @@ -344,7 +345,7 @@ bool asst::BattleProcessTask::wait_condition(const BattleAction& action) if (need_exit()) { return false; } - const auto& image = m_ctrler->get_image(); + image = m_ctrler->get_image(); update_opers_info(image); if (auto iter = m_cur_opers_info.find(name); @@ -356,6 +357,10 @@ bool asst::BattleProcessTask::wait_condition(const BattleAction& action) std::this_thread::yield(); }; } + if (image.empty()) { + image = m_ctrler->get_image(); + try_possible_skill(image); + } return true; }