mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 18:47:55 +08:00
合并master
This commit is contained in:
@@ -28,19 +28,19 @@ namespace asst {
|
||||
std::optional<std::string> catch_emulator(const std::string& emulator_name = std::string());
|
||||
|
||||
// 开始刷理智
|
||||
void start_sanity();
|
||||
// 开始访问好友基建
|
||||
void start_visit();
|
||||
bool start_sanity();
|
||||
// 开始访问基建
|
||||
bool start_visit();
|
||||
|
||||
// 开始公开招募操作
|
||||
void start_open_recruit(const std::vector<int>& required_level, bool set_time = true);
|
||||
bool start_open_recruit(const std::vector<int>& required_level, bool set_time = true);
|
||||
// 开始基建换班任务
|
||||
void start_infrast();
|
||||
bool start_infrast();
|
||||
|
||||
// 开始匹配任务,调试用
|
||||
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<std::string> text_vec, bool need_click = false);
|
||||
bool start_ocr_test_task(std::vector<std::string> text_vec, bool need_click = false);
|
||||
|
||||
void stop(bool block = true);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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.03";
|
||||
}
|
||||
@@ -143,23 +143,23 @@ std::optional<std::string> 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<std::mutex> lock;
|
||||
@@ -174,14 +174,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<std::string> text_vec, bool need_click)
|
||||
bool Assistance::start_ocr_test_task(std::vector<std::string> text_vec, bool need_click)
|
||||
{
|
||||
DebugTraceFunction;
|
||||
if (!m_thread_idle || !m_inited)
|
||||
{
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::unique_lock<std::mutex> lock(m_mutex);
|
||||
@@ -192,14 +194,16 @@ void Assistance::start_ocr_test_task(std::vector<std::string> text_vec, bool nee
|
||||
|
||||
m_thread_idle = false;
|
||||
m_condvar.notify_one();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Assistance::start_open_recruit(const std::vector<int>& required_level, bool set_time)
|
||||
bool Assistance::start_open_recruit(const std::vector<int>& required_level, bool set_time)
|
||||
{
|
||||
DebugTraceFunction;
|
||||
if (!m_thread_idle || !m_inited)
|
||||
{
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::unique_lock<std::mutex> lock(m_mutex);
|
||||
@@ -212,14 +216,16 @@ void Assistance::start_open_recruit(const std::vector<int>& required_level, bool
|
||||
|
||||
m_thread_idle = false;
|
||||
m_condvar.notify_one();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void asst::Assistance::start_infrast()
|
||||
bool asst::Assistance::start_infrast()
|
||||
{
|
||||
DebugTraceFunction;
|
||||
if (!m_thread_idle || !m_inited)
|
||||
{
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::unique_lock<std::mutex> lock(m_mutex);
|
||||
@@ -233,6 +239,8 @@ void asst::Assistance::start_infrast()
|
||||
|
||||
m_thread_idle = false;
|
||||
m_condvar.notify_one();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Assistance::stop(bool block)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
@@ -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 = "捕获模拟器窗口:" + 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 = "捕获模拟器窗口:" + catched;
|
||||
AsstStart(p_asst, "VisitBegin");
|
||||
if (AsstStart(p_asst, "VisitBegin"))
|
||||
{
|
||||
exec_times.Content = "";
|
||||
}
|
||||
}
|
||||
|
||||
private void checkBox_maxTimes_Checked(object sender, RoutedEventArgs e)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>0.6.1.0</ApplicationVersion>
|
||||
<ApplicationVersion>0.6.3.0</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -146,6 +146,7 @@
|
||||
"template": "StartButton2.png",
|
||||
"type": "clickSelf",
|
||||
"rearDelay": 20000,
|
||||
"templThreshold": 0.95,
|
||||
"next": [
|
||||
"StartButton2",
|
||||
"PRTS"
|
||||
@@ -163,10 +164,11 @@
|
||||
]
|
||||
},
|
||||
"WaitAfterPRTS": {
|
||||
"rearDelay": 5000,
|
||||
"rearDelay": 3000,
|
||||
"algorithm": "justreturn",
|
||||
"type": "doNothing",
|
||||
"next": [
|
||||
"PRTS",
|
||||
"EndOfAction",
|
||||
"ClickCornerAfterPRTS"
|
||||
]
|
||||
@@ -187,7 +189,8 @@
|
||||
"StartButton1",
|
||||
"StartButton2",
|
||||
"UseMedicine",
|
||||
"UseStone"
|
||||
"UseStone",
|
||||
"ClickCornerAfterPRTS"
|
||||
]
|
||||
},
|
||||
"EndOfAction": {
|
||||
@@ -213,12 +216,13 @@
|
||||
"StartButton1",
|
||||
"StartButton2",
|
||||
"UseMedicine",
|
||||
"UseStone"
|
||||
"UseStone",
|
||||
"EndOfAction"
|
||||
]
|
||||
},
|
||||
"Loading": {
|
||||
"template": "Loading.png",
|
||||
"threshold": 0.8,
|
||||
"templThreshold": 0.8,
|
||||
"type": "doNothing",
|
||||
"next": [
|
||||
"StartButton1"
|
||||
|
||||
Reference in New Issue
Block a user