fix(auto-plan): 修复地脉功能布尔值解析和配置文档

- 修复 useFragileResin、useTransientResin、isGoToSynthesizer、useAdventurerHandbook、isNotification 字段的布尔值解析逻辑
- 修改 timeout 字段解析使用 parseInteger 函数
- 更新 README.md 中的地脉功能配置说明和参数详解表格
- 添加地脉类型的详细参数说明和配置示例
- 修复版本密钥表格格式问题
- 补充 JSON 配置格式示例和地脉功能相关配置项说明
This commit is contained in:
yan
2026-02-17 12:32:20 +08:00
parent fcc475aed7
commit 8fffb2302c
2 changed files with 184 additions and 48 deletions

View File

@@ -3,8 +3,6 @@
**自动体力计划JS**
本脚本通过调用 **BetterGI** 本体自动秘境实现体力计划
## 功能说明
本脚本为 BetterGI 的自动秘境功能提供**计划/排期**能力,让你能:
@@ -19,15 +17,15 @@
脚本通过以下界面配置项进行设置(对应 settings.json
| 配置项 | 类型 | 说明 | 示例值 |
|---------------------------------------|-------------------|------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|
| **key** | input-text | 版本密钥(必填,仔细看本文档) | xxxx |
| **auto_load** | multi-checkbox | 加载模式(可多选)<br>・输入加载:使用下方 run_config 字段<br>・UID加载读取 config/run_config.json每个UID独立<br>・bgi_tools加载从远程API拉取 | 默认:["输入加载","UID加载"] |
| **run_config** | input-text | 自动秘境计划配置(当选择“输入加载”时生效)<br>格式见下方“计划配置语法” | 速刷\|苍白的遗荣\|3\|1-3\|0,6\|9<br>(多条用英文逗号分隔) |
| **bgi_tools_http_pull_json_config** | input-text | bgi_tools 拉取配置的 API 地址(当选择 bgi_tools加载 时生效) | https://example.com/api/pull |
| **bgi_tools_open_push** | checkbox | 是否在脚本结束时推送当前全部配置给 bgi_tools用于同步/备份) | 勾选 = 开启推送 |
| **bgi_tools_http_push_all_json_config** | input-text | bgi_tools 推送全部配置的 API 地址(当开启推送时使用) | https://example.com/api/push-all |
| **bgi_tools_token** | input-text | bgi_tools授权token 语法:tokenName=tokenValue | tokenName=tokenValue |
| 配置项 | 类型 | 说明 | 示例值 |
|-----------------------------------------|----------------|-------------------------------------------------------------------------------------------------------------|------------------------------------------|
| **key** | input-text | 版本密钥(必填,仔细看本文档) | xxxx |
| **auto_load** | multi-checkbox | 加载模式(可多选)<br>・输入加载:使用下方 run_config 字段<br>・UID加载读取 config/run_config.json每个UID独立<br>・bgi_tools加载从远程API拉取 | 默认:["输入加载","UID加载"] |
| **run_config** | input-text | 自动秘境计划配置(当选择“输入加载”时生效)<br>格式见下方“计划配置语法” | 速刷\|苍白的遗荣\|3\|1-3\|0,6\|9<br>(多条用英文逗号分隔) |
| **bgi_tools_http_pull_json_config** | input-text | bgi_tools 拉取配置的 API 地址(当选择 bgi_tools加载 时生效) | https://example.com/api/pull |
| **bgi_tools_open_push** | checkbox | 是否在脚本结束时推送当前全部配置给 bgi_tools用于同步/备份) | 勾选 = 开启推送 |
| **bgi_tools_http_push_all_json_config** | input-text | bgi_tools 推送全部配置的 API 地址(当开启推送时使用) | https://example.com/api/push-all |
| **bgi_tools_token** | input-text | bgi_tools授权token 语法:tokenName=tokenValue | tokenName=tokenValue |
### 计划配置语法run_config 字段)
@@ -42,48 +40,185 @@
**字段详解**
| 位置 | 字段 | 是否必填 | 说明 | 示例 |
|:--:|:-----------:|:---:|:--------------------------------------:|:-----------------------:|
| 1 | 类型 | **必填** | 秘境/地脉(后期支持地脉冗余字段) | 秘境/地脉 |
| 2 | 周几执行(0-6) | 可选 | 0=周日,1=周一,...,6=周六;可多选按`/`分割,不填=每天都可执行 | 0/3,3 |
| 3 | 执行顺序 | 可选 | 数字越大越优先执行(同时间点先跑优先级高的) | 9 / 5 / 1 |
| |||***`秘境类型后几位参数说明`***
| 4 | 队伍名称 | 可选 | BetterGI 中已保存的队伍名称(用于切换队伍) | 速刷 / 雷国 / 国家队 |
| 位置 | 字段 | 是否必填 | 说明 | 示例 |
|:--:|:-----------:|:------:|:--------------------------------------:|:-----------------------:|
| 1 | 类型 | **必填** | 秘境/地脉(后期支持地脉冗余字段) | 秘境/地脉 |
| 2 | 周几执行(0-6) | 可选 | 0=周日,1=周一,...,6=周六;可多选按`/`分割,不填=每天都可执行 | 0/3,3 |
| 3 | 执行顺序 | 可选 | 数字越大越优先执行(同时间点先跑优先级高的) | 9 / 5 / 1 |
| | | | ***`秘境类型后几位参数说明`***
| 4 | 队伍名称 | 可选 | BetterGI 中已保存的队伍名称(用于切换队伍) | 速刷 / 雷国 / 国家队 |
| 5 | 秘境名称/刷取物品名称 | **必填** | 与 BetterGI 自动秘境识别的名称保持一致 | 苍白的遗荣 / 炽烈的炎之魔女 / 辰砂往生录 |
| 6 | 刷几轮 | 可选 | 整数,执行几轮(每轮 = 1次完整秘境 | 3 / 5 / 10 |
| 7 | 限时/周日 | 可选 | 1=周一~周六可用、2=周日可用、3=仅周日、留空=不限制 | 1 / 2 / 3 |
| 8 | 树脂使用顺序 | 可选 | 原粹树脂,浓缩树脂,须臾树脂,脆弱树脂`/`分割,不填=默认执行 原粹树脂 | 原粹树脂/浓缩树脂,须臾树脂 |
| 6 | 刷几轮 | 可选 | 整数,执行几轮(每轮 = 1次完整秘境 | 3 / 5 / 10 |
| 7 | 限时/周日 | 可选 | 1=周一~周六可用、2=周日可用、3=仅周日、留空=不限制 | 1 / 2 / 3 |
| 8 | 树脂使用顺序 | 可选 | 原粹树脂,浓缩树脂,须臾树脂,脆弱树脂`/`分割,不填=默认执行 原粹树脂 | 原粹树脂/浓缩树脂,须臾树脂 |
| | | | ***`地脉类型后几位参数说明`***
| 4 | 队伍名称 | 可选 | BetterGI 中已保存的队伍名称(用于切换队伍) | 速刷 / 雷国 / 国家队 |
| 5 | 国家 | **必填** | 识别国家(用于切换国家) | 纳塔 ... |
| 6 | 刷几轮 | **必填** | 刷几轮 | 1 |
| 7 | 地脉类型 | **必填** | 启示之花/藏金之花 | 启示之花 / 藏金之花 |
| 8 | 好感队 | 可选 | | |
| 9 | 使用脆弱树脂 | 可选 | 启用随便填个值 |
| 10 | 使用须臾树脂 | 可选 | 启用随便填个值 |
| 11 | 合成浓缩树脂 | 可选 | 启用随便填个值 |
| 12 | 使用冒险家之书 | 可选 | 启用随便填个值 |
| 13 | 详细通知 | 可选 | 启用随便填个值 |
| 14 | 战斗超时 | 可选 | 启用随便填个值 |
**配置示例**
```
秘境|0/3|9|速刷|苍白的遗荣|3|1, # 优先级最高,周日,周三刷3轮遗荣
秘境||5|国家队|炽烈的炎之魔女|5||, # 优先级次之每天刷5轮魔女
秘境|0|2|雷国|无想之刃狭间|2|2|浓缩树脂/原粹树脂 # 只在周日刷,优先使用浓缩树脂后使用原粹树脂,优先级较低
秘境|0|2|雷国|无想之刃狭间|2|2|浓缩树脂/原粹树脂, # 只在周日刷,优先使用浓缩树脂后使用原粹树脂,优先级较低
地脉|0|2|雷国|蒙德|2|藏金之花||
```
(注意:最后一条也可以不带逗号)
### 计划配置语法config/run_config.json 配置)
```json
[
{
"order": 1, // 顺序值
"days": [0],// 执行日期
"runType":"秘境",// 预留地脉 类型支持。 秘境、地脉
"autoFight": {
"physical": [
{"order": 0, "name": "原粹树脂", "open": true},
{"order": 1, "name": "浓缩树脂", "open": false},
{"order": 2, "name": "须臾树脂", "open": false},
{"order": 3, "name": "脆弱树脂", "open": false}
],//树脂开启和使用顺序
"domainName": undefined,//秘境名称
"partyName": undefined,//队伍名称
"sundaySelectedValue": undefined,//周日|限时选择的值
"domainRoundNum": undefined,//副本轮数
} // 秘境信息对象
}
[
uid,
[
{
"order": 1,
// 顺序值
"days": [
0
],
// 执行日期
"runType": "秘境",
// 预留地脉 类型支持。 秘境、地脉
"autoFight": {
"physical": [
{
"order": 0,
"name": "原粹树脂",
"open": true
},
{
"order": 1,
"name": "浓缩树脂",
"open": false
},
{
"order": 2,
"name": "须臾树脂",
"open": false
},
{
"order": 3,
"name": "脆弱树脂",
"open": false
}
],
//树脂开启和使用顺序
"domainName": undefined,
//秘境名称
"partyName": undefined,
//队伍名称
"sundaySelectedValue": undefined,
//周日|限时选择的值
"domainRoundNum": undefined//副本轮数
}
// 秘境信息对象,
"autoLeyLineOutcrop": {
"count": 0,
//刷几轮
"country": "",
//国家
"leyLineOutcropType": "启示之花",
//地脉类型 启示之花/藏金之花
"useAdventurerHandbook": false,
//使用冒险家之书
"friendshipTeam": "",
//好感队伍名称
"team": "",
//队伍名称
"timeout": 120,
//战斗超时
"isGoToSynthesizer": false,
//合成浓缩树脂
"useFragileResin": false,
//使用脆弱树脂
"useTransientResin": false,
//使用须臾树脂
"isNotification": false
//详细通知
}
//地脉信息对象
}
]
]
]
```
```json
[
[
10000002,
[
{
"order": 1,
"days": [
0
],
"runType": "秘境",
"autoFight": {
"physical": [
{
"order": 0,
"name": "原粹树脂",
"open": true
},
{
"order": 1,
"name": "浓缩树脂",
"open": false
},
{
"order": 2,
"name": "须臾树脂",
"open": false
},
{
"order": 3,
"name": "脆弱树脂",
"open": false
}
],
"domainName": "",
"partyName": "",
"sundaySelectedValue": 1,
"domainRoundNum": 1
}
},
{
"order": 2,
"days": [],
"runType": "地脉",
"autoLeyLineOutcrop": {
"count": 1,
"country": "纳塔",
"leyLineOutcropType": "启示之花",
"useAdventurerHandbook": false,
"friendshipTeam": "",
"team": "",
"timeout": 120,
"isGoToSynthesizer": false,
"useFragileResin": false,
"useTransientResin": false,
"isNotification": false
}
}
}
]
]
]
```
### 如果你不想研究语法 请部署[bettergi-scripts-tools](https://github.com/Kirito520Asuna/bettergi-scripts-tools) v0.0.4以上版本
***`话不多说直接上图:`***
@@ -93,6 +228,7 @@
![config](md/bgi-tools-config-ui.jpg)
![config-01](md/bgi-tools-config-ui-01.jpg)
![config-02](md/bgi-tools-config-ui-02.jpg)
## 使用建议
1. 第一次使用建议只勾选「输入加载」,把计划写在 `run_config` 里测试
@@ -113,9 +249,9 @@
## 版本密钥
| 版本 | 密钥 |
|---------|----------------------------|
| 0.0.1 | oiJbmjU2R0NniiwiZxh |
| 版本 | 密钥 |
|-------|---------------------|
| 0.0.1 | oiJbmjU2R0NniiwiZxh |
## 版本历史(简要)

View File

@@ -299,17 +299,17 @@ async function loadMode(Load, autoOrderSet, runConfig) {
index++
autoLeyLineOutcrop.friendshipTeam=arr[index]
index++
autoLeyLineOutcrop.useFragileResin=arr[index]
autoLeyLineOutcrop.useFragileResin=arr[index].trim()!==""
index++
autoLeyLineOutcrop.useTransientResin=arr[index]
autoLeyLineOutcrop.useTransientResin=arr[index].trim()!==""
index++
autoLeyLineOutcrop.isGoToSynthesizer=arr[index]
autoLeyLineOutcrop.isGoToSynthesizer=arr[index].trim()!==""
index++
autoLeyLineOutcrop.useAdventurerHandbook=arr[index]
autoLeyLineOutcrop.useAdventurerHandbook=arr[index].trim()!==""
index++
autoLeyLineOutcrop.isNotification=arr[index]
autoLeyLineOutcrop.isNotification=arr[index].trim()!==""
index++
autoLeyLineOutcrop.timeout=arr[index]
autoLeyLineOutcrop.timeout=parseInteger(arr[index])
autoOrder.autoLeyLineOutcrop=autoLeyLineOutcrop // 将地脉信息对象添加到顺序对象中
}