mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 10:32:19 +08:00
Improve Roguelike Recruitment
This commit is contained in:
@@ -254,6 +254,7 @@ bool asst::RoguelikeRecruitTaskPlugin::check_char(const std::string& char_name,
|
||||
|
||||
constexpr int SwipeTimes = 5;
|
||||
std::unordered_set<std::string> pre_oper_names;
|
||||
bool has_been_same = false;
|
||||
int i = 0;
|
||||
for (; i != SwipeTimes; ++i) {
|
||||
if (need_exit()) {
|
||||
@@ -278,10 +279,18 @@ bool asst::RoguelikeRecruitTaskPlugin::check_char(const std::string& char_name,
|
||||
return true;
|
||||
}
|
||||
if (pre_oper_names == oper_names) {
|
||||
Log.trace(__FUNCTION__, "| Oper list not changed, stop swiping");
|
||||
break;
|
||||
if (has_been_same) {
|
||||
Log.trace(__FUNCTION__, "| Oper list not changed for three times, stop swiping");
|
||||
break;
|
||||
}
|
||||
else {
|
||||
has_been_same = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
has_been_same = false;
|
||||
pre_oper_names = std::move(oper_names);
|
||||
}
|
||||
pre_oper_names = std::move(oper_names);
|
||||
}
|
||||
|
||||
// 没识别到目标干员,可能不在这一页,继续划动
|
||||
|
||||
Reference in New Issue
Block a user