mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 09:50:40 +08:00
merge.合并master
This commit is contained in:
@@ -685,6 +685,26 @@
|
||||
650,
|
||||
230
|
||||
],
|
||||
"next": [
|
||||
"FightMissionFailed",
|
||||
"EndOfAction",
|
||||
"StartToWakeUp",
|
||||
"OfflineConfirm",
|
||||
"StartButton1"
|
||||
]
|
||||
},
|
||||
"FightMissionFailed": {
|
||||
"algorithm": "OcrDetect",
|
||||
"text": [
|
||||
"任务失败"
|
||||
],
|
||||
"action": "ClickSelf",
|
||||
"roi": [
|
||||
36,
|
||||
226,
|
||||
482,
|
||||
269
|
||||
],
|
||||
"next": [
|
||||
"EndOfAction",
|
||||
"StartToWakeUp",
|
||||
@@ -899,6 +919,26 @@
|
||||
255
|
||||
],
|
||||
"next": [
|
||||
"RecruitBeginLoading",
|
||||
"RecruitBegin"
|
||||
]
|
||||
},
|
||||
"RecruitBeginLoading": {
|
||||
"algorithm": "OcrDetect",
|
||||
"action": "doNothing",
|
||||
"text": [
|
||||
"正在提交",
|
||||
"反馈至神经"
|
||||
],
|
||||
"roi": [
|
||||
700,
|
||||
600,
|
||||
300,
|
||||
120
|
||||
],
|
||||
"next": [
|
||||
"RecruitBeginLoading",
|
||||
"Recruit",
|
||||
"RecruitBegin"
|
||||
]
|
||||
},
|
||||
@@ -913,6 +953,27 @@
|
||||
420
|
||||
],
|
||||
"next": [
|
||||
"RecruitFinishLoading",
|
||||
"RecruitFinish",
|
||||
"RecruitSkip",
|
||||
"RecruitSkipWithoutButton"
|
||||
]
|
||||
},
|
||||
"RecruitFinishLoading":{
|
||||
"algorithm": "OcrDetect",
|
||||
"action": "doNothing",
|
||||
"text": [
|
||||
"正在提交",
|
||||
"反馈至神经"
|
||||
],
|
||||
"roi": [
|
||||
700,
|
||||
600,
|
||||
300,
|
||||
120
|
||||
],
|
||||
"next": [
|
||||
"RecruitFinishLoading",
|
||||
"RecruitFinish",
|
||||
"RecruitSkip",
|
||||
"RecruitSkipWithoutButton"
|
||||
@@ -1692,6 +1753,17 @@
|
||||
"Stop"
|
||||
]
|
||||
},
|
||||
"RecruitCheckTimeUnreduced":{
|
||||
"action": "Stop",
|
||||
"template": "RecruitTimeReduce.png",
|
||||
"Doc": "检查时间是不是没有调整过",
|
||||
"roi": [
|
||||
350,
|
||||
150,
|
||||
200,
|
||||
150
|
||||
]
|
||||
},
|
||||
"RecruitConfirm": {
|
||||
"action": "ClickSelf",
|
||||
"roi": [
|
||||
@@ -1701,6 +1773,25 @@
|
||||
80
|
||||
],
|
||||
"next": [
|
||||
"RecruitConfirmLoading",
|
||||
"RecruitFlag"
|
||||
]
|
||||
},
|
||||
"RecruitConfirmLoading":{
|
||||
"algorithm": "OcrDetect",
|
||||
"action": "doNothing",
|
||||
"text": [
|
||||
"正在提交",
|
||||
"反馈至神经"
|
||||
],
|
||||
"roi": [
|
||||
700,
|
||||
600,
|
||||
300,
|
||||
120
|
||||
],
|
||||
"next": [
|
||||
"RecruitConfirmLoading",
|
||||
"RecruitFlag"
|
||||
]
|
||||
},
|
||||
@@ -1906,6 +1997,27 @@
|
||||
150
|
||||
],
|
||||
"next": [
|
||||
"DroneConfirmLoading",
|
||||
"DeliverableOrder",
|
||||
"DroneAssist-Trade-Stop",
|
||||
"DroneAssistMfg"
|
||||
]
|
||||
},
|
||||
"DroneConfirmLoading": {
|
||||
"algorithm": "OcrDetect",
|
||||
"action": "doNothing",
|
||||
"text": [
|
||||
"正在提交",
|
||||
"反馈至神经"
|
||||
],
|
||||
"roi": [
|
||||
700,
|
||||
600,
|
||||
300,
|
||||
120
|
||||
],
|
||||
"next": [
|
||||
"DroneConfirmLoading",
|
||||
"DeliverableOrder",
|
||||
"DroneAssist-Trade-Stop",
|
||||
"DroneAssistMfg"
|
||||
@@ -3058,6 +3170,25 @@
|
||||
"ClueGiveTo1stConfirm"
|
||||
]
|
||||
},
|
||||
"ClueGiveLoading": {
|
||||
"algorithm": "OcrDetect",
|
||||
"action": "doNothing",
|
||||
"text": [
|
||||
"正在提交",
|
||||
"反馈至神经"
|
||||
],
|
||||
"roi": [
|
||||
700,
|
||||
600,
|
||||
300,
|
||||
120
|
||||
],
|
||||
"next": [
|
||||
"ClueGiveLoading",
|
||||
"SelectClue",
|
||||
"CloseSendClue"
|
||||
]
|
||||
},
|
||||
"ClueGiveTo1st": {
|
||||
"template": "ClusCanBeSent.png",
|
||||
"action": "DoNothing",
|
||||
@@ -3086,6 +3217,7 @@
|
||||
160
|
||||
],
|
||||
"next": [
|
||||
"ClueGiveLoading",
|
||||
"SelectClue",
|
||||
"CloseSendClue"
|
||||
]
|
||||
@@ -3118,6 +3250,7 @@
|
||||
160
|
||||
],
|
||||
"next": [
|
||||
"ClueGiveLoading",
|
||||
"SelectClue",
|
||||
"CloseSendClue"
|
||||
]
|
||||
@@ -3150,6 +3283,7 @@
|
||||
160
|
||||
],
|
||||
"next": [
|
||||
"ClueGiveLoading",
|
||||
"SelectClue",
|
||||
"CloseSendClue"
|
||||
]
|
||||
@@ -3182,6 +3316,7 @@
|
||||
160
|
||||
],
|
||||
"next": [
|
||||
"ClueGiveLoading",
|
||||
"SelectClue",
|
||||
"CloseSendClue"
|
||||
]
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#include "Resource.h"
|
||||
#include "OcrImageAnalyzer.h"
|
||||
#include "Controller.h"
|
||||
#include "RecruitImageAnalyzer.h"
|
||||
#include "ProcessTask.h"
|
||||
#include "RecruitCalcTask.h"
|
||||
|
||||
@@ -108,35 +107,42 @@ bool asst::AutoRecruitTask::recruit_index(size_t index)
|
||||
|
||||
bool asst::AutoRecruitTask::calc_and_recruit()
|
||||
{
|
||||
RecruitCalcTask recurit_task(m_callback, m_callback_arg, m_task_chain);
|
||||
recurit_task.set_param(m_select_level, true)
|
||||
RecruitCalcTask recruit_task(m_callback, m_callback_arg, m_task_chain);
|
||||
recruit_task.set_param(m_select_level, true)
|
||||
.set_retry_times(m_retry_times)
|
||||
.set_exit_flag(m_exit_flag)
|
||||
.set_ctrler(m_ctrler)
|
||||
.set_status(m_status);
|
||||
|
||||
// 识别错误,放弃这个公招位,直接返回
|
||||
if (!recurit_task.run()) {
|
||||
if (!recruit_task.run()) {
|
||||
callback(AsstMsg::SubTaskError, basic_info());
|
||||
click_return_button();
|
||||
return true;
|
||||
}
|
||||
|
||||
int maybe_level = recurit_task.get_maybe_level();
|
||||
int maybe_level = recruit_task.get_maybe_level();
|
||||
if (need_exit()) {
|
||||
return false;
|
||||
}
|
||||
// 尝试刷新
|
||||
if (m_need_refresh && maybe_level == 3
|
||||
&& !recurit_task.get_has_special_tag()
|
||||
&& recurit_task.get_has_refresh()) {
|
||||
&& !recruit_task.get_has_special_tag()
|
||||
&& recruit_task.get_has_refresh()) {
|
||||
if (refresh()) {
|
||||
return calc_and_recruit();
|
||||
}
|
||||
}
|
||||
// 如果时间没调整过,那 tag 十有八九也没选,重新试一次
|
||||
// 造成时间没调的原因可见: https://github.com/MaaAssistantArknights/MaaAssistantArknights/pull/300#issuecomment-1073287984
|
||||
if (check_time_unreduced()) {
|
||||
return calc_and_recruit();
|
||||
}
|
||||
|
||||
if (need_exit()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (std::find(m_confirm_level.cbegin(), m_confirm_level.cend(), maybe_level) != m_confirm_level.cend()) {
|
||||
if (!confirm()) {
|
||||
return false;
|
||||
@@ -147,6 +153,12 @@ bool asst::AutoRecruitTask::calc_and_recruit()
|
||||
}
|
||||
return true;
|
||||
}
|
||||
bool asst::AutoRecruitTask::check_time_unreduced()
|
||||
{
|
||||
ProcessTask task(*this, { "RecruitCheckTimeUnreduced" });
|
||||
task.set_retry_times(1);
|
||||
return task.run();
|
||||
}
|
||||
|
||||
bool asst::AutoRecruitTask::check_recruit_home_page()
|
||||
{
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace asst
|
||||
bool recruit_index(size_t index);
|
||||
bool calc_and_recruit();
|
||||
bool check_recruit_home_page();
|
||||
bool check_time_unreduced();
|
||||
bool recruit_now();
|
||||
bool confirm();
|
||||
bool refresh();
|
||||
|
||||
@@ -168,12 +168,17 @@ void asst::StageDropsTaskPlugin::upload_to_penguin()
|
||||
callback(AsstMsg::SubTaskStart, info);
|
||||
|
||||
// Doc: https://developer.penguin-stats.io/public-api/api-v2-instruction/report-api
|
||||
std::string stage_id = m_cur_drops["stage"]["stageId"].as_string();
|
||||
std::string stage_id = m_cur_drops.get("stage", "stageId", std::string());
|
||||
if (stage_id.empty()) {
|
||||
info["why"] = "未知关卡";
|
||||
callback(AsstMsg::SubTaskError, info);
|
||||
return;
|
||||
}
|
||||
if (m_cur_drops.get("stars", 0) != 3) {
|
||||
info["why"] = "非三星作战";
|
||||
callback(AsstMsg::SubTaskError, info);
|
||||
return;
|
||||
}
|
||||
json::value body;
|
||||
body["server"] = m_server;
|
||||
body["stageId"] = stage_id;
|
||||
|
||||
Reference in New Issue
Block a user