fix(domain): 解决体力检测逻辑错误问题

- 移除了配置初始化中的体力OCR检测代码
- 在主执行函数中重新实现体力检测逻辑
- 添加体力不足时的错误提示功能
- 确保体力检测在每次执行前进行验证
```
This commit is contained in:
yan
2026-02-10 02:42:35 +08:00
parent 9a56fbab73
commit 204d80f775
2 changed files with 13 additions and 4 deletions

View File

@@ -163,10 +163,10 @@ async function checkKey(key = "") {
async function initConfig() {
config.info.key = settings.key || config.info.key
await checkKey(config.info.key)
//流程->返回主页 打开地图 返回主页
const physical = await ocrPhysical(true, true)
config.user.physical.current = physical.current
config.user.physical.min = physical.min
// //流程->返回主页 打开地图 返回主页
// const physical = await ocrPhysical(true, true)
// config.user.physical.current = physical.current
// config.user.physical.min = physical.min
// 初始化uid
config.user.uid = await ocrUid()
config.bgi_tools.api.httpPullJsonConfig = settings.bgi_tools_http_pull_json_config

View File

@@ -2,6 +2,7 @@ import {config, initConfig, initSettings, LoadType} from './config/config';
import {ocrUid} from './utils/uid';
import {getDayOfWeek} from './utils/tool';
import {pullJsonConfig, pushAllJsonConfig} from './utils/bgi_tools';
import {ocrPhysical} from "./utils/physical";
/**
* 自动执行秘境任务的异步函数
@@ -9,6 +10,14 @@ import {pullJsonConfig, pushAllJsonConfig} from './utils/bgi_tools';
* @returns {Promise<void>} - 执行完成后返回的Promise
*/
async function autoDomain(autoFight) {
//流程->返回主页 打开地图 返回主页
const physicalOcr = await ocrPhysical(true, true)
config.user.physical.current = physicalOcr.current
config.user.physical.min = physicalOcr.min
const physical = config.user.physical
if (physical.current >= physical.min) {
throwError(`体力不足,当前体力${physical.current},最低体力${physical.min},请手动补充体力后重试`)
}
// 创建秘境参数对象初始化值为0
let domainParam = new AutoDomainParam(autoFight.DomainRoundNum);
//秘境名称