From 52280e491f94e1b9ba159a70724492d1e37d9959 Mon Sep 17 00:00:00 2001 From: MistEO Date: Thu, 12 Aug 2021 22:20:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=87=A0=E4=B8=AA?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E4=B8=8A=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MeoAssistance/include/Assistance.h | 10 +++++----- MeoAssistance/include/AsstCaller.h | 2 +- MeoAssistance/src/Assistance.cpp | 26 ++++++++++++++++---------- MeoAssistance/src/AsstCaller.cpp | 5 +++-- MeoAsstGui/MainWindow.xaml.cs | 15 +++++++++++---- 5 files changed, 36 insertions(+), 22 deletions(-) diff --git a/MeoAssistance/include/Assistance.h b/MeoAssistance/include/Assistance.h index 7dcdfcaa4a..9175d575ef 100644 --- a/MeoAssistance/include/Assistance.h +++ b/MeoAssistance/include/Assistance.h @@ -28,16 +28,16 @@ namespace asst { std::optional catch_emulator(const std::string& emulator_name = std::string()); // 开始刷理智 - void start_sanity(); + bool start_sanity(); // 开始访问基建 - void start_visit(); + bool start_visit(); // 开始公开招募操作 - void start_open_recruit(const std::vector& required_level, bool set_time = true); + bool start_open_recruit(const std::vector& required_level, bool set_time = true); // 开始匹配任务,调试用 - void start_match_task(const std::string& task, int retry_times = ProcessTaskRetryTimesDefault, bool block = true); + bool start_match_task(const std::string& task, int retry_times = ProcessTaskRetryTimesDefault, bool block = true); // 开始OCR测试,调试用 - void start_ocr_test_task(std::vector text_vec, bool need_click = false); + bool start_ocr_test_task(std::vector text_vec, bool need_click = false); void stop(bool block = true); diff --git a/MeoAssistance/include/AsstCaller.h b/MeoAssistance/include/AsstCaller.h index 5b057d3248..77429eeca6 100644 --- a/MeoAssistance/include/AsstCaller.h +++ b/MeoAssistance/include/AsstCaller.h @@ -14,7 +14,7 @@ extern "C" { MEOAPI_PORT asst::Assistance* AsstCreateEx(AsstCallback callback, void* custom_arg); MEOAPI_PORT void AsstDestory(asst::Assistance* p_asst); MEOAPI_PORT bool AsstCatchEmulator(asst::Assistance* p_asst); - MEOAPI_PORT void AsstStart(asst::Assistance* p_asst, const char* task); + MEOAPI_PORT bool AsstStart(asst::Assistance* p_asst, const char* task); MEOAPI_PORT void AsstStop(asst::Assistance* p_asst); MEOAPI_PORT bool AsstSetParam(asst::Assistance* p_asst, const char* type, const char* param, const char* value); MEOAPI_PORT bool AsstRunOpenRecruit(asst::Assistance* p_asst, const int required_level[], bool set_time); diff --git a/MeoAssistance/src/Assistance.cpp b/MeoAssistance/src/Assistance.cpp index 9588d2d0fe..aea3c45212 100644 --- a/MeoAssistance/src/Assistance.cpp +++ b/MeoAssistance/src/Assistance.cpp @@ -137,23 +137,23 @@ std::optional Assistance::catch_emulator(const std::string& emulato } } -void asst::Assistance::start_sanity() +bool asst::Assistance::start_sanity() { - start_match_task("SanityBegin", ProcessTaskRetryTimesDefault); + return start_match_task("SanityBegin", ProcessTaskRetryTimesDefault); } -void asst::Assistance::start_visit() +bool asst::Assistance::start_visit() { - start_match_task("VisitBegin", ProcessTaskRetryTimesDefault); + return start_match_task("VisitBegin", ProcessTaskRetryTimesDefault); } -void Assistance::start_match_task(const std::string& task, int retry_times, bool block) +bool Assistance::start_match_task(const std::string& task, int retry_times, bool block) { DebugTraceFunction; DebugTrace("Start |", task, block ? "block" : "non block"); if (!m_thread_idle || !m_inited) { - return; + return false; } std::unique_lock lock; @@ -168,14 +168,16 @@ void Assistance::start_match_task(const std::string& task, int retry_times, bool m_thread_idle = false; m_condvar.notify_one(); + + return true; } -void Assistance::start_ocr_test_task(std::vector text_vec, bool need_click) +bool Assistance::start_ocr_test_task(std::vector text_vec, bool need_click) { DebugTraceFunction; if (!m_thread_idle || !m_inited) { - return; + return false; } std::unique_lock lock(m_mutex); @@ -186,14 +188,16 @@ void Assistance::start_ocr_test_task(std::vector text_vec, bool nee m_thread_idle = false; m_condvar.notify_one(); + + return true; } -void Assistance::start_open_recruit(const std::vector& required_level, bool set_time) +bool Assistance::start_open_recruit(const std::vector& required_level, bool set_time) { DebugTraceFunction; if (!m_thread_idle || !m_inited) { - return; + return false; } std::unique_lock lock(m_mutex); @@ -206,6 +210,8 @@ void Assistance::start_open_recruit(const std::vector& required_level, bool m_thread_idle = false; m_condvar.notify_one(); + + return true; } void Assistance::stop(bool block) diff --git a/MeoAssistance/src/AsstCaller.cpp b/MeoAssistance/src/AsstCaller.cpp index 03254d893f..f142fe71f9 100644 --- a/MeoAssistance/src/AsstCaller.cpp +++ b/MeoAssistance/src/AsstCaller.cpp @@ -73,12 +73,13 @@ bool AsstCatchEmulator(asst::Assistance* p_asst) } } -void AsstStart(asst::Assistance* p_asst, const char* task) +bool AsstStart(asst::Assistance* p_asst, const char* task) { if (p_asst == NULL) { + return false; } - p_asst->start_match_task(task, asst::Assistance::ProcessTaskRetryTimesDefault); + return p_asst->start_match_task(task, asst::Assistance::ProcessTaskRetryTimesDefault); } void AsstStop(asst::Assistance* p_asst) diff --git a/MeoAsstGui/MainWindow.xaml.cs b/MeoAsstGui/MainWindow.xaml.cs index 9f7986ab2d..39ac238760 100644 --- a/MeoAsstGui/MainWindow.xaml.cs +++ b/MeoAsstGui/MainWindow.xaml.cs @@ -21,7 +21,7 @@ namespace MeoAsstGui [DllImport("MeoAssistance.dll")] static private extern bool AsstCatchEmulator(IntPtr ptr); - [DllImport("MeoAssistance.dll")] static private extern void AsstStart(IntPtr ptr, string task); + [DllImport("MeoAssistance.dll")] static private extern bool AsstStart(IntPtr ptr, string task); [DllImport("MeoAssistance.dll")] static private extern void AsstStop(IntPtr ptr); @@ -113,7 +113,7 @@ namespace MeoAsstGui case AsstMsg.TaskStop: { string task_chain = detail["task_chain"].ToString(); - if (task_chain != "SanityBegin") + if (task_chain != "SanityBegin" && task_chain != "VisitBegin") { break; } @@ -206,8 +206,12 @@ namespace MeoAsstGui private void button_Click_startSanity(object sender, RoutedEventArgs e) { bool catched = AsstCatchEmulator(p_asst); + exec_times.Content = ""; catch_status.Content = "鎹曡幏妯℃嫙鍣ㄧ獥鍙o細" + catched; - AsstStart(p_asst, "SanityBegin"); + if (AsstStart(p_asst, "SanityBegin")) + { + exec_times.Content = ""; + } if (checkBox_useStone.IsChecked == true) { stone_times.Content = "宸茬鐭 0 涓"; @@ -263,7 +267,10 @@ namespace MeoAsstGui { bool catched = AsstCatchEmulator(p_asst); catch_status.Content = "鎹曡幏妯℃嫙鍣ㄧ獥鍙o細" + catched; - AsstStart(p_asst, "VisitBegin"); + if (AsstStart(p_asst, "VisitBegin")) + { + exec_times.Content = ""; + } } private void checkBox_maxTimes_Checked(object sender, RoutedEventArgs e) From 046b5c3ee08ff63ea5e28c25cedac402c4c6dd3d Mon Sep 17 00:00:00 2001 From: MistEO Date: Thu, 12 Aug 2021 22:36:28 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=B7=E7=90=86?= =?UTF-8?q?=E6=99=BA=E6=B5=81=E7=A8=8B=EF=BC=8C=E6=9B=B4=E6=96=B0beta06.02?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MeoAssistance/include/Version.h | 2 +- MeoAsstGui/MeoAsstGui.csproj | 2 +- resource/config.json | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/MeoAssistance/include/Version.h b/MeoAssistance/include/Version.h index 869f6ce41f..fa02f06cab 100644 --- a/MeoAssistance/include/Version.h +++ b/MeoAssistance/include/Version.h @@ -1,5 +1,5 @@ #pragma once namespace asst { - constexpr static const char* Version = "release.beta.06.01"; + constexpr static const char* Version = "release.beta.06.02"; } \ No newline at end of file diff --git a/MeoAsstGui/MeoAsstGui.csproj b/MeoAsstGui/MeoAsstGui.csproj index 45c6b3189c..bb6a7bfc67 100644 --- a/MeoAsstGui/MeoAsstGui.csproj +++ b/MeoAsstGui/MeoAsstGui.csproj @@ -29,7 +29,7 @@ false true 0 - 0.6.1.0 + 0.6.2.0 false true diff --git a/resource/config.json b/resource/config.json index df462fcebb..4ea6f000c7 100644 --- a/resource/config.json +++ b/resource/config.json @@ -255,10 +255,11 @@ ] }, "WaitAfterPRTS": { - "rearDelay": 5000, + "rearDelay": 3000, "algorithm": "justreturn", "type": "doNothing", "next": [ + "PRTS", "EndOfAction", "ClickCornerAfterPRTS" ] @@ -279,7 +280,8 @@ "StartButton1", "StartButton2", "UseMedicine", - "UseStone" + "UseStone", + "ClickCornerAfterPRTS" ] }, "EndOfAction": { @@ -305,7 +307,8 @@ "StartButton1", "StartButton2", "UseMedicine", - "UseStone" + "UseStone", + "EndOfAction" ] }, "Loading": { From 334d41ff0731458a21c1eb05a1afca06c085d883 Mon Sep 17 00:00:00 2001 From: MistEO Date: Sat, 14 Aug 2021 13:09:57 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dretry=E4=BC=9A=E6=B8=85?= =?UTF-8?q?=E7=A9=BA=E6=AC=A1=E6=95=B0=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=81?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B5=81=E7=A8=8B=E9=98=88=E5=80=BC=EF=BC=8C?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC=E5=8F=B7beta06.03?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MeoAssistance/include/Version.h | 2 +- MeoAsstGui/MainWindow.xaml.cs | 4 ++-- MeoAsstGui/MeoAsstGui.csproj | 2 +- resource/config.json | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/MeoAssistance/include/Version.h b/MeoAssistance/include/Version.h index fa02f06cab..da751c3b89 100644 --- a/MeoAssistance/include/Version.h +++ b/MeoAssistance/include/Version.h @@ -1,5 +1,5 @@ #pragma once namespace asst { - constexpr static const char* Version = "release.beta.06.02"; + constexpr static const char* Version = "release.beta.06.03"; } \ No newline at end of file diff --git a/MeoAsstGui/MainWindow.xaml.cs b/MeoAsstGui/MainWindow.xaml.cs index 39ac238760..ebc728b07a 100644 --- a/MeoAsstGui/MainWindow.xaml.cs +++ b/MeoAsstGui/MainWindow.xaml.cs @@ -154,7 +154,7 @@ namespace MeoAsstGui break; } ++retry_times; - button_Click_startSanity(null, null); + AsstStart(p_asst, "SanityBegin"); } else if (task_chain == "VisitBegin") { @@ -166,7 +166,7 @@ namespace MeoAsstGui break; } ++retry_times; - button_Click_visit(null, null); + AsstStart(p_asst, "VisitBegin"); } } break; diff --git a/MeoAsstGui/MeoAsstGui.csproj b/MeoAsstGui/MeoAsstGui.csproj index bb6a7bfc67..cdbc0666b5 100644 --- a/MeoAsstGui/MeoAsstGui.csproj +++ b/MeoAsstGui/MeoAsstGui.csproj @@ -29,7 +29,7 @@ false true 0 - 0.6.2.0 + 0.6.3.0 false true diff --git a/resource/config.json b/resource/config.json index 4ea6f000c7..4f5005c6ed 100644 --- a/resource/config.json +++ b/resource/config.json @@ -238,6 +238,7 @@ "template": "StartButton2.png", "type": "clickSelf", "rearDelay": 20000, + "templThreshold": 0.95, "next": [ "StartButton2", "PRTS" @@ -313,7 +314,7 @@ }, "Loading": { "template": "Loading.png", - "threshold": 0.8, + "templThreshold": 0.8, "type": "doNothing", "next": [ "StartButton1"