mirror of
https://github.com/babalae/bettergi-scripts-list.git
synced 2026-03-26 05:09:52 +08:00
refactor(config): 将配置对象中的domain属性重命名为run
- 将config.js中的domain对象重命名为run对象 - 更新所有引用config.domain为config.run的地方 - 修改main.js中对配置对象的访问路径 - 确保配置加载逻辑保持一致性
This commit is contained in:
@@ -3,7 +3,7 @@ import {ocrPhysical} from "../utils/physical";
|
||||
|
||||
const config = {
|
||||
//setting设置放在这个json
|
||||
domain: {
|
||||
run: {
|
||||
config: '',
|
||||
// load_uid_config: false,
|
||||
loads: [],//加载方式list
|
||||
@@ -216,7 +216,7 @@ async function initConfig() {
|
||||
}
|
||||
|
||||
})
|
||||
config.domain.config = settings.domain_config || config.domain.config
|
||||
config.run.config = settings.domain_config || config.run.config
|
||||
if (config.domainList.length <= 0) {
|
||||
throw new Error("配置文件缺失或读取异常!")
|
||||
}
|
||||
@@ -238,7 +238,7 @@ async function initConfig() {
|
||||
return {load: load, order: order}
|
||||
})
|
||||
loads.sort((a, b) => a.order - b.order)
|
||||
config.domain.loads = loads
|
||||
config.run.loads = loads
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ async function initRunOrderList(domainConfig) {
|
||||
}*/
|
||||
// let Load = LoadType.uid
|
||||
|
||||
for (const Load of config.domain.loads) {
|
||||
for (const Load of config.run.loads) {
|
||||
await loadMode(Load.load, autoFightOrderSet, domainConfig);
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ async function main() {
|
||||
await pushAllJsonConfig(JSON.parse(file.readTextSync(config.path.domain)), config.bgi_tools.api.httpPushAllJsonConfig, config.bgi_tools.token)
|
||||
}
|
||||
// 获取配置
|
||||
let runConfig = config.domain.config;
|
||||
let runConfig = config.run.config;
|
||||
//"队伍名称|秘境名称/刷取物品名称|刷几轮|限时/周日|周几执行(0-6)不填默认执行|执行顺序,..."
|
||||
const autoRunOrderList = await initRunOrderList(runConfig);
|
||||
const list = autoRunOrderList.filter(item => item.autoFight.DomainRoundNum > 0)
|
||||
|
||||
Reference in New Issue
Block a user