From ecf8fc5d74abf45a1a0824d3538ca9f61c2c1062 Mon Sep 17 00:00:00 2001 From: Jamis Date: Sun, 28 Sep 2025 13:12:46 +0800 Subject: [PATCH] Update ver 0.14 (#2021) --- repo/js/AbundantOre/README.md | 2 +- repo/js/AbundantOre/main.js | 26 ++++++++++++++++++-------- repo/js/AbundantOre/manifest.json | 2 +- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/repo/js/AbundantOre/README.md b/repo/js/AbundantOre/README.md index 605b2e032..302bd0a51 100644 --- a/repo/js/AbundantOre/README.md +++ b/repo/js/AbundantOre/README.md @@ -25,4 +25,4 @@ - 如果有多个游戏帐号,可在最后一个输入框内为每个游戏帐号填写一个唯一的字符串以使他们的刷新时间分开保存,互不干扰。这个唯一的字符串并不必须是帐号的UID,只要互不相同就可以了。 - 对于因没有完成地图探索任务而无法正常完成某些路线的玩家,如果不想跳过整个区域,可以将脚本文件名称填入`local/disabled_paths.txt`文件中以跳过这些地图追踪脚本,语法请参考`assets/disabled_paths.conf`。 -- 如果一定要使用其他角色挖矿,请在自定义挖矿动作中填写相应的角色和挖矿动作,例如`迪希雅 attack(2.0)`。使用此选项可能导致产量下降或其他问题,对此我们不做任何保证,亦不能提供技术支持。 +- 如果一定要使用其他角色挖矿,请在自定义挖矿动作中填写相应的角色和挖矿动作,例如`迪希雅 attack(2.0)`。也可填写`默认`或`default`来使用全局设置中的挖矿动作。使用此选项可能导致产量下降或其他问题,对此我们不做任何保证,亦不能提供技术支持。 diff --git a/repo/js/AbundantOre/main.js b/repo/js/AbundantOre/main.js index f629462e5..92f3a4fb0 100644 --- a/repo/js/AbundantOre/main.js +++ b/repo/js/AbundantOre/main.js @@ -311,6 +311,8 @@ async function run_pathing_script(name, path_state_change, current_states) { path_state_change.add ||= []; path_state_change.sustain ||= []; + const use_global_mining_action = settings.custom_mining_action === "默认" || settings.custom_mining_action === "default"; + for (const s of path_state_change.require) { if (!current_states.has(s)) { log.debug("Trying to get {s}", s); @@ -329,14 +331,22 @@ async function run_pathing_script(name, path_state_change, current_states) { const json_obj = JSON.parse(json_content); var modified = false; for (const i of json_obj.positions) { - if (i.action === "mining") { - // set Noelle mining action - i.action = "combat_script"; - 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; + if (use_global_mining_action) { + if (settings.custom_mining_action && i.action === "combat_script" && i.action_params.includes("诺艾尔 ")) { + i.action = "mining"; + i.action_params = ""; + modified = true; + } + } else { + if (i.action === "mining") { + // set Noelle mining action + i.action = "combat_script"; + 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; + } } } if (modified) { diff --git a/repo/js/AbundantOre/manifest.json b/repo/js/AbundantOre/manifest.json index b055fccb4..1a0b4ab8a 100644 --- a/repo/js/AbundantOre/manifest.json +++ b/repo/js/AbundantOre/manifest.json @@ -2,7 +2,7 @@ "bgi_version": "0.50.0", "manifest_version": 1, "name": "矿产资源批发", - "version": "0.13", + "version": "0.14", "description": "自动记录矿石刷新时间,优先选择效率最高的路线,支持按区域、种类、数量自动规划挖矿路线", "authors": [ {