js:锄地一条龙 (#1347)

修复修改主界面判定导致的拾取失效
This commit is contained in:
mno
2025-07-15 08:16:18 +08:00
committed by GitHub
parent d28ce7fdaf
commit 726af55700
2 changed files with 5 additions and 2 deletions

View File

@@ -512,6 +512,7 @@ async function runPath(pathFilePath, map_name, whitelistKeywords, blacklistKeywo
}
return null;
}
//检查是否在主界面
async function isMainUI() {
// 修改后的图像路径
@@ -553,13 +554,15 @@ async function runPath(pathFilePath, map_name, whitelistKeywords, blacklistKeywo
// 尝试找到 F 图标
let fRes = await findFIcon(imagePath, 1102, 335, 34, 400, 200);
if (!fRes || new Date() - lastCheckMainUi > 2011) {
if (!fRes || ((new Date() - lastCheckMainUi) > 2011)) {
state.atMainUi = await isMainUI();
lastCheckMainUi = new Date();
}
if (!fRes && state.atMainUi) {
//log.info("在主界面,尝试下滑");
await keyMouseScript.runFile(`assets/滚轮下翻.json`);
}
if (!fRes) {
continue;
}