From 690120100b24034b282081888ef0883472201818 Mon Sep 17 00:00:00 2001 From: Jamis Date: Wed, 10 Sep 2025 10:33:55 +0800 Subject: [PATCH] =?UTF-8?q?JS=E8=84=9A=E6=9C=ACAbundantOre=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E8=87=B30.7=20(#1842)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * AbundantOre v0.7 * update --- repo/js/AbundantOre/README.md | 5 +++-- repo/js/AbundantOre/main.js | 13 ++++++++----- repo/js/AbundantOre/manifest.json | 2 +- repo/js/AbundantOre/settings.json | 7 ++++++- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/repo/js/AbundantOre/README.md b/repo/js/AbundantOre/README.md index cc582bdbf..90c69e862 100644 --- a/repo/js/AbundantOre/README.md +++ b/repo/js/AbundantOre/README.md @@ -15,9 +15,9 @@ 例如填写时间`23:00~03:50`,如果我们在`23:30`开始挖矿,那么将在第二天`03:50`左右停止;如果我们在`22:30`开始挖矿,脚本会因不在预设时间范围内立即停止。 - 如果三个条件均未填写,脚本将在挖完所有的矿后停止。注意如果第一次运行这个脚本,这个过程可能持续十数个小时。 + 如果三个条件均未填写,脚本将在挖完所有的矿后停止。注意如果第一次运行这个脚本,挖所有矿的过程可能持续十数个小时。 -- 地面挖矿队伍中必须有诺艾尔,只挖水下的矿则无此限制。 +- 地面挖矿队伍中请带诺艾尔,只挖水下的矿则无此限制。如需进一步了解,请阅读[进阶使用](#进阶使用)中的相关内容。 - 矿产资源的刷新时间记录在脚本目录下`local/persistent_data.json`文件中,升级或重新安装BetterGI可能导致该记录丢失,请自行备份。 - 如果`需要战斗的路线`选择了`全跳过`选项,将不会运行所有需要打败怪物的挖矿路线。但角色仍可能在运行部分路线时被路过的怪物摸两下,请仍保证队伍有一定的生存能力。 @@ -26,3 +26,4 @@ - 如果有多个游戏帐号,可在最后一个输入框内为每个游戏帐号填写一个唯一的字符串以使他们的刷新时间分开保存,互不干扰。这个唯一的字符串并不必须是帐号的UID,只要互不相同就可以了。 - 对于因没有完成地图探索任务而无法正常完成某些路线的玩家,如果不想跳过整个区域,可以将脚本文件名称填入`local/disabled_paths.txt`文件中以跳过这些地图追踪脚本,语法请参考`assets/disabled_paths.conf`。 - 使用BetterGI `0.49.0`版本的用户请勾选`自动适配DPI缩放`复选框,使用高于`0.49.0`的测试版或正式版的用户,请不要勾选此复选框。 +- 如果一定要使用其他角色挖矿,请在自定义挖矿动作中填写相应的角色和挖矿动作,例如`迪希雅 attack(2.0)`。使用此选项可能导致产量下降或其他问题,对此我们不做任何保证,亦不能提供技术支持。 diff --git a/repo/js/AbundantOre/main.js b/repo/js/AbundantOre/main.js index 5047034ca..c7eb5cb31 100644 --- a/repo/js/AbundantOre/main.js +++ b/repo/js/AbundantOre/main.js @@ -311,13 +311,16 @@ async function run_pathing_script(name, path_state_change, current_states) { log.info("运行 {name}", name); var json_content = await file.readText(filename_to_path_map[name]); { - // set Noelle mining action const json_obj = JSON.parse(json_content); var modified = false; for (const i of json_obj.positions) { if (i.action === "mining" && !i.action_params) { + // set Noelle mining action i.action = "combat_script"; - i.action_params = "诺艾尔 attack(2.0)"; + i.action_params = settings.custom_mining_action || "诺艾尔 attack(2.0)"; + modified = true; + } else if (settings.custom_mining_action && i.action === "combat_script" && i.action_params.includes("诺艾尔 ")) { + i.action_params = settings.custom_mining_action; modified = true; } } @@ -383,8 +386,8 @@ async function main() { // Run an empty pathing script to give BGI a chance to switch team if the user specifies one. await pathingScript.runFile("assets/empty_pathing.json"); if (["natlan", "fontaine terrestrial", "sumeru", "inazuma", "liyue", "chasm underground", "mondstadt"].filter(i => !get_exclude_tags().includes(i)).length > 0) { - if (!Array.from(getAvatars()).includes("诺艾尔")) { - log.error("地面挖矿必须带诺艾尔"); + if (!Array.from(getAvatars()).includes("诺艾尔") && !settings.custom_mining_action) { + log.error("地面挖矿请带诺艾尔"); return; } } @@ -524,4 +527,4 @@ async function main() { (async function() { await main(); -})(); \ No newline at end of file +})(); diff --git a/repo/js/AbundantOre/manifest.json b/repo/js/AbundantOre/manifest.json index e92bf3f65..515c0cc74 100644 --- a/repo/js/AbundantOre/manifest.json +++ b/repo/js/AbundantOre/manifest.json @@ -2,7 +2,7 @@ "bgi_version": "0.49.0", "manifest_version": 1, "name": "矿产资源批发", - "version": "0.6", + "version": "0.7", "description": "自动记录矿石刷新时间,优先选择效率最高的路线,支持按区域、种类、数量自动规划挖矿路线", "authors": [ { diff --git a/repo/js/AbundantOre/settings.json b/repo/js/AbundantOre/settings.json index 603bc825e..9e1850b3d 100644 --- a/repo/js/AbundantOre/settings.json +++ b/repo/js/AbundantOre/settings.json @@ -88,9 +88,14 @@ "default": true, "label": "自动适配DPI缩放👇" }, + { + "name": "custom_mining_action", + "type": "input-text", + "label": "自定义挖矿动作,不建议填,详见README" + }, { "name": "profile_id", "type": "input-text", "label": "(仅多帐号适用)区分帐号的唯一ID" } -] \ No newline at end of file +]