Compare commits
78
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92b8beab53 | ||
|
|
4beaa4a3d9 | ||
|
|
beddfe01ba | ||
|
|
bf06ba3ce1 | ||
|
|
85d3da2f02 | ||
|
|
105e4ccd10 | ||
|
|
5992a9d91b | ||
|
|
5f02b26cd2 | ||
|
|
6388c6521c | ||
|
|
db74dec3f6 | ||
|
|
89edfe7945 | ||
|
|
deaa565847 | ||
|
|
90b812f6a9 | ||
|
|
659143aaf6 | ||
|
|
114cad1b47 | ||
|
|
cfe5e745be | ||
|
|
12ee510601 | ||
|
|
b3a6da24f9 | ||
|
|
f95ced446c | ||
|
|
5eb91c4092 | ||
|
|
4bc4516cd8 | ||
|
|
3df57333c2 | ||
|
|
13b85c5904 | ||
|
|
1a3e626af0 | ||
|
|
0c20c74075 | ||
|
|
f91a15515e | ||
|
|
63fe6ec8bb | ||
|
|
2acdb2c1a1 | ||
|
|
740ce67be7 | ||
|
|
f9d04bc62b | ||
|
|
a83ba61d87 | ||
|
|
974a80eb2b | ||
|
|
a33eb1c45f | ||
|
|
b561b8db33 | ||
|
|
8a7c47b17a | ||
|
|
4cb82865d8 | ||
|
|
9479297dcc | ||
|
|
d61f804442 | ||
|
|
4747c39ae1 | ||
|
|
7a6854e7d5 | ||
|
|
6f7c78b474 | ||
|
|
43701b90f0 | ||
|
|
6090cce849 | ||
|
|
96cf2d5261 | ||
|
|
8813235ebf | ||
|
|
bbd9634c07 | ||
|
|
d7b6ab9365 | ||
|
|
13f3951d7f | ||
|
|
c8fba493c1 | ||
|
|
96f523d4b8 | ||
|
|
f8e231c235 | ||
|
|
58bceffe0e | ||
|
|
4c6232fdb3 | ||
|
|
1eb483b639 | ||
|
|
796bda0af3 | ||
|
|
6d8bbc18fc | ||
|
|
753c595625 | ||
|
|
88bd60ab93 | ||
|
|
36669b89ef | ||
|
|
70b3f6dd99 | ||
|
|
6996356251 | ||
|
|
359bdb899e | ||
|
|
ec39fc980e | ||
|
|
8d502d76c1 | ||
|
|
3519008bd2 | ||
|
|
649bc0fc66 | ||
|
|
4fbc74e7e0 | ||
|
|
847e4076d2 | ||
|
|
951a890ded | ||
|
|
ea13091320 | ||
|
|
2e57a3aae9 | ||
|
|
ff4ff78349 | ||
|
|
71ace72d9c | ||
|
|
e54e5e7af7 | ||
|
|
17af6e01f8 | ||
|
|
5e98ff724f | ||
|
|
e2f84f7edd | ||
|
|
de75d02104 |
No files matched your search
@@ -0,0 +1,169 @@
|
||||
---
|
||||
name: "release-note-generator"
|
||||
description: "基于 BetterGI 本地 git 历史和实际 diff,按 GitHub 已发布 Releases 的中文更新日志风格生成发布说明。用于生成 Release Note、版本更新日志、从上一个非 alpha 正式版本到 HEAD 的变更汇总;不得使用 git tag 作为版本依据。"
|
||||
---
|
||||
|
||||
# Release Note Generator
|
||||
|
||||
基于本地 git 历史和实际代码 diff 生成 BetterGI 发布说明。发布说明的结构、分类和措辞应贴近 GitHub 已发布 Releases 的历史风格;生成具体内容时不依赖网络,所有变更信息从本地仓库获取。
|
||||
|
||||
## 触发时机
|
||||
|
||||
- 用户要求生成 Release Note / 更新日志
|
||||
- 用户要求基于最近提交和实际代码变更做汇总
|
||||
|
||||
## 历史 Release 风格
|
||||
|
||||
已发布日志的稳定特征:
|
||||
|
||||
- 标题通常为 `## <version> <简短主题>`,例如 `0.61.0 原神6.6`、`0.61.2 优化`、`0.60.1 修复老问题`、`0.59 自动烹饪与BUG修复`。
|
||||
- 大版本或内容较多时,标题下可有一句总览;补丁版本或内容很少时可以直接列 bullet。
|
||||
- 分类标题使用项目语义,而不是 Conventional Commits 类型。常见分类包括:`版本适配` / `<月之X适配>`、`自动战斗`、`地图追踪`、`地图遮罩`、`独立任务`、`JS脚本` / `JS相关`、`实时任务`、`自动剧情`、`其他`。
|
||||
- 版本适配类通常放在最前面,包含新角色识别、新地图、传送点/锚点、七圣召唤元数据等。
|
||||
- `其他` 分类保留,用于 UI、通知、配置、稳定性、OCR、启动器、仓库、文档等无法归入核心模块的内容。
|
||||
- 条目语言偏简洁直白,可以用“新增/修复/优化/支持/更新/回滚/适配”,不需要营销化。
|
||||
- PR 号与作者使用纯文本,例如 `(#3132) @haokaiyang`;多个 PR 可以写在同一括号组里,例如 `(#3101 #3108)`。
|
||||
- 不输出 GitHub 自动生成的 `Contributors`、`Assets`、reaction 等区块。
|
||||
|
||||
## 版本边界
|
||||
|
||||
禁止执行或参考 `git tag`、`git describe --tags`。版本边界和输出版本号都不能使用 tag 作为依据。
|
||||
|
||||
从 HEAD 向后遍历提交历史,匹配**明确以版本号发布为主题的提交**:
|
||||
|
||||
- 提交消息必须匹配以下模式之一(大小写不敏感):
|
||||
- `Update version to X.Y.Z`
|
||||
- `bump version to X.Y.Z`
|
||||
- `release X.Y.Z`
|
||||
- `vX.Y.Z`
|
||||
- 版本号正则:`\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?`
|
||||
- 版本号**必须是提交消息的核心主题**,不能只是顺带提及(如 "fix: update package version to 1.0.19" 这种子包更新不算)
|
||||
- 排除包含 `alpha` 的提交
|
||||
- 排除仅更新子包/依赖版本的提交
|
||||
|
||||
### 通用规则
|
||||
|
||||
- 统计区间:`(boundary_commit, HEAD]`,边界提交本身不计入
|
||||
- 如果 HEAD 附近已经存在当前目标版本的正式版本提交,不要把它作为边界;继续向父提交方向寻找上一个正式版本提交
|
||||
- 若未找到边界版本,明确说明并使用兜底范围
|
||||
|
||||
## 信息采集
|
||||
|
||||
### 提交列表
|
||||
|
||||
- 使用 `git -c i18n.logOutputEncoding=utf8 -c core.quotepath=false log` 获取提交序列
|
||||
- 格式:`--pretty=format:"%H%x00%h%x00%an%x00%ae%x00%s%x00%b%x1e"`,字段用 `\x00` 分隔,commit 用 `\x1e` 分隔
|
||||
- 先用 `git rev-list --count` 取总数,采集后校验一致性
|
||||
- 读取 commit body,用于提取 `Co-authored-by`、正文中的 PR/Issue 号和补充说明
|
||||
|
||||
### Diff 查阅(必须)
|
||||
|
||||
- 对每个 commit 必须查阅实际 diff:`git diff <sha>~1..<sha>`
|
||||
- **不允许仅基于 commit 消息生成说明**,必须结合实际代码改动理解变更内容
|
||||
- 同一功能的新增 + 后续优化/修复应合并为一条,只记"新增 xxx"
|
||||
|
||||
### 作者信息
|
||||
|
||||
- 所有作者名前统一加 `@` 前缀
|
||||
- 从 commit 的 `author email` 解析标识:
|
||||
- `数字[email protected]` → `@login`
|
||||
- `[email protected]` → `@login`
|
||||
- `[email protected]` 等非 noreply 邮箱 → `@author name`(即提交中的 `an` 字段值前加 `@`)
|
||||
- 从 commit body 的 `Co-authored-by: name <email>` 提取共同作者,并按同样规则解析
|
||||
- 当作者为 `huiyadanli`(含邮箱 `[email protected]`)时省略 `@author`(项目维护者,无需标注)
|
||||
- 不需要调用 GitHub API,纯本地解析
|
||||
|
||||
## 内容提炼规则
|
||||
|
||||
### 合并策略
|
||||
|
||||
- 同一功能在同一版本周期内先新增后优化/修复的,只保留"新增 xxx",不单独列优化
|
||||
- 同一 issue/PR 的多个 commit 合并为一条记录
|
||||
- 同一文件或模块的多次小改动合并为一条有意义的描述
|
||||
- 可省略纯内部重构、CI、调试日志清理、无用户影响的格式化,但这些 commit 仍必须被检查并纳入内部覆盖记录
|
||||
|
||||
### 分类
|
||||
|
||||
优先使用以下历史 Release 常见分类,按顺序输出。只有对应分类下有变更时才输出该分类标题,无变更则跳过不输出。
|
||||
|
||||
分类来源于项目已发布 GitHub Releases,与项目实际使用习惯对齐:
|
||||
|
||||
| 分类名 | 对应项目模块 | 覆盖范围 |
|
||||
|--------|-------------|---------|
|
||||
| 版本适配 / `<月之X适配>` | `Assets/` `AutoFight/Assets/` `AutoGeniusInvokation/Assets/` `AutoTrackPath/Assets/` | 新角色识别数据、新地图添加、传送点/锚点数据更新、七圣召唤角色牌等元数据更新 |
|
||||
| 自动战斗 | `GameTask/AutoFight` `GameTask/Macro` `GameTask/SkillCd` | 战斗策略、角色切换、技能释放与CD、一键宏、经验值拾取、战后拾取、游泳检测、角色数据(非版本适配类) |
|
||||
| 地图追踪 | `GameTask/AutoPathing` `GameTask/AutoTrackPath` `GameTask/MapMask` | 路径执行与所有路径处理器(含莉奈娅挖矿、拾取、采矿等 Handler)、地图类型、传送逻辑、地图编辑器(MapPathingPage、MapEditorWebBridge) |
|
||||
| 地图遮罩 | `GameTask/MapMask` `View/MaskWindow*` `ViewModel/MaskWindow*` `Core/Config/MaskWindowConfig*` | 地图遮罩、日志遮罩、遮罩指标栏、遮罩位置和实时展示 |
|
||||
| 独立任务 | `GameTask/AutoLeyLineOutcrop` `GameTask/AutoDomain` `GameTask/AutoBoss` `GameTask/AutoStygianOnslaught` `GameTask/AutoCook` `GameTask/AutoWood` `GameTask/AutoFishing` `GameTask/FarmingPlan` `GameTask/AutoSkip` `GameTask/QuickSereniteaPot` | 地脉花、秘境、首领讨伐、幽境危战、烹饪、伐木、钓鱼、养成计划、自动剧情、快速尘歌壶等独立运行的任务 |
|
||||
| JS脚本 | `Core/Script` `Core/BgiVision` | JS 脚本 API、BvLocator、HTML 遮罩、模块导入、v8 引擎、脚本项目 |
|
||||
| 实时任务 | `GameTask/TaskTriggerDispatcher*` `GameTask/AutoPick` `GameTask/AutoEat` `GameTask/Common` | 自动拾取、自动吃药、自动跳过、实时触发器、进入游戏与界面检测等 |
|
||||
| 其他 | — | 无法归入以上分类的杂项(必须保留,即使为空也输出) |
|
||||
|
||||
- 归类原则:按**变更所属的项目模块(代码所在目录)**划分,而非按变更类型(新增/修复/优化)或用户感知的子功能划分
|
||||
- 当一个变更涉及多个模块时,归入其主要逻辑所在的模块
|
||||
- 版本适配类命名:若能从变更或用户要求明确对应原神版本/月之版本,可用 `<月之X适配>`;否则使用 `版本适配`
|
||||
- 仅当本轮有多个明确的新功能且难以归入既有模块时,才使用 `新功能`
|
||||
- 若某项变更无法明确归入上述分类,放入"其他"
|
||||
- 遇到历史分类未覆盖的新模块,允许 AI 自行新建分类(放在"其他"之前),但分类名必须是项目语义,不要使用 `feat/fix/refactor`
|
||||
|
||||
每条记录格式:
|
||||
```
|
||||
描述内容 (#PR号) @author
|
||||
```
|
||||
|
||||
- PR 号和作者名均使用纯文本,不加超链接
|
||||
- 当作者为 `huiyadanli` 时省略 `@author`(项目维护者,无需标注)
|
||||
- 描述用自然语言,不直接复制 commit 原文
|
||||
- 移除 `feat:`、`fix:` 等 Conventional Commits 前缀
|
||||
- PR 号从 commit 消息中提取(如 `(#3111)`)
|
||||
- 多人参与的记录:`@id1 @id2`
|
||||
- 合并多个 PR 时格式为 `(#3101 #3108)`,不要写成多个分散条目
|
||||
|
||||
### 描述质量
|
||||
|
||||
生成后必须做后处理检查,确保表达准确:
|
||||
|
||||
- 描述要准确反映实际变更的范围和内容,不能缩小也不能夸大
|
||||
- 如果 diff 显示新增了一张地图,就写"新增 xxx 地图",而不是"新增 xxx 传送点"
|
||||
- 如果改动只涉及一个配置项,不要写成整体功能变更
|
||||
- 面向用户的变更用用户视角描述(功能、体验、问题现象)
|
||||
- 面向开发者的变更可以保留技术术语(接口、脚本引擎、配置项等)
|
||||
- 去掉不必要的代码标识符(方法名、类名等),除非它是脚本开发者会直接使用的 API
|
||||
- 纯内部重构、CI 变更等不影响使用的内容可以省略不列
|
||||
- 主题句要概括本版本最重要的 2~4 个变化;不要把所有分类机械罗列一遍
|
||||
- 重要新增功能优先写“新增 xxx”,后续修复/优化并入同一条描述
|
||||
|
||||
## 输出格式
|
||||
|
||||
输出到 `.claude/documents/ReleaseNotes-<version>.md`(文件名 ASCII)。
|
||||
|
||||
输出文件的版本号规则:取边界版本号的**次版本号(minor)加 1**,补丁版本归零。即 `major.(minor+1).0`。例如边界为 `0.60.1`,输出版本号为 `0.61.0`。
|
||||
|
||||
若用户明确指定版本号或发布主题,以用户指定为准;否则按上述规则推导。
|
||||
|
||||
```markdown
|
||||
## <version> <版本主题>
|
||||
<一句话版本主题>
|
||||
|
||||
### 分类名1
|
||||
- 变更描述 (#PR号) @author
|
||||
- 变更描述 @author
|
||||
|
||||
### 分类名2
|
||||
- 变更描述 (#PR号) @author
|
||||
|
||||
### 其他
|
||||
- 变更描述 @author
|
||||
```
|
||||
|
||||
补丁版本或少量修复可以不分分类,直接输出 bullet;但如果使用分类,仍必须保留 `其他` 分类。
|
||||
|
||||
## 质量门槛
|
||||
|
||||
- 不允许遗漏检查区间内任意 commit;确认无用户影响的 commit 可以不输出
|
||||
- 不允许仅基于 commit 标题,必须查阅实际 diff
|
||||
- 同一功能的多次提交必须合并,不允许出现"新增 xxx""优化 xxx(同功能)"的冗余
|
||||
- 优先使用历史 Release 分类,不允许自行发明无项目语义的分类名
|
||||
- "其他"分类必须存在
|
||||
- 不依赖网络,全部信息从本地 git 获取
|
||||
- 输出前检查是否漏掉用户可见修复,尤其是同一新功能上线后的后续修复 commit
|
||||
+4
-5
@@ -31,10 +31,6 @@ github_actions_cache/
|
||||
# Rider
|
||||
.idea
|
||||
|
||||
.claude
|
||||
CLAUDE.md
|
||||
AGENTS.md
|
||||
|
||||
__pycache__/
|
||||
|
||||
|
||||
@@ -43,4 +39,7 @@ __pycache__/
|
||||
!.trae/rules/
|
||||
!.trae/rules/**
|
||||
!.trae/skills/
|
||||
!.trae/skills/**
|
||||
!.trae/skills/**
|
||||
|
||||
# Claude
|
||||
.claude/*
|
||||
@@ -14,7 +14,8 @@
|
||||
- 请尽量使用 Behaviors 库来实现交互,避免不符合 MVVM 规范的交互事件触发方式。
|
||||
|
||||
### 其他框架使用要求
|
||||
请优先使用 Newtonsoft.Json 作为json序列化工具,但是如果这个模型已经被System.Text.Json序列化过了,那么就直接使用System.Text.Json反序列化。
|
||||
1. 请优先使用 Newtonsoft.Json 作为json序列化工具,但是如果这个模型已经被System.Text.Json序列化过了,那么就直接使用System.Text.Json反序列化。
|
||||
2. 所有简单的对话框弹出需求优先使用 ThemedMessageBox 弹出。而不是 WPF 自带的 MessageBox。
|
||||
|
||||
## MVVM 架构规则
|
||||
|
||||
@@ -77,4 +78,9 @@
|
||||
services.AddSingleton<IExampleService, ExampleService>();
|
||||
```
|
||||
|
||||
最后,程序能够编译就认为成功,无需实际运行程序。
|
||||
最后,程序能够编译就认为成功,无需实际运行程序。
|
||||
|
||||
编译指令参考,如果出现程序占用场景,直接放弃编译验证即可
|
||||
```
|
||||
dotnet build BetterGenshinImpact.sln -c Debug
|
||||
```
|
||||
@@ -0,0 +1,86 @@
|
||||
本项目使用了 WPF-UI、 CommunityToolkit.Mvvm、Microsoft.Xaml.Behaviors.Wpf 来实现 MVVM 架构。在编写代码的时候请注意:
|
||||
|
||||
### 主要依赖框架
|
||||
#### UI 框架
|
||||
- **WPF-UI (4.0.2)** - 现代化 WPF UI 框架
|
||||
- **gong-wpf-dragdrop(3.2.1)** - 拖拽框架
|
||||
|
||||
#### MVVM 框架
|
||||
- **CommunityToolkit.Mvvm (8.2.2)** - 微软官方 MVVM 工具包
|
||||
- 所有 ViewModel 必须继承自 `ObservableObject`
|
||||
- 使用 `[ObservableProperty]` 特性自动生成属性
|
||||
- 使用 `[RelayCommand]` 特性自动生成命令
|
||||
- **Microsoft.Xaml.Behaviors.Wpf(1.1.122)** - WPF 行为扩展库
|
||||
- 请尽量使用 Behaviors 库来实现交互,避免不符合 MVVM 规范的交互事件触发方式。
|
||||
|
||||
### 其他框架使用要求
|
||||
1. 请优先使用 Newtonsoft.Json 作为json序列化工具,但是如果这个模型已经被System.Text.Json序列化过了,那么就直接使用System.Text.Json反序列化。
|
||||
2. 所有简单的对话框弹出需求优先使用 ThemedMessageBox 弹出。而不是 WPF 自带的 MessageBox。
|
||||
|
||||
## MVVM 架构规则
|
||||
|
||||
### 基础架构
|
||||
|
||||
### ViewModel 编写规范
|
||||
|
||||
1. **继承规则**
|
||||
```csharp
|
||||
public partial class ExampleViewModel : ViewModel
|
||||
{
|
||||
[ObservableProperty]
|
||||
private string _title = "";
|
||||
|
||||
[RelayCommand]
|
||||
private void DoSomething()
|
||||
{
|
||||
// 实现逻辑
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
2. **属性命名**
|
||||
- 私有字段使用下划线前缀: `_fieldName`
|
||||
- 公共属性使用 PascalCase: `PropertyName`
|
||||
- 使用 `[ObservableProperty]` 自动生成属性
|
||||
|
||||
3. **命令实现**
|
||||
- 使用 `[RelayCommand]` 特性
|
||||
- 异步命令使用 `[RelayCommand]` + `async Task`
|
||||
|
||||
### View 编写规范
|
||||
|
||||
1. **代码后置**
|
||||
```csharp
|
||||
public partial class ExamplePage : UserControl
|
||||
{
|
||||
public ExampleViewModel ViewModel { get; }
|
||||
|
||||
public ExamplePage(ExampleViewModel viewModel)
|
||||
{
|
||||
ViewModel = viewModel;
|
||||
DataContext = this;
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
2. **XAML 绑定**
|
||||
- 使用 `{Binding}` 语法绑定 ViewModel 属性
|
||||
- 命令绑定: `Command="{Binding ExampleCommand}"`
|
||||
- 避免在 XAML 中编写复杂逻辑
|
||||
|
||||
### 依赖注入规范
|
||||
|
||||
1. **服务注册**
|
||||
```csharp
|
||||
// 在 App.xaml.cs 中注册
|
||||
services.AddView<ExamplePage, ExampleViewModel>();
|
||||
services.AddSingleton<IExampleService, ExampleService>();
|
||||
```
|
||||
|
||||
最后,程序能够编译就认为成功,无需实际运行程序。
|
||||
|
||||
编译指令参考,如果出现程序占用场景,直接放弃编译验证即可
|
||||
```
|
||||
dotnet build BetterGenshinImpact.sln -c Debug
|
||||
```
|
||||
@@ -18,6 +18,7 @@
|
||||
<FontFamily x:Key="TextThemeFontFamily">/Resources/Fonts/MiSans-Regular.ttf#MiSans</FontFamily>
|
||||
<FontFamily x:Key="DigitalThemeFontFamily">/Resources/Fonts/deluge-led.ttf#Deluge LED</FontFamily>
|
||||
<bgivc:DomainNameToCascadingItemConverter x:Key="DomainNameConverter" />
|
||||
<bgivc:AutoBossNameToCascadingItemConverter x:Key="AutoBossNameConverter" />
|
||||
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
|
||||
<bgivc:BooleanToVisibilityRevertConverter x:Key="BooleanToVisibilityRevertConverter" />
|
||||
<bgivc:BooleanToEnableTextConverter x:Key="BooleanToEnableTextConverter" />
|
||||
|
||||
@@ -78,7 +78,7 @@ public partial class App : Application
|
||||
.MinimumLevel.Debug()
|
||||
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
|
||||
.MinimumLevel.Override("Microsoft.Hosting.Lifetime", LogEventLevel.Warning);
|
||||
if (all.MaskWindowConfig.MaskEnabled)
|
||||
if (all.MaskWindowConfig is { MaskEnabled: true, ShowLogBox: true })
|
||||
{
|
||||
loggerConfiguration.WriteTo.RichTextBox(richTextBox, LogEventLevel.Information,
|
||||
"[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}");
|
||||
@@ -151,6 +151,7 @@ public partial class App : Application
|
||||
// services.AddSingleton<TcgViewModel>();
|
||||
|
||||
// My Services
|
||||
services.AddSingleton<OverlayMetricsService>();
|
||||
services.AddSingleton<TaskTriggerDispatcher>();
|
||||
services.AddSingleton<NotificationService>();
|
||||
services.AddHostedService(sp => sp.GetRequiredService<NotificationService>());
|
||||
@@ -210,6 +211,7 @@ public partial class App : Application
|
||||
/// </summary>
|
||||
protected override async void OnStartup(StartupEventArgs e)
|
||||
{
|
||||
Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.Normal;
|
||||
// Wine 平台适配
|
||||
WinePlatformAddon.ApplyApplicationConfig();
|
||||
base.OnStartup(e);
|
||||
@@ -381,4 +383,4 @@ public partial class App : Application
|
||||
// log
|
||||
GetLogger<App>().LogDebug(e, "UnHandle Exception");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<AssemblyName>BetterGI</AssemblyName>
|
||||
<Version>0.60.2-alpha.3</Version>
|
||||
<Version>0.62.0</Version>
|
||||
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
|
||||
@@ -43,9 +43,9 @@
|
||||
|
||||
|
||||
<PackageReference Include="BetterGI.VCRuntime" Version="14.44.35208" />
|
||||
<PackageReference Include="BetterGI.Assets.Map" Version="1.0.18" />
|
||||
<PackageReference Include="BetterGI.Assets.Model" Version="1.0.22" />
|
||||
<PackageReference Include="BetterGI.Assets.Other" Version="1.0.15" />
|
||||
<PackageReference Include="BetterGI.Assets.Map" Version="1.0.19" />
|
||||
<PackageReference Include="BetterGI.Assets.Model" Version="1.0.28" />
|
||||
<PackageReference Include="BetterGI.Assets.Other" Version="1.0.17" />
|
||||
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
|
||||
<PackageReference Include="DeviceId" Version="6.9.0" />
|
||||
@@ -54,6 +54,7 @@
|
||||
<PackageReference Include="Emoji.Wpf" Version="0.3.4" />
|
||||
<PackageReference Include="LibGit2Sharp" Version="0.31.0" />
|
||||
<PackageReference Include="LazyCache" Version="2.4.0" />
|
||||
<PackageReference Include="LibreHardwareMonitorLib" Version="0.9.6" />
|
||||
<PackageReference Include="MailKit" Version="4.14.0" />
|
||||
<PackageReference Include="Meziantou.Framework.Win32.CredentialManager" Version="1.7.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.4" />
|
||||
@@ -85,17 +86,18 @@
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.RichTextBoxEx.Wpf" Version="1.1.0.1" />
|
||||
<!-- <PackageReference Include="supabase-csharp" Version="0.16.2" />-->
|
||||
<PackageReference Include="System.Drawing.Common" Version="10.0.0" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="10.0.7" />
|
||||
<PackageReference Include="System.IO.Hashing" Version="9.0.4" />
|
||||
<PackageReference Include="TorchSharp" Version="0.105.0" />
|
||||
<PackageReference Include="Vanara.PInvoke.CoreAudio" Version="4.1.3" />
|
||||
<PackageReference Include="Vanara.PInvoke.NtDll" Version="4.1.3" />
|
||||
<PackageReference Include="Vanara.PInvoke.SHCore" Version="4.1.3" />
|
||||
<PackageReference Include="Vanara.PInvoke.User32" Version="4.1.3" />
|
||||
<PackageReference Include="XamlAnimatedGif" Version="2.3.1" />
|
||||
<PackageReference Include="WPF-UI" Version="4.2.0" />
|
||||
<PackageReference Include="WPF-UI.DependencyInjection" Version="4.2.0" />
|
||||
<PackageReference Include="WPF-UI.Tray" Version="4.2.0" />
|
||||
<PackageReference Include="WPF-UI.Violeta" Version="4.2.0.10" />
|
||||
<PackageReference Include="WPF-UI" Version="4.3.0" />
|
||||
<PackageReference Include="WPF-UI.DependencyInjection" Version="4.3.0" />
|
||||
<PackageReference Include="WPF-UI.Tray" Version="4.3.0" />
|
||||
<PackageReference Include="WPF-UI.Violeta" Version="4.3.0.0" />
|
||||
<PackageReference Include="gong-wpf-dragdrop" Version="3.2.1" />
|
||||
<PackageReference Include="YamlDotNet" Version="16.3.0" />
|
||||
<PackageReference Include="YoloSharp" Version="6.0.3" />
|
||||
@@ -201,6 +203,9 @@
|
||||
<None Update="GameTask\AutoDomain\Assets\1920x1080\**">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="GameTask\AutoBoss\Assets\**">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="User\I18n\en.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
||||
@@ -21,10 +21,12 @@ public class BvLocator
|
||||
{
|
||||
private static readonly ILogger Logger = App.GetLogger<BvLocator>();
|
||||
private readonly CancellationToken _cancellationToken;
|
||||
private int? _timeout;
|
||||
private int? _retryInterval;
|
||||
|
||||
public RecognitionObject RecognitionObject { get; }
|
||||
|
||||
public Action<List<Region>>? RetryAction { get; set; }
|
||||
public Func<List<Region>, Task>? RetryAction { get; set; }
|
||||
|
||||
public static int DefaultTimeout { get; set; } = 10000;
|
||||
|
||||
@@ -98,17 +100,21 @@ public class BvLocator
|
||||
|
||||
public async Task<List<Region>> WaitFor(int? timeout = null)
|
||||
{
|
||||
var actualTimeout = timeout ?? DefaultTimeout;
|
||||
var retryCount = actualTimeout / DefaultRetryInterval;
|
||||
var actualTimeout = timeout ?? _timeout ?? DefaultTimeout;
|
||||
var actualRetryInterval = _retryInterval ?? DefaultRetryInterval;
|
||||
var retryCount = Math.Max(1, actualTimeout / actualRetryInterval);
|
||||
|
||||
List<Region> results = [];
|
||||
var retryRes = await NewRetry.WaitForAction(() =>
|
||||
var retryRes = await NewRetry.WaitForAction(async () =>
|
||||
{
|
||||
results = FindAll();
|
||||
var b = results.Count > 0;
|
||||
RetryAction?.Invoke(results);
|
||||
if (!b && RetryAction != null)
|
||||
{
|
||||
await RetryAction(results);
|
||||
}
|
||||
return b;
|
||||
}, _cancellationToken, retryCount, DefaultRetryInterval);
|
||||
}, _cancellationToken, retryCount, actualRetryInterval);
|
||||
|
||||
if (retryRes)
|
||||
{
|
||||
@@ -150,20 +156,21 @@ public class BvLocator
|
||||
|
||||
public async Task WaitForDisappear(int? timeout = null)
|
||||
{
|
||||
var actualTimeout = timeout ?? DefaultTimeout;
|
||||
var retryCount = actualTimeout / DefaultRetryInterval;
|
||||
var actualTimeout = timeout ?? _timeout ?? DefaultTimeout;
|
||||
var actualRetryInterval = _retryInterval ?? DefaultRetryInterval;
|
||||
var retryCount = Math.Max(1, actualTimeout / actualRetryInterval);
|
||||
|
||||
var retryRes = await NewRetry.WaitForAction(() =>
|
||||
var retryRes = await NewRetry.WaitForAction(async () =>
|
||||
{
|
||||
var results = FindAll();
|
||||
var b = results.Count == 0;
|
||||
if (!b)
|
||||
if (!b && RetryAction != null)
|
||||
{
|
||||
RetryAction?.Invoke(results);
|
||||
await RetryAction(results);
|
||||
}
|
||||
|
||||
return b;
|
||||
}, _cancellationToken, retryCount, DefaultRetryInterval);
|
||||
}, _cancellationToken, retryCount, actualRetryInterval);
|
||||
|
||||
if (!retryRes)
|
||||
{
|
||||
@@ -205,7 +212,77 @@ public class BvLocator
|
||||
|
||||
public BvLocator WithRetryAction(Action<List<Region>>? action)
|
||||
{
|
||||
RetryAction = action;
|
||||
if (action == null)
|
||||
{
|
||||
RetryAction = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
RetryAction = (results) =>
|
||||
{
|
||||
action(results);
|
||||
return Task.CompletedTask;
|
||||
};
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置超时时间(毫秒)
|
||||
/// </summary>
|
||||
/// <param name="timeout">超时时间(毫秒)</param>
|
||||
/// <returns></returns>
|
||||
public BvLocator WithTimeout(int timeout)
|
||||
{
|
||||
if (timeout <= 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(timeout), "timeout 必须大于 0");
|
||||
}
|
||||
_timeout = timeout;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置重试间隔(毫秒)
|
||||
/// </summary>
|
||||
/// <param name="retryInterval">重试间隔(毫秒)</param>
|
||||
/// <returns></returns>
|
||||
public BvLocator WithRetryInterval(int retryInterval)
|
||||
{
|
||||
if (retryInterval <= 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(retryInterval), "retryInterval 必须大于 0");
|
||||
}
|
||||
_retryInterval = retryInterval;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 为 JavaScript 提供的动态参数重载
|
||||
/// 解决 ClearScript 无法将 JS 函数隐式转换为 Action 委托的问题
|
||||
/// 支持同步和异步 JS 函数
|
||||
/// </summary>
|
||||
/// <param name="action">JS 回调函数</param>
|
||||
/// <returns></returns>
|
||||
public BvLocator WithRetryAction(dynamic action)
|
||||
{
|
||||
if (action == null)
|
||||
{
|
||||
RetryAction = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
RetryAction = async (results) =>
|
||||
{
|
||||
var taskResult = action(results);
|
||||
// 如果 JS 返回的是 Promise/Task,等待其完成
|
||||
if (taskResult is Task task)
|
||||
{
|
||||
await task;
|
||||
}
|
||||
};
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using BetterGenshinImpact.GameTask;
|
||||
using BetterGenshinImpact.GameTask.AutoDomain;
|
||||
using BetterGenshinImpact.GameTask.AutoBoss;
|
||||
using BetterGenshinImpact.GameTask.AutoFight;
|
||||
using BetterGenshinImpact.GameTask.AutoFishing;
|
||||
using BetterGenshinImpact.GameTask.AutoGeniusInvokation;
|
||||
@@ -153,6 +154,11 @@ public partial class AllConfig : ObservableObject
|
||||
/// 自动秘境配置
|
||||
/// </summary>
|
||||
public AutoDomainConfig AutoDomainConfig { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 自动首领讨伐配置
|
||||
/// </summary>
|
||||
public AutoBossConfig AutoBossConfig { get; set; } = new();
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -271,6 +277,7 @@ public partial class AllConfig : ObservableObject
|
||||
AutoWoodConfig.PropertyChanged += OnAnyPropertyChanged;
|
||||
AutoFightConfig.PropertyChanged += OnAnyPropertyChanged;
|
||||
AutoDomainConfig.PropertyChanged += OnAnyPropertyChanged;
|
||||
AutoBossConfig.PropertyChanged += OnAnyPropertyChanged;
|
||||
AutoStygianOnslaughtConfig.PropertyChanged += OnAnyPropertyChanged;
|
||||
AutoArtifactSalvageConfig.PropertyChanged += OnAnyPropertyChanged;
|
||||
AutoRedeemCodeConfig.PropertyChanged += OnAnyPropertyChanged;
|
||||
|
||||
@@ -38,6 +38,12 @@ public partial class CommonConfig : ObservableObject
|
||||
[ObservableProperty]
|
||||
private bool _screenshotUidCoverEnabled = true;
|
||||
|
||||
/// <summary>
|
||||
/// 是否保存奖励识别调试截图
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private bool _rewardRecognitionScreenshotEnabled;
|
||||
|
||||
/// <summary>
|
||||
/// 退出时最小化至托盘
|
||||
/// </summary>
|
||||
@@ -80,4 +86,22 @@ public partial class CommonConfig : ObservableObject
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private string _redeemCodeFeedsUpdateVersion = "20251013";
|
||||
|
||||
/// <summary>
|
||||
/// 国服兑换码更新是否允许通知
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private bool _redeemCodeCnFeedsNotificationEnabled = true;
|
||||
|
||||
/// <summary>
|
||||
/// 国际服兑换码更新是否允许通知
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private bool _redeemCodeGlobalFeedsNotificationEnabled;
|
||||
|
||||
/// <summary>
|
||||
/// 当前看过的国际服兑换码推送版本
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private string _redeemCodeGlobalFeedsUpdateVersion = string.Empty;
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using OpenCvSharp;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Config;
|
||||
|
||||
@@ -10,6 +12,23 @@ namespace BetterGenshinImpact.Core.Config;
|
||||
[Serializable]
|
||||
public partial class MaskWindowConfig : ObservableObject
|
||||
{
|
||||
// 指标栏布局和遮罩里其它元素一样按 1920x1080 折算比例保存,默认放在状态栏/日志上方以避开游戏底部 UI。
|
||||
public const double DefaultMetricsLeftRatio = 20.0 / 1920;
|
||||
public const double DefaultMetricsTopRatio = 744.0 / 1080;
|
||||
public const double DefaultMetricsWidthRatio = 477.0 / 1920;
|
||||
public const double DefaultMetricsHeightRatio = 58.0 / 1080;
|
||||
|
||||
// 这些是开发评审过程中曾下发过的默认布局;用户没有手动调整时迁移到最新默认值,避免旧默认继续挡住游戏 UI。
|
||||
private static readonly (double Left, double Top, double Width, double Height)[] LegacyMetricsLayouts =
|
||||
[
|
||||
(4.0 / 1920, 4.0 / 1080, 720.0 / 1920, 42.0 / 1080),
|
||||
(600.0 / 1920, 16.0 / 1080, 720.0 / 1920, 42.0 / 1080),
|
||||
(20.0 / 1920, 724.0 / 1080, 760.0 / 1920, 58.0 / 1080),
|
||||
(20.0 / 1920, 724.0 / 1080, 760.0 / 1920, 42.0 / 1080),
|
||||
(20.0 / 1920, 760.0 / 1080, 477.0 / 1920, 42.0 / 1080),
|
||||
(20.0 / 1920, 760.0 / 1080, 477.0 / 1920, 58.0 / 1080)
|
||||
];
|
||||
|
||||
/// <summary>
|
||||
/// 方位提示是否启用
|
||||
/// </summary>
|
||||
@@ -63,6 +82,15 @@ public partial class MaskWindowConfig : ObservableObject
|
||||
[ObservableProperty]
|
||||
private bool _showFps = false;
|
||||
|
||||
/// <summary>
|
||||
/// 显示遮罩指标栏
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private bool _showOverlayMetrics = false;
|
||||
|
||||
// 配置文件里使用 string key 便于兼容旧版本,读取后由 EnsureOverlayMetricItems 约束回固定枚举集合。
|
||||
public Dictionary<string, bool> OverlayMetricItems { get; set; } = OverlayMetricItemDefaults.CreateDefaultItems();
|
||||
|
||||
/// <summary>
|
||||
/// 遮罩文本透明度 (0.0-1.0)
|
||||
/// </summary>
|
||||
@@ -95,4 +123,85 @@ public partial class MaskWindowConfig : ObservableObject
|
||||
|
||||
[ObservableProperty]
|
||||
private double _statusListHeightRatio = 24.0 / 1080;
|
||||
|
||||
[ObservableProperty]
|
||||
private double _metricsLeftRatio = DefaultMetricsLeftRatio;
|
||||
|
||||
[ObservableProperty]
|
||||
private double _metricsTopRatio = DefaultMetricsTopRatio;
|
||||
|
||||
[ObservableProperty]
|
||||
private double _metricsWidthRatio = DefaultMetricsWidthRatio;
|
||||
|
||||
[ObservableProperty]
|
||||
private double _metricsHeightRatio = DefaultMetricsHeightRatio;
|
||||
|
||||
public void ResetOverlayMetricsLayout()
|
||||
{
|
||||
MetricsLeftRatio = DefaultMetricsLeftRatio;
|
||||
MetricsTopRatio = DefaultMetricsTopRatio;
|
||||
MetricsWidthRatio = DefaultMetricsWidthRatio;
|
||||
MetricsHeightRatio = DefaultMetricsHeightRatio;
|
||||
}
|
||||
|
||||
public void MigrateLegacyOverlayMetricsLayout()
|
||||
{
|
||||
if (LegacyMetricsLayouts.Any(layout =>
|
||||
IsSameRatio(MetricsLeftRatio, layout.Left)
|
||||
&& IsSameRatio(MetricsTopRatio, layout.Top)
|
||||
&& IsSameRatio(MetricsWidthRatio, layout.Width)
|
||||
&& IsSameRatio(MetricsHeightRatio, layout.Height)))
|
||||
{
|
||||
ResetOverlayMetricsLayout();
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsSameRatio(double left, double right)
|
||||
{
|
||||
return Math.Abs(left - right) < 0.0000001;
|
||||
}
|
||||
|
||||
public void EnsureOverlayMetricItems()
|
||||
{
|
||||
// 旧配置可能缺少新指标或残留废弃指标,这里统一补默认项并移除非法 key,避免 UI 渲染任意字符串。
|
||||
OverlayMetricItems ??= [];
|
||||
|
||||
// TriggerInterval 第一版展示的是配置值,现已替换为 PeakProcessingCost;保留用户原来的勾选状态。
|
||||
const string legacyTriggerIntervalKey = "TriggerInterval";
|
||||
var peakProcessingCostKey = OverlayMetricItem.PeakProcessingCost.ToString();
|
||||
if (OverlayMetricItems.TryGetValue(legacyTriggerIntervalKey, out var legacyEnabled)
|
||||
&& !OverlayMetricItems.ContainsKey(peakProcessingCostKey))
|
||||
{
|
||||
OverlayMetricItems[peakProcessingCostKey] = legacyEnabled;
|
||||
}
|
||||
|
||||
foreach (var item in OverlayMetricItemDefaults.AllItems)
|
||||
{
|
||||
var key = item.ToString();
|
||||
if (!OverlayMetricItems.ContainsKey(key))
|
||||
{
|
||||
OverlayMetricItems[key] = OverlayMetricItemDefaults.IsEnabledByDefault(item);
|
||||
}
|
||||
}
|
||||
|
||||
var validKeys = OverlayMetricItemDefaults.AllItems.Select(item => item.ToString()).ToHashSet();
|
||||
foreach (var key in OverlayMetricItems.Keys.Where(key => !validKeys.Contains(key)).ToList())
|
||||
{
|
||||
OverlayMetricItems.Remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsOverlayMetricEnabled(OverlayMetricItem item)
|
||||
{
|
||||
return OverlayMetricItems != null && OverlayMetricItems.TryGetValue(item.ToString(), out var enabled)
|
||||
? enabled
|
||||
: OverlayMetricItemDefaults.IsEnabledByDefault(item);
|
||||
}
|
||||
|
||||
public void SetOverlayMetricEnabled(OverlayMetricItem item, bool enabled)
|
||||
{
|
||||
EnsureOverlayMetricItems();
|
||||
OverlayMetricItems[item.ToString()] = enabled;
|
||||
OnPropertyChanged(nameof(OverlayMetricItems));
|
||||
}
|
||||
}
|
||||
@@ -46,13 +46,13 @@ public partial class OneDragonFlowConfig : ObservableObject
|
||||
[ObservableProperty]
|
||||
private int _minResinToKeep = 0;
|
||||
|
||||
// 领取每日奖励的好感数量
|
||||
// 普通周日或限时奖励选项
|
||||
[ObservableProperty]
|
||||
private string _sundayEverySelectedValue = "0";
|
||||
|
||||
// 领取每日奖励的好感数量
|
||||
|
||||
// 每周秘境的全局限时奖励选项,单日留空时使用
|
||||
[ObservableProperty]
|
||||
private string _sundaySelectedValue = "0";
|
||||
private string _sundayWeeklySelectedValue = "0";
|
||||
|
||||
// 尘歌壶传送方式,1. 地图传送 2. 尘歌壶道具
|
||||
[ObservableProperty]
|
||||
@@ -151,6 +151,9 @@ public partial class OneDragonFlowConfig : ObservableObject
|
||||
|
||||
[ObservableProperty]
|
||||
private string _mondayDomainName = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _mondaySelectedValue = "0";
|
||||
|
||||
|
||||
//周二
|
||||
@@ -159,6 +162,9 @@ public partial class OneDragonFlowConfig : ObservableObject
|
||||
|
||||
[ObservableProperty]
|
||||
private string _tuesdayDomainName = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _tuesdaySelectedValue = "0";
|
||||
|
||||
//周三
|
||||
[ObservableProperty]
|
||||
@@ -166,6 +172,9 @@ public partial class OneDragonFlowConfig : ObservableObject
|
||||
|
||||
[ObservableProperty]
|
||||
private string _wednesdayDomainName = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _wednesdaySelectedValue = "0";
|
||||
|
||||
//周四
|
||||
[ObservableProperty]
|
||||
@@ -173,6 +182,9 @@ public partial class OneDragonFlowConfig : ObservableObject
|
||||
|
||||
[ObservableProperty]
|
||||
private string _thursdayDomainName = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _thursdaySelectedValue = "0";
|
||||
|
||||
//周五
|
||||
[ObservableProperty]
|
||||
@@ -180,6 +192,9 @@ public partial class OneDragonFlowConfig : ObservableObject
|
||||
|
||||
[ObservableProperty]
|
||||
private string _fridayDomainName = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _fridaySelectedValue = "0";
|
||||
|
||||
//周六
|
||||
[ObservableProperty]
|
||||
@@ -187,6 +202,9 @@ public partial class OneDragonFlowConfig : ObservableObject
|
||||
|
||||
[ObservableProperty]
|
||||
private string _saturdayDomainName = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _saturdaySelectedValue = "0";
|
||||
|
||||
//周日
|
||||
[ObservableProperty]
|
||||
@@ -195,6 +213,9 @@ public partial class OneDragonFlowConfig : ObservableObject
|
||||
[ObservableProperty]
|
||||
private string _sundayDomainName = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _sundaySelectedValue = "0";
|
||||
|
||||
// 完成后操作
|
||||
[ObservableProperty]
|
||||
private string _completionAction = string.Empty;
|
||||
@@ -208,22 +229,37 @@ public partial class OneDragonFlowConfig : ObservableObject
|
||||
var dayOfWeek = (serverTime.Hour >= 4 ? serverTime : serverTime.AddDays(-1)).DayOfWeek;
|
||||
return dayOfWeek switch
|
||||
{
|
||||
DayOfWeek.Monday => (MondayPartyName, MondayDomainName,SundaySelectedValue),
|
||||
DayOfWeek.Tuesday => (TuesdayPartyName, TuesdayDomainName,SundaySelectedValue),
|
||||
DayOfWeek.Wednesday => (WednesdayPartyName, WednesdayDomainName,SundaySelectedValue),
|
||||
DayOfWeek.Thursday => (ThursdayPartyName, ThursdayDomainName,SundaySelectedValue),
|
||||
DayOfWeek.Friday => (FridayPartyName, FridayDomainName,SundaySelectedValue),
|
||||
DayOfWeek.Saturday => (SaturdayPartyName, SaturdayDomainName,SundaySelectedValue),
|
||||
DayOfWeek.Sunday => (SundayPartyName, SundayDomainName,SundaySelectedValue),
|
||||
_ => (PartyName, DomainName,SundaySelectedValue)
|
||||
DayOfWeek.Monday => (GetWeeklyPartyName(MondayPartyName), GetWeeklyDomainName(MondayDomainName), GetWeeklySelectedValue(MondaySelectedValue)),
|
||||
DayOfWeek.Tuesday => (GetWeeklyPartyName(TuesdayPartyName), GetWeeklyDomainName(TuesdayDomainName), GetWeeklySelectedValue(TuesdaySelectedValue)),
|
||||
DayOfWeek.Wednesday => (GetWeeklyPartyName(WednesdayPartyName), GetWeeklyDomainName(WednesdayDomainName), GetWeeklySelectedValue(WednesdaySelectedValue)),
|
||||
DayOfWeek.Thursday => (GetWeeklyPartyName(ThursdayPartyName), GetWeeklyDomainName(ThursdayDomainName), GetWeeklySelectedValue(ThursdaySelectedValue)),
|
||||
DayOfWeek.Friday => (GetWeeklyPartyName(FridayPartyName), GetWeeklyDomainName(FridayDomainName), GetWeeklySelectedValue(FridaySelectedValue)),
|
||||
DayOfWeek.Saturday => (GetWeeklyPartyName(SaturdayPartyName), GetWeeklyDomainName(SaturdayDomainName), GetWeeklySelectedValue(SaturdaySelectedValue)),
|
||||
DayOfWeek.Sunday => (GetWeeklyPartyName(SundayPartyName), GetWeeklyDomainName(SundayDomainName), GetWeeklySelectedValue(SundaySelectedValue)),
|
||||
_ => (PartyName, DomainName, SundayWeeklySelectedValue)
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
return (PartyName, DomainName,SundayEverySelectedValue);
|
||||
return (PartyName, DomainName, SundayEverySelectedValue);
|
||||
}
|
||||
}
|
||||
|
||||
private string GetWeeklyPartyName(string partyName)
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(partyName) ? PartyName : partyName;
|
||||
}
|
||||
|
||||
private string GetWeeklyDomainName(string domainName)
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(domainName) ? DomainName : domainName;
|
||||
}
|
||||
|
||||
private string GetWeeklySelectedValue(string selectedValue)
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(selectedValue) || selectedValue == "0" ? SundayWeeklySelectedValue : selectedValue;
|
||||
}
|
||||
|
||||
public bool ShouldRunLeyLineToday()
|
||||
{
|
||||
if (!LeyLineRunMonday
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Config;
|
||||
|
||||
public enum OverlayMetricItem
|
||||
{
|
||||
GameFps,
|
||||
ProcessingCost,
|
||||
PeakProcessingCost,
|
||||
CaptureCost,
|
||||
TriggerCost,
|
||||
SkippedTicks,
|
||||
CpuUsage,
|
||||
GpuUsage,
|
||||
MemoryUsage
|
||||
}
|
||||
|
||||
public static class OverlayMetricItemDefaults
|
||||
{
|
||||
// 显式顺序同时决定遮罩三行三列显示顺序和设置页复选框顺序,不要随手改回 Enum.GetValues。
|
||||
public static IReadOnlyList<OverlayMetricItem> AllItems { get; } =
|
||||
[
|
||||
OverlayMetricItem.GameFps,
|
||||
OverlayMetricItem.ProcessingCost,
|
||||
OverlayMetricItem.PeakProcessingCost,
|
||||
OverlayMetricItem.CaptureCost,
|
||||
OverlayMetricItem.TriggerCost,
|
||||
OverlayMetricItem.SkippedTicks,
|
||||
OverlayMetricItem.GpuUsage,
|
||||
OverlayMetricItem.CpuUsage,
|
||||
OverlayMetricItem.MemoryUsage
|
||||
];
|
||||
|
||||
public static Dictionary<string, bool> CreateDefaultItems()
|
||||
{
|
||||
return AllItems.ToDictionary(item => item.ToString(), IsEnabledByDefault);
|
||||
}
|
||||
|
||||
public static bool IsEnabledByDefault(OverlayMetricItem item)
|
||||
{
|
||||
// 默认只开启低风险的常用实时指标;硬件传感器项由用户按需开启,读不到时也不会占位显示。
|
||||
return item is OverlayMetricItem.GameFps
|
||||
or OverlayMetricItem.ProcessingCost
|
||||
or OverlayMetricItem.PeakProcessingCost
|
||||
or OverlayMetricItem.CaptureCost
|
||||
or OverlayMetricItem.SkippedTicks
|
||||
or OverlayMetricItem.MemoryUsage;
|
||||
}
|
||||
|
||||
public static string GetDisplayName(OverlayMetricItem item)
|
||||
{
|
||||
return item switch
|
||||
{
|
||||
OverlayMetricItem.GameFps => "游戏帧率",
|
||||
OverlayMetricItem.ProcessingCost => "处理耗时",
|
||||
OverlayMetricItem.PeakProcessingCost => "峰值耗时",
|
||||
OverlayMetricItem.CaptureCost => "截图耗时",
|
||||
OverlayMetricItem.TriggerCost => "触发器耗时",
|
||||
OverlayMetricItem.SkippedTicks => "跳过次数",
|
||||
OverlayMetricItem.CpuUsage => "CPU占用",
|
||||
OverlayMetricItem.GpuUsage => "显卡占用",
|
||||
OverlayMetricItem.MemoryUsage => "内存占用",
|
||||
_ => item.ToString()
|
||||
};
|
||||
}
|
||||
|
||||
public static string GetToolTipText(OverlayMetricItem item)
|
||||
{
|
||||
return item switch
|
||||
{
|
||||
OverlayMetricItem.GameFps => "游戏当前渲染帧率。",
|
||||
OverlayMetricItem.ProcessingCost => "BetterGI 每轮截图、识别和触发器处理的总耗时。",
|
||||
OverlayMetricItem.PeakProcessingCost => "最近 5 秒内 BetterGI 单轮处理耗时的峰值。",
|
||||
OverlayMetricItem.CaptureCost => "单次获取游戏画面的耗时。",
|
||||
OverlayMetricItem.TriggerCost => "本轮实际执行触发器的总耗时。",
|
||||
OverlayMetricItem.SkippedTicks => "上一轮未结束导致本秒跳过的调度次数。",
|
||||
OverlayMetricItem.CpuUsage => "CPU 总占用率,读取不到时自动隐藏。",
|
||||
OverlayMetricItem.GpuUsage => "显卡核心占用率,读取不到时自动隐藏。",
|
||||
OverlayMetricItem.MemoryUsage => "系统内存占用率,读取不到时自动隐藏。",
|
||||
_ => string.Empty
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -44,4 +44,14 @@ public readonly record struct OcrVersionConfig(
|
||||
[0.485f, 0.456f, 0.406f],
|
||||
[0.229f, 0.224f, 0.225f]
|
||||
), new OcrShape(3, 320, 48));
|
||||
|
||||
public static OcrVersionConfig PpOcrV6 = new(
|
||||
"PP-OCRv6",
|
||||
OcrImgMode.BGR,
|
||||
false,
|
||||
new OcrNormalizeImage(
|
||||
1.0f / 255.0f,
|
||||
[0.485f, 0.456f, 0.406f],
|
||||
[0.229f, 0.224f, 0.225f]
|
||||
), new OcrShape(3, 320, 48));
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Threading.Tasks;
|
||||
using BetterGenshinImpact.Core.Config;
|
||||
@@ -100,6 +100,9 @@ public class OcrFactory : IDisposable
|
||||
PaddleOcrModelConfig.V5 =>
|
||||
new PaddleOcrService(App.ServiceProvider.GetRequiredService<BgiOnnxFactory>(),
|
||||
PaddleOcrService.PaddleOcrModelType.V5),
|
||||
PaddleOcrModelConfig.V6 =>
|
||||
new PaddleOcrService(App.ServiceProvider.GetRequiredService<BgiOnnxFactory>(),
|
||||
PaddleOcrService.PaddleOcrModelType.V6),
|
||||
PaddleOcrModelConfig.V4 =>
|
||||
new PaddleOcrService(App.ServiceProvider.GetRequiredService<BgiOnnxFactory>(),
|
||||
PaddleOcrService.PaddleOcrModelType.V4),
|
||||
@@ -120,7 +123,6 @@ public class OcrFactory : IDisposable
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
public Task Unload()
|
||||
{
|
||||
if (_paddleOcrService is not IDisposable disposable)
|
||||
|
||||
@@ -13,8 +13,17 @@ public class Det(BgiOnnxModel model, OcrVersionConfig config, BgiOnnxFactory bgi
|
||||
{
|
||||
private readonly InferenceSession _session = bgiOnnxFactory.CreateInferenceSession(model, true);
|
||||
|
||||
/// <summary>Gets or sets the maximum size for resizing the input image.</summary>
|
||||
public int? MaxSize { get; set; } = 960;
|
||||
/// <summary>Gets or sets the detection side length limit used by the Python det preprocess.</summary>
|
||||
public int LimitSideLen { get; set; } = 960;
|
||||
|
||||
/// <summary>Gets or sets the maximum size limit after resizing.</summary>
|
||||
public int MaxSideLimit { get; set; } = 4000;
|
||||
|
||||
/// <summary>Gets or sets the side length limit type. Supports max/min/resize_long.</summary>
|
||||
public string LimitType { get; set; } = "max";
|
||||
|
||||
/// <summary>Gets or sets the shortest side threshold used for tiny-image upscaling.</summary>
|
||||
public int SmallImageLimitSideLen { get; set; } = 64;
|
||||
|
||||
/// <summary>Gets or sets the size for dilation during preprocessing.</summary>
|
||||
public int? DilatedSize { get; set; } = 2;
|
||||
@@ -71,20 +80,24 @@ public class Det(BgiOnnxModel model, OcrVersionConfig config, BgiOnnxFactory bgi
|
||||
}
|
||||
|
||||
var contours = dilated.FindContoursAsArray(RetrievalModes.List, ContourApproximationModes.ApproxSimple);
|
||||
// var size = src.Size();
|
||||
var scaleRate = 1.0 * src.Width / resizedSize.Width;
|
||||
// PaddleOCR Python keeps ratio_h/ratio_w separately. Because we align det resize to that behavior,
|
||||
// map contour points back with independent X/Y scales before building rotated rects.
|
||||
var scaleX = 1.0 * src.Width / resizedSize.Width;
|
||||
var scaleY = 1.0 * src.Height / resizedSize.Height;
|
||||
|
||||
var rects = contours
|
||||
.Where(x => BoxScoreThreshold == null || GetScore(x, pred) > BoxScoreThreshold)
|
||||
.Select(contour =>
|
||||
contour.Select(point => new Point2f((float)(point.X * scaleX), (float)(point.Y * scaleY))).ToArray())
|
||||
.Select(Cv2.MinAreaRect)
|
||||
.Where(x => x.Size.Width > MinSize && x.Size.Height > MinSize)
|
||||
.Select(rect =>
|
||||
{
|
||||
var minEdge = Math.Min(rect.Size.Width, rect.Size.Height);
|
||||
Size2f newSize = new(
|
||||
(rect.Size.Width + UnclipRatio * minEdge) * scaleRate,
|
||||
(rect.Size.Height + UnclipRatio * minEdge) * scaleRate);
|
||||
RotatedRect largerRect = new(rect.Center * scaleRate, newSize, rect.Angle);
|
||||
rect.Size.Width + UnclipRatio * minEdge,
|
||||
rect.Size.Height + UnclipRatio * minEdge);
|
||||
RotatedRect largerRect = new(rect.Center, newSize, rect.Angle);
|
||||
return largerRect;
|
||||
})
|
||||
.OrderBy(v => v.Center.Y)
|
||||
@@ -107,11 +120,14 @@ public class Det(BgiOnnxModel model, OcrVersionConfig config, BgiOnnxFactory bgi
|
||||
3 => src,
|
||||
var x => throw new Exception($"Unexpect src channel: {x}, allow: (1/3/4)")
|
||||
};
|
||||
// DetResizeForTest resize_long
|
||||
using (var resized = MatResize(padded, MaxSize))
|
||||
// Align with PaddleOCR Python DetResizeForTest:
|
||||
// 1. tiny image padding when h + w < 64
|
||||
// 2. keep current max/960 behavior for normal images
|
||||
// 3. switch to limit_type=min for very small crops so det can see the text
|
||||
using (var resized = MatResizeForDetection(padded))
|
||||
{
|
||||
resizedSize = new Size(resized.Width, resized.Height);
|
||||
padded = MatPadding32(resized);
|
||||
padded = resized.Clone();
|
||||
}
|
||||
|
||||
using (var _ = padded)
|
||||
@@ -150,19 +166,80 @@ public class Det(BgiOnnxModel model, OcrVersionConfig config, BgiOnnxFactory bgi
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 按比例缩放图像,保持长边不超过 maxSize。
|
||||
/// 按 PaddleOCR Python 的 DetResizeForTest 思路缩放图像:
|
||||
/// 小图先补边,再按 max/min/resize_long 规则缩放,并对齐到 32 的倍数。
|
||||
/// </summary>
|
||||
/// <param name="src"></param>
|
||||
/// <param name="maxSize"></param>
|
||||
/// <returns></returns>
|
||||
private static Mat MatResize(Mat src, int? maxSize)
|
||||
private Mat MatResizeForDetection(Mat src)
|
||||
{
|
||||
if (maxSize == null) return src.Clone();
|
||||
using var preprocessed = PrepareTinyImage(src);
|
||||
|
||||
var size = src.Size();
|
||||
var longEdge = Math.Max(size.Width, size.Height);
|
||||
var scaleRate = 1.0 * maxSize.Value / longEdge;
|
||||
return scaleRate < 1.0 ? src.Resize(default, scaleRate, scaleRate) : src.Clone();
|
||||
var size = preprocessed.Size();
|
||||
var height = size.Height;
|
||||
var width = size.Width;
|
||||
|
||||
var limitSideLen = LimitSideLen;
|
||||
var limitType = LimitType;
|
||||
|
||||
if (Math.Min(height, width) < SmallImageLimitSideLen)
|
||||
{
|
||||
limitSideLen = SmallImageLimitSideLen;
|
||||
limitType = "min";
|
||||
}
|
||||
|
||||
var ratio = CalculateResizeRatio(width, height, limitSideLen, limitType);
|
||||
var resizeHeight = (int)(height * ratio);
|
||||
var resizeWidth = (int)(width * ratio);
|
||||
|
||||
if (Math.Max(resizeHeight, resizeWidth) > MaxSideLimit)
|
||||
{
|
||||
var maxSideRatio = 1.0 * MaxSideLimit / Math.Max(resizeHeight, resizeWidth);
|
||||
resizeHeight = (int)(resizeHeight * maxSideRatio);
|
||||
resizeWidth = (int)(resizeWidth * maxSideRatio);
|
||||
}
|
||||
|
||||
resizeHeight = Math.Max((int)Math.Round(resizeHeight / 32.0) * 32, 32);
|
||||
resizeWidth = Math.Max((int)Math.Round(resizeWidth / 32.0) * 32, 32);
|
||||
|
||||
if (resizeWidth <= 0 || resizeHeight <= 0)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
$"Invalid det resize target size: {resizeWidth}x{resizeHeight}, src={width}x{height}");
|
||||
}
|
||||
|
||||
using var resized = preprocessed.Resize(new Size(resizeWidth, resizeHeight));
|
||||
return MatPadding32(resized);
|
||||
}
|
||||
|
||||
private static Mat PrepareTinyImage(Mat src)
|
||||
{
|
||||
if (src.Width + src.Height >= 64)
|
||||
{
|
||||
return src.Clone();
|
||||
}
|
||||
|
||||
var newHeight = Math.Max(32, src.Height);
|
||||
var newWidth = Math.Max(32, src.Width);
|
||||
var padded = new Mat(newHeight, newWidth, src.Type(), Scalar.Black);
|
||||
src.CopyTo(padded[new Rect(0, 0, src.Width, src.Height)]);
|
||||
return padded;
|
||||
}
|
||||
|
||||
private static double CalculateResizeRatio(int width, int height, int limitSideLen, string limitType)
|
||||
{
|
||||
return limitType switch
|
||||
{
|
||||
"max" => Math.Max(height, width) > limitSideLen
|
||||
? 1.0 * limitSideLen / Math.Max(height, width)
|
||||
: 1.0,
|
||||
"min" => Math.Min(height, width) < limitSideLen
|
||||
? 1.0 * limitSideLen / Math.Min(height, width)
|
||||
: 1.0,
|
||||
"resize_long" => 1.0 * limitSideLen / Math.Max(height, width),
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(limitType), limitType,
|
||||
"limitType only supports max/min/resize_long")
|
||||
};
|
||||
}
|
||||
|
||||
private static float GetScore(Point[] contour, Mat pred)
|
||||
@@ -197,4 +274,4 @@ public class Det(BgiOnnxModel model, OcrVersionConfig config, BgiOnnxFactory bgi
|
||||
}
|
||||
|
||||
public string GetConfigName => config.Name;
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@ public class PaddleOcrService : IOcrService, IDisposable
|
||||
recognitionModel,
|
||||
recognitionVersion,
|
||||
recLabel ?? (() => DefaultRecLabelFunc(recognitionModel)),
|
||||
TestImagePath);
|
||||
preHeatImagePath ?? TestImagePath);
|
||||
}
|
||||
|
||||
public (Det, Rec) Build(BgiOnnxFactory onnxFactory)
|
||||
@@ -130,6 +130,12 @@ public class PaddleOcrService : IOcrService, IDisposable
|
||||
BgiOnnxModel.PaddleOcrRecV5,
|
||||
OcrVersionConfig.PpOcrV5);
|
||||
|
||||
public static readonly PaddleOcrModelType V6 = Create(
|
||||
BgiOnnxModel.PaddleOcrDetV6,
|
||||
OcrVersionConfig.PpOcrV6,
|
||||
BgiOnnxModel.PaddleOcrRecV6,
|
||||
OcrVersionConfig.PpOcrV6);
|
||||
|
||||
public static readonly PaddleOcrModelType V5Latin = Create(
|
||||
BgiOnnxModel.PaddleOcrDetV5,
|
||||
OcrVersionConfig.PpOcrV5,
|
||||
@@ -285,7 +291,7 @@ public class PaddleOcrService : IOcrService, IDisposable
|
||||
var startTime = Stopwatch.GetTimestamp();
|
||||
var str = _localRecModel.Run(mat).Text;
|
||||
var time = Stopwatch.GetElapsedTime(startTime);
|
||||
Debug.WriteLine($"PaddleOcrWithoutDetector 耗时 {time.TotalMilliseconds}ms 结果: {str}");
|
||||
// Debug.WriteLine($"PaddleOcrWithoutDetector 耗时 {time.TotalMilliseconds}ms 结果: {str}");
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -294,7 +300,7 @@ public class PaddleOcrService : IOcrService, IDisposable
|
||||
var startTime = Stopwatch.GetTimestamp();
|
||||
var result = RunAll(mat);
|
||||
var time = Stopwatch.GetElapsedTime(startTime);
|
||||
Debug.WriteLine($"PaddleOcr 耗时 {time.TotalMilliseconds}ms 结果: {result.Text}");
|
||||
// Debug.WriteLine($"PaddleOcr 耗时 {time.TotalMilliseconds}ms 结果: {result.Text}");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,18 @@ public class BgiOnnxModel
|
||||
public static readonly BgiOnnxModel BgiAvatarSide =
|
||||
Register("BgiAvatarSide", @"Assets\Model\Common\avatar_side_classify_sim.onnx");
|
||||
|
||||
/// <summary>
|
||||
/// Q技能冷却分类模型
|
||||
/// </summary>
|
||||
public static readonly BgiOnnxModel BgiQClassify =
|
||||
Register("BgiQClassify", @"Assets\Model\Common\q_classify_sim.onnx");
|
||||
|
||||
/// <summary>
|
||||
/// Silero 人声检测模型
|
||||
/// </summary>
|
||||
public static readonly BgiOnnxModel SileroVad =
|
||||
Register("SileroVad", @"Assets\Model\Vad\silero_vad.onnx");
|
||||
|
||||
/// <summary>
|
||||
/// paddleOCR V4 检测模型
|
||||
/// </summary>
|
||||
@@ -67,6 +79,12 @@ public class BgiOnnxModel
|
||||
public static readonly BgiOnnxModel PaddleOcrDetV5 =
|
||||
Register("PpOcrDetV5", @"Assets\Model\PaddleOCR\Det\V5\PP-OCRv5_mobile_det_infer\slim.onnx");
|
||||
|
||||
/// <summary>
|
||||
/// paddleOCR V6 检测模型
|
||||
/// </summary>
|
||||
public static readonly BgiOnnxModel PaddleOcrDetV6 =
|
||||
Register("PpOcrDetV6", @"Assets\Model\PaddleOCR\Det\V6\PP-OCRv6_small_det_infer\slim.onnx");
|
||||
|
||||
/// <summary>
|
||||
/// paddleOCR V4 识别模型
|
||||
/// </summary>
|
||||
@@ -85,6 +103,12 @@ public class BgiOnnxModel
|
||||
public static readonly BgiOnnxModel PaddleOcrRecV5 =
|
||||
Register("PpOcrRecV5", @"Assets\Model\PaddleOCR\Rec\V5\PP-OCRv5_mobile_rec_infer\slim.onnx");
|
||||
|
||||
/// <summary>
|
||||
/// paddleOCR V6 识别模型
|
||||
/// </summary>
|
||||
public static readonly BgiOnnxModel PaddleOcrRecV6 =
|
||||
Register("PpOcrRecV6", @"Assets\Model\PaddleOCR\Rec\V6\PP-OCRv6_small_rec_infer\slim.onnx");
|
||||
|
||||
/// <summary>
|
||||
/// paddleOCR V5 拉丁文 识别模型
|
||||
/// </summary>
|
||||
@@ -144,4 +168,4 @@ public class BgiOnnxModel
|
||||
RegisteredModels.Add(model);
|
||||
return model;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,4 +10,5 @@ public enum PaddleOcrModelConfig
|
||||
V5Latin = 4,
|
||||
V5Eslav = 5,
|
||||
V5Korean = 6,
|
||||
}
|
||||
V6 = 8,
|
||||
}
|
||||
@@ -88,6 +88,7 @@ public class AutoPathingScript
|
||||
|
||||
/// <summary>
|
||||
/// 读取 AutoPathing 目录下指定文件夹的内容(非递归方式)
|
||||
/// 目录不存在时返回空数组,不会自动创建目录
|
||||
/// </summary>
|
||||
/// <param name="subPath">相对于 User\AutoPathing 的子目录路径,默认为相对根目录</param>
|
||||
/// <returns>文件夹内所有文件和文件夹的相对路径数组,出错时返回空数组</returns>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using BetterGenshinImpact.Core.Config;
|
||||
using BetterGenshinImpact.Core.Script.Dependence.Model;
|
||||
using BetterGenshinImpact.GameTask;
|
||||
using BetterGenshinImpact.GameTask.AutoBoss;
|
||||
using BetterGenshinImpact.GameTask.AutoDomain;
|
||||
using BetterGenshinImpact.GameTask.AutoEat;
|
||||
using BetterGenshinImpact.GameTask.AutoFishing;
|
||||
@@ -17,6 +18,7 @@ using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Dynamic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using BetterGenshinImpact.GameTask.AutoFight;
|
||||
@@ -189,8 +191,16 @@ public class Dispatcher
|
||||
return null;
|
||||
}
|
||||
|
||||
await new AutoDomainTask(new AutoDomainParam(0, path)).Start(cancellationToken);
|
||||
return null;
|
||||
return await new AutoDomainTask(new AutoDomainParam(0, path)).Start(cancellationToken);
|
||||
|
||||
case "AutoBoss":
|
||||
var autoBossConfig = TaskContext.Instance().Config.AutoBossConfig;
|
||||
if (taskSettingsPageViewModel.GetFightStrategy(autoBossConfig.StrategyName, out var autoBossPath))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return await new AutoBossTask(new AutoBossParam(autoBossPath)).Start(cancellationToken);
|
||||
|
||||
case "AutoFishing":
|
||||
await new AutoFishingTask(AutoFishingTaskParam.BuildFromSoloTaskConfig(soloTask.Config)).Start(
|
||||
@@ -271,16 +281,15 @@ public class Dispatcher
|
||||
GridScreenName gridScreenName = ScriptObjectConverter.GetValue((ScriptObject)soloTask.Config, "gridScreenName", (GridScreenName?)null) ?? throw new Exception("gridScreenName为空或错误");
|
||||
string? itemName = ScriptObjectConverter.GetValue((ScriptObject)soloTask.Config, "itemName", (string?)null);
|
||||
IEnumerable<string>? itemNames = ScriptObjectConverter.GetValue<string>((ScriptObject)soloTask.Config, "itemNames");
|
||||
if (itemName != null && itemNames != null)
|
||||
CountInventoryItemParam param = new()
|
||||
{
|
||||
throw new ArgumentException($"参数{nameof(itemName)}和{nameof(itemNames)}不能同时使用");
|
||||
}
|
||||
if (itemName == null && itemNames == null)
|
||||
{
|
||||
throw new ArgumentException($"参数{nameof(itemName)}和{nameof(itemNames)}不能同时为空");
|
||||
}
|
||||
var result = await new CountInventoryItem(gridScreenName, itemName, itemNames).Start(cancellationToken);
|
||||
if (itemName != null)
|
||||
GridScreenName = gridScreenName,
|
||||
ItemName = itemName,
|
||||
ItemNames = itemNames?.ToList() ?? []
|
||||
};
|
||||
|
||||
var result = await new CountInventoryItem(param).Start(cancellationToken);
|
||||
if (param.ItemName != null)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
@@ -318,7 +327,7 @@ public class Dispatcher
|
||||
/// <param name="param">秘境任务参数</param>
|
||||
/// <param name="customCt">自定义取消令牌</param>
|
||||
/// <returns></returns>
|
||||
public async Task RunAutoDomainTask(AutoDomainParam param, CancellationToken? customCt = null)
|
||||
public async Task<Dictionary<string, int>> RunAutoDomainTask(AutoDomainParam param, CancellationToken? customCt = null)
|
||||
{
|
||||
if (param == null)
|
||||
{
|
||||
@@ -326,9 +335,26 @@ public class Dispatcher
|
||||
}
|
||||
|
||||
CancellationToken cancellationToken = customCt ?? CancellationContext.Instance.Cts.Token;
|
||||
await new AutoDomainTask(param).Start(cancellationToken);
|
||||
return await new AutoDomainTask(param).Start(cancellationToken);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 运行自动首领讨伐任务
|
||||
/// </summary>
|
||||
/// <param name="param">自动首领讨伐任务参数</param>
|
||||
/// <param name="customCt">自定义取消令牌</param>
|
||||
/// <returns></returns>
|
||||
public async Task<Dictionary<string, int>> RunAutoBossTask(AutoBossParam param, CancellationToken? customCt = null)
|
||||
{
|
||||
if (param == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(param), "自动首领讨伐任务参数不能为空");
|
||||
}
|
||||
|
||||
CancellationToken cancellationToken = customCt ?? CancellationContext.Instance.Cts.Token;
|
||||
return await new AutoBossTask(param).Start(cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 运行自动战斗任务
|
||||
/// </summary>
|
||||
@@ -343,7 +369,9 @@ public class Dispatcher
|
||||
}
|
||||
|
||||
CancellationToken cancellationToken = customCt ?? CancellationContext.Instance.Cts.Token;
|
||||
await new AutoFightTask(param).Start(cancellationToken);
|
||||
var factory = GameTask.AutoFight.Factory.CombatTaskFactoryProvider.GetFactory(param.CombatStrategyPath);
|
||||
var fightTask = factory.CreateTask(param);
|
||||
await fightTask.Start(cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -362,22 +390,55 @@ public class Dispatcher
|
||||
CancellationToken cancellationToken = customCt ?? CancellationContext.Instance.Cts.Token;
|
||||
await new AutoLeyLineOutcropTask(param).Start(cancellationToken);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 运行自动幽境危战任务
|
||||
/// </summary>
|
||||
/// <param name="param">自动幽境危战任务参数</param>
|
||||
/// <param name="customCt">自定义取消令牌</param>
|
||||
/// <returns></returns>
|
||||
public async Task RunAutoStygianOnslaughtTask(AutoStygianOnslaughtParam param, CancellationToken? customCt = null)
|
||||
{
|
||||
if (param == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(param), "自动幽境危战任务参数不能为空");
|
||||
}
|
||||
|
||||
CancellationToken cancellationToken = customCt ?? CancellationContext.Instance.Cts.Token;
|
||||
await new AutoStygianOnslaughtTask(param).Start(cancellationToken);
|
||||
public async Task RunAutoStygianOnslaughtTask(AutoStygianOnslaughtParam param, CancellationToken? customCt = null)
|
||||
{
|
||||
if (param == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(param), "自动幽境危战任务参数不能为空");
|
||||
}
|
||||
|
||||
CancellationToken cancellationToken = customCt ?? CancellationContext.Instance.Cts.Token;
|
||||
await new AutoStygianOnslaughtTask(param).Start(cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 运行背包物品计数任务。
|
||||
/// </summary>
|
||||
/// <param name="param">背包物品计数参数。</param>
|
||||
/// <param name="customCt">自定义取消令牌。</param>
|
||||
/// <returns>单物品返回数量;多物品返回名称到数量的脚本对象。</returns>
|
||||
public async Task<object?> RunCountInventoryItemTask(CountInventoryItemParam param, CancellationToken? customCt = null)
|
||||
{
|
||||
if (param == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(param), "背包物品计数参数不能为空");
|
||||
}
|
||||
|
||||
CancellationToken cancellationToken = customCt ?? CancellationContext.Instance.Cts.Token;
|
||||
object result = await new CountInventoryItem(param).Start(cancellationToken);
|
||||
|
||||
if (param.ItemName != null)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
dynamic expando = new ExpandoObject();
|
||||
var expandoDict = (IDictionary<string, object>)expando;
|
||||
foreach (var kvp in (Dictionary<string, int>)result)
|
||||
{
|
||||
expandoDict[kvp.Key] = kvp.Value;
|
||||
}
|
||||
|
||||
return expandoDict;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -216,6 +216,11 @@ public class Genshin
|
||||
{
|
||||
return GetPositionFromMap(MapTypes.Teyvat.ToString());
|
||||
}
|
||||
|
||||
public Point2f? GetPositionFromMapWithMatchingMethod(string matchingMethod)
|
||||
{
|
||||
return GetPositionFromMapWithMatchingMethod(nameof(MapTypes.Teyvat), matchingMethod);
|
||||
}
|
||||
|
||||
public float GetCameraOrientation()
|
||||
{
|
||||
@@ -230,14 +235,18 @@ public class Genshin
|
||||
/// <param name="cacheTimeMs">缓存时间,单位毫秒,默认900ms</param>
|
||||
/// <returns>包含X和Y坐标的Point2f结构体</returns>
|
||||
public Point2f? GetPositionFromMap(string mapName, int cacheTimeMs = 900)
|
||||
{
|
||||
var matchingMethod = TaskContext.Instance().Config.PathingConditionConfig.MapMatchingMethod;
|
||||
return GetPositionFromMapWithMatchingMethod(mapName,matchingMethod, cacheTimeMs);
|
||||
}
|
||||
|
||||
public Point2f? GetPositionFromMapWithMatchingMethod(string mapName, string matchingMethod, int cacheTimeMs = 900)
|
||||
{
|
||||
var imageRegion = CaptureToRectArea();
|
||||
if (!Bv.IsInMainUi(imageRegion))
|
||||
{
|
||||
throw new InvalidOperationException("不在主界面,无法识别小地图坐标");
|
||||
}
|
||||
|
||||
var matchingMethod = TaskContext.Instance().Config.PathingConditionConfig.MapMatchingMethod;
|
||||
return MapManager.GetMap(mapName, matchingMethod)
|
||||
.ConvertImageCoordinatesToGenshinMapCoordinates(LazyNavigationInstance.Value
|
||||
.GetPositionStableByCache(imageRegion, mapName, matchingMethod, cacheTimeMs));
|
||||
@@ -352,6 +361,18 @@ public class Genshin
|
||||
await new GoToCraftingBenchTask().Start(country, CancellationContext.Instance.Cts.Token);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 在当前已打开的合成界面中合成指定材料。
|
||||
/// </summary>
|
||||
/// <param name="materialName">目标成品材料名。</param>
|
||||
/// <param name="quantity">目标合成个数,必须大于 0。</param>
|
||||
/// <param name="materialType">材料筛选类型;为空时从物品模型 CSV 中读取。</param>
|
||||
/// <returns>合成执行结果。</returns>
|
||||
public async Task<CraftMaterialResult> CraftMaterial(string materialName, int quantity, string? materialType = null)
|
||||
{
|
||||
return await new CraftMaterialTask(materialName, quantity, materialType).Start(CancellationContext.Instance.Cts.Token);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回主界面
|
||||
/// </summary>
|
||||
@@ -440,4 +461,4 @@ public class Genshin
|
||||
// if (actualScan < actualMine) actualScan = actualMine;
|
||||
// await new LinneaMiningTask(actualScan, actualMine).Start(CancellationContext.Instance.Cts.Token);
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -145,6 +145,35 @@ public class HtmlMask : IDisposable
|
||||
/// </summary>
|
||||
public bool Exists(string id) => HtmlMaskWindow.Exists(id);
|
||||
|
||||
/// <summary>
|
||||
/// 设置窗口的点击穿透模式
|
||||
/// </summary>
|
||||
/// <param name="windowId">窗口ID</param>
|
||||
/// <param name="enabled">true=点击穿透,false=可交互</param>
|
||||
public void SetClickThrough(string windowId, bool enabled)
|
||||
{
|
||||
HtmlMaskWindow.SetClickThrough(windowId, enabled);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取窗口的点击穿透状态
|
||||
/// </summary>
|
||||
/// <param name="windowId">窗口ID</param>
|
||||
/// <returns>true=点击穿透,false=可交互</returns>
|
||||
public bool GetClickThrough(string windowId)
|
||||
{
|
||||
return HtmlMaskWindow.GetClickThrough(windowId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 切换窗口的点击穿透模式
|
||||
/// </summary>
|
||||
/// <param name="windowId">窗口ID</param>
|
||||
public void ToggleClickThrough(string windowId)
|
||||
{
|
||||
HtmlMaskWindow.ToggleClickThrough(windowId);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 消息通信
|
||||
@@ -166,6 +195,30 @@ public class HtmlMask : IDisposable
|
||||
HtmlMaskWindow.NotifyFlush(windowId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 响应 HTML 页面通过 window.htmlMask.request(...) 发起的请求。
|
||||
/// </summary>
|
||||
/// <param name="windowId">HTML 遮罩窗口 ID。</param>
|
||||
/// <param name="requestId">从 Receive/Poll/PollAll 返回消息的 requestId 字段取得,不能由脚本自行生成。</param>
|
||||
/// <param name="jsonData">响应数据,必须是合法 JSON 字符串。</param>
|
||||
public void Respond(string windowId, string requestId, string jsonData)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(requestId))
|
||||
throw new ArgumentException("requestId cannot be empty", nameof(requestId));
|
||||
|
||||
if (!HtmlMaskWindow.Exists(windowId) || !_toHtmlQueues.TryGetValue(windowId, out var queue))
|
||||
throw new InvalidOperationException($"HTML遮罩窗口不存在或已关闭: {windowId}");
|
||||
|
||||
queue.Enqueue(new Message
|
||||
{
|
||||
Url = "/__response__",
|
||||
Data = ParseData(jsonData),
|
||||
RequestId = requestId
|
||||
});
|
||||
|
||||
HtmlMaskWindow.NotifyFlush(windowId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发送请求到HTML并等待响应
|
||||
/// </summary>
|
||||
|
||||
@@ -15,6 +15,7 @@ public class LimitedFile(string rootPath)
|
||||
{
|
||||
/// <summary>
|
||||
/// 读取指定文件夹内所有文件和文件夹的路径(非递归方式)。
|
||||
/// 目录不存在时返回空数组
|
||||
/// </summary>
|
||||
/// <param name="folderPath">文件夹路径(相对于根目录)</param>
|
||||
/// <returns>文件夹内所有文件和文件夹的路径数组</returns>
|
||||
@@ -23,19 +24,19 @@ public class LimitedFile(string rootPath)
|
||||
try
|
||||
{
|
||||
// 对传入的文件夹路径进行标准化
|
||||
string normalizedFolderPath = NormalizePath(folderPath);
|
||||
string fullPath = NormalizePath(folderPath);
|
||||
|
||||
// 确保目录存在
|
||||
if (!Directory.Exists(normalizedFolderPath))
|
||||
if (!Directory.Exists(fullPath))
|
||||
{
|
||||
Directory.CreateDirectory(normalizedFolderPath);
|
||||
TaskControl.Logger.LogError("ReadPathSync 目录不存在: {Path}", fullPath);
|
||||
return Array.Empty<string>();
|
||||
}
|
||||
|
||||
// 获取指定文件夹下的所有文件(非递归)
|
||||
string[] files = Directory.GetFiles(normalizedFolderPath, "*", SearchOption.TopDirectoryOnly);
|
||||
string[] files = Directory.GetFiles(fullPath, "*", SearchOption.TopDirectoryOnly);
|
||||
|
||||
// 获取指定文件夹下的所有子文件夹(非递归)
|
||||
string[] directories = Directory.GetDirectories(normalizedFolderPath, "*", SearchOption.TopDirectoryOnly);
|
||||
string[] directories = Directory.GetDirectories(fullPath, "*", SearchOption.TopDirectoryOnly);
|
||||
|
||||
// 合并文件和文件夹路径
|
||||
string[] combined = files.Concat(directories).ToArray();
|
||||
@@ -45,12 +46,33 @@ public class LimitedFile(string rootPath)
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// 记录异常并返回空数组
|
||||
TaskControl.Logger.LogError("ReadPathSync 异常: {Message}", ex.Message);
|
||||
return Array.Empty<string>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建指定路径的目录,如果已存在则跳过
|
||||
/// </summary>
|
||||
/// <param name="folderPath">文件夹路径(相对于根目录)</param>
|
||||
/// <returns>是否创建成功或目录已存在</returns>
|
||||
public bool CreateDirectory(string folderPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 对传入的文件夹路径进行标准化
|
||||
string fullPath = NormalizePath(folderPath);
|
||||
// 如果目录不存在,自动创建
|
||||
if (!Directory.Exists(fullPath)){Directory.CreateDirectory(fullPath);}
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
TaskControl.Logger.LogError("CreateDir 异常: {Message}", ex.Message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断指定路径是否为文件夹。
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using BetterGenshinImpact.Core.Config;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Script.Dependence;
|
||||
|
||||
/// <summary>
|
||||
/// 战斗策略文件访问类
|
||||
/// 提供JS脚本环境访问 User\AutoFight 目录下战斗策略文件的方法
|
||||
/// </summary>
|
||||
public class StrategyFile
|
||||
{
|
||||
private readonly LimitedFile _strategyFile = new(Global.Absolute(@"User\AutoFight"));
|
||||
|
||||
/// <summary>
|
||||
/// 判断 User\AutoFight 目录下的路径是否为文件夹
|
||||
/// </summary>
|
||||
/// <param name="subPath">相对于 User\AutoFight 的路径</param>
|
||||
/// <returns>是文件夹返回 true,否则返回 false</returns>
|
||||
public bool IsFolder(string subPath) => _strategyFile.IsFolder(subPath);
|
||||
|
||||
/// <summary>
|
||||
/// 判断 User\AutoFight 目录下的路径是否为文件
|
||||
/// </summary>
|
||||
/// <param name="subPath">相对于 User\AutoFight 的路径</param>
|
||||
/// <returns>是文件返回 true,否则返回 false</returns>
|
||||
public bool IsFile(string subPath) => _strategyFile.IsFile(subPath);
|
||||
|
||||
/// <summary>
|
||||
/// 判断 User\AutoFight 目录下的路径是否存在
|
||||
/// </summary>
|
||||
/// <param name="subPath">相对于 User\AutoFight 的路径</param>
|
||||
/// <returns>存在返回 true,否则返回 false</returns>
|
||||
public bool IsExists(string subPath) => _strategyFile.IsExists(subPath);
|
||||
|
||||
/// <summary>
|
||||
/// 读取 User\AutoFight 目录下指定文件夹的内容(非递归方式)
|
||||
/// 目录不存在时返回空数组,不会自动创建目录
|
||||
/// </summary>
|
||||
/// <param name="subPath">相对于 User\AutoFight 的子目录路径,默认为根目录</param>
|
||||
/// <returns>文件夹内所有文件和文件夹的相对路径数组,出错时返回空数组</returns>
|
||||
public string[] ReadPathSync(string subPath = "./") => _strategyFile.ReadPathSync(subPath);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using BetterGenshinImpact.Core.Script.Dependence;
|
||||
using BetterGenshinImpact.Core.Script.Dependence.Model;
|
||||
@@ -10,12 +10,15 @@ using OpenCvSharp;
|
||||
using BetterGenshinImpact.Core.Recognition;
|
||||
using BetterGenshinImpact.GameTask.Model.Area;
|
||||
using BetterGenshinImpact.Core.Script.Utils;
|
||||
using BetterGenshinImpact.GameTask.Common.Job;
|
||||
using BetterGenshinImpact.GameTask.AutoDomain;
|
||||
using BetterGenshinImpact.GameTask.AutoBoss;
|
||||
using BetterGenshinImpact.GameTask.AutoFight;
|
||||
using BetterGenshinImpact.GameTask.AutoFight.Model;
|
||||
using BetterGenshinImpact.GameTask.AutoLeyLineOutcrop;
|
||||
using BetterGenshinImpact.GameTask.AutoSkip;
|
||||
using BetterGenshinImpact.GameTask.AutoStygianOnslaught;
|
||||
using BetterGenshinImpact.GameTask.Model.GameUI;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Script;
|
||||
|
||||
@@ -74,9 +77,14 @@ public class EngineExtend
|
||||
engine.AddHostType("ServerTime", typeof(ServerTime));
|
||||
|
||||
engine.AddHostType("AutoDomainParam", typeof(AutoDomainParam));
|
||||
engine.AddHostType("AutoBossParam", typeof(AutoBossParam));
|
||||
engine.AddHostType("CountInventoryItemParam", typeof(CountInventoryItemParam));
|
||||
engine.AddHostType("GridScreenName", typeof(GridScreenName));
|
||||
engine.AddHostType("ItemIconRecognitionMode", typeof(ItemIconRecognitionMode));
|
||||
engine.AddHostType("AutoFightParam", typeof(AutoFightParam));
|
||||
engine.AddHostType("AutoLeyLineOutcropParam", typeof(AutoLeyLineOutcropParam));
|
||||
engine.AddHostType("AutoStygianOnslaughtParam", typeof(AutoStygianOnslaughtParam));
|
||||
engine.AddHostObject("strategyFile", new StrategyFile());
|
||||
//鼠标回调
|
||||
engine.AddHostType("KeyMouseHook", typeof(KeyMouseHook));
|
||||
// 添加C#的类型
|
||||
@@ -95,7 +103,7 @@ public class EngineExtend
|
||||
// 导入 JavaScript 模块
|
||||
// https://microsoft.github.io/ClearScript/2023/01/24/module-interop.html
|
||||
// https://github.com/microsoft/ClearScript/blob/master/ClearScriptTest/V8ModuleTest.cs
|
||||
engine.DocumentSettings.AccessFlags = DocumentAccessFlags.EnableFileLoading | DocumentAccessFlags.AllowCategoryMismatch;
|
||||
engine.DocumentSettings.AccessFlags = DocumentAccessFlags.AllowCategoryMismatch;
|
||||
if (searchPaths != null)
|
||||
{
|
||||
var normalizedPaths = new List<string>();
|
||||
|
||||
@@ -9,7 +9,7 @@ using Microsoft.ClearScript.JavaScript;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Script
|
||||
{
|
||||
public class PackageDocumentLoader : DocumentLoader
|
||||
public class PackageDocumentLoader : DefaultDocumentLoader
|
||||
{
|
||||
private readonly string _scriptRootPath;
|
||||
|
||||
@@ -22,21 +22,42 @@ namespace BetterGenshinImpact.Core.Script
|
||||
{
|
||||
string? targetPath = ResolvePhysicalPath(settings, sourceInfo, specifier);
|
||||
|
||||
// ResolvePhysicalPath 可能因 sourceInfo 为空而失败,直接从脚本根目录兜底
|
||||
if (targetPath == null || !File.Exists(targetPath))
|
||||
{
|
||||
return await Default.LoadDocumentAsync(settings, sourceInfo, specifier, category, contextCallback);
|
||||
var stripped = Regex.Replace(specifier, @"^(?:\.\.?/)+", "");
|
||||
if (!Path.IsPathRooted(stripped))
|
||||
{
|
||||
var fullPath = Path.GetFullPath(Path.Combine(_scriptRootPath, stripped));
|
||||
if (fullPath.StartsWith(_scriptRootPath, StringComparison.OrdinalIgnoreCase)
|
||||
&& File.Exists(fullPath))
|
||||
{
|
||||
targetPath = fullPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (targetPath == null || !File.Exists(targetPath))
|
||||
{
|
||||
throw new FileNotFoundException($"无法解析模块导入路径: '{specifier}'", specifier);
|
||||
}
|
||||
|
||||
// 处理 JS 文件的重写
|
||||
if (Path.GetExtension(targetPath).ToLower() == ".js")
|
||||
{
|
||||
var uri = new Uri(targetPath);
|
||||
|
||||
// 检查缓存
|
||||
var cached = GetCachedDocument(uri);
|
||||
if (cached != null) return cached;
|
||||
|
||||
string content = await File.ReadAllTextAsync(targetPath);
|
||||
string processedCode = RewriteScriptCode(content, targetPath);
|
||||
var documentInfo = new DocumentInfo(new Uri(targetPath)) { Category = ModuleCategory.Standard };
|
||||
return new StringDocument(documentInfo, processedCode);
|
||||
var documentInfo = new DocumentInfo(uri) { Category = ModuleCategory.Standard };
|
||||
return CacheDocument(new StringDocument(documentInfo, processedCode), false);
|
||||
}
|
||||
|
||||
return await Default.LoadDocumentAsync(settings, sourceInfo, specifier, category, contextCallback);
|
||||
throw new FileNotFoundException($"不支持的模块导入类型: '{specifier}' (仅支持 .js 文件)", specifier);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -54,11 +75,9 @@ namespace BetterGenshinImpact.Core.Script
|
||||
{
|
||||
string importPart = match.Groups[1].Value.Trim();
|
||||
string quote = match.Groups[2].Value;
|
||||
string rawPath = match.Groups[3].Value;
|
||||
|
||||
string path = rawPath.Replace("../../../packages", "packages");
|
||||
string path = match.Groups[3].Value.Replace("../../../packages", "packages");
|
||||
string? resourceFullPath = ResolvePathInternal(null, currentFilePath, path);
|
||||
|
||||
|
||||
if (resourceFullPath != null && File.Exists(resourceFullPath))
|
||||
{
|
||||
string normalizedPath = Path.GetRelativePath(_scriptRootPath, resourceFullPath).Replace("\\", "/");
|
||||
@@ -88,7 +107,24 @@ namespace BetterGenshinImpact.Core.Script
|
||||
|
||||
private string? ResolvePhysicalPath(DocumentSettings settings, DocumentInfo? sourceInfo, string specifier)
|
||||
{
|
||||
return ResolvePathInternal(settings.SearchPath, sourceInfo?.Name, specifier);
|
||||
string? referrer = null;
|
||||
if (sourceInfo.HasValue)
|
||||
{
|
||||
var sourceUri = sourceInfo.Value.Uri;
|
||||
if (sourceUri != null && sourceUri.IsAbsoluteUri && sourceUri.IsFile)
|
||||
{
|
||||
referrer = sourceUri.LocalPath;
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(sourceInfo.Value.Name))
|
||||
{
|
||||
if (Uri.TryCreate(sourceInfo.Value.Name, UriKind.Absolute, out var nameUri) && nameUri.IsFile)
|
||||
{
|
||||
referrer = nameUri.LocalPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ResolvePathInternal(settings.SearchPath, referrer, specifier);
|
||||
}
|
||||
|
||||
private string? ResolvePathInternal(string? searchPath, string? referrer, string specifier)
|
||||
@@ -98,6 +134,12 @@ namespace BetterGenshinImpact.Core.Script
|
||||
return ProbeFile(Path.Combine(_scriptRootPath, specifier));
|
||||
}
|
||||
|
||||
var packagesMatch = Regex.Match(specifier, @"^(?:\.\.\/)+(packages/.*)$");
|
||||
if (packagesMatch.Success)
|
||||
{
|
||||
return ProbeFile(Path.Combine(_scriptRootPath, packagesMatch.Groups[1].Value));
|
||||
}
|
||||
|
||||
if (specifier.StartsWith("."))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(referrer))
|
||||
@@ -128,8 +170,9 @@ namespace BetterGenshinImpact.Core.Script
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(path)) return path;
|
||||
if (File.Exists(path + ".js")) return path + ".js";
|
||||
var normalized = Path.GetFullPath(path);
|
||||
if (File.Exists(normalized)) return normalized;
|
||||
if (File.Exists(normalized + ".js")) return normalized + ".js";
|
||||
}
|
||||
catch { }
|
||||
return null;
|
||||
|
||||
@@ -28,6 +28,9 @@ public class Simulation
|
||||
SendInput.Keyboard.KeyUp(key);
|
||||
}
|
||||
}
|
||||
SendInput.Mouse.LeftButtonUp();
|
||||
SendInput.Mouse.RightButtonUp();
|
||||
SendInput.Mouse.MiddleButtonUp();
|
||||
}
|
||||
|
||||
public static bool IsKeyDown(User32.VK key)
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1018 B |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 484 B |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 284 B |
Binary file not shown.
|
After Width: | Height: | Size: 456 B |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
@@ -0,0 +1,83 @@
|
||||
using BetterGenshinImpact.Core.Recognition;
|
||||
using BetterGenshinImpact.GameTask.Model;
|
||||
|
||||
namespace BetterGenshinImpact.GameTask.AutoBoss.Assets;
|
||||
|
||||
public class AutoBossAssets : BaseAssets<AutoBossAssets>
|
||||
{
|
||||
public RecognitionObject OriginalResinTopIconRo;
|
||||
public RecognitionObject RewardBoxRo;
|
||||
public RecognitionObject OpenResinSupplementPaneButtonRo;
|
||||
public RecognitionObject TransientResinInSupplementPaneRo;
|
||||
public RecognitionObject FragileResinInSupplementPaneRo;
|
||||
public RecognitionObject IncreaseResinUsageQuantityButtonRo;
|
||||
|
||||
#pragma warning disable CS8618
|
||||
private AutoBossAssets() : base()
|
||||
{
|
||||
Initialization(systemInfo);
|
||||
}
|
||||
|
||||
protected AutoBossAssets(ISystemInfo systemInfo) : base(systemInfo)
|
||||
{
|
||||
Initialization(systemInfo);
|
||||
}
|
||||
#pragma warning restore CS8618
|
||||
|
||||
private void Initialization(ISystemInfo systemInfo)
|
||||
{
|
||||
OriginalResinTopIconRo = new RecognitionObject
|
||||
{
|
||||
Name = "AutoBossOriginalResinTopIcon",
|
||||
RecognitionType = RecognitionTypes.TemplateMatch,
|
||||
TemplateImageMat = GameTaskManager.LoadAssetImage("AutoBoss", "original_resin_top_icon.png", systemInfo),
|
||||
Threshold = 0.8,
|
||||
DrawOnWindow = false
|
||||
}.InitTemplate();
|
||||
|
||||
RewardBoxRo = new RecognitionObject
|
||||
{
|
||||
Name = "AutoBossRewardBox",
|
||||
RecognitionType = RecognitionTypes.TemplateMatch,
|
||||
TemplateImageMat = GameTaskManager.LoadAssetImage("AutoBoss", "box.png", systemInfo),
|
||||
Threshold = 0.8,
|
||||
DrawOnWindow = false
|
||||
}.InitTemplate();
|
||||
|
||||
OpenResinSupplementPaneButtonRo = new RecognitionObject
|
||||
{
|
||||
Name = "AutoBossOpenResinSupplementPaneButton",
|
||||
RecognitionType = RecognitionTypes.TemplateMatch,
|
||||
TemplateImageMat = GameTaskManager.LoadAssetImage("AutoBoss", "open_resin_supplement_pane_button.png", systemInfo),
|
||||
Threshold = 0.8,
|
||||
DrawOnWindow = false
|
||||
}.InitTemplate();
|
||||
|
||||
TransientResinInSupplementPaneRo = new RecognitionObject
|
||||
{
|
||||
Name = "AutoBossTransientResinInSupplementPane",
|
||||
RecognitionType = RecognitionTypes.TemplateMatch,
|
||||
TemplateImageMat = GameTaskManager.LoadAssetImage("AutoBoss", "transient_resin_in_supplement_pane.png", systemInfo),
|
||||
Threshold = 0.8,
|
||||
DrawOnWindow = false
|
||||
}.InitTemplate();
|
||||
|
||||
FragileResinInSupplementPaneRo = new RecognitionObject
|
||||
{
|
||||
Name = "AutoBossFragileResinInSupplementPane",
|
||||
RecognitionType = RecognitionTypes.TemplateMatch,
|
||||
TemplateImageMat = GameTaskManager.LoadAssetImage("AutoBoss", "fragile_resin_in_supplement_pane.png", systemInfo),
|
||||
Threshold = 0.8,
|
||||
DrawOnWindow = false
|
||||
}.InitTemplate();
|
||||
|
||||
IncreaseResinUsageQuantityButtonRo = new RecognitionObject
|
||||
{
|
||||
Name = "AutoBossIncreaseResinUsageQuantityButton",
|
||||
RecognitionType = RecognitionTypes.TemplateMatch,
|
||||
TemplateImageMat = GameTaskManager.LoadAssetImage("AutoBoss", "increase_resin_usage_quantity_button.png", systemInfo),
|
||||
Threshold = 0.8,
|
||||
DrawOnWindow = false
|
||||
}.InitTemplate();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
{
|
||||
"info": {
|
||||
"authors": [],
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"description": "",
|
||||
"enable_monster_loot_split": false,
|
||||
"last_modified_time": 1755828864835,
|
||||
"map_name": "Teyvat",
|
||||
"name": "未命名路径",
|
||||
"tags": [],
|
||||
"type": "collect",
|
||||
"version": "1.0"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"action": "",
|
||||
"action_params": "",
|
||||
"id": 1,
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": 2289.0078125,
|
||||
"y": -1197.31640625
|
||||
},
|
||||
{
|
||||
"action": "combat_script",
|
||||
"action_params": "wait(1.5)",
|
||||
"id": 2,
|
||||
"move_mode": "walk",
|
||||
"type": "target",
|
||||
"x": 2270.921875,
|
||||
"y": -1181.94580078125
|
||||
},
|
||||
{
|
||||
"action": "",
|
||||
"action_params": "",
|
||||
"id": 3,
|
||||
"move_mode": "walk",
|
||||
"type": "target",
|
||||
"x": 2266.435546875,
|
||||
"y": -1173.31787109375
|
||||
},
|
||||
{
|
||||
"action": "",
|
||||
"action_params": "",
|
||||
"id": 4,
|
||||
"move_mode": "walk",
|
||||
"type": "path",
|
||||
"x": 2238.7578125,
|
||||
"y": -1184.73046875
|
||||
},
|
||||
{
|
||||
"action": "",
|
||||
"action_params": "",
|
||||
"id": 5,
|
||||
"move_mode": "fly",
|
||||
"type": "path",
|
||||
"x": 2215.11328125,
|
||||
"y": -1197.294921875
|
||||
},
|
||||
{
|
||||
"action": "",
|
||||
"action_params": "",
|
||||
"id": 6,
|
||||
"move_mode": "walk",
|
||||
"type": "path",
|
||||
"x": 2191.3359375,
|
||||
"y": -1214.46533203125
|
||||
},
|
||||
{
|
||||
"action": "",
|
||||
"action_params": "",
|
||||
"id": 7,
|
||||
"move_mode": "walk",
|
||||
"type": "path",
|
||||
"x": 2119.0048828125,
|
||||
"y": -1231.728515625
|
||||
},
|
||||
{
|
||||
"action": "",
|
||||
"action_params": "",
|
||||
"id": 8,
|
||||
"move_mode": "walk",
|
||||
"type": "path",
|
||||
"x": 2117.5,
|
||||
"y": -1254.09521484375
|
||||
},
|
||||
{
|
||||
"action": "stop_flying",
|
||||
"action_params": "",
|
||||
"id": 9,
|
||||
"move_mode": "fly",
|
||||
"type": "path",
|
||||
"x": 2114.4345703125,
|
||||
"y": -1308.1357421875
|
||||
},
|
||||
{
|
||||
"action": "",
|
||||
"action_params": "",
|
||||
"id": 10,
|
||||
"move_mode": "run",
|
||||
"type": "path",
|
||||
"x": 2110.509765625,
|
||||
"y": -1331.59130859375
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "千年珍珠骏麟前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753791394637,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 4851.81982421875,
|
||||
"y": 4802.15673828125,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 4837.4677734375,
|
||||
"y": 4798.37158203125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 4780.36767578125,
|
||||
"y": 4788.42822265625,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 4766.72998046875,
|
||||
"y": 4786.763671875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "半永恒统辖矩阵前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753788953823,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 5150.287109375,
|
||||
"y": -2787.1591796875,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 5167.76123046875,
|
||||
"y": -2787.11328125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 5192.0302734375,
|
||||
"y": -2787.052734375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 5206.9306640625,
|
||||
"y": -2786.9921875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": 5215.41357421875,
|
||||
"y": -2787.46875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": 5234.9130859375,
|
||||
"y": -2787.0947265625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"x": 5243.3876953125,
|
||||
"y": -2793.0263671875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"x": 5254.2939453125,
|
||||
"y": -2788.7001953125,
|
||||
"type": "path",
|
||||
"move_mode": "jump",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"x": 5269.052734375,
|
||||
"y": -2787.484375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "前往古岩龙蜥",
|
||||
"type": "collect",
|
||||
"author": "柒叶子",
|
||||
"version": "1.0",
|
||||
"description": "前往古岩龙蜥",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 1669.650390625,
|
||||
"y": 341.86962890625,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 1674.890625,
|
||||
"y": 345.15625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 1573.65234375,
|
||||
"y": 254.67041015625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 1533.3095703125,
|
||||
"y": 229.28857421875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": 1485.296875,
|
||||
"y": 208.9697265625,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"info": {
|
||||
"authors": [
|
||||
{
|
||||
"links": "https://github.com/1004452714",
|
||||
"name": "DarkFlameMaster"
|
||||
}
|
||||
],
|
||||
"bgi_version": "0.52.0",
|
||||
"description": "",
|
||||
"enable_monster_loot_split": false,
|
||||
"last_modified_time": 1775791356948,
|
||||
"map_match_method": "SIFT",
|
||||
"map_name": "Teyvat",
|
||||
"name": "守望者・堕天",
|
||||
"tags": [],
|
||||
"type": "collect",
|
||||
"version": "1.0"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"action": "",
|
||||
"action_params": "",
|
||||
"id": 1,
|
||||
"move_mode": "fly",
|
||||
"type": "teleport",
|
||||
"x": -227.951171875,
|
||||
"y": 4109.8828125
|
||||
},
|
||||
{
|
||||
"action": "",
|
||||
"action_params": "",
|
||||
"id": 2,
|
||||
"move_mode": "fly",
|
||||
"type": "path",
|
||||
"x": -229.71484375,
|
||||
"y": 4114.32080078125
|
||||
},
|
||||
{
|
||||
"action": "stop_flying",
|
||||
"action_params": "",
|
||||
"id": 3,
|
||||
"move_mode": "walk",
|
||||
"type": "path",
|
||||
"x": -250.228515625,
|
||||
"y": 4167.486328125
|
||||
},
|
||||
{
|
||||
"action": "",
|
||||
"action_params": "",
|
||||
"id": 4,
|
||||
"move_mode": "run",
|
||||
"type": "path",
|
||||
"x": -261.037109375,
|
||||
"y": 4195.42529296875
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "实验性场力发生装置前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.45.0",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753791496368,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 4144.181640625,
|
||||
"y": 4423.85693359375,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 4137.7529296875,
|
||||
"y": 4420.017578125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 4132.763671875,
|
||||
"y": 4396.77880859375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 4159.6943359375,
|
||||
"y": 4373.40283203125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": 4169.7021484375,
|
||||
"y": 4349.689453125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": 4150.146484375,
|
||||
"y": 4345.55419921875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"x": 4131.76904296875,
|
||||
"y": 4342.962890625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "急冻树前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753707716845,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": -1638.53125,
|
||||
"y": 2153.89794921875,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": -1641.4697265625,
|
||||
"y": 2151.00634765625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": -1649.2578125,
|
||||
"y": 2128.595703125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": -1654.67578125,
|
||||
"y": 2117.858154296875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": -1651.724609375,
|
||||
"y": 2107.5087890625,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": -1665.9697265625,
|
||||
"y": 2100.76171875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "恒常机关阵列前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753787243395,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": -4481.716796875,
|
||||
"y": -2169.716796875,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": -4484.8984375,
|
||||
"y": -2169.53125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": -4489.75,
|
||||
"y": -2166.4501953125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": -4498.640625,
|
||||
"y": -2160.86328125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": -4492.728515625,
|
||||
"y": -2144.09765625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": -4471.73828125,
|
||||
"y": -2128.3017578125,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "掣电树前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753788008539,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 2080.2138671875,
|
||||
"y": 107.275390625,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 2086.857421875,
|
||||
"y": 95.4287109375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 2110.9052734375,
|
||||
"y": 63.419921875,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 2123.095703125,
|
||||
"y": 49.15185546875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"info":{"name":"","type":""},"positions":[{"x":-656.78515625,"y":-90.4169921875,"type":"teleport","move_mode":"walk"},{"x":-687.0263671875,"y":-96.19189453125,"type":"path","move_mode":"walk"},{"x":-719.9736328125,"y":-94.6748046875,"type":"path","move_mode":"walk"},{"x":-754.28125,"y":-91.27001953125,"type":"path","move_mode":"walk"},{"x":-781.6640625,"y":-96.474609375,"type":"path","move_mode":"walk"},{"x":-809.107421875,"y":-119.3671875,"type":"path","move_mode":"walk"},{"x":-833.240234375,"y":-132.7734375,"type":"path","move_mode":"walk"},{"x":-857.30859375,"y":-119.65185546875,"type":"path","move_mode":"walk"},{"x":-857.30078125,"y":-119.65380859375,"type":"path","move_mode":"walk"},{"x":-875.322265625,"y":-102.798828125,"type":"path","move_mode":"walk"},{"x":-889.1103515625,"y":-81.04638671875,"type":"path","move_mode":"walk"},{"x":-894.4716796875,"y":-54.01171875,"type":"path","move_mode":"walk"},{"x":-889.3955078125,"y":-26.36376953125,"type":"path","move_mode":"walk"},{"x":-896.947265625,"y":-4.6171875,"type":"path","move_mode":"walk"},{"x":-882.3173828125,"y":6.94140625,"type":"path","move_mode":"walk"},{"x":-864.560546875,"y":20.841796875,"type":"path","move_mode":"walk"},{"x":-855.5419921875,"y":44.05712890625,"type":"path","move_mode":"walk"}]}
|
||||
@@ -0,0 +1,121 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "无相之水前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753787792567,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": -765.5771484375,
|
||||
"y": -3557.05078125,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": -771.0966796875,
|
||||
"y": -3562.517578125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": -829.66015625,
|
||||
"y": -3615.818359375,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": -865.271484375,
|
||||
"y": -3620.0400390625,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying",
|
||||
"action_params": "1500"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": -868.1953125,
|
||||
"y": -3604.36328125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": -872.5732421875,
|
||||
"y": -3582.705078125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"x": -880.25390625,
|
||||
"y": -3570.9833984375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"x": -892.919921875,
|
||||
"y": -3565.12890625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"x": -916.8203125,
|
||||
"y": -3558.5556640625,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"x": -932.3837890625,
|
||||
"y": -3555.0947265625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"x": -960.7353515625,
|
||||
"y": -3551.0908203125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "无相之火前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.45.0",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753787370971,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": -3233.89453125,
|
||||
"y": -3155.427734375,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": -3224.46484375,
|
||||
"y": -3113.1689453125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": -3201.7431640625,
|
||||
"y": -3095.697265625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": -3183.052734375,
|
||||
"y": -3082.67578125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": -3180.9990234375,
|
||||
"y": -3064.708984375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": -3179.1962890625,
|
||||
"y": -3046.359375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "无相之草前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753788793031,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 4036.58203125,
|
||||
"y": -2464.6328125,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 4032.9716796875,
|
||||
"y": -2476.08203125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 4020.458984375,
|
||||
"y": -2489.951171875,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying",
|
||||
"action_params": "1000"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 4004.5302734375,
|
||||
"y": -2468.169921875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "up_down_grab_leaf",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": 4003.3828125,
|
||||
"y": -2441.16796875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "up_down_grab_leaf",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": 3986.103515625,
|
||||
"y": -2428.77734375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "up_down_grab_leaf",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"x": 3975.9375,
|
||||
"y": -2412.4384765625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "up_down_grab_leaf",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"x": 3902.85546875,
|
||||
"y": -2437.8798828125,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "无相之雷前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.45.0",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753708525378,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": -1867.1708984375,
|
||||
"y": 1331.25390625,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": -1880.634765625,
|
||||
"y": 1332.6240234375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": -1886.341796875,
|
||||
"y": 1315.49609375,
|
||||
"type": "path",
|
||||
"move_mode": "jump",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": -1897.9521484375,
|
||||
"y": 1312.71728515625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": -1906.6083984375,
|
||||
"y": 1310.859375,
|
||||
"type": "path",
|
||||
"move_mode": "jump",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": -1925.8857421875,
|
||||
"y": 1309.81689453125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"x": -1939.40234375,
|
||||
"y": 1308.43408203125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "歌裴莉娅的葬送前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.45.0",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753791762596,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 3602.185546875,
|
||||
"y": 3529.386474609375,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 3617.0234375,
|
||||
"y": 3515.871337890625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 3633.8837890625,
|
||||
"y": 3500.517578125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 3646.794921875,
|
||||
"y": 3487.844482421875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": 3661.6240234375,
|
||||
"y": 3472.979248046875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": 3685.3115234375,
|
||||
"y": 3472.762939453125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"x": 3699.0478515625,
|
||||
"y": 3486.41015625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"x": 3712.1982421875,
|
||||
"y": 3499.31689453125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"x": 3726.9365234375,
|
||||
"y": 3513.27685546875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"x": 3742.3486328125,
|
||||
"y": 3528.9443359375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"x": 3758.2509765625,
|
||||
"y": 3545.006103515625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
"x": 3773.4033203125,
|
||||
"y": 3560.517822265625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 13,
|
||||
"x": 3787.8408203125,
|
||||
"y": 3571.67578125,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": "combat_script",
|
||||
"action_params": "keypress(F),wait(3),click,wait(2),keypress(F),wait(6)"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "冰封组曲快速前往",
|
||||
"type": "collect",
|
||||
"authors": [],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.45.0",
|
||||
"tags": [],
|
||||
"last_modified_time": 1755781802879,
|
||||
"enable_monster_loot_split": false,
|
||||
"map_match_method": ""
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 3805.1650390625,
|
||||
"y": 3592.691650390625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 3787.48046875,
|
||||
"y": 3572.779541015625,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},{
|
||||
"id": 13,
|
||||
"x": 3787.8408203125,
|
||||
"y": 3571.67578125,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": "combat_script",
|
||||
"action_params": "keypress(F),wait(3),click,wait(2),keypress(F),wait(6)"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "水形幻人前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753791583765,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 5183.00537109375,
|
||||
"y": 3375.525146484375,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 5206.87890625,
|
||||
"y": 3383.91845703125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 5221.623046875,
|
||||
"y": 3389.093017578125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 5239.80322265625,
|
||||
"y": 3397.223388671875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "深罪浸礼者前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753789336063,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 6817.49609375,
|
||||
"y": 383.68896484375,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 6745.57421875,
|
||||
"y": 370.45361328125,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying",
|
||||
"action_params": "1800"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 6761.9853515625,
|
||||
"y": 375.31298828125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 6779.85546875,
|
||||
"y": 380.6865234375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": 6790.7373046875,
|
||||
"y": 391.13427734375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": 6798.34228515625,
|
||||
"y": 398.11328125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"x": 6816.609375,
|
||||
"y": 405.6845703125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"x": 6827.55029296875,
|
||||
"y": 409.98974609375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"x": 6836.47412109375,
|
||||
"y": 424.748046875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"x": 6842.34814453125,
|
||||
"y": 446.39990234375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"x": 6851.697265625,
|
||||
"y": 462.83251953125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
"x": 6854.1611328125,
|
||||
"y": 476.1376953125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 13,
|
||||
"x": 6858.7880859375,
|
||||
"y": 507.1513671875,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 14,
|
||||
"x": 6850.39697265625,
|
||||
"y": 542.9169921875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "深邃摹结株前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753792527051,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 9345.50390625,
|
||||
"y": -1340.40771484375,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 9336.6083984375,
|
||||
"y": -1310.02734375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 9328.75,
|
||||
"y": -1281.68017578125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"info": {
|
||||
"authors": [
|
||||
{
|
||||
"links": "https://github.com/1004452714",
|
||||
"name": "DarkFlameMaster"
|
||||
}
|
||||
],
|
||||
"bgi_version": "0.52.0",
|
||||
"description": "",
|
||||
"enable_monster_loot_split": false,
|
||||
"last_modified_time": 1775700388310,
|
||||
"map_match_method": "SIFT",
|
||||
"map_name": "Teyvat",
|
||||
"name": "深黯魇语之主前往",
|
||||
"tags": [],
|
||||
"type": "collect",
|
||||
"version": "1.0"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"action": "",
|
||||
"action_params": "",
|
||||
"id": 1,
|
||||
"move_mode": "fly",
|
||||
"type": "teleport",
|
||||
"x": 10285.056640625,
|
||||
"y": 6355.1962890625
|
||||
},
|
||||
{
|
||||
"action": "",
|
||||
"action_params": "",
|
||||
"id": 2,
|
||||
"move_mode": "fly",
|
||||
"type": "path",
|
||||
"x": 10293.6328125,
|
||||
"y": 6361.96728515625
|
||||
},
|
||||
{
|
||||
"action": "stop_flying",
|
||||
"action_params": "",
|
||||
"id": 3,
|
||||
"move_mode": "fly",
|
||||
"type": "path",
|
||||
"x": 10335.369140625,
|
||||
"y": 6393.92578125
|
||||
},
|
||||
{
|
||||
"action": "",
|
||||
"action_params": "",
|
||||
"id": 4,
|
||||
"move_mode": "run",
|
||||
"type": "path",
|
||||
"x": 10360.021484375,
|
||||
"y": 6406.78564453125
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "灵觉隐修的迷者前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753792615054,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 9595.2724609375,
|
||||
"y": -1857.921875,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 9590.01171875,
|
||||
"y": -1861.314453125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 9574.6259765625,
|
||||
"y": -1865.4580078125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 9559.29296875,
|
||||
"y": -1883.2001953125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": 9532.3603515625,
|
||||
"y": -1903.8388671875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "熔岩辉龙像前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753792755970,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 9884.259765625,
|
||||
"y": -2216.931640625,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "force_tp",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 9894.6767578125,
|
||||
"y": -2228.0947265625,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 9914.0439453125,
|
||||
"y": -2248.6640625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "爆炎树前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753711249019,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 837.4912109375,
|
||||
"y": 235.0888671875,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 852.419921875,
|
||||
"y": 228.279296875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 900.30859375,
|
||||
"y": 228.51904296875,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 914.7392578125,
|
||||
"y": 238.0849609375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": 933.87890625,
|
||||
"y": 240.2333984375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": 950.39453125,
|
||||
"y": 228.48388671875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"x": 955.4921875,
|
||||
"y": 212.90380859375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"x": 955.54296875,
|
||||
"y": 187.16552734375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"x": 954.6064453125,
|
||||
"y": 154.91064453125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "科培琉司的劫罚前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.45.0",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753791900320,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 3602.185546875,
|
||||
"y": 3529.386474609375,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 3617.0234375,
|
||||
"y": 3515.871337890625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 3633.8837890625,
|
||||
"y": 3500.517578125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 3646.794921875,
|
||||
"y": 3487.844482421875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": 3661.6240234375,
|
||||
"y": 3472.979248046875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": 3685.3115234375,
|
||||
"y": 3472.762939453125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"x": 3699.0478515625,
|
||||
"y": 3486.41015625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"x": 3712.1982421875,
|
||||
"y": 3499.31689453125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"x": 3726.9365234375,
|
||||
"y": 3513.27685546875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"x": 3742.3486328125,
|
||||
"y": 3528.9443359375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"x": 3758.2509765625,
|
||||
"y": 3545.006103515625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
"x": 3773.4033203125,
|
||||
"y": 3560.517822265625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 13,
|
||||
"x": 3787.8408203125,
|
||||
"y": 3571.67578125,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": "combat_script",
|
||||
"action_params": "keypress(F),wait(3),click,wait(2),keypress(S),wait(1),keypress(F),wait(6)"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "冰封组曲快速前往",
|
||||
"type": "collect",
|
||||
"authors": [],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.45.0",
|
||||
"tags": [],
|
||||
"last_modified_time": 1755781802879,
|
||||
"enable_monster_loot_split": false,
|
||||
"map_match_method": ""
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 3805.1650390625,
|
||||
"y": 3592.691650390625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 3787.48046875,
|
||||
"y": 3572.779541015625,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 13,
|
||||
"x": 3787.8408203125,
|
||||
"y": 3571.67578125,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": "combat_script",
|
||||
"action_params": "keypress(F),wait(3),click,wait(2),keypress(S),wait(1),keypress(F),wait(6)"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "秘源机兵·构型械前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753792234740,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 8346.9765625,
|
||||
"y": -2673.501953125,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 8339.2861328125,
|
||||
"y": -2714.384765625,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 8335.357421875,
|
||||
"y": -2738.8916015625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "秘源机兵·统御械前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.45.0",
|
||||
"tags": [],
|
||||
"last_modified_time": 1754186646369,
|
||||
"enable_monster_loot_split": false,
|
||||
"map_match_method": ""
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": 11953.5166015625,
|
||||
"y": -3641.2392578125,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 11962.9072265625,
|
||||
"y": -3683.81640625,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 11967.5966796875,
|
||||
"y": -3718.607421875,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "纯水精灵前往",
|
||||
"type": "collect",
|
||||
"authors": [],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.45.0",
|
||||
"tags": [],
|
||||
"last_modified_time": 1755790741507,
|
||||
"enable_monster_loot_split": false,
|
||||
"map_match_method": ""
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 283.8291015625,
|
||||
"y": 1668.5810546875,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "teleport"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 288.32421875,
|
||||
"y": 1672.90087890625,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 290.20703125,
|
||||
"y": 1678.84716796875,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 289.1533203125,
|
||||
"y": 1685.48388671875,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": 286.9931640625,
|
||||
"y": 1694.46435546875,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": 283.7001953125,
|
||||
"y": 1710.96728515625,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"x": 281.958984375,
|
||||
"y": 1727.70361328125,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"x": 281.6826171875,
|
||||
"y": 1767.6513671875,
|
||||
"action": "combat_script",
|
||||
"move_mode": "walk",
|
||||
"action_params": "wait(0.3),keypress(F)",
|
||||
"type": "target"
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"x": 256.720703125,
|
||||
"y": 1783.6162109375,
|
||||
"action": "combat_script",
|
||||
"move_mode": "walk",
|
||||
"action_params": "wait(0.3),keypress(F)",
|
||||
"type": "target"
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"x": 270.623046875,
|
||||
"y": 1807.337890625,
|
||||
"action": "combat_script",
|
||||
"move_mode": "walk",
|
||||
"action_params": "wait(0.3),keypress(F)",
|
||||
"type": "target"
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"x": 297.2255859375,
|
||||
"y": 1793.3134765625,
|
||||
"action": "combat_script",
|
||||
"move_mode": "walk",
|
||||
"action_params": "wait(0.3),keypress(F)",
|
||||
"type": "target"
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
"x": 276.962890625,
|
||||
"y": 1788.15185546875,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "纯水精灵快速前往",
|
||||
"type": "collect",
|
||||
"authors": [],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.45.0",
|
||||
"tags": [],
|
||||
"last_modified_time": 1755778295567,
|
||||
"enable_monster_loot_split": false,
|
||||
"map_match_method": ""
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "path",
|
||||
"x": 276.962890625,
|
||||
"y": 1788.15185546875,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 281.9873046875,
|
||||
"y": 1769.00146484375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 281.6826171875,
|
||||
"y": 1767.6513671875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "combat_script",
|
||||
"action_params": "wait(0.5),keypress(F)"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 297.2255859375,
|
||||
"y": 1793.3134765625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "combat_script",
|
||||
"action_params": "wait(0.5),keypress(F)"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": 270.623046875,
|
||||
"y": 1807.337890625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "combat_script",
|
||||
"action_params": "wait(0.5),keypress(F)"
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": 256.720703125,
|
||||
"y": 1783.6162109375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "combat_script",
|
||||
"action_params": "wait(0.5),keypress(F)"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "翠翎恐蕈前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753788482153,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 3926.216796875,
|
||||
"y": -163.984375,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 3885.845703125,
|
||||
"y": -110.1142578125,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"info": {
|
||||
"authors": [
|
||||
{
|
||||
"links": "https://github.com/1004452714",
|
||||
"name": "DarkFlameMaster"
|
||||
}
|
||||
],
|
||||
"bgi_version": "0.52.0",
|
||||
"description": "",
|
||||
"enable_monster_loot_split": false,
|
||||
"last_modified_time": 1775787047367,
|
||||
"map_match_method": "SIFT",
|
||||
"map_name": "Teyvat",
|
||||
"name": "蕴光月守宫",
|
||||
"tags": [],
|
||||
"type": "collect",
|
||||
"version": "1.0"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"action": "force_tp",
|
||||
"action_params": "",
|
||||
"id": 1,
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": 9664.5869140625,
|
||||
"y": 5690.94580078125
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"macroEvents":[{"type":0,"keyCode":87,"mouseX":0,"mouseY":0,"time":100},{"type":0,"keyCode":160,"mouseX":0,"mouseY":0,"time":3516},{"type":1,"keyCode":160,"mouseX":0,"mouseY":0,"time":3984},{"type":0,"keyCode":65,"mouseX":0,"mouseY":0,"time":4391},{"type":1,"keyCode":65,"mouseX":0,"mouseY":0,"time":4531},{"type":0,"keyCode":65,"mouseX":0,"mouseY":0,"time":5062},{"type":1,"keyCode":65,"mouseX":0,"mouseY":0,"time":5203},{"type":0,"keyCode":160,"mouseX":0,"mouseY":0,"time":8859},{"type":1,"keyCode":160,"mouseX":0,"mouseY":0,"time":9328},{"type":0,"keyCode":160,"mouseX":0,"mouseY":0,"time":12781},{"type":1,"keyCode":160,"mouseX":0,"mouseY":0,"time":13094},{"type":0,"keyCode":160,"mouseX":0,"mouseY":0,"time":13828},{"type":1,"keyCode":160,"mouseX":0,"mouseY":0,"time":14187},{"type":1,"keyCode":87,"mouseX":0,"mouseY":0,"time":12984}],"info":{"name":"","description":"","x":319,"y":192,"width":1920,"height":1080,"recordDpi":1}}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"info": {
|
||||
"authors": [
|
||||
{
|
||||
"links": "",
|
||||
"name": "少年"
|
||||
}
|
||||
],
|
||||
"bgi_version": "0.52.0",
|
||||
"description": "",
|
||||
"enable_monster_loot_split": false,
|
||||
"last_modified_time": 1775793118383,
|
||||
"map_match_method": "SIFT",
|
||||
"map_name": "Teyvat",
|
||||
"name": "蕴光月幻蝶",
|
||||
"tags": [],
|
||||
"type": "collect",
|
||||
"version": "1.0"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"action": "force_tp",
|
||||
"action_params": "",
|
||||
"id": 1,
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": 9265.14453125,
|
||||
"y": 2474.61669921875
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"macroEvents":[{"type":0,"keyCode":87,"mouseX":0,"mouseY":0,"time":532},{"type":0,"keyCode":68,"mouseX":0,"mouseY":0,"time":1797},{"type":1,"keyCode":68,"mouseX":0,"mouseY":0,"time":2328},{"type":0,"keyCode":160,"mouseX":0,"mouseY":0,"time":2563},{"type":1,"keyCode":160,"mouseX":0,"mouseY":0,"time":3297},{"type":0,"keyCode":160,"mouseX":0,"mouseY":0,"time":3657},{"type":1,"keyCode":160,"mouseX":0,"mouseY":0,"time":4375},{"type":0,"keyCode":160,"mouseX":0,"mouseY":0,"time":4703},{"type":1,"keyCode":160,"mouseX":0,"mouseY":0,"time":5141},{"type":1,"keyCode":87,"mouseX":0,"mouseY":0,"time":5813},{"type":0,"keyCode":87,"mouseX":0,"mouseY":0,"time":6235},{"type":1,"keyCode":87,"mouseX":0,"mouseY":0,"time":6610}],"info":{"name":"","description":"","x":557,"y":57,"width":1920,"height":1080,"recordDpi":1}}
|
||||
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "贪食匿叶龙山王前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753792348393,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 8431.9306640625,
|
||||
"y": -1813.763671875,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 8495.365234375,
|
||||
"y": -1834.43408203125,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 8518.2822265625,
|
||||
"y": -1847.02880859375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"info": {
|
||||
"authors": [
|
||||
{
|
||||
"links": "https://github.com/1004452714",
|
||||
"name": "DarkFlameMaster"
|
||||
}
|
||||
],
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"description": "",
|
||||
"enable_monster_loot_split": false,
|
||||
"last_modified_time": 1775791925697,
|
||||
"map_name": "Teyvat",
|
||||
"name": "超重型陆巡舰·机动战垒",
|
||||
"tags": [],
|
||||
"type": "collect",
|
||||
"version": "1.0"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"action": "force_tp",
|
||||
"action_params": "",
|
||||
"id": 1,
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": 9483.109375,
|
||||
"y": 3347.98681640625
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"macroEvents":[{"type":0,"keyCode":87,"mouseX":0,"mouseY":0,"time":422},{"type":0,"keyCode":160,"mouseX":0,"mouseY":0,"time":906},{"type":1,"keyCode":160,"mouseX":0,"mouseY":0,"time":1797},{"type":0,"keyCode":160,"mouseX":0,"mouseY":0,"time":2156},{"type":1,"keyCode":160,"mouseX":0,"mouseY":0,"time":2938},{"type":0,"keyCode":160,"mouseX":0,"mouseY":0,"time":3250},{"type":1,"keyCode":160,"mouseX":0,"mouseY":0,"time":4016},{"type":0,"keyCode":160,"mouseX":0,"mouseY":0,"time":4375},{"type":1,"keyCode":160,"mouseX":0,"mouseY":0,"time":5141},{"type":0,"keyCode":160,"mouseX":0,"mouseY":0,"time":6672},{"type":1,"keyCode":87,"mouseX":0,"mouseY":0,"time":9860},{"type":1,"keyCode":160,"mouseX":0,"mouseY":0,"time":9875}],"info":{"name":"","description":"","x":557,"y":57,"width":1920,"height":1080,"recordDpi":1}}
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "遗迹巨蛇前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "TheChasm",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753793052904,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": 887.7176513671875,
|
||||
"y": 762.7557373046875,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 899.0771484375,
|
||||
"y": 760.0130615234375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 965.908935546875,
|
||||
"y": 743.64697265625,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 993.7598876953125,
|
||||
"y": 736.390625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"info": {
|
||||
"authors": [],
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "SIFT",
|
||||
"description": "",
|
||||
"enable_monster_loot_split": false,
|
||||
"last_modified_time": 1763000407374,
|
||||
"map_name": "Teyvat",
|
||||
"name": "重拳出击鸭",
|
||||
"tags": [],
|
||||
"type": "collect",
|
||||
"version": "1.0"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"action": "",
|
||||
"action_params": "",
|
||||
"id": 1,
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": 10018.619140625,
|
||||
"y": 1538.62646484375
|
||||
},
|
||||
{
|
||||
"action": "",
|
||||
"action_params": "",
|
||||
"id": 2,
|
||||
"move_mode": "walk",
|
||||
"type": "path",
|
||||
"x": 10041.8623046875,
|
||||
"y": 1483.87255859375
|
||||
},
|
||||
{
|
||||
"action": "combat_script",
|
||||
"action_params": "keypress(f),wait(3),keypress(f),wait(1),keypress(f),wait(1),keypress(f)",
|
||||
"id": 3,
|
||||
"move_mode": "walk",
|
||||
"type": "target",
|
||||
"x": 10044.5068359375,
|
||||
"y": 1473.15869140625
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"info": {
|
||||
"authors": [],
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "SIFT",
|
||||
"description": "",
|
||||
"enable_monster_loot_split": false,
|
||||
"last_modified_time": 1763000508226,
|
||||
"map_name": "Teyvat",
|
||||
"name": "重拳出击鸭-打完返回",
|
||||
"tags": [],
|
||||
"type": "collect",
|
||||
"version": "1.0"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"action": "combat_script",
|
||||
"action_params": "keypress(f),wait(3),keypress(f),wait(1),keypress(f),wait(1),keypress(f)",
|
||||
"id": 1,
|
||||
"move_mode": "walk",
|
||||
"type": "target",
|
||||
"x": 10044.5068359375,
|
||||
"y": 1473.15869140625
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "金焰绒翼龙暴君前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753792463678,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 9041.6884765625,
|
||||
"y": -1457.52587890625,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 8970.724609375,
|
||||
"y": -1441.958984375,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 8954.1708984375,
|
||||
"y": -1438.552734375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "铁甲熔火帝皇前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753792049126,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 4417.4072265625,
|
||||
"y": 2229.10107421875,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 4407.68896484375,
|
||||
"y": 2206.82958984375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 4400.6142578125,
|
||||
"y": 2190.57421875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 4395.05322265625,
|
||||
"y": 2171.19287109375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "隐山猊兽前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753787074751,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 2207.36328125,
|
||||
"y": 1253.46923828125,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 2214.837890625,
|
||||
"y": 1320.07177734375,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 2221.3984375,
|
||||
"y": 1384.4091796875,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 2221.5322265625,
|
||||
"y": 1408.23876953125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "雷音权现前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.45.0",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753787915965,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": -4251.583984375,
|
||||
"y": -4785.17578125,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": -4258.99609375,
|
||||
"y": -4711.1953125,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"info": {
|
||||
"authors": [],
|
||||
"bgi_version": "0.45.0",
|
||||
"description": "",
|
||||
"enable_monster_loot_split": false,
|
||||
"last_modified_time": 1762998844804,
|
||||
"map_match_method": "",
|
||||
"map_name": "Teyvat",
|
||||
"name": "霜夜巡天灵主",
|
||||
"tags": [],
|
||||
"type": "collect",
|
||||
"version": "1.0"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"action": "",
|
||||
"action_params": "",
|
||||
"id": 1,
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": 10789.005859375,
|
||||
"y": 2277.687744140625
|
||||
},
|
||||
{
|
||||
"action": "",
|
||||
"action_params": "",
|
||||
"id": 2,
|
||||
"move_mode": "walk",
|
||||
"type": "path",
|
||||
"x": 10773.37890625,
|
||||
"y": 2294
|
||||
},
|
||||
{
|
||||
"action": "",
|
||||
"action_params": "",
|
||||
"id": 3,
|
||||
"move_mode": "walk",
|
||||
"type": "path",
|
||||
"x": 10761.36328125,
|
||||
"y": 2319.513427734375
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "风蚀沙虫前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753789042822,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 4572.232421875,
|
||||
"y": -1071.85693359375,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 4569.2626953125,
|
||||
"y": -1046.1904296875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 4567.267578125,
|
||||
"y": -1034.00634765625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 4565.1396484375,
|
||||
"y": -1017.8115234375,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying",
|
||||
"action_params": "2500"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "魔偶剑鬼前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.45.0",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753787463391,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": -2405.50390625,
|
||||
"y": -3912.66015625,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": -2347.587890625,
|
||||
"y": -3942.6298828125,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying",
|
||||
"action_params": "2000"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "魔像督军前往",
|
||||
"type": "collect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tool_tingsu",
|
||||
"links": ""
|
||||
}
|
||||
],
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.52.0",
|
||||
"map_match_method": "TemplateMatch",
|
||||
"tags": [],
|
||||
"last_modified_time": 1753792140100,
|
||||
"enable_monster_loot_split": false
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 3848.580078125,
|
||||
"y": 1136.95166015625,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 3788.3203125,
|
||||
"y": 1137.62060546875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using System;
|
||||
|
||||
namespace BetterGenshinImpact.GameTask.AutoBoss;
|
||||
|
||||
/// <summary>
|
||||
/// 自动首领讨伐的持久化配置,由独立任务页和一条龙入口复用。
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public partial class AutoBossConfig : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
private string _bossName = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _strategyName = "根据队伍自动选择";
|
||||
|
||||
[ObservableProperty]
|
||||
private string _teamName = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _specifyRunCount = false;
|
||||
|
||||
[ObservableProperty]
|
||||
private int _runCount = 1;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _useTransientResin = false;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _useFragileResin = false;
|
||||
|
||||
[ObservableProperty]
|
||||
private int _reviveRetryCount = 3;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _returnToStatueAfterEachRound = false;
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用奖励名称识别。默认关闭。
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private bool _rewardRecognitionEnabled = false;
|
||||
|
||||
/// <summary>
|
||||
/// 关闭指定讨伐次数时清空补充树脂开关,避免树脂耗尽模式误用须臾或脆弱树脂。
|
||||
/// </summary>
|
||||
/// <param name="value">新的指定讨伐次数开关状态。</param>
|
||||
partial void OnSpecifyRunCountChanged(bool value)
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
UseTransientResin = false;
|
||||
UseFragileResin = false;
|
||||
}
|
||||
|
||||
partial void OnRunCountChanged(int value)
|
||||
{
|
||||
if (value < 1)
|
||||
{
|
||||
RunCount = 1;
|
||||
}
|
||||
}
|
||||
|
||||
partial void OnReviveRetryCountChanged(int value)
|
||||
{
|
||||
if (value < 0)
|
||||
{
|
||||
ReviveRetryCount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BetterGenshinImpact.GameTask.AutoBoss;
|
||||
|
||||
/// <summary>
|
||||
/// 自动首领讨伐支持的 Boss 数据和路线类型分类。
|
||||
/// </summary>
|
||||
public static class AutoBossData
|
||||
{
|
||||
private static IReadOnlyList<string>? _supportedBossNames;
|
||||
|
||||
/// <summary>
|
||||
/// 按国家分组的可选 Boss 列表,UI 级联下拉只展示这里配置的目标。
|
||||
/// </summary>
|
||||
public static readonly IReadOnlyDictionary<string, IReadOnlyList<string>> CountryToBosses =
|
||||
new Dictionary<string, IReadOnlyList<string>>
|
||||
{
|
||||
["蒙德"] = ["急冻树", "无相之雷", "守望者·堕天"],
|
||||
["璃月"] = ["爆炎树", "纯水精灵", "古岩龙蜥", "无相之岩", "遗迹巨蛇", "隐山猊兽"],
|
||||
["稻妻"] = ["无相之火", "恒常机关阵列", "雷音权现", "魔偶剑鬼", "无相之水"],
|
||||
["须弥"] = ["掣电树", "半永恒统辖矩阵", "翠翎恐蕈", "风蚀沙虫", "无相之草", "深罪浸礼者", "兆载永劫龙兽"],
|
||||
["枫丹"] = ["歌裴莉娅的葬送", "科培琉司的劫罚", "实验性场力发生装置", "魔像督军", "千年珍珠骏麟", "水形幻人", "铁甲熔火帝皇"],
|
||||
["纳塔"] = ["金焰绒翼龙暴君", "灵觉隐修的迷者", "秘源机兵·构型械", "秘源机兵·统御械", "熔岩辉龙像", "深邃摹结株", "贪食匿叶龙山王"],
|
||||
["挪德卡莱"] = ["蕴光月守宫", "深黯魇语之主", "超重型陆巡舰·机动战垒", "霜夜巡天灵主", "蕴光月幻蝶", "重拳出击鸭"]
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 所有支持的 Boss 名称扁平列表。
|
||||
/// </summary>
|
||||
public static IReadOnlyList<string> SupportedBossNames =>
|
||||
_supportedBossNames ??= CountryToBosses.Values.SelectMany(x => x).ToList();
|
||||
|
||||
/// <summary>
|
||||
/// 战斗后需要重新交互才能再次讨伐的 Boss。
|
||||
/// </summary>
|
||||
public static readonly HashSet<string> TalkToStartBosses =
|
||||
[
|
||||
"歌裴莉娅的葬送",
|
||||
"科培琉司的劫罚",
|
||||
"纯水精灵",
|
||||
"重拳出击鸭"
|
||||
];
|
||||
|
||||
/// <summary>
|
||||
/// 所在分层地图还不支持路径追踪的Boss
|
||||
/// 暂时使用强制传送和键鼠宏寻路。
|
||||
/// </summary>
|
||||
public static readonly HashSet<string> NoPathingSupportBosses =
|
||||
[
|
||||
"蕴光月守宫",
|
||||
"超重型陆巡舰·机动战垒",
|
||||
"蕴光月幻蝶"
|
||||
];
|
||||
|
||||
/// <summary>
|
||||
/// 判断 Boss 是否在支持列表中。
|
||||
/// </summary>
|
||||
/// <param name="bossName">Boss 名称。</param>
|
||||
/// <returns>支持该 Boss 时返回 true。</returns>
|
||||
public static bool IsSupportedBoss(string bossName)
|
||||
{
|
||||
return SupportedBossNames.Contains(bossName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断 Boss 是否需要重新交互。
|
||||
/// </summary>
|
||||
/// <param name="bossName">Boss 名称。</param>
|
||||
/// <returns>需要执行战后快速前往路线时返回 true。</returns>
|
||||
public static bool IsTalkToStartBoss(string bossName)
|
||||
{
|
||||
return TalkToStartBosses.Contains(bossName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断 Boss 是否不支持地图追踪。
|
||||
/// </summary>
|
||||
/// <param name="bossName">Boss 名称。</param>
|
||||
/// <returns>需要强制传送加键鼠宏路线时返回 true。</returns>
|
||||
public static bool IsNoPathingSupportBoss(string bossName)
|
||||
{
|
||||
return NoPathingSupportBosses.Contains(bossName);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
using BetterGenshinImpact.Core.Config;
|
||||
using BetterGenshinImpact.GameTask.Model;
|
||||
|
||||
namespace BetterGenshinImpact.GameTask.AutoBoss;
|
||||
|
||||
/// <summary>
|
||||
/// 自动首领讨伐任务参数,供独立任务、一条龙和 JS 调用统一传递配置。
|
||||
/// </summary>
|
||||
public class AutoBossParam : BaseTaskParam<AutoBossTask>
|
||||
{
|
||||
private const string AutoStrategyName = "根据队伍自动选择";
|
||||
private string _strategyName = AutoStrategyName;
|
||||
private string _combatStrategyPath = BuildCombatStrategyPath(AutoStrategyName);
|
||||
private bool _combatStrategyPathCustomized;
|
||||
|
||||
/// <summary>
|
||||
/// 需要讨伐的 Boss 名称。
|
||||
/// </summary>
|
||||
public string BossName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// UI 中选择的战斗策略名称;当没有自定义策略路径时会同步更新 <see cref="CombatStrategyPath"/>。
|
||||
/// </summary>
|
||||
public string StrategyName
|
||||
{
|
||||
get => _strategyName;
|
||||
set
|
||||
{
|
||||
_strategyName = string.IsNullOrWhiteSpace(value) ? AutoStrategyName : value;
|
||||
if (!_combatStrategyPathCustomized)
|
||||
{
|
||||
_combatStrategyPath = BuildCombatStrategyPath(_strategyName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 实际用于解析自动战斗脚本的路径。JS 可直接设置该路径来覆盖 UI 选择。
|
||||
/// </summary>
|
||||
public string CombatStrategyPath
|
||||
{
|
||||
get => _combatStrategyPath;
|
||||
set
|
||||
{
|
||||
_combatStrategyPath = value;
|
||||
_combatStrategyPathCustomized = !string.IsNullOrWhiteSpace(value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 讨伐前需要切换到的队伍名称;为空时保持当前队伍。
|
||||
/// </summary>
|
||||
public string TeamName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用“指定讨伐次数”模式;关闭时刷取至原粹树脂耗尽。
|
||||
/// </summary>
|
||||
public bool SpecifyRunCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 指定模式下成功领取奖励的目标次数。
|
||||
/// </summary>
|
||||
public int RunCount { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 指定讨伐次数模式下,原粹树脂不足时是否允许使用须臾树脂补充。
|
||||
/// </summary>
|
||||
public bool UseTransientResin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 指定讨伐次数模式下,原粹树脂不足时是否允许使用脆弱树脂补充。
|
||||
/// </summary>
|
||||
public bool UseFragileResin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 检测到角色死亡后,回神像恢复并重试当前首领讨伐的最大次数。
|
||||
/// </summary>
|
||||
public int ReviveRetryCount { get; set; } = 3;
|
||||
|
||||
/// <summary>
|
||||
/// 每轮领奖后是否先返回七天神像,再重新前往 Boss。
|
||||
/// </summary>
|
||||
public bool ReturnToStatueAfterEachRound { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用奖励名称识别。默认关闭。
|
||||
/// </summary>
|
||||
public bool RewardRecognitionEnabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 使用当前全局 AutoBoss 配置创建参数,主要用于 JS 无参构造和一条龙默认启动。
|
||||
/// </summary>
|
||||
public AutoBossParam() : base(null, null)
|
||||
{
|
||||
SetDefault();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 使用当前全局 AutoBoss 配置创建参数,并用传入路径覆盖实际战斗策略路径。
|
||||
/// </summary>
|
||||
/// <param name="combatStrategyPath">自动战斗策略文件或策略目录路径。</param>
|
||||
public AutoBossParam(string combatStrategyPath) : base(null, null)
|
||||
{
|
||||
SetDefault();
|
||||
CombatStrategyPath = combatStrategyPath;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从当前全局 AutoBoss 配置填充默认参数。
|
||||
/// </summary>
|
||||
public void SetDefault()
|
||||
{
|
||||
SetAutoBossConfig(TaskContext.Instance().Config.AutoBossConfig);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从指定 AutoBoss 配置复制可配置项,不覆盖已经通过构造参数或属性设置的自定义战斗策略路径。
|
||||
/// </summary>
|
||||
/// <param name="config">自动首领讨伐配置。</param>
|
||||
public void SetAutoBossConfig(AutoBossConfig config)
|
||||
{
|
||||
BossName = config.BossName;
|
||||
StrategyName = config.StrategyName;
|
||||
TeamName = config.TeamName;
|
||||
SpecifyRunCount = config.SpecifyRunCount;
|
||||
RunCount = config.RunCount;
|
||||
UseTransientResin = config.UseTransientResin;
|
||||
UseFragileResin = config.UseFragileResin;
|
||||
ReviveRetryCount = config.ReviveRetryCount;
|
||||
ReturnToStatueAfterEachRound = config.ReturnToStatueAfterEachRound;
|
||||
RewardRecognitionEnabled = config.RewardRecognitionEnabled;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据战斗策略名称重新计算实际策略路径,并清除“自定义路径”标记。
|
||||
/// </summary>
|
||||
/// <param name="strategyName">战斗策略名称;为空时使用当前全局 AutoBoss 配置的策略名称。</param>
|
||||
public void SetCombatStrategyPath(string? strategyName = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(strategyName))
|
||||
{
|
||||
strategyName = TaskContext.Instance().Config.AutoBossConfig.StrategyName;
|
||||
}
|
||||
|
||||
_strategyName = string.IsNullOrWhiteSpace(strategyName) ? AutoStrategyName : strategyName;
|
||||
_combatStrategyPath = BuildCombatStrategyPath(_strategyName);
|
||||
_combatStrategyPathCustomized = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将战斗策略名称转换为自动战斗策略文件或目录的绝对路径。
|
||||
/// </summary>
|
||||
/// <param name="strategyName">战斗策略名称。</param>
|
||||
/// <returns>策略文件路径;“根据队伍自动选择”返回自动战斗策略目录。</returns>
|
||||
private static string BuildCombatStrategyPath(string strategyName)
|
||||
{
|
||||
return AutoStrategyName.Equals(strategyName)
|
||||
? Global.Absolute(@"User\AutoFight\")
|
||||
: Global.Absolute(@"User\AutoFight\" + strategyName + ".txt");
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -91,4 +91,12 @@ public partial class AutoDomainConfig : ObservableObject
|
||||
// 战斗死亡后重试次数
|
||||
[ObservableProperty]
|
||||
private int _reviveRetryCount = 3;
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用奖励名称识别。默认关闭。
|
||||
/// 开启后每轮领取奖励时会用 ONNX 图标匹配 + OCR 材料名双路识别奖励名称与数量,秘境结束打印汇总。
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private bool _rewardRecognitionEnabled = false;
|
||||
|
||||
}
|
||||
@@ -51,6 +51,11 @@ public class AutoDomainParam : BaseTaskParam<AutoDomainTask>
|
||||
// 使用脆弱树脂刷取副本次数
|
||||
public int FragileResinUseCount { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用奖励名称识别。默认关闭。
|
||||
/// </summary>
|
||||
public bool RewardRecognitionEnabled { get; set; } = false;
|
||||
|
||||
public AutoDomainParam(int domainRoundNum, string path) : base(null, null)
|
||||
{
|
||||
DomainRoundNum = domainRoundNum;
|
||||
@@ -79,6 +84,7 @@ public class AutoDomainParam : BaseTaskParam<AutoDomainTask>
|
||||
SpecifyResinUse = config.SpecifyResinUse;
|
||||
OriginalResin20UseCount = config.OriginalResin20UseCount;
|
||||
OriginalResin40UseCount = config.OriginalResin40UseCount;
|
||||
RewardRecognitionEnabled = config.RewardRecognitionEnabled;
|
||||
}
|
||||
|
||||
public AutoDomainParam(int domainRoundNum = 0) : base(null, null)
|
||||
|
||||
@@ -38,6 +38,7 @@ using System.Collections.ObjectModel;
|
||||
using BetterGenshinImpact.Core.Script.Dependence;
|
||||
using BetterGenshinImpact.GameTask.AutoDomain.Model;
|
||||
using BetterGenshinImpact.GameTask.Common;
|
||||
using BetterGenshinImpact.GameTask.Common.Reward;
|
||||
using Compunet.YoloSharp;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using BetterGenshinImpact.GameTask.AutoFight;
|
||||
@@ -45,7 +46,7 @@ using BetterGenshinImpact.GameTask.AutoDomain.Assets;
|
||||
|
||||
namespace BetterGenshinImpact.GameTask.AutoDomain;
|
||||
|
||||
public class AutoDomainTask : ISoloTask
|
||||
public class AutoDomainTask : ISoloTask<Dictionary<string, int>>
|
||||
{
|
||||
public string Name => "自动秘境";
|
||||
|
||||
@@ -55,7 +56,9 @@ public class AutoDomainTask : ISoloTask
|
||||
|
||||
private readonly AutoDomainConfig _config;
|
||||
|
||||
private readonly CombatScriptBag _combatScriptBag;
|
||||
private readonly CombatScriptBag? _combatScriptBag;
|
||||
private readonly string? _jsonCombatStrategyPath;
|
||||
private readonly Dictionary<string, int> _rewardSummary = new();
|
||||
|
||||
private CancellationToken _ct;
|
||||
|
||||
@@ -81,7 +84,15 @@ public class AutoDomainTask : ISoloTask
|
||||
|
||||
_config = TaskContext.Instance().Config.AutoDomainConfig;
|
||||
|
||||
_combatScriptBag = CombatScriptParser.ReadAndParse(_taskParam.CombatStrategyPath);
|
||||
if (_taskParam.CombatStrategyPath.EndsWith(".json", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
_jsonCombatStrategyPath = _taskParam.CombatStrategyPath;
|
||||
Logger.LogInformation("自动秘境:检测到JSON策略文件,将使用JSON战斗引擎");
|
||||
}
|
||||
else
|
||||
{
|
||||
_combatScriptBag = CombatScriptParser.ReadAndParse(_taskParam.CombatStrategyPath);
|
||||
}
|
||||
|
||||
_resinPriorityListWhenSpecifyUse = ResinUseRecord.BuildFromDomainParam(taskParam);
|
||||
|
||||
@@ -109,9 +120,12 @@ public class AutoDomainTask : ISoloTask
|
||||
return RecognitionObject.OcrMatch(x, y, width, height, targetText);
|
||||
}
|
||||
|
||||
public async Task Start(CancellationToken ct)
|
||||
Task ISoloTask.Start(CancellationToken ct) => Start(ct);
|
||||
|
||||
public async Task<Dictionary<string, int>> Start(CancellationToken ct)
|
||||
{
|
||||
_ct = ct;
|
||||
_rewardSummary.Clear();
|
||||
|
||||
Init();
|
||||
Notify.Event(NotificationEvent.DomainStart).Success("自动秘境启动");
|
||||
@@ -153,6 +167,7 @@ public class AutoDomainTask : ISoloTask
|
||||
|
||||
await ArtifactSalvage();
|
||||
Notify.Event(NotificationEvent.DomainEnd).Success("自动秘境结束");
|
||||
return new Dictionary<string, int>(_rewardSummary);
|
||||
}
|
||||
|
||||
private async Task DoDomain()
|
||||
@@ -172,25 +187,40 @@ public class AutoDomainTask : ISoloTask
|
||||
Logger.LogDebug("0. 关闭秘境提示");
|
||||
await CloseDomainTip();
|
||||
|
||||
//0.5. 初始化队伍,只执行一次
|
||||
if (i == 0)
|
||||
if (_jsonCombatStrategyPath != null)
|
||||
{
|
||||
combatScenes = new CombatScenes().InitializeTeam(CaptureToRectArea());
|
||||
ESkillCdTracker.Clear();
|
||||
// JSON策略:战斗引擎内部初始化队伍,无需TXTSpecific步骤
|
||||
// 1. 走到钥匙处启动
|
||||
Logger.LogInformation("自动秘境:{Text}", "1. 走到钥匙处启动");
|
||||
await WalkToPressF();
|
||||
|
||||
// 2. 执行战斗(JSON战斗引擎)
|
||||
Logger.LogInformation("自动秘境:{Text}", "2. 执行战斗策略(JSON)");
|
||||
await StartJsonFight();
|
||||
}
|
||||
else
|
||||
{
|
||||
//0.5. 初始化队伍,只执行一次
|
||||
if (i == 0)
|
||||
{
|
||||
combatScenes = new CombatScenes().InitializeTeam(CaptureToRectArea());
|
||||
}
|
||||
|
||||
RetryTeamInit(combatScenes); // 队伍没初始化成功则重试
|
||||
RetryTeamInit(combatScenes);
|
||||
|
||||
// 0. 切换到第一个角色
|
||||
var combatCommands = FindCombatScriptAndSwitchAvatar(combatScenes);
|
||||
// 0. 切换到第一个角色
|
||||
var combatCommands = FindCombatScriptAndSwitchAvatar(combatScenes);
|
||||
|
||||
// 1. 走到钥匙处启动
|
||||
Logger.LogInformation("自动秘境:{Text}", "1. 走到钥匙处启动");
|
||||
await WalkToPressF();
|
||||
// 1. 走到钥匙处启动
|
||||
Logger.LogInformation("自动秘境:{Text}", "1. 走到钥匙处启动");
|
||||
await WalkToPressF();
|
||||
|
||||
// 2. 执行战斗(战斗线程、视角线程、检测战斗完成线程)
|
||||
Logger.LogInformation("自动秘境:{Text}", "2. 执行战斗策略");
|
||||
await StartFight(combatScenes, combatCommands);
|
||||
combatScenes.AfterTask();
|
||||
// 2. 执行战斗(战斗线程、视角线程、检测战斗完成线程)
|
||||
Logger.LogInformation("自动秘境:{Text}", "2. 执行战斗策略");
|
||||
await StartFight(combatScenes, combatCommands);
|
||||
combatScenes.AfterTask();
|
||||
}
|
||||
EndFightWait();
|
||||
|
||||
// 3. 寻找石化古树 并左右移动直到石化古树位于屏幕中心
|
||||
@@ -324,17 +354,6 @@ public class AutoDomainTask : ISoloTask
|
||||
throw new Exception("请检查是否在秘境门前");
|
||||
}
|
||||
|
||||
var menu = await NewRetry.WaitForElementAppear(
|
||||
GetConfirmRa("单人挑战"),
|
||||
() => Simulation.SendInput.Keyboard.KeyPress(AutoPickAssets.Instance.PickVk),
|
||||
_ct,
|
||||
20,
|
||||
500
|
||||
);
|
||||
if (!menu)
|
||||
{
|
||||
throw new Exception("请检查是否已进入秘境页面");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -365,12 +384,19 @@ public class AutoDomainTask : ISoloTask
|
||||
{
|
||||
var fightAssets = AutoFightAssets.Instance;
|
||||
|
||||
var menuFound = await NewRetry.WaitForElementAppear(
|
||||
GetConfirmRa("单人挑战"),
|
||||
await NewRetry.WaitForElementDisappear(
|
||||
AutoPickAssets.Instance.PickRo,
|
||||
() => Simulation.SendInput.Keyboard.KeyPress(AutoPickAssets.Instance.PickVk),
|
||||
_ct,
|
||||
10,
|
||||
1000
|
||||
20,
|
||||
500
|
||||
);
|
||||
var menuFound = await NewRetry.WaitForElementAppear(
|
||||
GetConfirmRa("单人挑战"),
|
||||
null,//只等待,不执行操作
|
||||
_ct,
|
||||
20,
|
||||
500
|
||||
);
|
||||
if (!menuFound)
|
||||
{
|
||||
@@ -682,6 +708,45 @@ public class AutoDomainTask : ISoloTask
|
||||
return Task.WhenAll(combatTask, domainEndTask);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// JSON策略战斗入口:委托给AutoFightJsonTask,抑制其自带的结束检测和拾取逻辑,
|
||||
/// 秘境的DomainEndDetectionTask通过CancellationToken控制战斗结束。
|
||||
/// </summary>
|
||||
private async Task StartJsonFight()
|
||||
{
|
||||
CancellationTokenSource cts = new();
|
||||
_ct.Register(cts.Cancel);
|
||||
|
||||
var jsonParam = new AutoFightParam
|
||||
{
|
||||
CombatStrategyPath = _jsonCombatStrategyPath!,
|
||||
FightFinishDetectEnabled = false,
|
||||
ExpBasedPickupEnabled = false,
|
||||
KazuhaPickupEnabled = false,
|
||||
PickDropsAfterFightEnabled = false,
|
||||
Timeout = 600,
|
||||
};
|
||||
|
||||
var jsonTask = new AutoFightJsonTask(jsonParam);
|
||||
|
||||
var domainEndTask = DomainEndDetectionTask(cts);
|
||||
|
||||
var combatTask = Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
await jsonTask.Start(cts.Token);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.LogWarning("JSON战斗任务异常:{Msg}", e.Message);
|
||||
}
|
||||
}, cts.Token);
|
||||
|
||||
domainEndTask.Start();
|
||||
await Task.WhenAll(combatTask, domainEndTask);
|
||||
}
|
||||
|
||||
private void EndFightWait()
|
||||
{
|
||||
if (_ct.IsCancellationRequested)
|
||||
@@ -1206,6 +1271,7 @@ public class AutoDomainTask : ISoloTask
|
||||
Notify.Event(NotificationEvent.DomainReward).Success("自动秘境奖励领取");
|
||||
|
||||
Sleep(1000, _ct);
|
||||
TryRecognizeRewardResult();
|
||||
|
||||
for (var i = 0; i < 30; i++)
|
||||
{
|
||||
@@ -1262,6 +1328,37 @@ public class AutoDomainTask : ISoloTask
|
||||
throw new NormalEndException("未检测到秘境结束,可能是背包物品已满。");
|
||||
}
|
||||
|
||||
private void TryRecognizeRewardResult()
|
||||
{
|
||||
if (!_taskParam.RewardRecognitionEnabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// 使用多页识别(自动检测是否需要翻页)
|
||||
Logger.LogInformation("自动秘境:开始奖励识别");
|
||||
var rewards = RewardResultRecognizer.Instance.RecognizeMultiPage();
|
||||
|
||||
RewardResultRecognizer.MergeIntoSummary(_rewardSummary, rewards);
|
||||
|
||||
if (rewards.Count > 0)
|
||||
{
|
||||
Logger.LogInformation("自动秘境:本轮奖励识别结果 {Rewards}",
|
||||
string.Join(", ", rewards.Select(r => $"{r.Key} x{r.Value}")));
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.LogWarning("自动秘境:本轮奖励识别结果为空");
|
||||
}
|
||||
}
|
||||
catch (Exception e) when (e is not OperationCanceledException)
|
||||
{
|
||||
Logger.LogWarning(e, "自动秘境:奖励识别失败,已跳过本轮奖励汇总");
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ExitDomain()
|
||||
{
|
||||
Simulation.SendInput.Keyboard.KeyPress(VK.VK_ESCAPE);
|
||||
|
||||
@@ -22,6 +22,7 @@ public class AutoFightAssets : BaseAssets<AutoFightAssets>
|
||||
public Rect ERect;
|
||||
public Rect ECooldownRect;
|
||||
public Rect QRect;
|
||||
public Rect QRectForClassify;
|
||||
public Rect ZCooldownRect;
|
||||
public Rect EndTipsUpperRect; // 挑战达成提示
|
||||
public Rect EndTipsRect;
|
||||
@@ -78,6 +79,8 @@ public class AutoFightAssets : BaseAssets<AutoFightAssets>
|
||||
(int)(41 * AssetScale), (int)(18 * AssetScale));
|
||||
QRect = new Rect(CaptureRect.Width - (int)(157 * AssetScale), CaptureRect.Height - (int)(165 * AssetScale),
|
||||
(int)(110 * AssetScale), (int)(110 * AssetScale));
|
||||
QRectForClassify = new Rect(CaptureRect.Width - (int)(172 * AssetScale), CaptureRect.Height - (int)(166 * AssetScale),
|
||||
(int)(137 * AssetScale), (int)(137 * AssetScale));
|
||||
ZCooldownRect = new Rect(CaptureRect.Width - (int)(130 * AssetScale), (int)(814 * AssetScale),
|
||||
(int)(60 * AssetScale), (int)(24 * AssetScale));
|
||||
// 小道具位置 1920-133,800,60,50
|
||||
|
||||
@@ -1765,8 +1765,7 @@
|
||||
"西特拉利",
|
||||
"黑曜石奶奶",
|
||||
"黑曜石",
|
||||
"奶奶",
|
||||
"老伴"
|
||||
"奶奶"
|
||||
],
|
||||
"burstCD": 15,
|
||||
"id": "10000107",
|
||||
@@ -2075,5 +2074,78 @@
|
||||
"nameEn": "Linnea",
|
||||
"skillCD": 18,
|
||||
"weapon": "10"
|
||||
},
|
||||
{
|
||||
"alias": [
|
||||
"洛恩",
|
||||
"Lohen"
|
||||
],
|
||||
"burstCD": 15,
|
||||
"id": "10000129",
|
||||
"name": "洛恩",
|
||||
"nameEn": "Lohen",
|
||||
"skillCD": 18,
|
||||
"weapon": "10"
|
||||
},
|
||||
{
|
||||
"alias": [
|
||||
"尼可",
|
||||
"Nicole"
|
||||
],
|
||||
"burstCD": 15,
|
||||
"id": "10000131",
|
||||
"name": "尼可",
|
||||
"nameEn": "Nicole",
|
||||
"skillCD": 16,
|
||||
"weapon": "10"
|
||||
},
|
||||
{
|
||||
"alias": [
|
||||
"布伦妮",
|
||||
"Prune"
|
||||
],
|
||||
"burstCD": 18,
|
||||
"id": "10000132",
|
||||
"name": "布伦妮",
|
||||
"nameEn": "Prune",
|
||||
"skillCD": 15,
|
||||
"weapon": "10"
|
||||
},
|
||||
{
|
||||
"alias": [
|
||||
"桑多涅",
|
||||
"Sandrone",
|
||||
"Marionette"
|
||||
],
|
||||
"burstCD": 15,
|
||||
"id": "10000133",
|
||||
"name": "桑多涅",
|
||||
"nameEn": "Marionette",
|
||||
"skillCD": 4,
|
||||
"weapon": "10"
|
||||
},
|
||||
{
|
||||
"alias": [
|
||||
"阿罗夏",
|
||||
"Alyosha"
|
||||
],
|
||||
"burstCD": 18,
|
||||
"id": "10000148",
|
||||
"name": "阿罗夏",
|
||||
"nameEn": "Alyosha",
|
||||
"skillCD": 15,
|
||||
"weapon": "10"
|
||||
},
|
||||
{
|
||||
"alias": [
|
||||
"奥黛塔",
|
||||
"Odette"
|
||||
],
|
||||
"burstCD": 15,
|
||||
"id": "10000150",
|
||||
"name": "奥黛塔",
|
||||
"nameEn": "Odette",
|
||||
"skillCD": 15,
|
||||
"weapon": "10"
|
||||
}
|
||||
]
|
||||
@@ -13,7 +13,7 @@ namespace BetterGenshinImpact.GameTask.AutoFight;
|
||||
[Serializable]
|
||||
public partial class AutoFightConfig : ObservableObject
|
||||
{
|
||||
[ObservableProperty] private string _strategyName = "";
|
||||
[ObservableProperty] private string _strategyName = "根据队伍自动选择";
|
||||
|
||||
/// <summary>
|
||||
/// 英文逗号分割 强制指定队伍角色
|
||||
|
||||
@@ -0,0 +1,921 @@
|
||||
using BetterGenshinImpact.Core.Recognition.ONNX;
|
||||
using BetterGenshinImpact.Core.Simulator;
|
||||
using BetterGenshinImpact.Core.Simulator.Extensions;
|
||||
using BetterGenshinImpact.GameTask.AutoFight.Assets;
|
||||
using BetterGenshinImpact.GameTask.AutoFight.Model;
|
||||
using BetterGenshinImpact.GameTask.AutoFight.Script;
|
||||
using BetterGenshinImpact.GameTask.Model.Area;
|
||||
using BetterGenshinImpact.Helpers;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using static BetterGenshinImpact.GameTask.Common.TaskControl;
|
||||
using BetterGenshinImpact.GameTask.Common.Job;
|
||||
using OpenCvSharp;
|
||||
using BetterGenshinImpact.GameTask.AutoPick.Assets;
|
||||
using BetterGenshinImpact.Core.Recognition;
|
||||
using BetterGenshinImpact.GameTask.Common.Element.Assets;
|
||||
using BetterGenshinImpact.GameTask.Common;
|
||||
using BetterGenshinImpact.GameTask.AutoPathing.Handler;
|
||||
using BetterGenshinImpact.GameTask.AutoPathing.Model;
|
||||
|
||||
namespace BetterGenshinImpact.GameTask.AutoFight;
|
||||
|
||||
public class AutoFightJsonTask : ISoloTask
|
||||
{
|
||||
public string Name => "自动战斗(JSON策略)";
|
||||
|
||||
private readonly AutoFightParam _taskParam;
|
||||
private readonly JsonCombatStrategy _strategy;
|
||||
private CancellationToken _ct;
|
||||
|
||||
/// <summary>
|
||||
/// YOLO目标检测器(BgiWorld模型),用于战斗结束检测
|
||||
/// 当前未使用(战斗结束检测已委托到 AutoFightEndDetection),保留声明以与 TXT 策略保持一致
|
||||
/// 初始化条件:_taskParam.FightFinishDetectEnabled == true
|
||||
/// </summary>
|
||||
private readonly BgiYoloPredictor? _predictor;
|
||||
private DateTime _lastFightFlagTime = DateTime.Now;
|
||||
|
||||
private readonly ReturnMainUiTask _returnMainUiTask = new();
|
||||
private readonly double _assetScale = TaskContext.Instance().SystemInfo.AssetScale;
|
||||
private readonly double _dpi = TaskContext.Instance().DpiScale;
|
||||
|
||||
private static readonly object PickLock = new object();
|
||||
|
||||
/// <summary>
|
||||
/// 当前队伍中的角色名集合(用于过滤动作节点)
|
||||
/// </summary>
|
||||
private HashSet<string> _teamCharacterNames = new(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
// 日志防刷:1秒内同一动作名至多输出一次日志
|
||||
private string _lastLoggedActionName = "";
|
||||
private DateTime _lastLogTime = DateTime.MinValue;
|
||||
|
||||
/// <summary>
|
||||
/// 展开后的优先级动作条目
|
||||
/// 每个 JsonAction 展开为 1+N 个条目(1个主条件 + N个 morePriorities)
|
||||
/// </summary>
|
||||
private class PrioritizedAction
|
||||
{
|
||||
public JsonAction Action { get; set; }
|
||||
public string Expression { get; set; }
|
||||
public int Priority { get; set; }
|
||||
}
|
||||
|
||||
// 战斗点位
|
||||
public static WaypointForTrack? FightWaypoint { get; set; } = null;
|
||||
|
||||
private TaskFightFinishDetectConfig _finishDetectConfig;
|
||||
|
||||
private class TaskFightFinishDetectConfig
|
||||
{
|
||||
public int DelayTime = 1500;
|
||||
public int DetectDelayTime = 450;
|
||||
public Dictionary<string, int> DelayTimes = new();
|
||||
public double CheckTime = 5;
|
||||
public List<string> CheckNames = new();
|
||||
public bool FastCheckEnabled;
|
||||
public bool RotateFindEnemyEnabled = false;
|
||||
|
||||
public (int, int, int) BattleEndProgressBarColor { get; }
|
||||
public (int, int, int) BattleEndProgressBarColorTolerance { get; }
|
||||
|
||||
public TaskFightFinishDetectConfig(AutoFightParam.FightFinishDetectConfig finishDetectConfig)
|
||||
{
|
||||
FastCheckEnabled = finishDetectConfig.FastCheckEnabled;
|
||||
ParseCheckTimeString(finishDetectConfig.FastCheckParams, out CheckTime, CheckNames);
|
||||
ParseFastCheckEndDelayString(finishDetectConfig.CheckEndDelay, out DelayTime, DelayTimes);
|
||||
BattleEndProgressBarColor =
|
||||
ParseStringToTuple(finishDetectConfig.BattleEndProgressBarColor, (95, 235, 255));
|
||||
BattleEndProgressBarColorTolerance =
|
||||
ParseSingleOrCommaSeparated(finishDetectConfig.BattleEndProgressBarColorTolerance, (6, 6, 6));
|
||||
DetectDelayTime =
|
||||
(int)((double.TryParse(finishDetectConfig.BeforeDetectDelay, out var result) ? result : 0.45) * 1000);
|
||||
RotateFindEnemyEnabled = finishDetectConfig.RotateFindEnemyEnabled;
|
||||
}
|
||||
|
||||
public static void ParseCheckTimeString(
|
||||
string input,
|
||||
out double checkTime,
|
||||
List<string> names)
|
||||
{
|
||||
checkTime = 5;
|
||||
if (string.IsNullOrEmpty(input))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var uniqueNames = new HashSet<string>();
|
||||
|
||||
var segments = input.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
foreach (var segment in segments)
|
||||
{
|
||||
var trimmedSegment = segment.Trim();
|
||||
|
||||
if (double.TryParse(trimmedSegment, NumberStyles.Float, CultureInfo.InvariantCulture,
|
||||
out double number))
|
||||
{
|
||||
checkTime = number;
|
||||
}
|
||||
else if (!uniqueNames.Contains(trimmedSegment))
|
||||
{
|
||||
uniqueNames.Add(trimmedSegment);
|
||||
}
|
||||
}
|
||||
|
||||
names.AddRange(uniqueNames);
|
||||
}
|
||||
|
||||
public static void ParseFastCheckEndDelayString(
|
||||
string input,
|
||||
out int delayTime,
|
||||
Dictionary<string, int> nameDelayMap)
|
||||
{
|
||||
delayTime = 1500;
|
||||
|
||||
if (string.IsNullOrEmpty(input))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var segments = input.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
foreach (var segment in segments)
|
||||
{
|
||||
var parts = segment.Split(',');
|
||||
|
||||
if (parts.Length == 1)
|
||||
{
|
||||
if (double.TryParse(parts[0].Trim(), NumberStyles.Float, CultureInfo.InvariantCulture,
|
||||
out double number))
|
||||
{
|
||||
delayTime = (int)(number * 1000);
|
||||
}
|
||||
}
|
||||
else if (parts.Length == 2)
|
||||
{
|
||||
string name = parts[0].Trim();
|
||||
if (double.TryParse(parts[1].Trim(), NumberStyles.Float, CultureInfo.InvariantCulture,
|
||||
out double value))
|
||||
{
|
||||
nameDelayMap[name] = (int)(value * 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static bool IsSingleNumber(string input, out int result)
|
||||
{
|
||||
return int.TryParse(input, out result);
|
||||
}
|
||||
|
||||
static (int, int, int) ParseSingleOrCommaSeparated(string input, (int, int, int) defaultValue)
|
||||
{
|
||||
if (IsSingleNumber(input, out var singleNumber))
|
||||
{
|
||||
return (singleNumber, singleNumber, singleNumber);
|
||||
}
|
||||
|
||||
return ParseStringToTuple(input, defaultValue);
|
||||
}
|
||||
|
||||
static (int, int, int) ParseStringToTuple(string input, (int, int, int) defaultValue)
|
||||
{
|
||||
var parts = input.Split(',');
|
||||
if (parts.Length == 3 &&
|
||||
int.TryParse(parts[0], out var num1) &&
|
||||
int.TryParse(parts[1], out var num2) &&
|
||||
int.TryParse(parts[2], out var num3))
|
||||
{
|
||||
return (num1, num2, num3);
|
||||
}
|
||||
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
public AutoFightJsonTask(AutoFightParam taskParam)
|
||||
{
|
||||
_taskParam = taskParam;
|
||||
_strategy = JsonCombatStrategyParser.ParseFile(_taskParam.CombatStrategyPath);
|
||||
|
||||
if (_taskParam.FightFinishDetectEnabled)
|
||||
{
|
||||
_predictor = App.ServiceProvider.GetRequiredService<BgiOnnxFactory>().CreateYoloPredictor(BgiOnnxModel.BgiWorld);
|
||||
}
|
||||
|
||||
_finishDetectConfig = new TaskFightFinishDetectConfig(_taskParam.FinishDetectConfig);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取战斗场景,带重试机制
|
||||
/// 最多重试 5 次,每次间隔 1 秒
|
||||
/// </summary>
|
||||
/// <returns>初始化完成的战斗场景</returns>
|
||||
public CombatScenes GetCombatScenesWithRetry()
|
||||
{
|
||||
const int maxRetries = 5;
|
||||
var retryDelayMs = 1000;
|
||||
|
||||
for (int attempt = 1; attempt <= maxRetries; attempt++)
|
||||
{
|
||||
var combatScenes = new CombatScenes().InitializeTeam(CaptureToRectArea());
|
||||
if (combatScenes.CheckTeamInitialized())
|
||||
{
|
||||
return combatScenes;
|
||||
}
|
||||
|
||||
if (attempt < maxRetries)
|
||||
{
|
||||
Thread.Sleep(retryDelayMs);
|
||||
}
|
||||
}
|
||||
throw new Exception("识别队伍角色失败(已重试 5 次)");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 启动自动战斗(JSON策略模式)
|
||||
/// </summary>
|
||||
/// <param name="ct">取消令牌</param>
|
||||
public async Task Start(CancellationToken ct)
|
||||
{
|
||||
_ct = ct;
|
||||
|
||||
LogScreenResolution();
|
||||
var combatScenes = GetCombatScenesWithRetry();
|
||||
|
||||
// 收集当前队伍角色名
|
||||
foreach (var avatar in combatScenes.GetAvatars())
|
||||
{
|
||||
_teamCharacterNames.Add(avatar.Name);
|
||||
}
|
||||
Logger.LogInformation("JSON 策略:当前队伍角色:{Names}", string.Join(", ", _teamCharacterNames));
|
||||
|
||||
// 过滤可用动作:Character 为空(通用)或在当前队伍中
|
||||
var filteredActions = _strategy.Actions
|
||||
.Where(a => string.IsNullOrEmpty(a.Character) || _teamCharacterNames.Contains(a.Character))
|
||||
.ToList();
|
||||
|
||||
// 展开为优先级条目:每个动作产生 1个主条目 + N个 morePriorities 条目
|
||||
var validActions = new List<PrioritizedAction>();
|
||||
foreach (var action in filteredActions)
|
||||
{
|
||||
validActions.Add(new PrioritizedAction
|
||||
{
|
||||
Action = action,
|
||||
Expression = action.Condition.Expression,
|
||||
Priority = action.Index
|
||||
});
|
||||
|
||||
foreach (var morePriority in action.MorePriorities)
|
||||
{
|
||||
validActions.Add(new PrioritizedAction
|
||||
{
|
||||
Action = action,
|
||||
Expression = morePriority.Expression,
|
||||
Priority = morePriority.Priority
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 按优先级排序,相同优先级时原动作排在 morePriorities 之前(通过索引辅助排序)
|
||||
validActions = validActions
|
||||
.OrderBy(p => p.Priority)
|
||||
.ThenBy(p => p.Expression == p.Action.Condition.Expression ? 0 : 1)
|
||||
.ToList();
|
||||
|
||||
Logger.LogInformation("JSON 策略:共 {Total} 个动作,展开为 {Expanded} 个优先级条目",
|
||||
_strategy.Actions.Count, validActions.Count);
|
||||
|
||||
if (validActions.Count == 0)
|
||||
{
|
||||
Logger.LogWarning("JSON 策略:没有可用的动作节点,跳过战斗");
|
||||
return;
|
||||
}
|
||||
|
||||
// 新的取消token
|
||||
var cts2 = new CancellationTokenSource();
|
||||
ct.Register(cts2.Cancel);
|
||||
|
||||
combatScenes.BeforeTask(cts2.Token);
|
||||
// 设置初始当前角色名(用于无 Character 字段的通用 action 回退)
|
||||
CombatScriptParser.CurrentAvatarName = combatScenes.GetAvatars().FirstOrDefault()?.Name ?? CombatScriptParser.CurrentAvatarName;
|
||||
TimeSpan fightTimeout = TimeSpan.FromSeconds(_taskParam.Timeout);
|
||||
Stopwatch timeoutStopwatch = Stopwatch.StartNew();
|
||||
|
||||
AutoFightSeek.RotationCount = 0;
|
||||
AutoFightTask.FightStatusFlag = true;
|
||||
|
||||
var fightEndFlag = false;
|
||||
var timeOutFlag = false;
|
||||
string lastFightName = "";
|
||||
|
||||
// 初始化条件求值器
|
||||
var evaluator = new ConditionEvaluator(combatScenes, () => CaptureToRectArea());
|
||||
|
||||
// 基于经验值的战后拾取检测
|
||||
ExperienceDetector? expDetector = null;
|
||||
if (_taskParam.KazuhaPickupEnabled && _taskParam.ExpBasedPickupEnabled)
|
||||
{
|
||||
var expRos = AutoFightAssets.Instance.ExperienceRecognitionObjects;
|
||||
expDetector = new ExperienceDetector(expRos, cts2.Token);
|
||||
expDetector.Start();
|
||||
}
|
||||
|
||||
// 战斗前动作
|
||||
await RunPreActions(combatScenes, evaluator);
|
||||
|
||||
// 战斗操作
|
||||
var fightTask = Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
JsonAction? lastExecutedAction = null;
|
||||
|
||||
while (!cts2.Token.IsCancellationRequested)
|
||||
{
|
||||
if (timeoutStopwatch.Elapsed > fightTimeout)
|
||||
{
|
||||
Logger.LogInformation("战斗超时结束");
|
||||
fightEndFlag = true;
|
||||
timeOutFlag = true;
|
||||
break;
|
||||
}
|
||||
|
||||
// 每次循环开始:截图一次,供所有条件求值复用
|
||||
using var capture = CaptureToRectArea();
|
||||
evaluator.SetCachedCapture(capture);
|
||||
|
||||
var anyExecuted = false;
|
||||
|
||||
foreach (var prioritizedAction in validActions)
|
||||
{
|
||||
if (cts2.Token.IsCancellationRequested) break;
|
||||
|
||||
var action = prioritizedAction.Action;
|
||||
|
||||
// 求值条件表达式(使用展开后的表达式和优先级)
|
||||
var conditionMet = evaluator.Evaluate(
|
||||
prioritizedAction.Expression,
|
||||
prioritizedAction.Priority,
|
||||
action.Character);
|
||||
|
||||
if (!conditionMet)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// 指定角色的动作:执行前确保切换到该角色
|
||||
if (!string.IsNullOrEmpty(action.Character))
|
||||
{
|
||||
var avatar = combatScenes.SelectAvatar(action.Character);
|
||||
if (avatar == null) continue;
|
||||
|
||||
avatar.Switch();
|
||||
CombatScriptParser.CurrentAvatarName = action.Character;
|
||||
}
|
||||
|
||||
// 执行动作
|
||||
await ExecuteAction(combatScenes, action);
|
||||
|
||||
// 确保E技能释放成功
|
||||
if (action.EnsureCast)
|
||||
{
|
||||
var characterName = string.IsNullOrEmpty(action.Character)
|
||||
? CombatScriptParser.CurrentAvatarName
|
||||
: action.Character;
|
||||
var avatar = combatScenes.SelectAvatar(characterName);
|
||||
if (avatar != null)
|
||||
{
|
||||
var imageAfterAction = CaptureToRectArea();
|
||||
var retry = 5;
|
||||
while (!(await AutoFightSkill.AvatarSkillAsync(Logger, avatar, false, 1, _ct, imageAfterAction)) && retry > 0)
|
||||
{
|
||||
Logger.LogWarning("{Name} 未检测到技能冷却,重新执行", action.Name);
|
||||
// 防止在纳塔飞天或爬墙
|
||||
Simulation.ReleaseAllKey();
|
||||
Simulation.SendInput.SimulateAction(GIActions.NormalAttack);
|
||||
Simulation.SendInput.SimulateAction(GIActions.Drop);
|
||||
await Delay(200, _ct);
|
||||
// 重新执行整个动作
|
||||
await ExecuteAction(combatScenes, action);
|
||||
imageAfterAction = CaptureToRectArea();
|
||||
await Task.Delay(30, _ct);
|
||||
retry--;
|
||||
}
|
||||
imageAfterAction.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
evaluator.UpdateLastExecTime(prioritizedAction.Priority);
|
||||
lastExecutedAction = action;
|
||||
anyExecuted = true;
|
||||
lastFightName = action.Character ?? "";
|
||||
|
||||
if (_fightEndFlag) break;
|
||||
|
||||
// 执行完第一个满足条件的动作后重新判断
|
||||
break;
|
||||
}
|
||||
|
||||
if (fightEndFlag || _fightEndFlag) break;
|
||||
|
||||
if (!anyExecuted)
|
||||
{
|
||||
await Delay(200, _ct);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.WriteLine(e.Message);
|
||||
Debug.WriteLine(e.StackTrace);
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
Simulation.ReleaseAllKey();
|
||||
AutoFightTask.FightStatusFlag = false;
|
||||
}
|
||||
}, cts2.Token);
|
||||
|
||||
await fightTask;
|
||||
|
||||
try
|
||||
{
|
||||
// 基于经验值检测结果的拾取判断
|
||||
if (_taskParam.KazuhaPickupEnabled && _taskParam.ExpBasedPickupEnabled && expDetector != null)
|
||||
{
|
||||
if (!expDetector.HasDetectedExperience)
|
||||
{
|
||||
Logger.LogInformation("基于经验值判断:等待经验值检测结果");
|
||||
var waitMs = 1100;
|
||||
while (!expDetector.HasDetectedExperience && waitMs > 0)
|
||||
{
|
||||
await Delay(100, _ct);
|
||||
waitMs -= 100;
|
||||
}
|
||||
}
|
||||
|
||||
var shouldPickup = expDetector.HasDetectedExperience;
|
||||
Logger.LogInformation("基于经验值判断:{Result} 战后拾取", shouldPickup ? "执行" : "不执行");
|
||||
|
||||
if (!shouldPickup)
|
||||
{
|
||||
if (_taskParam is { PickDropsAfterFightEnabled: true })
|
||||
{
|
||||
await new ScanPickTask().Start(_ct);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (expDetector != null)
|
||||
{
|
||||
await expDetector.StopAsync();
|
||||
expDetector.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
// 战后拾取(完全参照 AutoFightTask)
|
||||
await PostFightPickup(combatScenes, timeOutFlag, lastFightName);
|
||||
}
|
||||
|
||||
private bool _fightEndFlag;
|
||||
|
||||
/// <summary>执行单个 JSON 动作节点</summary>
|
||||
private async Task ExecuteAction(CombatScenes combatScenes, JsonAction action)
|
||||
{
|
||||
try
|
||||
{
|
||||
var character = string.IsNullOrEmpty(action.Character)
|
||||
? CombatScriptParser.CurrentAvatarName
|
||||
: action.Character;
|
||||
|
||||
var commands = CombatScriptParser.ParseLinePart(action.Action, character);
|
||||
|
||||
// 执行前输出日志
|
||||
LogActionOnce(action.Name);
|
||||
|
||||
CombatCommand? lastSubCmd = null;
|
||||
foreach (var cmd in commands)
|
||||
{
|
||||
if (_ct.IsCancellationRequested) break;
|
||||
|
||||
cmd.Execute(combatScenes, lastSubCmd);
|
||||
lastSubCmd = cmd;
|
||||
|
||||
// 仅由 check 指令触发战斗结束检测
|
||||
if (cmd.Method == Method.Check && _taskParam.FightFinishDetectEnabled)
|
||||
{
|
||||
_fightEndFlag = await CheckFightFinish(_finishDetectConfig.DelayTime, _finishDetectConfig.DetectDelayTime);
|
||||
if (_fightEndFlag)
|
||||
{
|
||||
Logger.LogInformation("{Name} 检测到战斗结束", action.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 更新当前角色名,供后续无指定角色动作使用
|
||||
CombatScriptParser.CurrentAvatarName = character;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.LogError("自动战斗:{Name} 执行失败:{Msg}", action.Name, e.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Simulation.ReleaseAllKey();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>战斗结束检测</summary>
|
||||
private async Task<bool> CheckFightFinish(int delayTime = 1500, int detectDelayTime = 450)
|
||||
{
|
||||
if (_finishDetectConfig.RotateFindEnemyEnabled)
|
||||
{
|
||||
bool? result = null;
|
||||
try
|
||||
{
|
||||
result = await AutoFightSeek.SeekAndFightAsync(Logger, detectDelayTime, delayTime, _ct);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError(ex, "SeekAndFightAsync 方法发生异常");
|
||||
result = false;
|
||||
}
|
||||
|
||||
AutoFightSeek.RotationCount = (result == null) ? AutoFightSeek.RotationCount + 1 : 0;
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
return result.Value;
|
||||
}
|
||||
}
|
||||
|
||||
if (!_finishDetectConfig.RotateFindEnemyEnabled) await Delay(delayTime, _ct);
|
||||
|
||||
Logger.LogInformation("打开编队界面检查战斗是否结束");
|
||||
Simulation.SendInput.SimulateAction(GIActions.OpenPartySetupScreen);
|
||||
await Delay(detectDelayTime, _ct);
|
||||
|
||||
using var ra = CaptureToRectArea();
|
||||
// 注意:像素坐标 (50, 790) 和 (50, 768) 是硬编码的,未做分辨率缩放
|
||||
// 与 TXT 版本逻辑保持一致,不进行缩放
|
||||
var b3 = ra.SrcMat.At<Vec3b>(50, 790); //进度条颜色
|
||||
var whiteTile = ra.SrcMat.At<Vec3b>(50, 768); //白块
|
||||
Simulation.SendInput.SimulateAction(GIActions.Drop);
|
||||
|
||||
if (IsWhite(whiteTile.Item2, whiteTile.Item1, whiteTile.Item0) &&
|
||||
IsYellow(b3.Item2, b3.Item1, b3.Item0))
|
||||
{
|
||||
Logger.LogInformation("识别到战斗结束");
|
||||
Simulation.SendInput.SimulateAction(GIActions.OpenPartySetupScreen);
|
||||
return true;
|
||||
}
|
||||
|
||||
Logger.LogInformation($"未识别到战斗结束: yellow{b3.Item0},{b3.Item1},{b3.Item2};white{whiteTile.Item0},{whiteTile.Item1},{whiteTile.Item2}");
|
||||
|
||||
if (_finishDetectConfig.RotateFindEnemyEnabled)
|
||||
{
|
||||
// 注意:此处使用 await 确保异常能被正确捕获
|
||||
// TXT 版本的 AutoFightTask.CheckFightFinish 中未使用 await,异常可能被吞掉
|
||||
Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var bloodLower = new Scalar(255, 90, 90);
|
||||
await MoveForwardTask.MoveForwardAsync(bloodLower, bloodLower, Logger, _ct);
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogWarning("MoveForwardAsync 异常:{Msg}", ex.Message);
|
||||
}
|
||||
}, _ct);
|
||||
}
|
||||
|
||||
_lastFightFlagTime = DateTime.Now;
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool IsYellow(int r, int g, int b)
|
||||
{
|
||||
return (r >= 200 && r <= 255) &&
|
||||
(g >= 200 && g <= 255) &&
|
||||
(b >= 0 && b <= 100);
|
||||
}
|
||||
|
||||
private bool IsWhite(int r, int g, int b)
|
||||
{
|
||||
return (r >= 240 && r <= 255) &&
|
||||
(g >= 240 && g <= 255) &&
|
||||
(b >= 240 && b <= 255);
|
||||
}
|
||||
|
||||
/// <summary>日志防刷:同一动作名在1秒内至多输出一次日志</summary>
|
||||
private void LogActionOnce(string actionName)
|
||||
{
|
||||
if (actionName == _lastLoggedActionName && (DateTime.Now - _lastLogTime).TotalSeconds < 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_lastLoggedActionName = actionName;
|
||||
_lastLogTime = DateTime.Now;
|
||||
Logger.LogInformation("自动战斗:{Name}", actionName);
|
||||
}
|
||||
|
||||
/// <summary>执行战斗前动作</summary>
|
||||
private async Task RunPreActions(CombatScenes combatScenes, ConditionEvaluator evaluator)
|
||||
{
|
||||
if (_strategy.Info.PreActions == null || _strategy.Info.PreActions.Count == 0)
|
||||
return;
|
||||
|
||||
Logger.LogInformation("JSON 策略:执行战斗前动作");
|
||||
using var capture = CaptureToRectArea();
|
||||
evaluator.SetCachedCapture(capture);
|
||||
|
||||
foreach (var preAction in _strategy.Info.PreActions)
|
||||
{
|
||||
if (_ct.IsCancellationRequested) break;
|
||||
|
||||
try
|
||||
{
|
||||
var firstSpaceIndex = preAction.IndexOf(' ');
|
||||
var character = CombatScriptParser.CurrentAvatarName;
|
||||
var commands = preAction;
|
||||
if (firstSpaceIndex > 0)
|
||||
{
|
||||
character = preAction[..firstSpaceIndex];
|
||||
commands = preAction[(firstSpaceIndex + 1)..];
|
||||
}
|
||||
|
||||
var cmdList = CombatScriptParser.ParseLineCommands(commands, character);
|
||||
foreach (var cmd in cmdList)
|
||||
{
|
||||
if (_ct.IsCancellationRequested) break;
|
||||
cmd.Execute(combatScenes);
|
||||
await Delay(300, _ct);
|
||||
}
|
||||
|
||||
Logger.LogInformation("战斗前动作:{Action}", preAction);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.LogWarning("战斗前动作执行失败:{Action},{Msg}", preAction, e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>战后拾取</summary>
|
||||
private async Task PostFightPickup(CombatScenes combatScenes, bool timeOutFlag, string lastFightName)
|
||||
{
|
||||
if (_taskParam.KazuhaPickupEnabled)
|
||||
{
|
||||
var picker = combatScenes.SelectAvatar("枫原万叶") ?? combatScenes.SelectAvatar("琴");
|
||||
|
||||
string? oldPartyName = null;
|
||||
if (RunnerContext.Instance.PartyName is not null)
|
||||
{
|
||||
oldPartyName = RunnerContext.Instance.PartyName;
|
||||
}
|
||||
else if (picker is null && !string.IsNullOrEmpty(_taskParam.KazuhaPartyName))
|
||||
{
|
||||
Logger.LogWarning("换队拾取:当前队伍名称为空,尝试读取!");
|
||||
await Delay(1000, _ct);
|
||||
await _returnMainUiTask.Start(_ct);
|
||||
|
||||
for (int attempt = 0; attempt < 6; attempt++)
|
||||
{
|
||||
Simulation.SendInput.SimulateAction(GIActions.OpenPartySetupScreen);
|
||||
var enterGameAppear = await NewRetry.WaitForElementAppear(
|
||||
ElementAssets.Instance.PartyBtnChooseView,
|
||||
() => { },
|
||||
_ct,
|
||||
15,
|
||||
500
|
||||
);
|
||||
if (attempt == 5 && !enterGameAppear)
|
||||
{
|
||||
Logger.LogWarning("换队拾取:读取队伍名称失败,跳过换队拾取步骤");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(_taskParam.KazuhaPartyName))
|
||||
{
|
||||
await Delay(1000, _ct);
|
||||
|
||||
var timeWaitStart = 0;
|
||||
while (timeWaitStart < 6000)
|
||||
{
|
||||
using var ra = CaptureToRectArea();
|
||||
var partyViewBtn = ra.Find(ElementAssets.Instance.PartyBtnChooseView);
|
||||
if (partyViewBtn.IsExist())
|
||||
{
|
||||
var rawPartyName = ra.Find(new RecognitionObject
|
||||
{
|
||||
RecognitionType = RecognitionTypes.Ocr,
|
||||
RegionOfInterest = new Rect(partyViewBtn.Right, partyViewBtn.Top, (int)(350 * _assetScale),
|
||||
partyViewBtn.Height)
|
||||
}).Text;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(rawPartyName))
|
||||
{
|
||||
oldPartyName = string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
var tempName = rawPartyName
|
||||
.Replace("\"", "")
|
||||
.Replace("\r\n", "")
|
||||
.Replace("\r", "");
|
||||
|
||||
int firstNewLineIndex = tempName.IndexOf('\n');
|
||||
if (firstNewLineIndex != -1)
|
||||
{
|
||||
tempName = tempName.Substring(0, firstNewLineIndex);
|
||||
}
|
||||
|
||||
oldPartyName = tempName.Trim();
|
||||
}
|
||||
|
||||
Logger.LogInformation("换队拾取:当前队伍名称读取为:{oldPartyName}", oldPartyName);
|
||||
Logger.LogDebug("OCR原始识别文本(含转义):{rawPartyName}", rawPartyName);
|
||||
RunnerContext.Instance.PartyName = oldPartyName;
|
||||
break;
|
||||
}
|
||||
await Delay(200, _ct);
|
||||
timeWaitStart += 200;
|
||||
}
|
||||
}
|
||||
|
||||
var switchPartyFlag = false;
|
||||
if (picker == null && !timeOutFlag && !string.IsNullOrEmpty(_taskParam.KazuhaPartyName) && oldPartyName != _taskParam.KazuhaPartyName)
|
||||
{
|
||||
try
|
||||
{
|
||||
Logger.LogInformation($"切换为拾取队伍:{_taskParam.KazuhaPartyName}");
|
||||
var success = await new SwitchPartyTask().Start(_taskParam.KazuhaPartyName, _ct);
|
||||
if (success)
|
||||
{
|
||||
Logger.LogInformation($"成功切换队伍为{_taskParam.KazuhaPartyName}");
|
||||
switchPartyFlag = true;
|
||||
RunnerContext.Instance.PartyName = _taskParam.KazuhaPartyName;
|
||||
RunnerContext.Instance.ClearCombatScenes();
|
||||
var cs = await RunnerContext.Instance.GetCombatScenes(_ct);
|
||||
picker = cs.SelectAvatar("枫原万叶") ?? cs.SelectAvatar("琴");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.LogWarning("切换队伍异常,跳过此步骤!{Msg}", e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
if (picker != null)
|
||||
{
|
||||
if (picker.Name == "枫原万叶")
|
||||
{
|
||||
var time = TimeSpan.FromSeconds(picker.GetSkillCdSeconds());
|
||||
|
||||
bool shouldSkip = lastFightName == picker.Name && time.TotalSeconds > 3;
|
||||
bool forcePickup = _taskParam.QinDoublePickUp;
|
||||
|
||||
if (forcePickup || !shouldSkip)
|
||||
{
|
||||
Logger.LogInformation("使用 枫原万叶-长E 拾取掉落物");
|
||||
await Delay(200, _ct);
|
||||
if (picker.TrySwitch(10))
|
||||
{
|
||||
await picker.WaitSkillCd(_ct);
|
||||
await SimulateHoldElementalSkillAsync(800, _ct);
|
||||
await SimulateMouseLeftClickLoopAsync(6, _ct);
|
||||
await Delay(1500, _ct);
|
||||
picker.AfterUseSkill();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.LogInformation("距最近一次万叶出招,时间过短,跳过此次万叶拾取!");
|
||||
}
|
||||
}
|
||||
else if (picker.Name == "琴")
|
||||
{
|
||||
Logger.LogInformation("使用 琴-长E 拾取掉落物");
|
||||
|
||||
var actionsToUse = PickUpCollectHandler.PickUpActions
|
||||
.Where(action => action.StartsWith("琴-长E" + " ", StringComparison.OrdinalIgnoreCase))
|
||||
.Select(action => action.Replace("琴-长E", "琴", StringComparison.OrdinalIgnoreCase))
|
||||
.ToArray();
|
||||
|
||||
var find = _taskParam.QinDoublePickUp;
|
||||
await Delay(150, _ct);
|
||||
if (picker.TrySwitch(10))
|
||||
{
|
||||
foreach (var miningActionStr in actionsToUse)
|
||||
{
|
||||
var pickUpAction = CombatScriptParser.ParseContext(miningActionStr);
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
await picker.WaitSkillCd(_ct);
|
||||
foreach (var command in pickUpAction.CombatCommands)
|
||||
{
|
||||
command.Execute(combatScenes);
|
||||
Task.Run(() =>
|
||||
{
|
||||
if (Monitor.TryEnter(PickLock))
|
||||
{
|
||||
try
|
||||
{
|
||||
if (find)
|
||||
{
|
||||
using (var imagePick = CaptureToRectArea())
|
||||
{
|
||||
if (imagePick.Find(AutoPickAssets.Instance.PickRo).IsExist())
|
||||
{
|
||||
find = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
Monitor.Exit(PickLock);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!find)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
Logger.LogInformation("自动拾取;尝试再次执行 琴-长E 拾取");
|
||||
picker.AfterUseSkill();
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Simulation.ReleaseAllKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (switchPartyFlag && !string.IsNullOrEmpty(oldPartyName))
|
||||
{
|
||||
try
|
||||
{
|
||||
Logger.LogInformation($"切换为原队伍:{oldPartyName}");
|
||||
var success = await new SwitchPartyTask().Start(oldPartyName, _ct);
|
||||
if (success)
|
||||
{
|
||||
Logger.LogInformation($"切换为原队伍{oldPartyName}");
|
||||
switchPartyFlag = true;
|
||||
RunnerContext.Instance.PartyName = oldPartyName;
|
||||
RunnerContext.Instance.ClearCombatScenes();
|
||||
await RunnerContext.Instance.GetCombatScenes(_ct);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.LogWarning("恢复原队伍失败,跳过此步骤!{Msg}", e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_taskParam is { PickDropsAfterFightEnabled: true })
|
||||
{
|
||||
await new ScanPickTask().Start(_ct);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查并记录屏幕分辨率
|
||||
/// </summary>
|
||||
private void LogScreenResolution()
|
||||
{
|
||||
AssertUtils.CheckGameResolution("自动战斗");
|
||||
}
|
||||
}
|
||||
@@ -117,6 +117,34 @@ public class AutoFightParam : BaseTaskParam<AutoFightTask>
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 解析策略文件路径,自动检测 .json 或 .txt 扩展名。
|
||||
/// 优先检测 .json,未命中则回退 .txt。
|
||||
/// </summary>
|
||||
/// <param name="strategyName">策略名称(不含扩展名)</param>
|
||||
/// <returns>(完整路径, 类型标识: "json" / "txt")</returns>
|
||||
public static (string path, string type) ResolveStrategyPath(string strategyName)
|
||||
{
|
||||
if ("根据队伍自动选择".Equals(strategyName))
|
||||
{
|
||||
var dir = Global.Absolute(@"User\AutoFight\");
|
||||
return (dir, "txt");
|
||||
}
|
||||
|
||||
var baseDir = Global.Absolute(@"User\AutoFight\");
|
||||
|
||||
// 优先检测 .json
|
||||
var jsonPath = System.IO.Path.Combine(baseDir, strategyName + ".json");
|
||||
if (System.IO.File.Exists(jsonPath))
|
||||
{
|
||||
return (jsonPath, "json");
|
||||
}
|
||||
|
||||
// 回退 .txt
|
||||
var txtPath = System.IO.Path.Combine(baseDir, strategyName + ".txt");
|
||||
return (txtPath, "txt");
|
||||
}
|
||||
|
||||
public void SetDefault()
|
||||
{
|
||||
var autoFightConfig = TaskContext.Instance().Config.AutoFightConfig;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using BetterGenshinImpact.Core.Simulator;
|
||||
using BetterGenshinImpact.Core.Simulator;
|
||||
using BetterGenshinImpact.Core.Simulator.Extensions;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Threading;
|
||||
@@ -711,7 +711,6 @@ namespace BetterGenshinImpact.GameTask.AutoFight
|
||||
|
||||
if (useMedicine.Count > 0)
|
||||
{
|
||||
Logger.LogInformation("元素爆发 {text} 的角色序号:{useMedicine}", "就绪", useMedicine);
|
||||
return Task.FromResult(useMedicine);
|
||||
}
|
||||
|
||||
|
||||
@@ -680,11 +680,21 @@ public class AutoFightTask : ISoloTask
|
||||
await Delay(200, ct);
|
||||
if (picker.TrySwitch(10))
|
||||
{
|
||||
// 等待元素战技 CD 就绪
|
||||
await picker.WaitSkillCd(ct);
|
||||
picker.UseSkill(true);
|
||||
await Delay(50, ct);
|
||||
Simulation.SendInput.SimulateAction(GIActions.NormalAttack);
|
||||
|
||||
// 调用统一的辅助方法,模拟万叶长按 E 的输入序列:
|
||||
// 包含释放鼠标左键前摇防卡键 -> E 键 KeyDown -> 延时 800ms -> E 键 KeyUp -> 延时 50ms
|
||||
await SimulateHoldElementalSkillAsync(800, ct);
|
||||
|
||||
// 调用统一的辅助方法,模拟 6 次鼠标左键连续点击:
|
||||
// 配合万叶长 E 的滞空特性执行下落攻击,内部包含 try/finally 以保证取消任务时安全释放左键
|
||||
await SimulateMouseLeftClickLoopAsync(6, ct);
|
||||
|
||||
// 等待下落攻击和聚怪拾取动作彻底结束
|
||||
await Delay(1500, ct);
|
||||
// 截图并更新技能最新冷却时间
|
||||
picker.AfterUseSkill();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BetterGenshinImpact.GameTask.AutoFight.Factory;
|
||||
|
||||
/// <summary>
|
||||
/// 战斗策略工厂提供者
|
||||
/// 根据策略文件扩展名自动选择合适的工厂
|
||||
/// </summary>
|
||||
public static class CombatTaskFactoryProvider
|
||||
{
|
||||
private static readonly List<ICombatTaskFactory> _factories = [];
|
||||
|
||||
static CombatTaskFactoryProvider()
|
||||
{
|
||||
// 注册顺序:json 优先,txt 兜底
|
||||
RegisterFactory(new JsonCombatTaskFactory());
|
||||
RegisterFactory(new TxtCombatTaskFactory());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 注册战斗任务工厂
|
||||
/// </summary>
|
||||
/// <param name="factory">战斗任务工厂实例</param>
|
||||
public static void RegisterFactory(ICombatTaskFactory factory)
|
||||
{
|
||||
_factories.Add(factory);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据策略文件路径获取对应的工厂
|
||||
/// </summary>
|
||||
/// <param name="strategyPath">策略文件路径</param>
|
||||
/// <returns>匹配的战斗任务工厂</returns>
|
||||
/// <exception cref="InvalidOperationException">不支持的文件类型</exception>
|
||||
public static ICombatTaskFactory GetFactory(string strategyPath)
|
||||
{
|
||||
strategyPath ??= string.Empty;
|
||||
var factory = _factories.FirstOrDefault(f => f.CanHandle(strategyPath));
|
||||
if (factory == null)
|
||||
{
|
||||
throw new System.InvalidOperationException($"不支持的战斗策略文件类型:{strategyPath}");
|
||||
}
|
||||
return factory;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace BetterGenshinImpact.GameTask.AutoFight.Factory;
|
||||
|
||||
/// <summary>
|
||||
/// 战斗策略工厂接口
|
||||
/// </summary>
|
||||
public interface ICombatTaskFactory
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据策略文件路径创建对应的战斗 Task
|
||||
/// </summary>
|
||||
ISoloTask CreateTask(AutoFightParam param);
|
||||
|
||||
/// <summary>
|
||||
/// 判断本工厂是否可以处理指定路径的策略文件
|
||||
/// </summary>
|
||||
bool CanHandle(string strategyPath);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System.IO;
|
||||
|
||||
namespace BetterGenshinImpact.GameTask.AutoFight.Factory;
|
||||
|
||||
/// <summary>
|
||||
/// .json 战斗策略工厂 — 创建 AutoFightJsonTask
|
||||
/// </summary>
|
||||
public class JsonCombatTaskFactory : ICombatTaskFactory
|
||||
{
|
||||
public ISoloTask CreateTask(AutoFightParam param)
|
||||
{
|
||||
return new AutoFightJsonTask(param);
|
||||
}
|
||||
|
||||
public bool CanHandle(string strategyPath)
|
||||
{
|
||||
return strategyPath.EndsWith(".json", System.StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
Loaded 100 of 191 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user