[bug] AutoSwitchRoles 目标角色已在队伍其他号位时无法正确调整位置

Open
#3,715 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript
Domain
tooling

Research direction

Locate the AutoSwitchRoles JavaScript script and its role-selection or team-position logic. Reproduce the issue with the current and target teams shown in the report, then trace how an already-present character is handled. Done means the script rearranges existing characters into the requested order and verifies the final team successfully.

Written by the indexing model from the issue text.

Description

bug
提交确认
  • 我已搜索现有 Issue,确认没有相同问题
  • 我已阅读相关脚本的 README 或使用说明
  • 我已确认问题来自脚本或脚本仓库;BetterGI 本体问题应提交到主仓库
  • 我已移除日志、截图中的 UID、路径等隐私信息
涉及范围

JS 脚本

BetterGI 版本号

0.66

相关脚本名称与版本

AutoSwitchRoles

运行环境与关键配置

Windows 11、官服、中文、1080p。

问题描述

当前队伍:

白术, 沃雅妮莎, 伊涅芙, 芙宁娜

目标队伍:

桑多涅, 伊涅芙, 芙宁娜, 白术

切换时,如果目标角色已经在队伍其他位置,脚本会提示:
该角色已在队伍中,无需切换
并直接跳过,最终导致角色顺序不正确并切换失败。

期望结果

如果角色已经在队伍中,但不在目标号位,希望脚本仍能正确调整其位置,而不是直接跳过。

复现步骤
  1. 当前队伍设为:白术, 沃雅妮莎, 伊涅芙, 芙宁娜
  2. 目标设为:桑多涅, 伊涅芙, 芙宁娜, 白术
  3. 执行 AutoSwitchRoles
  4. 设置伊涅芙、芙宁娜时出现“该角色已在队伍中,无需切换”
  5. 重试后仍无法得到目标队伍,最终提示“角色切换失败”
日志、截图或录屏
[12:11:14.825] [INF] BetterGenshinImpact.Service.ScriptService
→ 开始执行JS脚本: "配对界面切换角色"

[12:11:14.869] [INF] BetterGenshinImpact.GameTask.Common.TaskControl
尝试切换至队伍: "<队伍名>"

[12:11:17.904] [INF] BetterGenshinImpact.GameTask.Common.TaskControl
切换队伍,当前队伍名称: "<队伍名>",使用正则表达式规则进行模糊匹配

[12:11:21.028] [INF] BetterGenshinImpact.GameTask.Common.TaskControl
切换队伍成功: "<队伍名>"

[12:11:24.506] [INF] BetterGenshinImpact.GameTask.Common.TaskControl
识别到的队伍角色:"白术,沃雅妮莎,伊涅芙,芙宁娜"

[12:11:24.513] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
设置对应号位为【桑多涅】,切换角色为【桑多涅】

[12:11:24.514] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
设置对应号位为【伊涅芙】,切换角色为【伊涅芙】

[12:11:24.514] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
设置对应号位为【芙宁娜】,切换角色为【芙宁娜】

[12:11:24.514] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
设置对应号位为【白术】,切换角色为【白术】

[12:11:24.515] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
目标角色: [桑多涅,伊涅芙,芙宁娜,白术]

[12:11:27.864] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
开始设置1号位角色

[12:11:28.875] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
对角色【桑多涅】执行筛选: 元素=冰, 武器=大剑

[12:11:31.979] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
已找到角色【桑多涅】

[12:11:34.306] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
开始设置2号位角色

[12:11:35.317] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
对角色【伊涅芙】执行筛选: 元素=雷, 武器=长枪

[12:11:38.450] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
已找到角色【伊涅芙】

[12:11:38.898] [ERR] BetterGenshinImpact.Core.Script.Dependence.Log
该角色已在队伍中,无需切换

[12:11:40.558] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
开始设置3号位角色

[12:11:41.563] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
对角色【芙宁娜】执行筛选: 元素=水, 武器=单手剑

[12:11:44.721] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
已找到角色【芙宁娜】

[12:11:45.181] [ERR] BetterGenshinImpact.Core.Script.Dependence.Log
该角色已在队伍中,无需切换

[12:11:46.843] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
开始设置4号位角色

[12:11:47.852] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
对角色【白术】执行筛选: 元素=草, 武器=法器

[12:11:50.954] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
已找到角色【白术】

[12:11:54.178] [INF] BetterGenshinImpact.GameTask.Common.TaskControl
识别到的队伍角色:"桑多涅,沃雅妮莎,伊涅芙,白术"

[12:11:54.179] [WRN] BetterGenshinImpact.Core.Script.Dependence.Log
角色不匹配,准备重试...

[12:11:57.595] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
开始设置1号位角色

[12:11:58.604] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
对角色【桑多涅】执行筛选: 元素=冰, 武器=大剑

[12:12:01.782] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
已找到角色【桑多涅】

[12:12:02.205] [ERR] BetterGenshinImpact.Core.Script.Dependence.Log
该角色已在队伍中,无需切换

[12:12:03.876] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
开始设置2号位角色

[12:12:04.882] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
对角色【伊涅芙】执行筛选: 元素=雷, 武器=长枪

[12:12:08.013] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
已找到角色【伊涅芙】

[12:12:08.425] [ERR] BetterGenshinImpact.Core.Script.Dependence.Log
该角色已在队伍中,无需切换

[12:12:10.085] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
开始设置3号位角色

[12:12:11.092] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
对角色【芙宁娜】执行筛选: 元素=水, 武器=单手剑

[12:12:14.256] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
已找到角色【芙宁娜】

[12:12:16.553] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
开始设置4号位角色

[12:12:17.561] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
对角色【白术】执行筛选: 元素=草, 武器=法器

[12:12:20.704] [INF] BetterGenshinImpact.Core.Script.Dependence.Log
已找到角色【白术】

[12:12:21.108] [ERR] BetterGenshinImpact.Core.Script.Dependence.Log
该角色已在队伍中,无需切换

[12:12:23.695] [INF] BetterGenshinImpact.GameTask.Common.TaskControl
识别到的队伍角色:"桑多涅,沃雅妮莎,芙宁娜,白术"

[12:12:23.695] [WRN] BetterGenshinImpact.Core.Script.Dependence.Log
角色不匹配,准备重试...

[12:12:23.695] [ERR] BetterGenshinImpact.Core.Script.Dependence.Log
角色切换失败

[12:12:23.701] [INF] BetterGenshinImpact.Service.ScriptService
→ 脚本执行结束: "配对界面切换角色", 耗时: 1分8.875秒
其他信息

No response

Dominant language
JavaScript
Stars
793
Forks
505
Avg merge
1d 12h
Merged PRs (30d)
68

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from babalae/bettergi-scripts-list

All issues in babalae/bettergi-scripts-list

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.