Skip to content

Commit

Permalink
Merge pull request icegreentee#458 from segfault-bilibili/rollup-7.4.1
Browse files Browse the repository at this point in the history
【7.4.1】镜层周回误入心魔战时返回
  • Loading branch information
segfault-bilibili committed Apr 16, 2024
2 parents acfc8ed + 0717346 commit fa681e4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
23 changes: 21 additions & 2 deletions floatUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -8080,7 +8080,7 @@ function algo_init() {
}

if (hasScreenCaptureError) {
toastLog("通过录屏API截图时出错\n请使用root或adb权限截屏");
toastLog("通过录屏API截图时出错\n请尝试重启系统,或尝试使用root或adb权限截屏");
stopThread();
}

Expand Down Expand Up @@ -8253,7 +8253,9 @@ function algo_init() {
hasScreenCaptureError = true;
dialogs.alert("截屏出错",
"通过录屏API截屏时出错。\n"
+"请尝试在识图自动战斗脚本设置中开启\"使用root或adb权限截屏\",或者换一个模拟器(比如安卓9的MuMu)再试试。");
+"请尝试重启系统;\n"
+"或者可以尝试在识图自动战斗脚本设置中开启\"使用root或adb权限截屏\";\n"
+"或者换一个模拟器(比如安卓12的MuMu)再试试。");
throw e;
}
}
Expand Down Expand Up @@ -12274,6 +12276,9 @@ function algo_init() {
if (isMirrorsEntranceButtonPresent(screenshot)) {
log("已回到首页");
knownClickPos = clickSets.enterMirrors;
} else if (isKimochiResults(screenshot)) {
log("误入心魔战战绩");
knownClickPos = clickSets.back;
} else if (isMirrorsTop(screenshot)) {
log("镜层首页");
knownClickPos = clickSets.mirrorsTop;
Expand Down Expand Up @@ -13258,6 +13263,14 @@ function algo_init() {
topLeft: {x: 801, y: 374, pos: "center"},
bottomRight: {x: 832, y: 405, pos: "center"},
},
kimochiResults1: {
topLeft: {x: 16, y: 170, pos: "top"},
bottomRight: {x: 32, y: 196, pos: "top"},
},
kimochiResults2: {
topLeft: {x: 340, y: 170, pos: "top"},
bottomRight: {x: 700, y: 196, pos: "top"},
},
}
const knownQuestColors = {
playerSupport: "#7363a0",
Expand All @@ -13267,6 +13280,8 @@ function algo_init() {
charaExpEventLvUp: "#f26c84",
playerLvUp: "#b28750",
resultExpItem: "#b28750",
kimochiResults1: "#a47121",
kimochiResults2: "#a47121",
}
function detectPureColor(screenshot, type, threshold) {
let area = getConvertedArea(knownQuestCoords[type]);
Expand Down Expand Up @@ -13296,6 +13311,10 @@ function algo_init() {
let found = ["followPrompt", "charaExpEventLvUp", "resultExpItem"].find((type) => detectPureColor(screenshot, type, threshold)) ? true : false;
return found;
}
function isKimochiResults(screenshot) {
let threshold = parseInt(limit.openUpPureColorThreshold);
return [1, 2].reduce((prev, cur) => prev && detectPureColor(screenshot, `kimochiResults${cur}`, threshold), true);
}

function taskOpenUp() {
if (!limit.privilege && (limit.useCVAutoBattle && limit.rootScreencap)) {
Expand Down
2 changes: 1 addition & 1 deletion project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"build"
],
"packageName": "top.momoe.auto",
"versionName": "7.4.0",
"versionName": "7.4.1",
"versionInfo": "",
"versionCode": 1,
"icon":"./images/icon.png",
Expand Down
Loading

0 comments on commit fa681e4

Please sign in to comment.