js,0.6或者1.0渲染精度 (#559)

* js,OCR摩拉

摩拉数值输出到本地,最后增加返回游戏界面

* js,精度切换

先就做这些
This commit is contained in:
JJMdzh
2025-04-12 10:15:21 +08:00
committed by GitHub
parent 2c55aeee60
commit 198b395b4d
4 changed files with 59 additions and 0 deletions

View File

@@ -158,5 +158,7 @@ async function recognizeTextInRegion(ocrRegion, timeout = 5000) {
} else { } else {
log.warn("未能识别到角色菜单或天赋,跳过摩拉数值识别。"); log.warn("未能识别到角色菜单或天赋,跳过摩拉数值识别。");
} }
await sleep(500);
await genshin.returnMainUi();
})(); })();

View File

@@ -0,0 +1,33 @@
(async function () {
setGameMetrics(1920, 1080, 1);
await genshin.returnMainUi();
renderingPrecision=settings.Rendering || "0.6"
if (renderingPrecision === "0.6") {
keyPress("Escape");
await sleep(1500);
click(45, 820);
await sleep(1500);
click(165, 290);
await sleep(500);
click(1625, 605);
await sleep(500);
click(1625, 635);
await sleep(500);
log.info("已切换0.6");
} else if (renderingPrecision === "1.0") {
keyPress("Escape");
await sleep(1500);
click(45, 820);
await sleep(1500);
click(165, 290);
await sleep(500);
click(1625, 605);
await sleep(500);
click(1625, 800);
await sleep(500);
log.info("已切换至1.0");
} else {
log.error("未知的渲染精度值");
}
await genshin.returnMainUi();
})();

View File

@@ -0,0 +1,13 @@
{
"manifest_version": 1,
"name": "选择精度",
"version": "1.0",
"description": "暂时0.6或1.0精度切换",
"authors": [
{
"name": "吉吉喵"
}
],
"settings_ui": "settings.json",
"main": "main.js"
}

View File

@@ -0,0 +1,11 @@
[
{
"name": "Rendering",
"type": "select",
"label": "渲染精度默认0.6",
"options": [
"0.6",
"1.0",
]
}
]