Skip to content

js使用地图追踪返回值确定运行结果 - #3545

Draft
Bedrockx wants to merge 8 commits into
babalae:mainfrom
Bedrockx:main
Draft

js使用地图追踪返回值确定运行结果#3545
Bedrockx wants to merge 8 commits into
babalae:mainfrom
Bedrockx:main

Conversation

@Bedrockx

Copy link
Copy Markdown
Contributor

背景

BGI 端(better-genshin-impact PR #3495)为 pathingScript.run / runFile / runFileFromUser 新增了执行结果返回值,JS 可直接判断地图追踪是否真正完整走完,无需再依赖"读取路线终点坐标 + 获取当前坐标 + 距离阈值"等旁路推断。

改动

适配以下 3 个脚本,使用新返回值确定路线运行结果:

  • 采集cd管理executeRoute 使用返回值判定路线成败;路径组模式复用 executeRoute 返回的 pathRes,避免重复坐标校验
  • AAA狗粮批发runPath 透出地图追踪执行结果,调用处直接用返回值判定(失败计 failcount 并跳过记录)
  • 锄地一条龙runPath 透出执行结果,组循环直接用返回值判定(失败发送通知并不记录运行数据)

统一判定方式:

const runRes = await pathingScript.runFile(path);
if (runRes !== undefined) {
    if (runRes.success) log.info("路线运行成功");
    else log.error(`路线运行失败:${runRes.message}`);
} else {
    // 旧版本BGI(无返回值):静默回退原有坐标校验,不输出额外日志
}

兼容性

  • 旧版本 BGI 中 runFile 返回 undefined,脚本自动回退原坐标校验逻辑,行为与之前一致
  • 无需修改各脚本的 bgi_version

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d2a4ea0a-a6af-4e5a-8cd5-750bde201d76

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Bedrockx

Copy link
Copy Markdown
Contributor Author

有回退处理,当返回结果为undefined时静默回到原逻辑,因此bgi未更新也不影响使用

采集cd管理、AAA狗粮批发、锄地一条龙三脚本的路线成败判定收紧为
runRes.success 为布尔时才使用返回值并输出日志,旧版BGI返回undefined
或字段取值异常时静默走原坐标校验回退,不再输出多余日志。
原版拾取(bgi原版拾取)模式下物品拾取由 BetterGI AutoPick 完成,
脚本仅交互调查,无需滚轮翻动物品列表,跳过两处滚轮动作。
@Bedrockx
Bedrockx marked this pull request as draft August 20, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant