Compare commits

...
Author SHA1 Message Date
辉鸭蛋 00f680f4ec 修改屏幕缩放问题 2026-05-03 13:01:40 +08:00
huiyadanli 36c2e25792 Update version to 0.60.2-alpha.3 2026-05-02 14:27:07 +00:00
zhousenyu 6b9ac1b5d0 fix: 任务启动阶段无法通过快捷键正常终止,启动阶段强制关闭游戏时启动按钮无法复位 (#3036) 2026-05-02 19:24:51 +08:00
躁动的氨气and辉鸭蛋 6071b4096f fix: 修复某些js回调在突然终止后弹出的v8报错 (#3072)
Co-authored-by: 辉鸭蛋 <[email protected]>
2026-05-02 19:20:47 +08:00
kaedelcb dc1c25ee00 优化添加一条龙任务添加的弹窗UI (#3068) 2026-05-02 18:57:06 +08:00
KangkangTaoand辉鸭蛋 8ca6830c4b fix: 跳过空月祝福使用硬件输入模拟代替窗口消息避免云原神中不生效 (#3080)
* fix: 跳过空月祝福使用硬件输入模拟代替窗口消息避免云原神中不生效

* 加入停顿

---------

Co-authored-by: 辉鸭蛋 <[email protected]>
2026-05-02 18:54:17 +08:00
辉鸭蛋 e5aa33c577 原神HDR自动关闭 2026-05-02 18:23:13 +08:00
辉鸭蛋 a76767499d feat: 更新.gitignore,添加项目规则文档和技能说明 2026-05-02 17:27:56 +08:00
云端客and辉鸭蛋 3470c5e30b feat(genshin): 添加通过OCR识别当前角色UID的功能 (#2988)
Co-authored-by: 辉鸭蛋 <[email protected]>
2026-05-02 16:11:03 +08:00
躁动的氨气 10ee93e8bb feat: 为js提供html遮罩 (#2975) 2026-05-02 15:55:34 +08:00
躁动的氨气 255bf653e8 feat: 地图编辑器使用全局战斗策略,避免导出带BOM (#3092) 2026-05-01 18:49:56 +08:00
ddaodan 4a17383f86 修复自动地脉花战后切队与结束检测问题 (#3088) 2026-04-30 10:29:09 +08:00
躁动的氨气 edc5580267 feat: 扩展地图编辑器功能,支持直接运行 (#3090) 2026-04-30 10:15:50 +08:00
辉鸭蛋 dfef6ddf30 优化 后台对话结束,已自动切回游戏前台 的时机 2026-04-29 01:39:06 +08:00
辉鸭蛋 0cc48ce6d8 Disable similarityComment feature
Disable similarity comments in repo-bot configuration.
2026-04-29 00:03:50 +08:00
躁动的氨气 6be85a03af feat: 提高莉奈娅挖矿容错,删除js处的调用接口 (#3073) 2026-04-28 22:57:05 +08:00
火山andcoderabbitai[bot] e78d54ba2a 修改调度器配置设置的默认值,提供新建配置组的部分预设参数 (#3077)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-04-27 19:46:14 +08:00
ddaodan 1fd45c42b1 提醒快捷键与游戏键位冲突 (#3083) 2026-04-27 19:40:38 +08:00
Bread Grocery e06b105365 fix(js): 修复模块被导入时副作用代码被重复执行 (#3070) 2026-04-24 10:32:14 +08:00
huiyadanli 83637172fd Update version to 0.60.2-alpha.2 2026-04-21 11:50:40 +00:00
躁动的氨气 b0a1bb019c fix: 莉奈娅挖矿引用问题 (#3063) 2026-04-20 21:26:21 +08:00
kaedelcb 304147f965 修复游泳检测问题 (#3055) 2026-04-20 13:52:11 +08:00
躁动的氨气 99a17010d2 feat: 使用yolo进行莉奈娅挖矿 (#3058) 2026-04-20 13:49:53 +08:00
ddaodan fb527a13c4 自动地脉花补充战斗中寻敌配置 (#3059) 2026-04-20 13:49:43 +08:00
辉鸭蛋 2ea663b0ff #3054 越界逻辑错误修复 2026-04-16 23:57:57 +08:00
huiyadanli bbf1be3de9 Update version to 0.60.2-alpha.1 2026-04-16 15:40:56 +00:00
kaedelcb 3586e37c69 战斗过程卡切换角色优化 (#3054) 2026-04-16 23:37:52 +08:00
辉鸭蛋 4896d0344a fix(AutoEat): 将复活按键改为跟随快捷使用小道具键位 #2930
复活逻辑不再硬编码为Z键,改为使用`GIActions.QuickUseGadget`模拟输入,使其与游戏内的“快捷使用小道具”键位配置保持一致。
2026-04-16 00:55:28 +08:00
辉鸭蛋 c1d0a53110 OCR不再限制算子 2026-04-16 00:30:21 +08:00
辉鸭蛋 0eedfb6969 实时任务中对遮罩的操作异步化 2026-04-16 00:29:56 +08:00
LXYan2333 d0c02717e8 胡桃 10aaz 宏 (#3049) 2026-04-15 23:34:37 +08:00
kaedelcb 2a53fb9742 新增基于怪物死亡经验判断是否执行聚集材料 (#3051) 2026-04-15 23:34:07 +08:00
ShadowLemoon bd8451a190 perf: 增强幽境任务鲁棒性 (#3050) 2026-04-15 23:33:28 +08:00
辉鸭蛋 ee500b2971 Update OpenAI model version in repo-bot.yml 2026-04-15 11:20:56 +08:00
Yushao Chen (Jerry)andJerryChen97 b0a1715ba3 fix: 移除 TrySwitch 中遗留的调试用 SaveImage 调用 (#3032)
Co-authored-by: JerryChen97 <[email protected]>
2026-04-12 21:57:00 +08:00
ddaodan 33760242ea feat: 地脉花新增"蒙德8-风车镇"路径 (#3029) 2026-04-12 21:56:30 +08:00
Yushao Chen (Jerry)andJerryChen97 7d91fba327 fix: FindActiveIndexRectByColor 方法3 返回 0-based 索引修正为 1-based (#3035)
Co-authored-by: JerryChen97 <[email protected]>
2026-04-12 21:54:16 +08:00
Jamis 8956c306c2 增加支持新地图空之神殿 (#3041) 2026-04-12 21:52:53 +08:00
ddaodan a7dac95468 优化 GitHub Issue 模板 (#3030) 2026-04-11 18:47:25 +08:00
huiyadanli dea40ce177 Update version to 0.60.1 2026-04-09 16:18:49 +00:00
辉鸭蛋 410c3f2a92 处理 Paddle OCR 逻辑可能造成的 JSON 序列化问题 2026-04-10 00:03:19 +08:00
ema 30d11bed4c 替换修复秘境选择控件 (#3019) 2026-04-09 23:21:35 +08:00
郝凯阳 cfebcd0b8d auto tcg: update character card config to v6.5 (#3016) 2026-04-09 18:08:57 +08:00
Jamis 43f2263cfa 增加空之神殿TP点位信息 (#3015) 2026-04-09 18:08:45 +08:00
huiyadanli f9dd661c05 Update version to 0.60.0 2026-04-08 13:41:19 +00:00
躁动的氨气 24128ee64b feat: 莉奈娅挖矿动作 (#2997)
* feat: 莉奈娅挖矿动作

* Add mining action for character 莉奈娅

* Update MiningHandler.cs

* Update MiningHandler.cs

* Update MiningHandler.cs
2026-04-08 19:57:12 +08:00
辉鸭蛋 c8d10614c5 翻译排除了一些动态文本的场景 2026-04-06 16:02:56 +08:00
Jamis 5c7e8e8f11 更新6.5.0传送锚点信息 (#3004) 2026-04-06 15:17:35 +08:00
ddaodan 907fe5b3c2 优化通知事件选择界面 (#3001) 2026-04-06 13:08:28 +08:00
ddaodan 4c81109f0d feat: 聊天界面打开时屏蔽热键 (#3000) 2026-04-06 01:42:03 +08:00
辉鸭蛋 11102a4be2 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2026-04-05 20:57:45 +08:00
辉鸭蛋 c1c578d256 fix: 优化适龄提示窗口检测逻辑避免频繁点击 #2992
- 使用OCR识别适龄提示文字,避免仅依赖按钮检测导致的误点击
- 添加1秒检测间隔防止频繁触发OCR识别
- 记录最近识别的文字区域用于后续判断
2026-04-05 20:57:43 +08:00
huiyadanli 1690a727fc Update version to 0.59.2-alpha.3 2026-04-05 12:38:22 +00:00
辉鸭蛋 ee928a6847 优化config.json读取或者写入失败时候的异常处理。读取失败会备份原来的config文件并报错 2026-04-05 20:36:26 +08:00
辉鸭蛋 4ad7db06ae fix(ui): 处理桌面组合禁用时的主题应用异常 #2678
当系统桌面组合功能被禁用时,应用 Mica/Acrylic 主题会抛出 COM 异常(HRESULT: 0x80263001)。现通过异常捕获机制,在检测到此特定错误时回退到纯色背景方案,确保程序在受限环境下仍能正常运行。

- 在 ApplyThemeToWindow 方法中添加异常处理逻辑
- 引入 ApplyFallbackTheme 方法应用纯色后备主题
- 根据主题类型提供对应的后备背景色
2026-04-05 20:21:54 +08:00
ToXz 8a6194f374 feat : Hoyolab map provider with 3 language selector (#2987) 2026-04-05 19:45:57 +08:00
ddaodan b1f1fe913a fix: 修复纪行可选奖励导致流程卡住并补充日志提醒 (#2995) 2026-04-05 01:36:02 +08:00
DarkFlameMaster c8be442943 docs: 给文档链接增加 www 前缀 (#2996) 2026-04-05 01:35:15 +08:00
huiyadanli 3d394475e1 Update version to 0.59.2-alpha.2 2026-04-04 12:26:10 +00:00
辉鸭蛋 da068549fe chore: update MimeKit package version to 4.15.1 2026-04-04 20:23:34 +08:00
辉鸭蛋 ca249206ae 更新依赖包版本与元数据 2026-04-04 20:21:54 +08:00
ddaodan f80814952b feat: 自动地脉花更新挪德卡莱3-月矩力试验设计局的路径 (#2991) 2026-04-03 17:31:05 +08:00
辉鸭蛋 38f41ac573 Merge remote-tracking branch 'origin/main' 2026-04-02 00:36:37 +08:00
辉鸭蛋 399b9d4adb 并发生成SIFT 2026-04-02 00:36:31 +08:00
秋云 091bbb2865 fix: 捕获OpenCV抛出的异常 (#2985) 2026-04-01 10:56:11 +08:00
ddaodan ec7b00e35e fix: 修复自动地脉花领奖流误判和队伍切换回退 (#2981) 2026-03-31 11:01:02 +08:00
ShadowLemoon c5f7a68e79 feat: 通知设置添加超链接查看事件id (#2976) 2026-03-29 21:45:36 +08:00
辉鸭蛋 e0c56a74ea 修改新版自动秘境奖励领取的通知时机,截图能够截到奖励内容 2026-03-29 01:15:15 +08:00
huiyadanli 3f1dc374eb Update version to 0.59.2-alpha.1 2026-03-28 16:33:40 +00:00
辉鸭蛋 eaa412d8c9 Merge remote-tracking branch 'origin/main' 2026-03-29 00:31:29 +08:00
辉鸭蛋 03a4102fe7 Revert "文本识别的模糊匹配功能 (#2799)"
This reverts commit e9d11f7267.
2026-03-29 00:31:13 +08:00
辉鸭蛋 70c5a84bed Revert "尝试修复JSON序列化问题,本质问题是OCR模块,用纯托管 argmax 替代该路径。"
This reverts commit e958e24d4e.
2026-03-29 00:30:41 +08:00
ddaodan 147f466fb9 fix: 修复自动地脉花追踪按钮识别与奖励页树脂点击异常 (#2971) 2026-03-28 20:58:23 +08:00
huiyadanli 4cbdaa6ff8 Update version to 0.59.1 2026-03-26 18:48:16 +00:00
辉鸭蛋 8300d9dd7c 自动烹饪支持自动识别已经满熟练度 #2958 2026-03-27 02:46:03 +08:00
辉鸭蛋 5b2701a68f Merge remote-tracking branch 'origin/main' 2026-03-26 22:13:09 +08:00
辉鸭蛋 3d84638c55 Revert "加入点击 #1599"
This reverts commit 0d8de96e17.
2026-03-26 22:08:45 +08:00
ddaodan 7f6c3c408b fix: avoid party reswitch during auto ley line pathing (#2955) 2026-03-26 19:30:46 +08:00
提瓦特钓鱼玳师 fc7993afda 添加JS脚本文件夹下文件重命名功能 (#2960) 2026-03-26 13:40:33 +08:00
辉鸭蛋 040a5e8417 Merge remote-tracking branch 'origin/main' 2026-03-24 23:34:38 +08:00
辉鸭蛋 1c33bb9282 领取地脉花奖励后扫描周围掉落物光柱,默认关闭 2026-03-24 23:34:30 +08:00
huiyadanli f923a8a4d2 Update version to 0.59.0 2026-03-24 15:27:39 +00:00
辉鸭蛋 f658bf85ee Merge remote-tracking branch 'origin/main' 2026-03-23 02:48:46 +08:00
辉鸭蛋 0d8de96e17 加入点击 #1599 2026-03-23 02:48:40 +08:00
huiyadanli e9413f4214 Update version to 0.58.4-alpha.1 2026-03-22 18:41:24 +00:00
辉鸭蛋 aef3fa913b 自动烹饪修改成独立任务 (#2949) 2026-03-23 02:31:14 +08:00
躁动的氨气 d55b1d867b feat: 开门时适龄提示自动关闭 (#2948) 2026-03-23 02:04:54 +08:00
辉鸭蛋 311c8b2f37 Merge remote-tracking branch 'origin/main' 2026-03-22 15:53:21 +08:00
辉鸭蛋 1a478affb2 后台对话完之后自动将原神切到前台 #2350 2026-03-22 15:53:10 +08:00
辉鸭蛋 da6d956ef1 Comment out '需要更多信息' section
Comment out the '需要更多信息' section in the YAML configuration.
2026-03-22 15:26:56 +08:00
辉鸭蛋 955d7d51d9 Disable AI classification in repo-bot configuration 2026-03-22 15:20:45 +08:00
huiyadanli b4053e9357 Update version to 0.58.3-alpha.4 2026-03-22 06:53:31 +00:00
辉鸭蛋 a0d8133558 删除多余的启动游戏逻辑 #2943 #2942 2026-03-22 14:14:49 +08:00
辉鸭蛋 99f4f54ff7 文案调整 2026-03-22 02:51:56 +08:00
辉鸭蛋 c8a8d6217a 检测到游戏内小地图锁定配置 #1371 2026-03-22 02:48:02 +08:00
辉鸭蛋 cd978327fc fix: 修复最小化时候截图失败导致截图器没法正常截图,导致主界面卡顿的问题 #2939 #2851 2026-03-22 02:13:55 +08:00
辉鸭蛋 b0b13cb36d 删除 Starward 协议注册 相关日志 2026-03-22 01:52:54 +08:00
辉鸭蛋 beb36ff41a fix: 修复地图遮罩关闭时UI状态未正确重置的问题 #2940
当关闭地图遮罩功能时,确保所有挂起的计算任务被清理,并重置UI状态到初始值。同时修复了在配置禁用时UI状态未同步更新的问题。
2026-03-22 01:50:44 +08:00
Tristan 713589734b feat: 自动地脉花支持领奖后扫描掉落物 (#2928) 2026-03-21 16:37:29 +08:00
辉鸭蛋 eedce17a9c chore: update BetterGI.Assets.Other package version to 1.0.15 2026-03-21 12:55:54 +08:00
辉鸭蛋 4572b94122 Merge remote-tracking branch 'origin/main' 2026-03-21 12:31:49 +08:00
辉鸭蛋 5831e3671c 加大对话区判定次数 #2936 2026-03-21 12:31:41 +08:00
ddaodan e46076eaaa chore: 自动忽略历史 Issue (#2931) 2026-03-19 00:16:12 +08:00
辉鸭蛋 c553a49f18 Update repo-bot.yml 2026-03-18 00:29:16 +08:00
秋云 53810d34b8 fix: 优化TpTask惯性导航(误识别),处理初始未识别 (#2920) 2026-03-17 20:12:48 +08:00
ddaodan 875434b492 chore: 接入 Repo Bot Issue 助手 (#2916) 2026-03-17 18:57:37 +08:00
huiyadanli 565510ebe6 Update version to 0.58.3-alpha.3 2026-03-16 18:27:45 +00:00
辉鸭蛋 eec4518605 切换角色问题测试用代码 2026-03-17 02:25:31 +08:00
辉鸭蛋 201cbf1629 关闭开书 #2686 2026-03-17 02:10:06 +08:00
辉鸭蛋 33013fd7a5 OCR修改默认强制推理配置 2026-03-17 01:28:14 +08:00
辉鸭蛋 f9b707b1ac Merge remote-tracking branch 'origin/main' 2026-03-16 21:47:38 +08:00
辉鸭蛋 68ebf2eb4b 修复 E_ACCESSDENIED (0x80070005) 报错。
这是一种导致 he BetterGenshinImpact.View.Pages.HomePage page does not have a parameterless constructor. If you are using Wpf.Ui.Abstractions.INavigationViewPageProvider do not navigate initially and don't use Cache or Precache. 错误的场景
2026-03-16 21:47:25 +08:00
huiyadanli 2c28cc2335 Update version to 0.58.3-alpha.2 2026-03-15 02:47:28 +00:00
辉鸭蛋 47a4983c16 Merge remote-tracking branch 'origin/main' 2026-03-15 10:43:32 +08:00
辉鸭蛋 c5a9427ca7 最后匹配自定义游戏进程名 #2909 2026-03-15 10:43:25 +08:00
huiyadanli 12e6296059 Update version to 0.58.3-alpha.1 2026-03-14 08:22:23 +00:00
辉鸭蛋 cf344b2d39 修复User目录清空后,无法自动创建目录的问题 2026-03-14 16:15:56 +08:00
辉鸭蛋 e958e24d4e 尝试修复JSON序列化问题,本质问题是OCR模块,用纯托管 argmax 替代该路径。 2026-03-14 16:12:11 +08:00
辉鸭蛋 26416b00b5 Merge remote-tracking branch 'origin/main' 2026-03-14 15:56:15 +08:00
mno 54301e1e02 修改check触发检查的时机 (#2904) 2026-03-12 10:01:55 +08:00
Shadow-LemonandShadowLemoon 1e9b72e547 fix: 修复同时存在多个脚本仓库文件夹时迁移优先级出错 (#2906)
Co-authored-by: ShadowLemoon <[email protected]>
2026-03-12 00:08:26 +08:00
辉鸭蛋 d660f79b4c 修改自动战斗ready指令的表现 2026-03-11 23:06:06 +08:00
huiyadanli 48bbad9853 Update version to 0.58.1-alpha.1 2026-03-11 05:35:14 +00:00
Shadow-LemonandShadowLemoon 5dcbd9b577 fix: 修复命令行启动时自动更新阻塞导致 StartGameTask 跳过等待主界面的问题 (#2902)
Co-authored-by: ShadowLemoon <[email protected]>
2026-03-11 09:56:01 +08:00
MistEO bb1f6d7281 ci: check owner for mirrorc (#2901) 2026-03-11 09:53:44 +08:00
FishmanTheMurloc d4ef75344e 选择鱼饵增加等待时间,以降低鱼饵尚未出现时执行动作的频率 (#2900) 2026-03-10 20:41:38 +08:00
huiyadanli f614695a3a Update version to 0.58.0 2026-03-09 16:55:41 +00:00
辉鸭蛋 77306168f9 chore: 更新 BetterGI.Assets.Other 依赖至版本 1.0.13 2026-03-09 23:47:09 +08:00
辉鸭蛋 dee418cbe5 Merge remote-tracking branch 'origin/main' 2026-03-09 23:43:28 +08:00
辉鸭蛋 226785e8a4 Yap 的推理对象改为懒加载。index_2_word.json 修改成 Newtonsoft.Json 反序列化 #2890 2026-03-09 23:43:20 +08:00
DarkFlameMaster 5a5b77266e feat(JS): 支持调用 C#中含out/ref参数的方法 (#2884)
* feat(JS): 支持调用 C#中含out/ref参数的方法

* 新增NewVarOfArr方法用于支持交错数组

* 多删了一行
2026-03-09 23:42:44 +08:00
辉鸭蛋 864efb42a3 fix bug 2026-03-09 03:07:21 +08:00
辉鸭蛋 32582e39a9 Merge remote-tracking branch 'origin/main' 2026-03-08 21:30:47 +08:00
辉鸭蛋 6bcb63e996 修复宝箱图标刚好被遮住的场景 #2889 2026-03-08 21:30:38 +08:00
云端客 65b5032e6e [开放JS 调用 API]自动幽境危战 (#2882) 2026-03-08 21:13:18 +08:00
DarkFlameMaster b9e1c37b67 删除一条龙配置的弹窗主题与主窗口保持一致 (#2887) 2026-03-08 18:01:11 +08:00
guamian a5829ed6bb 尝试修复游泳检测炸内存 (#2883) 2026-03-06 23:06:40 +08:00
DarkFlameMaster 8b7d2353e5 feat(js):地图追踪增加读取目录下的内容等方法 (#2875)
* feat(js):地图追踪增加读取目录下的内容等方法

* refactor(AutoPathingScript): 重构文件操作方法到LimitedFile类

* fix

* docs(AutoPathingScript): 修正方法参数注释中的默认值描述

* 避免重复初始化实例,给恢复游戏窗口焦点的日志也加上当前窗口名
2026-03-05 01:13:52 +08:00
ShadowLemoon c3b8c9e78f 移除幽境危战调试日志 (#2881) 2026-03-05 01:12:44 +08:00
mno b49910873e 添加check动作 (#2864) 2026-03-01 22:10:33 +08:00
Jamis ea6a9a4af2 More granular control over pre-teleport delay (#2866) 2026-03-01 22:10:14 +08:00
辉鸭蛋 a51213dceb Merge remote-tracking branch 'origin/main' 2026-03-01 01:59:59 +08:00
辉鸭蛋 e3c451cd92 不再翻译日志 2026-03-01 01:59:52 +08:00
DarkFlameMaster e69283c3f2 更新蒙德凯瑟琳地图追踪文件 (#2861) 2026-02-28 23:59:29 +08:00
ddaodan 23de87d1a6 feat: 为自动地脉花配置新增万叶与琴的拾取选项 (#2862) 2026-02-28 23:59:04 +08:00
huiyadanli dad2e8ef7d Update version to 0.57.2-alpha.1 2026-02-27 17:14:21 +00:00
辉鸭蛋 7e944e18fb 法尔伽信息补充 2026-02-28 01:04:47 +08:00
辉鸭蛋 f1154e6ef7 地图遮罩改为异步任务,不影响自动拾取 2026-02-28 00:36:10 +08:00
DarkFlameMaster b2d5988d24 fix:适配秘境限时全开的UI改动 (#2854) 2026-02-26 21:38:36 +08:00
郝凯阳 c2b68cfee9 auto tcg: update character card config to v6.4 (#2849) 2026-02-26 18:32:33 +08:00
HSHMENG 6668a89fa7 七圣召唤配置文件中可以设置骰子数量增减 (#2832) 2026-02-26 10:15:53 +08:00
ddaodan 01f1beba0b feat: 自动地脉花独立战斗配置与OCR遮罩 (#2829) 2026-02-26 10:13:38 +08:00
Guest Liang 9e3c8920ba 修复七圣召唤月之五伊涅芙会导致手牌不可调和的死循环 (#2848) 2026-02-26 10:08:44 +08:00
辉鸭蛋 ce31169f66 fix: 修复小地图遮罩在主界面外的显示逻辑 2026-02-26 00:44:26 +08:00
辉鸭蛋 53854e6d28 refactor: 简化进程去重逻辑,直接使用 GroupBy 和 Select
使用 GroupBy 和 Select 直接获取唯一的进程对象,避免创建中间字典和手动释放重复的 Process 对象,使代码更简洁。
2026-02-24 19:29:09 +08:00
huiyadanli 01c506fa13 Update version to 0.57.1-alpha.3 2026-02-24 07:36:36 +00:00
辉鸭蛋 95e0f01753 新增小地图遮罩,在小地图上展示资源点位 (#2830) 2026-02-24 15:34:50 +08:00
DarkFlameMaster 4aaca366f0 feat: JS级联选择 和 秘境选择 滚轮事件禁止穿透至其他窗口 (#2828) 2026-02-24 15:21:20 +08:00
云端客and辉鸭蛋 cac0dfc754 开放自动地脉花 JS调用 (#2789)
Co-authored-by: 辉鸭蛋 <[email protected]>
2026-02-24 11:12:16 +08:00
huiyadanli 847bc8970e Update version to 0.57.1-alpha.2 2026-02-23 16:03:39 +00:00
this-Fish d4d99d34bc feat: 为快速尘歌壶任务增加离开功能,支持进出双向操作 (#2822) 2026-02-23 19:02:45 +08:00
辉鸭蛋 f86abe3ceb 支持任意文件名的启动 (#2819) 2026-02-23 13:18:18 +08:00
躁动的氨气 b1c6e9e4e3 Revert "feat: 自动拾取文本识别帧间连续性检查 (#2676)" (#2817) 2026-02-22 19:38:10 +08:00
DarkFlameMaster d632bdd9fc fix:自动拾取黑名单配置文本框复制剪切时UI短暂无响应 (#2818) 2026-02-22 19:37:47 +08:00
辉鸭蛋 fe61549c95 彻底删除 实验功能 遮罩以原神子窗体方式启动 UseSubform 2026-02-22 18:17:38 +08:00
辉鸭蛋 6832d0f8d8 revert revert #2809 with #2763 , 减轻死锁问题的表现 2026-02-22 18:03:52 +08:00
辉鸭蛋 a872dde7c8 自动拾取排除:「月谕圣牌」收藏 2026-02-22 18:02:26 +08:00
ShadowLemoon 12423edd6e fix: 修复迁移订阅触发时机 (#2811) 2026-02-21 11:46:24 +08:00
huiyadanli 9fe0209122 Update version to 0.57.1-alpha.1 2026-02-20 16:08:23 +00:00
辉鸭蛋 6e49368f0a 修复 #2804,树脂不足时候未终止自动秘境 2026-02-20 23:56:29 +08:00
辉鸭蛋 f80939dad4 去除所有 Cv2.ImRead ,解决中文路径问题 2026-02-20 22:28:45 +08:00
ShadowLemoon f7976b0bbd feat: 根据文件夹名字和内容重合度区分仓库;启动时自动更新仓库和订阅 (#2767)
* feat: 实现启动时自动更新已订阅脚本及多仓库分离存储

- ScriptConfig: 新增 AutoUpdateSubscribedScripts 配置项
- ScriptRepoUpdater: 动态 CenterRepoPath, 按仓库URL分离存储
  - 内容重合度检测(Jaccard系数)判断仓库异同
  - URL→文件夹名持久化映射(repo_folder_mapping.json)
  - repo_updated.json 存放于各自仓库文件夹内
  - AutoUpdateSubscribedScripts 启动时自动更新订阅脚本
  - 静默同步仓库、渠道URL解析、检出更新脚本
- RepoWebBridge: 使用动态路径, 辅助方法改为 internal
- MainWindowViewModel: 启动时调用自动更新

* feat: 基于内容重合度的导入zip仓库

* perf: 合并默认仓库url映射

* perf: 清理兼容字段

* perf: 添加线程锁以避免并发调用

* fix: 缓存FolderMapping、修复重合度异常返回值、目录扫描异常隔离、移除未使用变量

* perf: 优化更新流程

* perf: 内存缓存添加锁

* fix: 修复更新状态逻辑,确保克隆失败时不标记为已更新

* perf: 文件夹映射先写磁盘再写缓存

* refactor: 简化生成唯一文件夹名称的方法,移除不必要的参数

* fix: ResetRepo加写锁并清理URL映射条目

* perf: 优化重合度算法

* docs: 更新注释

* fix: 仅重置实际更新成功的脚本的 hasUpdate 标记

* feat: 手动一键更新按钮

* feat: 订阅路径迁移至独立文件存储并简化更新逻辑

- 订阅数据从 config.json 迁移到 User/subscriptions/{repo}.json 独立文件
- 添加 ReaderWriterLockSlim 保护订阅文件并发读写
- 使用 System.Text.Json + ConfigService.JsonOptions 序列化
- 新增 RepoWebBridge.GetSubscribedScriptPaths() 桥接方法
- 启动时自动从旧 config.json 迁移订阅数据到独立文件
- 合并手动/自动更新为 UpdateAllSubscribedScriptsCore 共用核心
- 移除 hasUpdate 检查,直接全量更新所有订阅脚本
- 移除冗余 logPrefix 参数

* refactor: 简化启动时自动更新调用

- 移除 Task.Run + try-catch 包装,异常处理已内置于方法中
- 直接使用 fire-and-forget 异步调用

* fix: 订阅目录命名改为 PascalCase (Subscriptions)

* refactor: 移除死代码和冗余中间层方法

* fix: ReadSubscriptionFile 异常时记录日志避免订阅数据静默丢失

* fix: 进度条改为Indeterminate模式、异常日志补全、订阅去重、迁移批量写入、锁注释

* refactor: 提取 ReadFolderMappingFromDisk 消除映射方法嵌套 try

* fix: 补全静态方法异常日志、WriteSubscriptionFile异常保护、ManualUpdate注释

* fix: ManualUpdateSubscribedScripts 加 try-catch 兜底并提示用户重置仓库

* fix: Dialog打开时检测后台自动更新状态,自动禁用按钮并显示进度提示

- ScriptRepoUpdater 新增 IsAutoUpdating 标志和 AutoUpdateStateChanged 事件
- ScriptRepoWindow 订阅事件,自动更新期间显示进度条、禁用所有操作按钮并 Toast 提示
- 更新仓库/重置仓库按钮也加上 IsEnabled 绑定 IsUpdating

* fix: 将自动更新调用包裹在 Task.Run 中避免 UI 线程阻塞

AutoUpdateSubscribedScripts 的 await 后续会被 WPF SynchronizationContext
调度回 UI 线程,导致大量 Git checkout 和文件 IO 操作阻塞界面。
用 Task.Run 确保整个流程在线程池执行。

* fix: 进度条分离 IsProgressIndeterminate 属性,按操作类型正确切换确定/不确定模式

* refactor: 消除 pathing 展开重复逻辑、用布尔字段替换字符串比较追踪状态来源、补全锁注释、统一日志方式

* fix: ExpandTopLevelPaths 泛化展开所有 PathMapper 顶层 key 防止误删用户目录,迁移移入锁内

* fix: 命令行启动配置组/一条龙前先等待自动更新订阅脚本完成

* feat: 添加命令行启动时是否先自动更新选项

* fix: 修复按钮位置
2026-02-20 15:09:17 +08:00
Takaranoao e9d11f7267 文本识别的模糊匹配功能 (#2799)
* chore: add AGENTS.md to .gitignore

* feat(config): 新增 AllowDuplicateChar OCR配置项

* refactor(ocr): Rec 暴露protected成员、提取RunInference、支持AllowDuplicateChar

* feat(ocr): 打通 AllowDuplicateChar 参数链 PaddleOcrService → Rec

* feat(ocr): OcrUtils 新增 CreateLabelDict/CreateWeights 工具方法

* feat(helpers): 新增 LruCache 缓存工具类

* feat(ocr): 新增 RecMatch DP模糊匹配识别器

* test(helpers): 新增 LruCache 单元测试

* test(ocr): 新增 RecMatch.GetTarget / CreateLabelDict 单元测试

* fix(ocr): 修复 RecMatch 中权重矩阵乘法的使用方式

* refactor(ocr): 合并 RecMatch 到 Rec,提取可测试静态方法,补充单元测试

将 RecMatch 子类合并到 Rec 中,消除继承关系和重复的批处理逻辑(提取 RunBatch<T>)。
将 GetTarget 核心逻辑和 GetMaxScoreDP 提取为 OcrUtils 静态方法以便独立测试。
重命名测试文件并新增 16 个单元测试覆盖 MapStringToLabelIndices、GetMaxScoreDP、CreateWeights。

* feat(ocr): 将 Rec.RunMatch 暴露给 JS 引擎和内部 C# 代码

新增 IOcrMatchService 接口,提供基于 DP 模糊匹配的 OcrMatch/OcrMatchDirect 方法,
返回 0~1 置信度分数。PaddleOcrService 实现该接口,OcrFactory.PaddleMatch 保证
非 null 返回(引擎不支持时自动回退到普通 OCR + 编辑距离字符串比较)。
BvPage 新增 OcrMatch/WaitForOcrMatch 供 JS 脚本使用,阈值可通过配置调整。

* feat(ui): 为 OCR 配置添加允许重复字符和模糊匹配阈值的设置项

在通用设置页 OCR 配置区域新增两个控件:
- 允许连续重复字符(AllowDuplicateChar)开关
- OCR模糊匹配阈值(OcrMatchDefaultThreshold)输入框

* fix: 修复 PR #2799 代码审查中发现的多项问题

- 修复 Rec.cs 空文本时 score/sb.Length 除零产生 NaN
- 修复 BvPage.cs rect==default 时同一对象被双重 Dispose
- 移除 Rec.cs Finalizer 避免 GC 线程加锁死锁
- 移除 CacheHelper WeakKey 无效功能,简化为直接 Dictionary 查找
- 添加 weights 数组长度与模型输出维度校验
- 修复 CreateLabelDict 空格标签索引冲突
- 修复 GetMaxScoreDP availableCount=0 除零
- 修复 OcrMatchFallbackService Contains 大小写敏感
- 修复 BvPage.cs DefaultRetryInterval=0 除零
- 添加 OcrMatchDefaultThreshold [0,1] 范围约束
- 提取 PaddleOcrService BGRA→BGR 转换辅助方法
- 使用 Interlocked.CompareExchange 修复 OcrFactory Fallback 线程安全
- 增大 LruCacheTests BuilderTest TTL 裕量避免 CI 不稳定
- 更新 .gitignore 注释

* fix: 修复 OcrMatch 归一化分母导致多区域匹配分数过低的 bug,改进 UI

- 修复 GetMaxScoreFlat 中 availableCount 使用非空图像数作为分母,
  导致多文字区域场景下匹配分数被过度稀释的问题,改为使用 target.Length
- AllowDuplicateChar 设置项添加"需重新加载OCR引擎"的提示
- OCR模糊匹配阈值控件从 TextBox 改为 Slider + 数值显示
- 移除 Det 类中有问题的 finalizer(含锁的析构函数可能导致死锁)
- 补充多区域场景的单元测试

* feat(ocr): 添加队伍切换时使用OcrMatch模糊匹配的选项和相关配置

* fix(ui): 更新匹配成功阈值默认值为 0.8

* fix(ocr): 修复队伍切换逻辑中的空值处理和优化代码结构

* refactor: 简化 LruCache,移除弱引用支持和 Builder 模式

- 移除有 TOCTOU bug 的 WeakReference 支持(且无实际使用方)
- CacheItem 类改为 ValueTuple 减少堆分配
- 无过期时不再赋值 DateTime.MaxValue,过期检查短路跳过
- 移除仅剩两参数的 LruCacheBuilder,直接使用构造函数

* fix(ocr): 修复 CreateWeights 中空格字符权重写入错误索引的 bug

复用 CreateLabelDict 构建索引映射,确保空格映射到 labels.Count+1,
与 CreateLabelDict 保持一致。添加对应测试用例。

* fix(ocr): 修复 GCHandle.Alloc 失败时 finally 中 Free 掩盖原始异常的问题

* fix(ocr): 添加队伍选择按钮存在性检查,避免 PartySetupFailedException

* fix(ocr): 调整 OcrMatchDefaultThreshold 的 TickFrequency 为 0.01

* fix(ocr): 修复区域裁剪逻辑,确保裁剪尺寸不为负值

* fix(ocr): 优化字符置信度提取逻辑,直接按目标字符索引查找置信度

* fix(ocr): 修正变量命名以保持一致性,调整方法名大小写

* fix(ocr): 修改 CreateWeights 方法以使用标签字典和标签计数,优化权重创建逻辑

* fix(ocr): 更新 OCR 置信度阈值设置,确保阈值范围为 0.01 到 0.99,并优化相关逻辑
2026-02-20 15:08:46 +08:00
Takaranoao 20fe152630 尝试修复一些ROI越界 (#2808)
* fix: 修复多处 OpenCV ROI 越界导致的断言失败

在低分辨率(如 1280x720)下,多处 Rect 坐标计算未做边界保护,
直接传入 SubMat / new Mat(mat, rect) 时触发 OpenCV ROI 断言崩溃。

修复位置:
- Behaviours.cs: fishBoxRect 计算结果钳位到图像边界,修复钓鱼任务越界
- GridScreen.cs: PostProcess 中幻影格子(插值生成)越界时直接丢弃
- ImageRegion.cs: DeriveCrop 两个重载统一加入坐标钳位与有效性校验
- GetGridIconsTask.cs: CropResizeArtifactSetFilterGridIcon X/Y 坐标加非负保护
- GeniusInvokationControl.cs: 角色区域扩展和 HP 区域 Y 偏移各加边界保护

* chore: 为 AutoFishingTask 鱼饵图标裁剪补充说明注释

* refactor: 提取 Rect 钳位逻辑为共享扩展方法 ClampTo

将 6 处重复的 ROI 钳位代码统一为 CommonExtension.ClampTo 扩展方法,
采用交集语义(坐标钳位时宽高同步缩减,不会扩大矩形)。
删除 AutoLeyLineOutcropTask 中的私有 ClampRect 方法。
2026-02-20 15:08:19 +08:00
huiyadanli 3c883fcf05 Update version to 0.57.0 2026-02-20 05:06:59 +00:00
xytoki a4684ee6f7 Update version to 0.56.4-alpha.4 2026-02-20 01:19:53 +00:00
xytoki edf0c695c6 Update version to 0.56.4-alpha.3 2026-02-19 17:15:20 +00:00
xytoki 12db6280b2 Update version to 0.56.4-alpha.2 2026-02-19 16:05:23 +00:00
huiyadanli ffec4aadbe Update version to 0.56.4-alpha.1 2026-02-19 12:34:30 +00:00
xytoki 368ca18d9f Update version to 0.56.3-alpha.8 2026-02-18 16:36:44 +00:00
xytoki 891c695383 Update version to 0.56.3-alpha.7 2026-02-18 15:49:04 +00:00
辉鸭蛋 53051eff11 Merge remote-tracking branch 'origin/main' 2026-02-18 20:54:34 +08:00
辉鸭蛋 0797f20f26 补充地脉花教程url 2026-02-18 20:54:13 +08:00
mno 77f8013bb0 更正自动拾取掉落物为扫描掉落物光柱 (#2795)
* 更正自动拾取掉落物为扫描掉落物光柱

原表述易引起误会,以为捡东西就要开启,改为更明确的扫描掉落物光柱以说明其功能
同时,该方法仅作为无万叶和琴时的备选方案,效果原差于直接使用聚集材料动作,将原”与万叶配合更佳“更正为”仅在无万叶时备用“

* Update en.json

更正en.json
2026-02-18 20:24:04 +08:00
Takaranoao df8e7288c1 chore: add AGENTS.md to .gitignore (#2798) 2026-02-18 20:23:19 +08:00
辉鸭蛋 e565f4b438 修复后台点击时 “选择对话选项前的延迟” 不生效的问题 2026-02-18 16:13:58 +08:00
辉鸭蛋 a8de2fb41a 尝试修复可能存在的角色识别错误问题 2026-02-18 15:44:58 +08:00
辉鸭蛋 a0584f6fdc feat(script): 向脚本引擎添加新的Bv视觉类
添加BvPage、BvLocator和BvImage类型到脚本引擎的宿主对象中,扩展脚本的视觉识别能力。
2026-02-18 13:03:02 +08:00
辉鸭蛋 44459cbca7 开启地脉花之前的OCR加入延迟 2026-02-18 12:59:43 +08:00
辉鸭蛋 c37ebae3bc Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2026-02-17 23:38:33 +08:00
辉鸭蛋 2f7e64ac57 fix(自动地脉花): 更新图标并改进异常处理日志
- 将自动地脉花功能图标从原图标更改为新图标
- 将自动地脉花任务失败时的日志级别从 Error 调整为 Debug,并添加简化的 Error 日志
- 在自动战斗任务结束时忽略 NormalEndException 和 TaskCanceledException 异常
2026-02-17 23:31:23 +08:00
辉鸭蛋 87c21f85bf fix: 地脉花任务捕获任务取消异常并调整日志级别
将地脉花自动任务中的特定异常捕获扩展为包含 TaskCanceledException,防止任务意外终止。同时将退出奖励界面的失败日志从 Warning 降级为 Debug,避免在正常任务取消时产生干扰性日志。
2026-02-17 22:58:31 +08:00
huiyadanli 7b7efdce80 Update version to 0.56.3-alpha.6 2026-02-17 14:51:14 +00:00
辉鸭蛋 536ed10dbf fix: 修复命令行参数检测和日志翻译的条件逻辑
- 命令行参数检测改为不区分大小写,确保参数匹配的可靠性
- 调试模式下禁用日志翻译,避免开发过程中的翻译干扰
- 仅非中文界面启用翻译日志提供程序,中文界面使用标准日志
2026-02-17 22:45:59 +08:00
辉鸭蛋 67ced40b6b 删除无用日志 2026-02-17 21:57:52 +08:00
DarkFlameMaster b242d98208 背包计数任务更快定位到武器经验材料 (#2793)
* 背包计数任务更快定位到武器经验材料

* 防止任务取消时鼠标按钮可能卡在按下状态
2026-02-17 19:23:30 +08:00
huiyadanli 28c50211a7 Update version to 0.56.3-alpha.5 2026-02-15 11:06:23 +00:00
辉鸭蛋 9f67726781 I18n v2 (#2709)
* feat(i18n): 添加界面与日志的国际化支持

- 新增 ITranslationService 接口及 JsonTranslationService 实现,提供基于 JSON 的翻译服务
- 添加 TrConverter 转换器,支持通过绑定动态翻译界面文本
- 引入 AutoTranslateInterceptor 行为,自动扫描并翻译界面中的静态文本
- 集成 TranslatingSerilogLoggerProvider,实现日志输出的实时翻译
- 在 App.xaml 中注册全局样式,为 Window、UserControl 和 Page 启用自动翻译

* refactor(AutoTranslateInterceptor): 优化自动翻译拦截器的加载与应用机制

- 移除 HomePage 中冗余的 EnableAutoTranslate 属性设置,改为继承属性
- 通过类构造函数注册全局 Loaded 事件处理器,替代在每个元素上单独添加
- 引入请求队列机制,批量处理待应用翻译的元素,避免重复调度
- 扩展属性类型检查,支持 object 类型以处理更多动态内容场景

* fix: 移除全局自动翻译拦截器以避免冲突

移除在 App.xaml 中为 Window、UserControl 和 Page 全局设置的 AutoTranslateInterceptor,
改为仅在 PickerWindow 中显式启用。这解决了全局样式可能导致的意外行为或冲突。

* feat(ui): 为多个窗口启用自动翻译拦截器

为 MapLabelSearchWindow、ArtifactOcrDialog、PromptDialog 等 14 个窗口添加了 AutoTranslateInterceptor.EnableAutoTranslate 属性,以启用自动翻译拦截功能。

* feat(i18n): 添加国际化目录支持并优化异常处理

* feat(ui): 添加软件UI语言设置并改进翻译服务

- 在通用设置页面新增UI语言选择控件,支持动态切换界面语言
- 修改游戏语言标签为“原神游戏语言”以明确区分
- 改进JsonTranslationService,支持UI语言切换时的实时翻译更新
- 优化AutoTranslateInterceptor,缓存原始文本值并在语言切换时恢复
- 添加属性变更监听机制,确保UI元素在语言切换后正确刷新

* feat(自动翻译): 添加排除自动翻译的依赖属性

在 AutoTranslateInterceptor 中新增 ExcludeAutoTranslate 附加属性,允许对特定依赖对象禁用自动翻译功能。当遍历元素进行翻译时,会检查此属性并跳过已标记排除的元素。

* feat(translation): 为缺失文本翻译添加详细上下文信息

扩展翻译服务以收集缺失文本的详细上下文,包括视图路径、元素类型、属性名等。
重构 `ITranslationService` 接口,引入 `TranslationSourceInfo` 类封装上下文信息。
修改 `AutoTranslateInterceptor` 自动收集 UI 元素信息,`JsonTranslationService` 合并多来源上下文。

* Revert "feat(自动翻译): 添加排除自动翻译的依赖属性"

This reverts commit a1c2334951.

* fix: 跳过 GridViewRowPresenter 中的文本翻译

添加 IsInGridViewRowPresenter 检查,避免在 GridViewRowPresenter 控件内进行自动翻译,防止潜在的界面显示问题。

* fix: 修复自动翻译拦截器在组合框上下文中的误触发

在自动翻译拦截器中添加了 IsInComboBoxContext 方法,用于检测依赖对象是否处于 ComboBox 或其相关弹出菜单的上下文中。当检测到对象位于组合框上下文时,跳过自动翻译逻辑,避免对下拉选项等界面元素进行不必要的翻译操作,从而解决潜在的界面干扰问题。

* feat(translation): 添加缺失翻译上报至 Supabase 的功能

- 新增 IMissingTranslationReporter 接口及 SupabaseMissingTranslationReporter 实现
- 在 JsonTranslationService 中集成缺失翻译上报逻辑
- 添加缺失翻译收集的配置设置(MissingTranslationCollectionSettings)
- 优化缺失翻译文件的序列化格式,将 Source 字段改为紧凑的数字表示
- 移除 ScriptRepoUpdater 中未使用的 using 语句
- 在 App.xaml.cs 中注册 SupabaseMissingTranslationReporter 服务

* fix: 修复自动翻译功能中原始值恢复和重复报告问题

- 移除未使用的法语翻译支持以简化语言选项
- 修复 Supabase 报告序列化时移除冗余字段
- 添加已缺失翻译键的缓存以避免重复报告
- 重构自动翻译拦截器,将原始值存储移至依赖属性
- 修复原始值恢复逻辑,确保正确遍历所有子元素

* feat(ui): 添加更新UI语言文件功能

- 在 ITranslationService 接口中添加 Reload 方法
- 在 JsonTranslationService 中实现 Reload 方法,支持重新加载语言文件并发送变更通知
- 在通用设置页面添加“更新”按钮,点击后从远程仓库下载最新语言文件
- 实现 OnUpdateUiLanguageAsync 命令,支持从 GitHub 和镜像源下载语言文件
- 下载后自动替换本地文件并重新加载翻译服务
2026-02-15 19:03:33 +08:00
ddaodan a2bd48a56f feat: 补充挪德卡莱区域的地脉花独立任务路径数据 (#2790) 2026-02-15 17:59:16 +08:00
辉鸭蛋 b9b251aa13 默认蒙德 2026-02-14 20:39:59 +08:00
huiyadanli 8ab64a70b5 Update version to 0.56.3-alpha.3 2026-02-14 08:37:58 +00:00
ddaodanand辉鸭蛋 c24329eca6 新增:自动地脉花独立任务 (#2583)
* 新增自动地脉花任务代码

* 新增自动地脉花任务资源

* 优化自动地脉花界面文案

* 删除地脉花旧脚本与无用资源

* 完善自动地脉花说明与任务日志

* 完善一条龙地脉花配置与教程入口

* feat: Enhance AutoLeyLineOutcrop functionality and add new pathing data

- Refactored combat text detection logic to improve accuracy.
- Added new regions and positions for "挪德卡莱" in LeyLineOutcropData.json.
- Introduced new pathing files for "挪德卡莱4-望崖营垒" and "挪德卡莱5-厄布拉神柱".
- Updated config.json with new strategies and coordinates for enhanced navigation.
- Improved error handling during party switch operations.
- Removed outdated README.md file from pathing assets.

* 修复一些日志打印

* 移动所有assets文件

* feat: clear drawn content in VisionContext before activating mask window

---------

Co-authored-by: 辉鸭蛋 <[email protected]>
2026-02-14 16:35:17 +08:00
辉鸭蛋 57421b9a45 Update README.md 2026-02-14 16:15:32 +08:00
DarkFlameMaster efc66e6062 feat:AutoDomain支持领奖时切换20/40原粹树脂,仅JS可用 (#2783)
* feat:AutoDomain支持领奖时切换20/40原粹树脂,仅JS可用

* fix bug

* chore

* fix:捕获重试耗尽异常,GameTaskManager资源重载
2026-02-14 16:12:24 +08:00
huiyadanli e8c067f7c0 Update version to 0.56.3-alpha.2 2026-02-13 15:29:26 +00:00
292dc8fb4f feat: 显示后台角色技能cd (#2754)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: 辉鸭蛋 <[email protected]>
2026-02-13 23:19:32 +08:00
this-Fish 0d466e5022 修改二次拾取,使万叶能再次拾取。 (#2760) 2026-02-13 22:24:27 +08:00
躁动的氨气 908294e2fe feat: 优化地图遮罩UI,添加快捷键 (#2775) 2026-02-13 21:20:28 +08:00
躁动的氨气 b3e2a08a6d feat: 修改仓库页面构建地址 (#2778) 2026-02-13 21:18:25 +08:00
辉鸭蛋 c28aba2bab hide map mask on run task https://github.com/babalae/bettergi-scripts-list/issues/2870 2026-02-13 21:17:30 +08:00
辉鸭蛋 08583c776f Merge remote-tracking branch 'origin/main' 2026-02-10 22:43:27 +08:00
辉鸭蛋 e15a1d7276 触发器多次触发改为30s 2026-02-10 22:43:17 +08:00
躁动的氨气 f80afc0244 fix: 日志遮罩扩大行数显示限制 (#2773) 2026-02-09 21:22:39 +08:00
huiyadanli 2caa6ee9f3 Update version to 0.56.3-alpha.1 2026-02-08 07:27:35 +00:00
Jamis 2f2311aa68 Fix rare welkin moon stuck issue (#2765) 2026-02-08 15:18:43 +08:00
躁动的氨气 4f7afb6a34 fix: 阻止默认的委托和派遣橙色点击 (#2762) 2026-02-08 00:36:09 +08:00
躁动的氨气andcoderabbitai[bot] 2f3ca34704 fix: 键鼠回调改为异步事件分发 (#2741)
* fix: 键鼠回调改为异步事件分发

* 添加队列限制与并行锁

* Update BetterGenshinImpact/Core/Script/Dependence/KeyMouseHook.cs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* 只允许外部dispose

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-02-07 16:58:07 +08:00
躁动的氨气 ea1a30a685 fix: 每日委托领奖使用点击屏幕 (#2761) 2026-02-07 16:51:28 +08:00
辉鸭蛋 b61ceae5ea 地图遮罩开关实时生效 2026-02-06 02:46:09 +08:00
this-Fish bf3957d4e8 优化换队拾取 (#2748)
* 优化换队拾取

需要换队拾取拾取时才执行换队拾取操作

* Add files via upload
2026-02-06 00:58:37 +08:00
辉鸭蛋 7c026fcf5f UI变化了后的10s内则所有触发器执行一遍,修复遮罩控件部分场景下残留的问题 2026-02-06 00:43:42 +08:00
ShadowLemoon 50055c3f26 feat: 状态机 (#2712) 2026-02-05 01:48:46 +08:00
躁动的氨气 6b2f2543c4 feat: 支持仓库使用公共资源 (#2716) 2026-02-05 01:48:06 +08:00
Ayu0K a24dd1c778 fix: 修复 RunMulti 中 Mat 所有权语义不明确导致的潜在 Dispose 问题 (#2730) 2026-02-05 01:37:18 +08:00
bling-yshs 2ced2862b3 fix: 修复 JS 脚本 multi-checkbox 配置项删除后仍能读取到旧值的问题 (#2725) 2026-02-05 01:36:08 +08:00
躁动的氨气 73422860af feat: 调整时间使用更短的延时 (#2738) 2026-02-04 19:44:21 +08:00
huiyadanli b5787aa9d3 Update version to 0.56.2 2026-02-03 14:46:22 +00:00
辉鸭蛋 f38e3e05ae 重置选项移动 2026-02-03 21:51:17 +08:00
辉鸭蛋 db67429350 fix: 调整事件触发顺序并修复地图点选择器状态
修复 PointsCanvas 中 ViewportChanged 事件与 Refresh 方法的调用顺序,确保界面正确更新。
在 MaskWindow 中增加关闭地图点选择器的逻辑,避免状态不一致。
2026-02-03 20:56:54 +08:00
辉鸭蛋 5484aea335 Revert "遮罩内 Popup 保持置顶"
This reverts commit ff3e89aa1c.
2026-02-03 20:40:05 +08:00
躁动的氨气 a948c70baf feat: 简化自动战斗日志输出 (#2732) 2026-02-03 17:35:23 +08:00
huiyadanli 688bdcd8ae Update version to 0.56.1 2026-02-02 18:22:32 +00:00
辉鸭蛋 3f2f45e3b1 fix: update BetterGI.Assets.Other package version to 1.0.12 2026-02-03 02:20:48 +08:00
辉鸭蛋 ff3e89aa1c 遮罩内 Popup 保持置顶 2026-02-03 02:19:58 +08:00
huiyadanli ddf1c72ba3 Update version to 0.56.0 2026-02-02 17:08:45 +00:00
辉鸭蛋 a651bbfbe5 优化更新界面UI与交互 2026-02-03 00:59:58 +08:00
kaedelcb a9cf0dcfb3 优化换队拾取和切换队伍 (#2729) 2026-02-03 00:39:39 +08:00
辉鸭蛋 e3caf32b94 Revise asset instructions and GitHub Actions setup
Updated README to reflect changes in asset handling and GitHub Actions.
2026-01-29 16:09:18 +08:00
huiyadanli 0761652e31 Update version to 0.55.2-alpha.2 2026-01-28 17:06:04 +00:00
辉鸭蛋 abc2b5dd19 fix: 修复地图标签搜索窗口DPI缩放和关闭逻辑
修复地图标签搜索窗口在高DPI缩放下的定位问题,调整计算方式以适配系统缩放比例。
同时确保地图点选择器关闭时同步隐藏搜索窗口,避免窗口残留。
2026-01-29 01:02:38 +08:00
辉鸭蛋 200f904a64 fix: 调整日志级别及UI元素位置比例
将米游社地图接口调用失败日志级别从Warning降为Debug,避免频繁警告干扰
调整日志文本框和状态列表的顶部位置及宽度比例,优化界面布局
2026-01-29 00:17:02 +08:00
辉鸭蛋 ab498fa731 fix: 调整截图预览区域尺寸以适应不同分辨率
调整 MaskWindow 中截图预览区域的列宽比例,将固定宽高改为最大宽高并启用拉伸对齐,提升在不同屏幕分辨率下的显示适应性。
2026-01-28 23:42:30 +08:00
辉鸭蛋 42ef97b1cd Revert "feat: 为多个窗口启用自动翻译拦截器"
This reverts commit fc942bd8cd.
2026-01-28 01:24:04 +08:00
辉鸭蛋 3beb762223 Merge remote-tracking branch 'origin/main' 2026-01-28 01:22:24 +08:00
辉鸭蛋 fc942bd8cd feat: 为多个窗口启用自动翻译拦截器
为 MapLabelSearchWindow、ArtifactOcrDialog、PromptDialog 等十三个 WPF 窗口添加了 AutoTranslateInterceptor 行为,以启用自动翻译功能。这确保了应用程序界面的文本内容在需要时可以被正确拦截并处理,提升国际化支持。
2026-01-28 01:22:09 +08:00
ema da80dd02c4 修复部分组件未随主题变更颜色 #2644 (#2699) 2026-01-27 12:28:24 +08:00
huiyadanli 0c4f7f30c8 Update version to 0.55.2-alpha.1 2026-01-25 19:03:22 +00:00
辉鸭蛋 62481baba9 地图遮罩功能(把米游社大地图搬到原神内) (#2655) 2026-01-26 02:58:23 +08:00
Anyrainel 3d6a24d11c fix: 修复自动剧情有时无法完成对话的问题 (#2684) 2026-01-26 02:51:15 +08:00
kaedelcb 1d9e05dc2c 修复切换队伍拾取初始队伍为空的异常识别 (#2688) 2026-01-26 02:49:42 +08:00
躁动的氨气 b612e70592 feat: 添加bgi版本获取 (#2692) 2026-01-26 02:40:24 +08:00
sdk2 2854e14f97 七圣召唤不再等待吞星之鲸加血 (#2679) 2026-01-25 20:41:38 +08:00
起个名字好难的喵 af2028c2b5 fix adventurers guild path (#2690) 2026-01-25 20:41:32 +08:00
躁动的氨气 99784c4263 feat: 优化进出千星速度 (#2682) 2026-01-24 23:15:14 +08:00
辉鸭蛋 e1545a3508 修复主题问题 2026-01-24 18:41:04 +08:00
huiyadanli e9611d9e22 Update version to 0.55.1-alpha.4 2026-01-24 04:07:40 +00:00
躁动的氨气 de79d8a61c feat: 添加进出千星以刷新CD (#2677) 2026-01-24 00:45:05 +08:00
躁动的氨气 ad4525c36f feat: 自动拾取文本识别帧间连续性检查 (#2676) 2026-01-23 21:56:36 +08:00
辉鸭蛋 a169489ac0 Merge remote-tracking branch 'origin/main' 2026-01-23 21:55:10 +08:00
辉鸭蛋 1bc51be511 点击完毕后加入延时,尝试解决TP失败的问题 #2672 #2670 2026-01-23 21:55:01 +08:00
辉鸭蛋 2a413c5dfc Add ignoreFolderPath to kachina.config.json 2026-01-22 14:57:46 +08:00
DarkFlameMaster ea3f653d95 JS的设置UI添加级联选择 (#2667) 2026-01-21 15:23:02 +08:00
ShadowLemoon 6e9da06f08 双玛头 (#2666) 2026-01-21 15:22:34 +08:00
huiyadanli a90da14842 Update version to 0.55.1-alpha.3 2026-01-19 16:10:38 +00:00
辉鸭蛋 6efee18f69 feat: add JsonIgnore attribute to Areas and Rewards properties in GiWorldPosition 2026-01-19 23:42:21 +08:00
辉鸭蛋 98ceba2315 feat(UI): 将多个窗口的WindowBackdropType设置为Auto解决窗口主题样式不正确的问题
统一修改AboutWindow、RepoUpdateDialog、ScriptRepoWindow、CheckUpdateWindow和PromptDialog的WindowBackdropType属性为Auto,提升窗口在透明背景下的显示效果。同时清理了WindowHelper.cs中的代码格式。
2026-01-19 21:48:41 +08:00
DarkFlameMaster 1d3e44c113 独立出自动剧情的自定义选项,JS调用时允许忽略内置选项条件 (#2639) 2026-01-19 21:15:50 +08:00
躁动的氨气 e25194e29a 简易策略支持中键滚动 (#2660) 2026-01-19 21:13:55 +08:00
Jamis 61eb5f4fe3 Fix teleport issue (#2662) 2026-01-19 20:12:14 +08:00
DarkFlameMaster 2d5c7f6e1f 新增一条龙配置的重命名与删除 (#2658) 2026-01-19 15:36:03 +08:00
DarkFlameMaster 3b3236d9f9 将战斗脚本解析日志改为只输出已匹配到的信息 (#2657) 2026-01-19 15:34:59 +08:00
Jamis 01b52a5d78 load tp info from MapLazyAssets (#2656) 2026-01-19 15:34:20 +08:00
躁动的氨气 2f44f74daa feat: 更新万能战斗策略 (#2654) 2026-01-19 03:35:48 +08:00
Jamis 8a99c2a63b rename GiWorldPosition field (#2653) 2026-01-19 00:44:35 +08:00
辉鸭蛋 1b748f4dc7 恢复原先窗口大小变化的判断,WinEventCallback有概率不触发 2026-01-18 23:50:50 +08:00
Jamis cbef23b7ba Use nullable types for genshin-map coordinates (#2650) 2026-01-18 21:56:50 +08:00
辉鸭蛋 9e18dcf018 feat: update WPF-UI packages and set default culture to Chinese (Simp… (#2646) 2026-01-18 16:34:07 +08:00
Jamis d4b8b09210 更新tp.json (#2640) 2026-01-18 15:52:05 +08:00
huiyadanli a7f030711b Update version to 0.55.1-alpha.2 2026-01-17 14:21:10 +00:00
辉鸭蛋 8fd6c64c14 Merge remote-tracking branch 'origin/main' 2026-01-17 22:10:22 +08:00
辉鸭蛋 4e24701b1d feat(界面): 实现遮罩窗口布局的相对比例定位
添加相对比例定位功能,将遮罩窗口中的状态列表和日志文本框从绝对坐标改为基于窗口宽高的比例坐标
新增OverlayRelativeOrAbsoluteConverter转换器处理坐标转换
修改相关视图模型和配置以支持比例定位
2026-01-17 22:07:27 +08:00
huiyadanli 3068069e79 Update version to 0.55.1-alpha.1 2026-01-17 09:49:25 +00:00
辉鸭蛋 73c142d33f 修复当前出战队伍是第五位时,无法正常下拉队伍的问题 #2633 2026-01-17 17:45:26 +08:00
辉鸭蛋 7333020e3a feat(界面): 添加覆盖布局编辑模式退出功能及提示
添加右键退出覆盖布局编辑模式的功能,并在编辑模式下显示操作提示
使用 SetCurrentValue 替代直接属性赋值以提高代码质量
2026-01-17 17:34:24 +08:00
辉鸭蛋 5f4185b7f0 添加动态修改log窗口位置的功能 2026-01-17 16:07:34 +08:00
huiyadanli 45a76d03d1 Update version to 0.55.0 2026-01-16 14:53:06 +00:00
辉鸭蛋 9372c007f8 一键更新失败的时候不抛出错误 2026-01-16 22:37:36 +08:00
辉鸭蛋 53c2751eb0 添加延时 #2633 2026-01-16 21:15:06 +08:00
躁动的氨气 117be11b8f 战斗策略添加状态检测 (#2637) 2026-01-16 20:29:54 +08:00
lqy 655f938fb9 fix: 修复模糊黑名单读取错误的文件路径 (#2635) 2026-01-16 13:40:32 +08:00
huiyadanli 62a0611e3d Update version to 0.54.4-alpha.2 2026-01-16 05:34:38 +00:00
辉鸭蛋 7caab0854e Merge remote-tracking branch 'origin/main' 2026-01-16 03:39:59 +08:00
BRyon fde3d79265 Update MiningHandler.cs (#2631) 2026-01-16 02:17:53 +08:00
辉鸭蛋 9697e4ebec Revert "修复可能导致遮罩不透明的设置 #2627"
This reverts commit 9b888a2430.
2026-01-16 00:59:00 +08:00
辉鸭蛋 b08e8485c3 Merge remote-tracking branch 'origin/main' 2026-01-16 00:58:42 +08:00
辉鸭蛋 b32da6f902 更新时不覆盖一键宏 #2521 2026-01-16 00:58:30 +08:00
躁动的小氨气 81f21e5bc9 少女月卡支持 (#2622) 2026-01-15 12:29:19 +08:00
辉鸭蛋 f2ebea497c Merge remote-tracking branch 'origin/main' 2026-01-15 02:03:08 +08:00
辉鸭蛋 e0c495fae3 冒险家协会加入挪德卡莱 2026-01-15 02:03:02 +08:00
huiyadanli 358b56fca2 Update version to 0.54.4-alpha.1 2026-01-14 17:56:10 +00:00
辉鸭蛋 9b888a2430 修复可能导致遮罩不透明的设置 #2627 2026-01-15 01:51:10 +08:00
辉鸭蛋 36477f9d39 UI:级联选择框选择副本 2026-01-15 01:48:19 +08:00
辉鸭蛋 ac915a9639 Merge remote-tracking branch 'origin/main' 2026-01-15 00:08:27 +08:00
辉鸭蛋 018bc35659 6.3 new avatar 2026-01-15 00:08:17 +08:00
huiyadanli 6eaea38dcf Update version to 0.54.3-alpha.4 2026-01-14 16:06:39 +00:00
辉鸭蛋 ddbf50121a 补充圣遗物副本 2026-01-15 00:00:21 +08:00
huiyadanli 843b929841 Update version to 0.54.3-alpha.3 2026-01-14 10:08:50 +00:00
Jamis e278ac1bf0 Add teleport points data to tp.json (#2620) 2026-01-14 18:06:29 +08:00
huiyadanli 158eb97056 Update version to 0.54.3-alpha.2 2026-01-14 09:52:49 +00:00
Jamis af90b930bd Fix SIFT regression (#2624) 2026-01-14 17:50:31 +08:00
郝凯阳 f5d783d473 auto tcg: update character card config to v6.3 (#2623) 2026-01-14 17:49:34 +08:00
huiyadanli c7c0a1eb4b Update version to 0.54.3-alpha.1 2026-01-14 03:45:14 +00:00
辉鸭蛋 d07b5e8571 Update BetterGI.Assets.Map package version to 1.0.17 2026-01-14 11:15:52 +08:00
辉鸭蛋 3167bf6590 fix: change mouse click method to use LeftButtonDown for improved accuracy #2618 2026-01-14 03:20:52 +08:00
辉鸭蛋 1c05245b83 feat: add option to start game with CMD for improved launch flexibility 2026-01-14 01:43:22 +08:00
辉鸭蛋 8eb50fade4 Merge remote-tracking branch 'origin/main' 2026-01-14 00:39:11 +08:00
辉鸭蛋 c0e1c4c28b 6.3 map 2026-01-14 00:39:05 +08:00
ShadowLemoon cd3ace0b62 perf: 减少一次拉取,提升100% (#2619) 2026-01-12 21:44:08 +08:00
kaedelcb 15d6525b14 优化游泳卡死问题 (#2616) 2026-01-12 00:20:31 +08:00
huiyadanli 6332905b7b Update version to 0.54.2-alpha.4 2026-01-10 17:23:24 +00:00
辉鸭蛋 16a8142faa feat: add progress reporting for repository fetch and clone operations 2026-01-11 01:15:45 +08:00
辉鸭蛋 6db5926dce fix: reset repository reference after update failure 2026-01-10 23:55:44 +08:00
ShadowLemoon 24c134fb11 fix: 始终重新克隆脚本仓库 (#2614) 2026-01-10 23:45:13 +08:00
Jamis 902dbdecd6 Add delay before teleporting in the midst of path tracking (#2550) 2026-01-10 21:54:28 +08:00
躁动的小氨气 26d8499419 新手引导标志迁移至本体 (#2612) 2026-01-10 21:53:33 +08:00
huiyadanli d0bb5be3b1 Update version to 0.54.2-alpha.3 2026-01-10 13:51:18 +00:00
躁动的小氨气 ba222b90a6 非原神窗口打印窗口名称 (#2610) 2026-01-10 21:00:32 +08:00
起个名字好难的喵 d2b2c9afb7 清理默认战斗策略,更新万能策略 (#2606) 2026-01-06 20:24:10 +08:00
Patrick-Ze 645b7fd607 精简日志,注释掉过多的解析战斗脚本命令 (#2605) 2026-01-06 14:16:06 +08:00
躁动的小氨气 9c3810a7ef Update publish.yml (#2604) 2026-01-05 22:21:07 +08:00
huiyadanli f7190a9042 Update version to 0.54.2-alpha.2 2026-01-04 16:32:34 +00:00
辉鸭蛋 7229bf1c05 fix get 2026-01-05 00:29:59 +08:00
huiyadanli cbf1cf1efc Update version to 0.54.2-alpha.1 2026-01-04 14:44:21 +00:00
辉鸭蛋 6f9044c792 Update bettergi-script-web-v2 repository in publish workflow 2026-01-04 22:42:45 +08:00
NyaMisty 2174fc1b04 feat: 添加round指令支持按轮次激活部分战斗宏脚本 (#2597) 2026-01-04 22:41:20 +08:00
ShadowLemoonand辉鸭蛋 d830dea328 perf: 极大加快脚本仓库的拉取速度 (#2359)
Co-authored-by: 辉鸭蛋 <[email protected]>
2026-01-04 22:19:32 +08:00
DarkFlameMaster cd5b22548c feat:JS添加自动剧情的实时任务时,支持传入参数 (#2591) 2026-01-03 16:24:53 +08:00
KongDemianand辉鸭蛋 71e64fe2a0 feat: 添加对Wine平台的兼容 (#2572)
Co-authored-by: 辉鸭蛋 <[email protected]>
2026-01-01 14:10:26 +08:00
Bread Grocery d46d594f31 fix(js): 修复使用ESM时,仅使用同步代码报错 (#2592) 2025-12-30 17:44:58 +08:00
DarkFlameMaster bda91816d4 fix: KeyMouseHook相关 (#2588) 2025-12-30 17:43:33 +08:00
Jamis 97486e7222 Reduce delay from 2000ms to 1000ms (#2590) 2025-12-30 00:56:21 +08:00
Jamis 8fc0cc264f Add teleports in Guiztli Ridge (#2587) 2025-12-27 12:01:49 +08:00
辉鸭蛋 bcfc3f7c7e 独立任务正在运行期间不允许画中画功能展示 2025-12-26 01:28:39 +08:00
辉鸭蛋 ed61c9dfe7 修改自动幽境危战的战斗终止检测,解决可能存在的误识别场景 2025-12-26 01:16:42 +08:00
huiyadanli c3871e0286 Update version to 0.54.1-alpha.4 2025-12-25 08:41:31 +00:00
Patrick-Ze 947752f17b 改进GetGridItemIconText获得全角数字字符时的处理 (#2581) 2025-12-25 16:30:00 +08:00
ShadowLemoon 6eca5dfc7b fix: 修复高缩放下日志子窗口消失 (#2585) 2025-12-25 16:11:33 +08:00
huiyadanli 8cc8d97780 Update version to 0.54.1-alpha.3 2025-12-22 16:29:58 +00:00
辉鸭蛋 cced20e8e4 Update BetterGI.Assets.Map package version to 1.0.15 2025-12-23 00:28:03 +08:00
DarkFlameMasterandEavina 88bcf9b151 暴露键鼠回调给js层 (#2571)
Co-authored-by: Eavina <[email protected]>
2025-12-23 00:25:49 +08:00
Jamis b4a1e9a2ab try to not interrupt pathing (#2532) 2025-12-23 00:24:46 +08:00
Jamis cf7eab0939 update misc map data (#2570) 2025-12-20 00:27:06 +08:00
Jamis f73a546acb Sea of Bygone Eras layered map (#2559) 2025-12-19 11:04:53 +08:00
Jamis f1dd7bdd54 增加远古圣山地图支持 (#2569) 2025-12-18 21:59:45 +08:00
辉鸭蛋 f66a96f0c0 Update BetterGI.Assets.Map package version to 1.0.14 2025-12-18 21:57:07 +08:00
辉鸭蛋 530c7df520 Merge remote-tracking branch 'origin/main' 2025-12-18 21:24:36 +08:00
辉鸭蛋 39be95f126 走一步防止在地脉花上 #2068 2025-12-18 21:24:10 +08:00
huiyadanli c1b7a3c1f7 Update version to 0.54.1-alpha.2 2025-12-15 02:31:23 +00:00
躁动的氨气 a40643e828 添加虚拟域名情况下README内图片获取支持 (#2552) 2025-12-15 01:32:10 +08:00
Jamis 85829868a1 improve welkin moon detection (#2549) 2025-12-15 01:31:52 +08:00
辉鸭蛋 a960ef40e9 出战角色编号识别,处理背景全白的情况 2025-12-14 23:59:21 +08:00
辉鸭蛋 573f7f13b8 新增新的聚所不拾取的场景 2025-12-14 21:51:17 +08:00
辉鸭蛋 3d526c2314 为画中画窗口新增了60帧的模式 2025-12-14 15:39:34 +08:00
erfangand辉鸭蛋 47784ca01c ### 功能说明 (#2528)
Co-authored-by: 辉鸭蛋 <[email protected]>
2025-12-14 14:09:02 +08:00
std::bad_allocand辉鸭蛋 f618f87326 为自动剧情添加画中画功能 (#2484)
Co-authored-by: 辉鸭蛋 <[email protected]>
2025-12-14 13:31:19 +08:00
辉鸭蛋 c7c25b104f 使用 SetWinEventHook 优化日志遮罩针对原神窗口的跟随延迟 #2540 2025-12-14 12:15:12 +08:00
辉鸭蛋 59cf8316b0 修复首页修改背景图无法连续更换的问题, fixed #2527 2025-12-14 11:00:09 +08:00
Jamisandcoderabbitai[bot] 2c32dafd44 支持旧日之海地图 (#2546)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-12-14 10:52:37 +08:00
huiyadanli 048e69e78b Update version to 0.54.1-alpha.1 2025-12-13 16:40:01 +00:00
Patrick-Ze 4d5af17f98 将万能战斗策略(萌新推荐)移动至备用策略文件夹 (#2534) 2025-12-14 00:35:26 +08:00
FishmanTheMurloc 9c3a2d738d 修复错误的Pen生命周期导致绘制失败的问题;单元测试鱼的名字的入参更新 (#2545) 2025-12-14 00:29:26 +08:00
火山 fb272c1756 Update MiningHandler — 更新挖矿动作 (#2544) 2025-12-14 00:29:07 +08:00
ShadowLemoon 8f432f6a43 feat: 优化进入幽境危战的流程 (#2537) 2025-12-14 00:28:16 +08:00
躁动的氨气 918aaf3b99 webview2改用虚拟域名 (#2543) 2025-12-14 00:27:21 +08:00
辉鸭蛋 c2a7fd3b92 Merge remote-tracking branch 'origin/main' 2025-12-12 01:16:35 +08:00
辉鸭蛋 b2995e7402 补充部分日志 2025-12-12 01:16:28 +08:00
Jamis 72446fe519 为js配置页面增加分隔符和多复选框 (#2535) 2025-12-11 18:24:03 +08:00
huiyadanli 275b2a5b90 Update version to 0.54.0 2025-12-08 14:16:52 +00:00
Bread Grocery 08f9312fb3 fix: 清除模块加载缓存导致library中的文件变动后无法生效 (#2525) 2025-12-07 23:38:35 +08:00
ShadowLemoon 15d688797f fix: 优化启动参数的文本框 (#2523) 2025-12-07 23:37:52 +08:00
辉鸭蛋 d282abfd49 恢复自定义的文字区域提取 2025-12-07 10:59:29 +08:00
huiyadanli a0cea560d6 Update version to 0.53.3-alpha.2 2025-12-06 18:15:18 +00:00
辉鸭蛋 9eac844757 优化OCR模型的CPU占用和执行速度 2025-12-07 02:11:04 +08:00
huiyadanli 5b748d6774 Update version to 0.53.3-alpha.1 2025-12-06 13:56:08 +00:00
辉鸭蛋 773b129bde 千星奇遇大厅F键不触发 2025-12-06 18:30:44 +08:00
辉鸭蛋 c26fde5644 6.2 模型 2025-12-06 13:59:18 +08:00
辉鸭蛋 10dcf831e8 6.2 每日提示确认 2025-12-06 13:57:18 +08:00
辉鸭蛋 91c370433c Merge remote-tracking branch 'origin/main' 2025-12-06 11:51:49 +08:00
辉鸭蛋 a9f3f563e1 增强 AutoSkipTrigger 以支持无气泡时识别 F 选项 2025-12-06 11:51:42 +08:00
kaedelcb e3a67f309d F文字菜单UI区域适配 (#2511) 2025-12-06 10:41:54 +08:00
辉鸭蛋 be25f42e47 补充少女的别名 2025-12-06 10:40:54 +08:00
辉鸭蛋 90c6a7d93a 补充少女名字 2025-12-06 09:42:52 +08:00
辉鸭蛋 47f7ac1995 新增角色 2025-12-03 23:51:53 +08:00
郝凯阳 63a936afee auto tcg: update character card config to v6.2 (#2509) 2025-12-03 17:49:43 +08:00
躁动的氨气 7035bca982 Fix namespace import for AutoWoodTask.cs (#2505) 2025-12-01 11:34:24 +08:00
DarkFlameMaster f19a16e1d3 增加模块导入的支持 (#2494) 2025-12-01 00:40:04 +08:00
躁动的氨气 e62a76d238 B服登录的第N次优化 (#2504) 2025-11-30 21:47:46 +08:00
DarkFlameMaster c4df2324b5 自动剧情支持自定义关键词 #2435 (#2497) 2025-11-30 21:47:18 +08:00
ShadowLemoon a9f5541145 refactor: 提取识别并点击按钮的通用方法并添加延迟 (#2503) 2025-11-30 19:37:48 +08:00
ShadowLemoon f8ec331a65 fix: 修复推理设备的更多弹窗大小 (#2502) 2025-11-30 19:36:04 +08:00
躁动的氨气 18efc69d0d 配置弹窗UI优化,更新截取物品图标导航地址 (#2499) 2025-11-30 19:35:46 +08:00
辉鸭蛋 fdd270068d 修复鱼类枚举 2025-11-30 10:36:06 +08:00
huiyadanli 38e541137e Update version to 0.53.2-alpha.4 2025-11-28 13:23:40 +00:00
辉鸭蛋 7bfe4ab87a Merge remote-tracking branch 'origin/main' 2025-11-28 21:21:35 +08:00
辉鸭蛋 ba4ec6f7f6 fix fish type 2025-11-28 21:21:26 +08:00
Jamis 55ed41f878 optimise log display in mask window (#2496) 2025-11-28 10:24:31 +08:00
辉鸭蛋 971151eaa1 添加 using 2025-11-26 21:24:16 +08:00
辉鸭蛋 ea40534851 添加出战角色检测方法2:边缘像素白色比例 2025-11-26 00:17:43 +08:00
huiyadanli 56959d356f Update version to 0.53.2-alpha.3 2025-11-25 14:31:29 +00:00
辉鸭蛋 16f4f5c311 UseGadgetHandler 支持最大CD参数 2025-11-25 22:28:35 +08:00
辉鸭蛋 12efb98edc Merge remote-tracking branch 'origin/main' 2025-11-25 22:19:56 +08:00
辉鸭蛋 b9707c43af 非4个角色情况下,ImageDifferenceDetector.FindMostDifferentImage 抛出错误的问题 2025-11-25 22:19:48 +08:00
huiyadanli eb1a06f4b6 Update version to 0.53.2-alpha.2 2025-11-24 15:01:29 +00:00
辉鸭蛋 89beeeccef 6.0 fish model 2 2025-11-24 22:58:36 +08:00
FishmanTheMurloc 49b78aafe2 修复群友发现的bug (#2492) 2025-11-24 11:03:39 +08:00
kaedelcb dbf489fd04 适配联机相关UI (#2488) 2025-11-23 00:29:13 +08:00
起个名字好难的喵 81ac69bde0 Update 万能战斗策略(萌新推荐).txt (#2480) 2025-11-18 21:06:41 +08:00
DarkFlameMaster 51116d16d0 优化 可提交物品的识别方法 (#2477) 2025-11-18 10:22:16 +08:00
辉鸭蛋 55bf112d80 适配模型🐟的命名. Shorten name of SecretSourceScoutSweeper fish 2025-11-18 10:09:26 +08:00
huiyadanli 05247ea5a9 Update version to 0.53.2-alpha.1 2025-11-16 15:32:37 +00:00
辉鸭蛋 fb0cccbf5f 支持 6.0 挪德卡莱自动钓鱼 2025-11-16 23:29:30 +08:00
辉鸭蛋 b55805965d Merge remote-tracking branch 'origin/main' 2025-11-16 22:37:47 +08:00
辉鸭蛋 461e446c35 延长秘境载入判断时间 #2470 2025-11-16 22:37:41 +08:00
ShadowLemoon 75835566d9 fix: 修复配置组设置无法调整高度 (#2468) 2025-11-16 00:55:51 +08:00
ShadowLemoon 6f657aa1fe refactor: 优化自动分解圣遗物的测试流程 (#2467) 2025-11-16 00:55:33 +08:00
汐 1e57bfcf18 时瞬操作 (#2469) 2025-11-16 00:54:36 +08:00
huiyadanli 522749385a Update version to 0.53.1-alpha.4 2025-11-15 04:11:25 +00:00
ShadowLemoon e659fec281 fix: 修复独立窗口的样式 (#2465) 2025-11-15 12:08:55 +08:00
辉鸭蛋 08a5729ac6 Merge remote-tracking branch 'origin/main' 2025-11-15 12:07:38 +08:00
辉鸭蛋 840ba00cdf fix: 对象提前释放问题 2025-11-15 12:07:31 +08:00
汐 5a62083bd4 时瞬的修改 (#2466) 2025-11-15 10:36:53 +08:00
Jamis c32aae6cca 改进空月祝福页面处理逻辑,提升处理速度 (#2449) 2025-11-14 22:23:18 +08:00
ShadowLemoon cca3b36398 fix: 捕获两处不致命的异常 (#2464) 2025-11-14 22:19:48 +08:00
26947144be 增加首页图片更换功能 (#2431)
Co-authored-by: Aether <[email protected]>
Co-authored-by: 辉鸭蛋 <[email protected]>
2025-11-14 22:12:21 +08:00
bling-yshs b43a2b7554 feat: 添加JS脚本和地图追踪的右键删除功能 (#2455) 2025-11-14 22:12:06 +08:00
躁动的氨气 be2918ef56 记录仓库页面位置和大小,提供默认值 (#2458) 2025-11-14 21:49:43 +08:00
ShadowLemoon 00dc48d847 feat: 为过时的脚本仓库弹窗提醒,提供更新按钮并避免直接打开 (#2460) 2025-11-14 21:45:26 +08:00
ShadowLemoon 3e114d8d60 chore: 给消息框添加标题栏图标 (#2463) 2025-11-14 21:44:49 +08:00
DarkFlameMaster 7cef698679 fix:设置战斗策略方法的逻辑bug (#2462) 2025-11-14 16:30:18 +08:00
ShadowLemoon 300656761d refactor: 给没有跟随主题的弹窗加上跟随主题的功能 (#2461) 2025-11-14 16:29:49 +08:00
huiyadanli 67aa0f68c6 Update version to 0.53.1-alpha.3 2025-11-13 19:05:44 +00:00
辉鸭蛋 71eb73c449 优化角色识别方式 2025-11-14 03:03:10 +08:00
辉鸭蛋 15fcb7d36c Merge remote-tracking branch 'origin/main' 2025-11-14 00:41:46 +08:00
辉鸭蛋 e39b34b4af 自动剧情: 点击角色横幅外的区域才能跳过新角色介绍 2025-11-14 00:41:37 +08:00
huiyadanli 86d2db17bf Update version to 0.53.1-alpha.2 2025-11-12 16:41:40 +00:00
辉鸭蛋 c05cd93d42 fix: log image saving for avatar index refresh failures 2025-11-13 00:29:44 +08:00
bling-yshs cb0bd2310a feat: 支持调整遮罩文本透明度 (#2454) 2025-11-09 17:49:49 +08:00
Bread Grocery ee12703d1a feat(js): 脚本读取图片时支持调整到指定尺寸 (#2446) 2025-11-07 19:29:10 +08:00
Bread Grocery 880d68823b fix: 修复领取尘歌壶奖励相关问题 (#2437) 2025-11-04 17:16:00 +08:00
Jamis 58b095663a 修复TemplateMatch地图特征加载两次的问题 (#2434) 2025-11-04 01:56:08 +08:00
Jamis d14de170f2 优化路径追踪过程中各种打断的处理 (#2425) 2025-11-02 10:56:43 +08:00
huiyadanli 16a5d2d815 Update version to 0.53.1-alpha.1 2025-11-01 06:37:27 +00:00
kaedelcb 6b7ee1a545 优化战斗相关截图和MAT的内存释放 (#2416) 2025-11-01 14:34:53 +08:00
DarkFlameMaster 9a6f8c1dc7 优化 自动剧情-关闭弹窗-小道具的检测逻辑 (#2427) 2025-11-01 14:13:41 +08:00
FishmanTheMurloc bc346d1680 GridScreen增加填充算法以应对item识别不全的问题 (#2423) 2025-11-01 14:12:41 +08:00
躁动的氨气 227f429c0b 暴露设置时间方法(跳过动画实测未生效) (#2426) 2025-11-01 14:12:07 +08:00
辉鸭蛋 fe0ded705f 优化秘境退出逻辑,减少不必要的退出调用 2025-11-01 14:11:45 +08:00
辉鸭蛋 48616b0683 修复重复退出秘境的问题 2025-11-01 14:03:16 +08:00
辉鸭蛋 ddbc6a9339 处理存在退出按钮场景下的返回 2025-11-01 13:47:34 +08:00
辉鸭蛋 583546ed2e 修复自动秘境使用指定树脂数量超出实际树脂数量时,不会自动退出秘境的问题 2025-11-01 02:09:12 +08:00
Jamis 19ea22a651 Also detect reading page (#2418) 2025-10-30 19:53:00 +08:00
辉鸭蛋 2cd8ff60a1 扩展其他自动战斗场景 2025-10-30 01:27:13 +08:00
辉鸭蛋 0b9e4ad14e 上一个命令和当前命令不是同一个角色,直接切换角色 #2411 2025-10-30 01:24:38 +08:00
躁动的氨气 4e479496f8 JS文件添加路径校验,补回仓库地址边框 (#2412) 2025-10-29 14:17:21 +08:00
Jamis 9527fb2363 Improve IsInBigMapUi() (#2373) 2025-10-28 23:41:02 +08:00
huiyadanli 9a8c37e513 Update version to 0.53.0 2025-10-28 14:26:38 +00:00
Bread Grocery d9f6a01fab feat(js): 全局方法暴露 getGameMetrics 方法 (#2403) 2025-10-28 10:24:59 +08:00
Jamis 3b43a7318f fix mask window lost issue (#2397) 2025-10-27 10:35:54 +08:00
FishmanTheMurloc 11c09d3d49 将PartyAvatarInitTests涉及到的代码与本体运行解耦 (#2396) 2025-10-27 10:25:31 +08:00
郝凯阳 3b4c36fc8e auto tcg: update character card config to v6.1 (#2384) 2025-10-23 14:23:33 +08:00
huiyadanli 62a25711e7 Update version to 0.52.1-alpha.1 2025-10-22 15:34:19 +00:00
辉鸭蛋 d308ea70ef 适配6.1新角色 2025-10-22 23:31:16 +08:00
kaedelcb 438fa70d2c 优化聚集材料命令/联机派遣修复 (#2374) 2025-10-22 01:31:31 +08:00
辉鸭蛋 6afbf06977 Revert "Revert "typo: 修复 AutoDomainParam 泛型定义 (#2369)" (#2370)" (#2378) 2025-10-21 04:38:02 +08:00
DarkFlameMaster f1bf269107 fix:修正小道具识别的裁剪区域,多分辨率适配 (#2368) 2025-10-20 15:38:44 +08:00
辉鸭蛋 e00f43b7f3 Revert "typo: 修复 AutoDomainParam 泛型定义 (#2369)" (#2370) 2025-10-20 15:36:41 +08:00
Bread Grocery d249eab914 typo: 修复 AutoDomainParam 泛型定义 (#2369) 2025-10-20 15:35:40 +08:00
躁动的氨气 627d48145d 修改角色识别失败保存图片路径 (#2354) 2025-10-19 21:17:43 +08:00
ShadowLemoon a58e93976c feat: 支持私有脚本仓库鉴权 (#2361) 2025-10-19 21:14:16 +08:00
huiyadanli 53564c3951 Update version to 0.52.0 2025-10-16 17:11:41 +00:00
辉鸭蛋 06ac010962 解决亮色主题下兑换码信息图标颜色问题 2025-10-17 01:06:51 +08:00
辉鸭蛋 b04a4f9427 内置黑名单更新 2025-10-16 02:18:14 +08:00
辉鸭蛋 192d4624d0 Merge remote-tracking branch 'origin/main' 2025-10-16 02:17:56 +08:00
辉鸭蛋 e90100e6f0 适配6.0版本后 40、20 树脂的计算,自动秘境不会再多刷一次了 2025-10-16 02:17:42 +08:00
起个名字好难的喵 c038563c4d Update tp.json (#2346) 2025-10-15 18:54:45 +08:00
NyaMisty 4d6d337631 fix: 修复http缺失的默认参数 (#2340) 2025-10-14 02:04:14 +08:00
huiyadanli 6d05fd2270 Update version to 0.51.2-alpha.3 2025-10-13 17:21:59 +00:00
辉鸭蛋 34761ef23e Merge remote-tracking branch 'origin/main' 2025-10-13 23:47:43 +08:00
辉鸭蛋 22663c6383 Update BetterGI.Assets.Map package version to 1.0.13 2025-10-13 23:47:33 +08:00
NyaMisty 81ab66acfa feat: 改进http,返回header和status_code,并实现url级别细粒度控制和ui提示 (#2332) 2025-10-13 20:26:56 +08:00
huiyadanli 7ab80da472 Update version to 0.51.2-alpha.2 2025-10-12 16:48:34 +00:00
辉鸭蛋 91939cfbea Update repository in publish workflow 2025-10-13 00:47:01 +08:00
NyaMisty 910b005461 feat: 支持在脚本中进行http请求 (#2331) 2025-10-13 00:42:20 +08:00
huiyadanli 38a5ddc842 Update version to 0.51.2-alpha.1 2025-10-12 12:49:55 +00:00
辉鸭蛋 f5dc391d84 获取当前成功角色的功能失败时不再返回最近一次成功的角色 2025-10-12 20:47:14 +08:00
辉鸭蛋 e6d1867b26 添加兑换码窗口以显示最新兑换码动态 (#2276) 2025-10-12 19:30:48 +08:00
ddaodan 4cd5ab25c5 Refactor ScriptRepoWindow layout and update logic (#2284) 2025-10-12 14:23:03 +08:00
xddandxdd 150328a8e6 重构邮件通知器以支持 465 端口和 587端口 (#2327)
Co-authored-by: xdd <[email protected]>
2025-10-12 14:18:07 +08:00
kaedelcb 4547c5cd74 挪德卡莱中心点更新/地图追踪不执行自动派遣 (#2323) 2025-10-11 21:25:01 +08:00
kaedelcb 00adec5709 优化盾奶位功能/旋转寻敌 (#2292) 2025-10-10 23:16:39 +08:00
辉鸭蛋 87bbe32592 update submodule 2025-10-10 22:33:25 +08:00
FishmanTheMurloc f5e22d20cb 圣遗物分解套装筛选的改进和JS引擎的约束 (#2319) 2025-10-10 22:09:34 +08:00
kaedelcb 2bf9eb9495 新增战后琴拾取/地图追踪聚材料命令 (#2320) 2025-10-10 22:09:19 +08:00
huiyadanli 92061261e2 Update version to 0.51.1-alpha.2 2025-10-09 18:59:20 +00:00
kaedelcb 8dcf563b31 新增战斗中的游泳检测 (#2315) 2025-10-10 02:51:38 +08:00
辉鸭蛋 a10cdc32d0 新的角色编号框识别方式 & 出战角色识别 (#2309) 2025-10-10 02:49:18 +08:00
辉鸭蛋 5381be1658 修复键鼠文件夹不存在的问题 #2316 2025-10-09 23:51:14 +08:00
辉鸭蛋 3100862c04 传入地图匹配方式 (#2273) 2025-10-08 16:14:39 +08:00
DarkFlameMaster 716ceb2b77 自动剧情-增加对“小道具”及“角色”弹窗的识别与关闭 (#2308) 2025-10-08 00:07:42 +08:00
DarkFlameMaster 92c6556316 提供自定义参数的 自动秘境 与 自动战斗 方法 (#2299) 2025-10-05 20:02:48 +08:00
辉鸭蛋 0bbc868039 Merge remote-tracking branch 'origin/main' 2025-10-04 22:18:31 +08:00
辉鸭蛋 a178996dca 6.0 地下地图 2025-10-04 22:18:11 +08:00
起个名字好难的喵 138663a378 feat: 6.0分层传送锚点 (#2297) 2025-10-04 01:43:04 +08:00
kaedelcb b71aa8c266 修复盾位选择列表问题 (#2282) 2025-09-30 15:50:41 +08:00
ShadowLemoon 973ff178cb fix: 修复地图切换区域时的文本检测区域 (#2275) 2025-09-28 19:21:29 +08:00
辉鸭蛋 24d1bab2d4 自动拾取添加模糊匹配 2025-09-27 00:49:47 +08:00
辉鸭蛋 e60ff723f2 Merge remote-tracking branch 'origin/main' 2025-09-26 23:30:13 +08:00
辉鸭蛋 4c5cdb0ccf 修复ItemsSource=' 1234' 导致XAML设计器报错的问题 #2039 2025-09-26 23:29:29 +08:00
FishmanTheMurloc 8a7440dbbe ScriptObjectConverter.GetValue()新增支持一层集合泛型参数解析;CountInventoryItem新增支持复数物品的计数,并在Dispatcher中向JavaScript暴露此种使用方式 (#2267) 2025-09-26 23:15:18 +08:00
bhbghghbgb 0aef3ec39a feat:自动圣遗物转化功能可识别并标记未激活副词条 (#2258) 2025-09-26 15:18:30 +08:00
FishmanTheMurloc 17790317d9 ScreenshotUidCoverEnabled配置的默认值改为true (#2262) 2025-09-25 15:41:00 +08:00
Jamis a3492aaabe fix wrongly recognized text 2 (#2263) 2025-09-25 09:58:40 +08:00
huiyadanli 5fefcc2047 Update version to 0.51.1-alpha.1 2025-09-24 06:21:35 +00:00
FishmanTheMurloc 808dbec396 暴露ocr的版本信息供调用者检查,增加一个检查此项的单测 (#2259) 2025-09-24 13:39:38 +08:00
kaedelcb 5681cb436c 不进行切换检测偏移适配 (#2256) 2025-09-24 01:42:33 +08:00
辉鸭蛋 71e71c5d6b 优化聚所的拾取排除 2025-09-24 01:40:06 +08:00
辉鸭蛋 e94614a3a9 优化自动开门 2025-09-24 01:36:19 +08:00
辉鸭蛋 547b4a4929 update submodule 2025-09-24 01:15:47 +08:00
辉鸭蛋 dc04c22473 调整浓缩树脂识别范围,解决V4模型无法准确识别浓缩树脂个数的问题 #2185 2025-09-24 01:09:40 +08:00
辉鸭蛋 e779aab20b 修复自动幽境危战停止时弹出错误提示窗口的问题 2025-09-23 23:25:10 +08:00
辉鸭蛋 eeb6bb320b 修复树脂不足情况下自动幽境危战无法正常退出的问题 #2241 2025-09-23 01:41:56 +08:00
bhbghghbgb 94e50307a5 重构服务器重置时间处理 (#2160) 2025-09-23 00:59:07 +08:00
辉鸭蛋 99502ed35b 优化快速购买时候,对洞天的识别率 2025-09-23 00:47:57 +08:00
辉鸭蛋 2ecacc0eeb 等待进入主界面后执行任务优化 2025-09-23 00:34:33 +08:00
辉鸭蛋 6f2b9ae95f 自动幽境危战,延长传送时间 2025-09-22 21:56:32 +08:00
Jamis fe21f945ab Replace wrongly recognized text (#2249) 2025-09-22 21:42:37 +08:00
辉鸭蛋 efc60de8df Merge remote-tracking branch 'origin/main' 2025-09-21 14:14:55 +08:00
辉鸭蛋 6d6f1b5153 修改日志自动清理配置 2025-09-21 14:14:49 +08:00
kaedelcb ba2ae75556 修复菈乌玛UI问题的卡顿等问题 (#2238) 2025-09-21 11:24:45 +08:00
nullpluto 6cba5a031b feat: 添加ServerChan通知 (#2235) 2025-09-20 19:27:01 +08:00
huiyadanli b067e6c0ed Update version to 0.51.0 2025-09-19 13:54:01 +00:00
辉鸭蛋 ac3ff56c30 更新测试版本添加警告提示 2025-09-19 21:41:33 +08:00
辉鸭蛋 12bd716308 fix: update log messages for team position adjustments 2025-09-19 21:29:34 +08:00
kaedelcb 0ccbb3d584 菈乌玛入队相关情况修复 (#2229) 2025-09-19 21:18:59 +08:00
huiyadanli 2138d0cf65 Update version to 0.50.1-alpha.5 2025-09-18 16:54:01 +00:00
辉鸭蛋 07d07b50f3 Merge remote-tracking branch 'origin/main' 2025-09-19 00:50:02 +08:00
辉鸭蛋 c894bf7493 修复点击物品过期提示时候出现的,图像roi溢出问题 2025-09-19 00:49:45 +08:00
xytoki d004b053f9 Update version to 0.50.1-alpha.4 2025-09-18 16:32:44 +00:00
辉鸭蛋 4cb3e901b2 更多角色切换的6.0适配 2025-09-18 22:33:00 +08:00
Qian f705c221ff fix: 使用控制台当前文本编码 (#2225) 2025-09-18 17:06:56 +08:00
huiyadanli bcbdd40eae Update version to 0.50.1-alpha.3 2025-09-17 17:31:37 +00:00
辉鸭蛋 15b772a975 适配 菈乌玛退队后队伍UI不会还原,但是跨地图传送后UI还原 的场景 2025-09-18 01:28:17 +08:00
辉鸭蛋 86d20271dd refactor: disable logging for main UI check in GameLoading 2025-09-18 00:09:30 +08:00
辉鸭蛋 13792b7250 解决聚所F的问题 #2212 2025-09-18 00:08:48 +08:00
huiyadanli 7e22c6cb54 Update version to 0.50.1-alpha.2 2025-09-17 12:05:19 +00:00
Khaenri'ah df9932a70b Update AutoStygianOnslaughtTask.cs (#2214) 2025-09-17 14:52:43 +08:00
辉鸭蛋 ba1e2f1326 新的黑名单 2025-09-17 01:57:02 +08:00
FishmanTheMurloc 25774aedbd 修复切换队伍列表向下查找时有时会识别不正确的bug (#2209) 2025-09-17 01:56:19 +08:00
辉鸭蛋 af707f304c 优化自动拾取的预处理环节,优化最终文字展现,使自动拾取OCR识别更加稳定 (#2211) 2025-09-17 01:46:41 +08:00
bling-yshs cd69a255dc feat: 通知->全局通知设置->添加新选项“手动停止时不通知”,允许用户选择手动停止时是否发送通知 (#2195) 2025-09-16 10:25:40 +08:00
辉鸭蛋 aa7f8b78e3 feat: add mouse movement to game interface for auto door opening functionality 2025-09-15 00:33:00 +08:00
FishmanTheMurloc c78a9418e1 6.0鱼定义和测试用例 (#2201) 2025-09-14 20:29:52 +08:00
bling-yshs ac5f26ea39 chore: 更新图标,支持更多尺寸 (#2196) 2025-09-14 20:28:31 +08:00
辉鸭蛋 d5d42b83b4 Merge remote-tracking branch 'origin/main' 2025-09-14 10:18:32 +08:00
辉鸭蛋 3a1d45df87 修复 Error: [ErrorCode:NoSuchFile] Load model from .\Assets\Model\Item\gridIcon.onnx failed:Load model .\Assets\Model\Item\gridIcon.onnx failed. File doesn't exist 2025-09-14 10:18:24 +08:00
bling-yshs 2b7bafd643 feat: 添加“打开所在目录”菜单项及其命令实现,用于打开脚本文件夹 (#2193) 2025-09-14 09:48:50 +08:00
huiyadanli d30c413706 Update version to 0.50.1-alpha.1 2025-09-13 18:07:45 +00:00
辉鸭蛋 faf1583fb2 log: 自动音乐专辑任务异常详情日志打印 2025-09-14 02:05:15 +08:00
辉鸭蛋 1f23c06d25 Update CheckUpdateWindow to enhance user guidance for update sources 2025-09-14 02:04:23 +08:00
huiyadanli b2aee79c61 Update version to 0.50.0 2025-09-13 01:27:48 +00:00
kaedelcband辉鸭蛋 b6e4fe374a 尘歌壶领取好感角色为空时不领好感 (#2092)
Co-authored-by: 辉鸭蛋 <[email protected]>
2025-09-13 07:12:26 +08:00
火山 bbe0b9fce1 战斗策略:万能通用战斗策略(初版) (#2088) 2025-09-13 07:10:47 +08:00
kaedelcb a6ae940732 适配合成保留和限时开放秘境功能 (#2177) 2025-09-13 07:00:18 +08:00
辉鸭蛋 db0edabad2 启动时重置 GameLoadingTrigger 的状态 2025-09-13 06:59:35 +08:00
郝凯阳 4b43c6b7e9 auto tcg: update character card config to v6.0 (#2172) 2025-09-13 06:44:56 +08:00
辉鸭蛋 ead3aa1e6b new logo 2025-09-13 06:30:23 +08:00
辉鸭蛋 bf02c6786b Merge remote-tracking branch 'origin/main' 2025-09-12 02:04:41 +08:00
辉鸭蛋 bfe55061f4 git 更新提升速度 2025-09-12 02:04:25 +08:00
huiyadanli fe41ccc42d Update version to 0.49.2-alpha.5 2025-09-11 17:43:06 +00:00
辉鸭蛋 8cc5ce7cfd 修复自动开门没事就启动的问题 2025-09-12 01:26:09 +08:00
辉鸭蛋 f87bbefdc1 兼容 6.0 版本 队伍下的草露进度条导致右侧角色位置偏移的场景 2025-09-12 01:09:20 +08:00
FishmanTheMurloc feed609fb1 适配新版本激活石化古树识别树脂 (#2174) 2025-09-11 23:31:02 +08:00
huiyadanli 1ad31c64d2 Update version to 0.49.2-alpha.4 2025-09-11 02:40:46 +00:00
辉鸭蛋 ebf6a8f5d4 Merge pull request #2167 from FishmanTheMurloc/main 2025-09-11 10:37:02 +08:00
FishmanTheMurloc 54195f84a1 切换队伍适配新版本最大队伍数由15增加到20;并新增最后一个非空队伍判断 2025-09-11 10:28:44 +08:00
辉鸭蛋 71e5880074 Merge remote-tracking branch 'origin/main' 2025-09-11 02:59:27 +08:00
辉鸭蛋 ba20d8158b 6.0 模板匹配地图 2025-09-11 02:59:11 +08:00
FishmanTheMurloc 52f50eb123 快速分解增加按钮是否找到校验,避免传导 2025-09-11 00:18:41 +08:00
FishmanTheMurloc 2c6bf5bd25 复苏提示识别支持多语言Fixes #1608 2025-09-10 21:14:07 +08:00
FishmanTheMurloc 3abed61fe2 副词条适配(待激活) 2025-09-10 20:39:25 +08:00
FishmanTheMurloc 6e2458e6c2 Merge branch 'babalae:main' into main 2025-09-10 19:30:59 +08:00
起个名字好难的喵 1de4f0501c feat: 6.0新增传送点 (#2166) 2025-09-10 19:17:27 +08:00
FishmanTheMurloc b08a78a0b4 适配地图传送界面新出现“游逸旅闻:[地区名]”文字,对原有文字识别点击造成干扰的情况,将原先“每日委托:[地区名]”文字的干扰排除方式一并改为从下到上取第一个匹配的方式;增加挪德卡莱和尘歌壶多语言字典 2025-09-10 19:16:55 +08:00
huiyadanli 9d87cbdba6 Update version to 0.49.2-alpha.3 2025-09-09 17:28:41 +00:00
辉鸭蛋 07667580f4 Merge remote-tracking branch 'origin/main' 2025-09-10 01:25:40 +08:00
辉鸭蛋 5e8e078d8d 修复删除仓库时,仓库被占用的问题。修复历次更新 Fetch 过慢的问题 2025-09-10 01:25:22 +08:00
huiyadanli 9404bc0098 Update version to 0.49.2-alpha.2 2025-09-09 16:57:36 +00:00
辉鸭蛋 442e6eb96d 物品过期处理 2025-09-10 00:54:50 +08:00
辉鸭蛋 40accef74b 6.0 角色模型 2025-09-10 00:34:09 +08:00
Jamis 60fb42cef6 提高SetTimeTask的稳定性 (#2161) 2025-09-09 23:46:37 +08:00
大头鱼 28c195cce3 优化 地图追踪任务添加窗口 性能,修复了索引时文件树复选框不被记忆的BUG (#2157) 2025-09-09 23:43:58 +08:00
躁动的氨气 9a6a11295e 优化节点更新标记逻辑 (#2162) 2025-09-09 23:43:08 +08:00
huiyadanli 3a410887b6 Update version to 0.49.2-alpha.1 2025-09-08 17:32:17 +00:00
辉鸭蛋 6cb1e5339c 添加火元素采集选项到条件定义 fixed #2159 2025-09-09 00:53:14 +08:00
辉鸭蛋 1cc64b96ff 6.0 地图 2025-09-09 00:52:50 +08:00
辉鸭蛋 595f5279cc 6.0 数据生成 2025-09-09 00:49:14 +08:00
辉鸭蛋 a100cc5826 Merge remote-tracking branch 'origin/main' 2025-09-09 00:49:06 +08:00
辉鸭蛋 00ef0e43a6 6.0 角色数据 2025-09-09 00:48:49 +08:00
FishmanTheMurloc b731a8770d 更正Dispatcher.RunTask内CountInventoryItem的入参名称 (#2158) 2025-09-07 20:28:11 +08:00
辉鸭蛋 6550340666 添加超链接 2025-09-06 14:30:13 +08:00
辉鸭蛋 19dbd48cfd Merge remote-tracking branch 'origin/main' 2025-09-06 12:24:25 +08:00
辉鸭蛋 2a78de70e4 手动导入迁移到仓库界面 2025-09-06 12:24:08 +08:00
huiyadanli bbf874b09b Update version to 0.49.1-alpha.3 2025-09-05 17:18:24 +00:00
FishmanTheMurloc 37fcde080f 图标识别应用两则 (#2154) 2025-09-06 01:17:05 +08:00
辉鸭蛋 2f55dd0502 使用release分支更新脚本仓库 2025-09-06 01:13:23 +08:00
huiyadanli 88832c11f5 Update version to 0.49.1-alpha.1 2025-09-04 17:30:56 +00:00
FishmanTheMurloc 85178f3a71 图标识别模型更新 (#2150) 2025-09-05 01:28:55 +08:00
躁动的氨气 dc7b477391 添加秘境状态检测,微调B服点击位置 (#2122) 2025-09-04 00:52:28 +08:00
大头鱼 d37dd443a7 [BUG修复] 为Windows10添加深浅主题切换功能以确保其界面正常显示 (#2125) 2025-09-04 00:48:40 +08:00
辉鸭蛋 4662b71c91 Merge remote-tracking branch 'origin/main' 2025-09-04 00:31:29 +08:00
辉鸭蛋 53349e8b4e JS 开放 OpenCvSharp 的完整包 2025-09-03 22:52:31 +08:00
FishmanTheMurloc 5d843c9c8f 给JS调用的背包数数独立任务 (#2133) 2025-09-02 01:18:37 +08:00
辉鸭蛋 bff207f3fe PlaceholderText 不展示,直接写到提示中 #2140 2025-09-01 01:57:11 +08:00
辉鸭蛋 206cee63b1 Merge remote-tracking branch 'origin/main' 2025-08-30 00:17:23 +08:00
辉鸭蛋 7bb299ca5f 修复简易战斗策略存在空格时候解析失败的问题 2025-08-30 00:17:14 +08:00
kaedelcb 79daf06d64 优化原粹树脂合成保留功能 (#2129) 2025-08-29 17:00:24 +08:00
FishmanTheMurloc 8c85cb90c7 圣遗物分解的bugfix和优化 (#2114) 2025-08-29 14:50:35 +08:00
辉鸭蛋 21ce9912e4 新增V4Auto的Ocr类型,使用最优模型识别,单测 PaddleOcrService_VariousLangWords_ShouldEqualOrMatch 已通过 2025-08-27 01:13:19 +08:00
辉鸭蛋 64f182e5c5 fix: 界面乱点的问题 2025-08-27 00:34:17 +08:00
Jamis 88493ab988 consider DPI scaling in MoveBy() (#2096) 2025-08-25 00:40:55 +08:00
bhbghghbgb 0a0b14ac06 fix: discord webhook notification (#2079) 2025-08-24 15:59:53 +08:00
大头鱼 126e39f77c 完善Markdown To FlowDocument的,在WIn11下为bgi添加浅色主题支持 (#2082) 2025-08-24 15:58:21 +08:00
辉鸭蛋 8d27bd88c1 更新包版本 2025-08-24 15:55:57 +08:00
FishmanTheMurloc 2753a81c1f 圣遗物分解筛选改用JS (#2087) 2025-08-22 10:31:14 +08:00
辉鸭蛋 d423b6d7cb Merge remote-tracking branch 'origin/main' 2025-08-21 23:30:08 +08:00
huiyadanli 444c4038a4 Update version to 0.49.0 2025-08-21 15:21:54 +00:00
辉鸭蛋 9ba4b70e76 Refactor Steambird upload script to use environment variable for TUS_USER 2025-08-21 23:18:58 +08:00
辉鸭蛋 f63a4bc84f Merge remote-tracking branch 'origin/main' 2025-08-21 23:18:02 +08:00
辉鸭蛋 504cd554bc Add TUS_PASS environment variable for Steambird upload 2025-08-21 23:17:54 +08:00
huiyadanli 31d01fd44e Update version to 0.48.2-alpha.10 2025-08-21 14:58:20 +00:00
辉鸭蛋 f634289419 Add upload option to Steambird in publish.yml 2025-08-21 22:55:16 +08:00
huiyadanli a2f7611bd8 Update version to 0.48.2-alpha.9 2025-08-21 14:37:43 +00:00
辉鸭蛋 25ad66c182 Merge remote-tracking branch 'origin/main' 2025-08-21 22:35:42 +08:00
辉鸭蛋 5a19ebed67 Add run ID parameter to API trigger for enhanced build requests 2025-08-21 22:35:27 +08:00
辉鸭蛋 e4a256d0ec Refactor version extraction to remove file extension before matching 2025-08-21 22:12:07 +08:00
huiyadanli 4e3842cbf2 Update version to 0.48.2-alpha.8 2025-08-21 02:02:53 +00:00
huiyadanli 72d5a537f4 Update version to 0.48.2-alpha.7 2025-08-20 18:53:53 +00:00
辉鸭蛋 0533fc0c1c Update dependency installation path in publish.yml for consistency 2025-08-21 02:45:29 +08:00
huiyadanli 64f24dff09 Update version to 0.48.2-alpha.6 2025-08-20 18:22:04 +00:00
辉鸭蛋 d0cb196f63 禁用无用的Github Action Job 2025-08-21 02:20:18 +08:00
辉鸭蛋 fc4a6df3c6 修改构建上传方式 2025-08-21 02:17:52 +08:00
辉鸭蛋 1f71e6f36d Add API trigger configuration in .cnb.yml for enhanced upload process 2025-08-21 02:08:59 +08:00
辉鸭蛋 fe5bc7883a Update import path in .cnb.yml to use full URL for better accessibility 2025-08-21 01:50:31 +08:00
辉鸭蛋 6325d4c3e5 Rename push event to web_trigger_one in cnb.yml 2025-08-21 01:41:19 +08:00
辉鸭蛋 063224cf2c Add CNB configuration for downloading and uploading build artifacts 2025-08-21 01:36:03 +08:00
辉鸭蛋 ba99fddba7 Update .gitignore and cnb.yml configuration 2025-08-21 01:34:31 +08:00
辉鸭蛋 ec1a84ffd9 Reorder imports and docker configuration in cnb.yml 2025-08-21 01:31:38 +08:00
辉鸭蛋 9f0c8d2990 Merge remote-tracking branch 'origin/main' 2025-08-21 01:20:36 +08:00
辉鸭蛋 18b18a9a4a 添加 CNB Actions 构建物下载和上传脚本及相关配置 2025-08-21 01:20:21 +08:00
xytoki d4eb38e1a6 Update version to 0.48.2-alpha.5 2025-08-20 12:11:33 +00:00
辉鸭蛋 7a12292db4 action添加上传进度条 2025-08-20 01:40:02 +08:00
huiyadanli 34e435b01f Update version to 0.48.2-alpha.4 2025-08-19 15:51:03 +00:00
辉鸭蛋 1096bb6935 Update publish.yml 2025-08-19 23:48:44 +08:00
xytoki 63a43147f8 Update version to 0.48.2-alpha.3 2025-08-19 07:29:58 +00:00
huiyadanli 6a34aaff4a Update version to 0.48.2-alpha.2 2025-08-18 15:54:29 +00:00
辉鸭蛋 8ddf5475ae 关闭 cnb 上传 2025-08-18 23:50:43 +08:00
xyToki f991c246a9 feat: add more update channels 2025-08-17 22:32:40 +08:00
huiyadanli 3b32850b4a Update version to 0.48.2-alpha.1 2025-08-17 13:59:51 +00:00
辉鸭蛋 767484889f 更多更新渠道 2025-08-17 21:57:48 +08:00
辉鸭蛋 016ed49181 添加自动兑换码剪切板的监听 #2041 2025-08-17 15:06:20 +08:00
辉鸭蛋 ce529fc2de 自动吃药相关问题修正,配置调整 2025-08-17 13:45:44 +08:00
躁动的氨气 d1b1c32528 JS添加保存图片方法,仓库json支持积累更新提示 (#2078) 2025-08-17 01:15:30 +08:00
辉鸭蛋 a77d1fbc45 JS脚本中 KeyPress 语法针对功能键也采取直接触发的方式 #2071 2025-08-17 00:20:28 +08:00
辉鸭蛋 ee0094c5e5 Merge remote-tracking branch 'origin/main' 2025-08-16 14:12:13 +08:00
5117600049and辉鸭蛋 88c138b6af Update Dispatcher.cs (#1972)
Co-authored-by: 辉鸭蛋 <[email protected]>
2025-08-16 13:52:45 +08:00
FishmanTheMurloc 8a41148ba6 拓展自动吃药,基于图标识别 (#2051) 2025-08-16 13:51:46 +08:00
躁动的氨气 436a8d207e 修复不同分辨率导致的B服登录无法使用 (#2037) 2025-08-16 13:51:21 +08:00
大头鱼 0b160fd8ef 修复了JS脚本、地图追踪页面中无法正确加载markdown文件的问题 (#2017) 2025-08-16 13:50:55 +08:00
iris10086 2b874442ab 自动识别宝箱逻辑。 暂未处理地脉花。 (#2073) 2025-08-16 11:48:07 +08:00
辉鸭蛋 21c4c1b749 F改建和按键绑定功能绑定 2025-08-16 11:26:52 +08:00
xytoki 5ca373707f Update version to 0.48.1-alpha.5 2025-08-15 12:23:24 +00:00
辉鸭蛋 611054d089 修复自动幽境危战传送逻辑 #2059 #2060 2025-08-15 00:51:28 +08:00
辉鸭蛋 1bd9b94ffd Update README.md 2025-08-14 22:28:38 +08:00
辉鸭蛋 90835989c2 Update README.md 2025-08-14 22:27:48 +08:00
辉鸭蛋 eaab7e2b40 Update README.md 2025-08-14 21:16:54 +08:00
huiyadanli 7aa7e2779c Update version to 0.48.1-alpha.4 2025-08-14 08:26:16 +00:00
辉鸭蛋 2c0d9983f5 修复自动幽境危战后无法正常分解圣遗物的问题 2025-08-12 01:23:52 +08:00
辉鸭蛋 45a10b85dc 修复一条龙自定义战斗策略不生效的问题 2025-08-12 00:30:50 +08:00
huiyadanli 7066082ab6 Update version to 0.48.1-alpha.3 2025-08-10 17:44:58 +00:00
辉鸭蛋 1ff8cc85b0 only attach 2025-08-11 01:43:07 +08:00
辉鸭蛋 45802dc143 控制台输出 2025-08-11 01:39:46 +08:00
辉鸭蛋 1474f4b318 Merge remote-tracking branch 'origin/main' 2025-08-11 00:59:16 +08:00
辉鸭蛋 1b1c0ab051 修复一些问题 2025-08-11 00:59:10 +08:00
起个名字好难的喵 b4de6ef0ff fix 5.6-5.8 Teleport pos error (#2045) 2025-08-11 00:22:53 +08:00
辉鸭蛋 cdb05b7df8 fix: update MoveMapTo method to use double for coordinates 2025-08-10 17:29:10 +08:00
辉鸭蛋 7785e53ef5 fix: correct output directory settings for AutoEat assets 2025-08-10 15:26:04 +08:00
xoipzand辉鸭蛋 d8ba04f97b 实时触发 - 自动吃药(秘境中的自动吃药功能改进作为实时触发功能 (#1993)
Co-authored-by: 辉鸭蛋 <[email protected]>
2025-08-10 13:48:25 +08:00
辉鸭蛋 85e8bb7dfd Merge remote-tracking branch 'origin/main' 2025-08-10 13:44:24 +08:00
辉鸭蛋 2fc192b47c F5加入延时 2025-08-10 13:44:17 +08:00
馬良※チノ ee4e5c9b8f feat: Bark通知设置自定义图标 (#2042) 2025-08-10 13:37:24 +08:00
kaedelcb 135d1b60bb 新增盾位优先功能和旋转寻敌优化 (#2039) 2025-08-10 13:36:16 +08:00
辉鸭蛋 5cf4a16630 Merge remote-tracking branch 'origin/main' 2025-08-09 23:17:38 +08:00
辉鸭蛋 2bedd0cd23 修复小道具使用逻辑,优化冷却时间处理 2025-08-09 23:17:27 +08:00
huiyadanli bdfba2c441 Update version to 0.48.1-alpha.2 2025-08-09 14:27:08 +00:00
Patrick-Ze 42322db33f 修复自定义的交互按键未对自动秘境生效的问题 (#2035) 2025-08-09 22:25:07 +08:00
辉鸭蛋 bc7e365e00 修改延时,减少幽境危战进入时候可能识别队伍角色失败的问题 2025-08-09 22:24:00 +08:00
辉鸭蛋 9090f46105 Update README.md 2025-08-09 17:21:48 +08:00
辉鸭蛋 a004304061 取消兑换码使用后不再弹出此剪切板内容的兑换码 2025-08-09 17:15:20 +08:00
辉鸭蛋 6d17e02af4 Merge remote-tracking branch 'origin/main' 2025-08-09 16:48:48 +08:00
辉鸭蛋 981018262f 修复传送进入秘境等待时间过短的问题 #2031 2025-08-09 16:48:19 +08:00
huiyadanli 763bcaa9c4 Update version to 0.48.1-alpha.1 2025-08-09 08:47:09 +00:00
辉鸭蛋 307390c2ad 新增使用小道具的action 2025-08-09 15:49:52 +08:00
辉鸭蛋 f139b645b2 更新脚本仓库的文案修改为:准备更新,请耐心等待 2025-08-08 22:53:41 +08:00
辉鸭蛋 5737c78c5c 调整延迟时间以优化自动分解流程 2025-08-08 22:43:56 +08:00
辉鸭蛋 7647e26536 延长时间 2025-08-08 22:32:23 +08:00
辉鸭蛋 9b982cd382 Merge remote-tracking branch 'origin/main' 2025-08-08 22:16:00 +08:00
辉鸭蛋 f9b7884494 修复战斗脚本中注释存在分号无法正常解析的问题 2025-08-08 22:15:37 +08:00
Luckylhz 98b7dbefda Update HardwareAccelerationConfig.cs (#2021) 2025-08-08 22:09:43 +08:00
huiyadanli 6fbf8064ac Update version to 0.48.0 2025-08-07 16:14:15 +00:00
huiyadanli 280127ea41 Update version to 0.47.5-alpha.2 2025-08-07 15:30:56 +00:00
躁动的氨气 82c54a3458 修复js脚本需要备份的文件无法恢复的问题 (#2018) 2025-08-07 23:26:35 +08:00
Jamis edb5db238c improve robustness (#2019) 2025-08-07 23:18:19 +08:00
辉鸭蛋 7b3ec7e6c3 Merge remote-tracking branch 'origin/main' 2025-08-07 23:17:50 +08:00
辉鸭蛋 5ed5c31555 修复自动幽境危战退出 2025-08-07 23:17:35 +08:00
huiyadanli 8043ac9127 Update version to 0.47.5-alpha.1 2025-08-06 17:46:47 +00:00
辉鸭蛋 764a810b87 自动幽境危战加入一条龙 2025-08-07 01:31:14 +08:00
辉鸭蛋 dafd07b74a 模型默认使用V4 2025-08-07 01:18:16 +08:00
huiyadanli 6141b30331 Update version to 0.47.4-alpha.7 2025-08-06 16:28:57 +00:00
辉鸭蛋 734482086a Merge remote-tracking branch 'origin/main' 2025-08-06 23:23:04 +08:00
辉鸭蛋 06078886ea 修复尘歌壶购买 2025-08-06 23:02:27 +08:00
Takaranoao 9ab70aae32 fix: update default setting for CPU OCR inference to disabled and adjust related UI text (#2013) 2025-08-06 22:04:39 +08:00
xytoki 445243d804 Update version to 0.47.4-alpha.6 2025-08-06 12:33:29 +00:00
xyToki 880d882528 chore(updater): add alpha channel for normal update & migrate update server 2025-08-06 20:31:35 +08:00
大头鱼 984b05ecfc 修复了优化PromptDialog布局后,部分调用场景的单行文本框对齐异常的问题 (#2008) 2025-08-06 17:29:26 +08:00
辉鸭蛋 51988bc145 延长纪行领取 2025-08-06 01:28:58 +08:00
辉鸭蛋 73244ee1b0 强制OCR使用CPU的功能默认关闭 2025-08-06 00:03:32 +08:00
辉鸭蛋 2aa062f411 优化模板匹配方式的地图追踪加载时候的日志打印 2025-08-06 00:02:38 +08:00
辉鸭蛋 1e089b27de 距离过远修复,添加重试次数 2025-08-05 23:59:10 +08:00
辉鸭蛋 83631731c6 Merge remote-tracking branch 'origin/main' 2025-08-05 22:17:37 +08:00
辉鸭蛋 e709acd6e0 fixed #2006 2025-08-05 22:17:23 +08:00
起个名字好难的喵 22ebeaa80c 修正部分角色挖矿为 aj 3次 (#2005) 2025-08-05 21:57:15 +08:00
kaedelcb e3f7afd7dc Mian pbuy6优化尘歌壶购买弹窗显示/旋转寻敌优化 (#1999) 2025-08-05 10:25:49 +08:00
辉鸭蛋 199cebbb36 尝试修复纪行无法自动点击的问题 2025-08-05 00:38:15 +08:00
辉鸭蛋 035a101544 Merge remote-tracking branch 'origin/main' 2025-08-05 00:24:49 +08:00
辉鸭蛋 b9887bcce8 更新默认服务器的URI地址 2025-08-05 00:24:34 +08:00
Takaranoao c45448d521 fix: CUDA目录嗅探默认关闭&尝试修复在奇奇怪怪权限的环境下嗅探CUDA目录导致异常的问题。 (#1994) 2025-08-04 02:01:03 +08:00
Takaranoao 1497727cb4 feat: add OpenVINO cache support and configuration options (#1992) 2025-08-03 13:07:29 +08:00
Takaranoao ee5e754346 chore: update OpenCvSharp4 package versions to 4.11.0.20250507 (#1991) 2025-08-03 13:07:17 +08:00
huiyadanli 1e72d68a13 Update version to 0.47.4-alpha.5 2025-08-02 18:21:55 +00:00
Takaranoao 556cb97e1d 调整官服退出重进参数,对高ping玩家好一点罢 (#1986) 2025-08-03 01:37:22 +08:00
躁动的氨气 dc59a3892d 增加JS保存文件支持 (#1990) 2025-08-03 01:33:47 +08:00
辉鸭蛋 404dd65f5e Update publish.yml 2025-08-03 01:19:38 +08:00
Takaranoao a868fd46be openvino 支持 (#1987) 2025-08-03 01:11:48 +08:00
huiyadanli ce4e679c0a Update version to 0.47.4-alpha.4 2025-08-02 17:04:01 +00:00
辉鸭蛋 f9a76cc1b9 Update publish.yml 2025-08-03 01:02:40 +08:00
huiyadanli 1b7b66fac2 Update version to 0.47.4-alpha.3 2025-08-02 14:15:26 +00:00
huiyadanli ace60f61b3 Update version to 0.47.4-alpha.2 2025-08-02 11:01:35 +00:00
辉鸭蛋 5d0cfb7819 修复大地图匹配不正常的问题 2025-08-02 18:59:22 +08:00
huiyadanli f9b9f9c6b4 Update version to 0.47.4-alpha.1 2025-08-02 09:59:30 +00:00
辉鸭蛋 5e491f1c6d 注释日志 2025-08-02 17:47:42 +08:00
kaedelcband辉鸭蛋 16b3fdd471 优化旋转寻找敌人逻辑/注释手动导入仓库功能 (#1982)
Co-authored-by: 辉鸭蛋 <[email protected]>
2025-08-02 17:33:15 +08:00
躁动的氨气 1add385e8a 小优化及新增脚本仓库桥接支持 (#1952) 2025-08-02 17:31:41 +08:00
辉鸭蛋 55667d2627 5.8角色模型 2025-08-02 15:14:46 +08:00
Takaranoao 6d9da4d15b feat: PaddleOcrV5 (#1966) 2025-08-02 14:51:07 +08:00
大头鱼 64dbd2a626 重构添加地图追踪任务页面的搜索功能,同时添加深度搜索功能。修复了搜索功能形同虚设,只能搜索最表面父文件夹的问题。 (#1980) 2025-08-02 14:48:19 +08:00
FishmanTheMurloc 46e40c633a Grid图标的模型准确率测试初稿,目前只炼了100多种物品;删去自动使用兑换码Panel中多余的内容 (#1973) 2025-08-02 14:47:34 +08:00
起个名字好难的喵 cec40c6c62 feat: 5.6-5.8新增传送点 (#1976) 2025-08-02 14:40:13 +08:00
kaedelcb ffa8d16fb4 优化自动秘境进入时序和异常处理逻辑 (#1979) 2025-08-02 14:37:13 +08:00
郝凯阳 b74e7c4131 auto tcg: update character card config to v5.8 (#1969) 2025-08-01 14:42:11 +08:00
huiyadanli 0613ba5f19 Update version to 0.47.3-alpha.2 2025-07-31 16:19:04 +00:00
辉鸭蛋 42fdbf814a 更新 BetterGI.Assets 包版本至 1.0.7,并修改地图匹配方法绑定 2025-08-01 00:17:13 +08:00
辉鸭蛋 885cb1723b 地图追踪的配置与缓存调整 2025-08-01 00:11:09 +08:00
辉鸭蛋 2293eb85f6 Merge remote-tracking branch 'origin/main' 2025-07-31 21:39:23 +08:00
辉鸭蛋 2f877ac4d1 地图切分 2025-07-31 21:39:15 +08:00
kaedelcb 9c23074cf4 禁用状态的最后检测动作/优化LOG和优化判断 (#1963) 2025-07-31 14:11:40 +08:00
zdAnQi bdfaf91be9 修复B服登录与重登陆 (#1965) 2025-07-31 14:10:41 +08:00
kaedelcb 1d49a0bd26 检测战斗结束增加旋转寻找敌人实验性功能 (#1960) 2025-07-31 01:04:05 +08:00
kaedelcb c5960fedec 修复万叶长E拾取判断的CD计算错误 (#1958) 2025-07-31 01:03:34 +08:00
辉鸭蛋 fd5fb8218b 5.8 地图生成 2025-07-31 00:45:39 +08:00
大头鱼 999169c944 优化PromptDialog对话框布局以支持用户自由调整窗口大小 (#1953) 2025-07-30 17:46:57 +08:00
辉鸭蛋 fff08ddf62 修复地图追踪中角色公转的场景,持续角度一直未在5度内时,直接强制等到转向到目标位置 #1644 2025-07-30 02:11:06 +08:00
辉鸭蛋 4802f3a524 距离过远的报错优化 2025-07-30 01:48:38 +08:00
辉鸭蛋 f783e57a6e 目标距离过远处理 2025-07-30 01:45:18 +08:00
辉鸭蛋 8a46f9dcd9 地图追踪json添加更多属性和配置 2025-07-30 01:06:57 +08:00
辉鸭蛋 0daa047dda chore: update BetterGI.Assets package version to 1.0.6 2025-07-30 00:02:21 +08:00
大头鱼 497e0c5d7b 1. 解决调度器为空时程序假死问题 (#1947) 2025-07-29 11:33:45 +08:00
kaedelcb 3262d9d56f 修复自动秘境点击地脉异常横幅识别问题 (#1939) 2025-07-28 13:40:15 +08:00
FishmanTheMurloc 120b80cb70 截取物品图标 实现使用星星作为名称后缀 (#1938) 2025-07-28 13:39:47 +08:00
huiyadanli 832958e794 Update version to 0.47.3-alpha.1 2025-07-27 12:47:51 +00:00
辉鸭蛋 cdc04f0a3b ++ 2025-07-27 20:42:33 +08:00
yusancky 7c171e3d53 修正 README 中钓鱼按键的格式化和专有词汇翻译问题 (#1937) 2025-07-27 20:31:43 +08:00
iris10086 36afc1f56c #1908 一键购买尘歌壶适配 (#1932) 2025-07-26 22:45:59 +08:00
mfkvfhpdx 20565f4328 调度器配置中增加执行成功任务跳过执行配置 (#1893) 2025-07-26 14:19:45 +08:00
辉鸭蛋 8d7b3a2301 Update README.md 2025-07-26 09:58:52 +08:00
辉鸭蛋 6ecab6266a 强制地图追踪版本要求 2025-07-26 00:16:52 +08:00
kaedelcb 89235457b1 修复地图追踪配置中获取材料名称的问题 (#1919) 2025-07-25 00:10:33 +08:00
Juemin Lin a52e3ebc7f 修复并发调用小地图识别时识别错误的Bug,修改并增加暴露给js的小地图识别函数 (#1911) 2025-07-25 00:10:33 +08:00
禹仔二号andzdAnQi 49a59d49f4 修复了webhook通知,修改了两个小报错 (#1918)
Co-authored-by: zdAnQi <[email protected]>
2025-07-25 00:10:32 +08:00
Arkadegong e4af63a525 调度器添加地图追踪文件时自动聚焦搜索框Update ScriptControlViewModel.cs (#1916) 2025-07-25 00:10:32 +08:00
zdAnQi af05f15072 添加本地仓库readme与txt获取接口 (#1915) 2025-07-25 00:10:32 +08:00
zdAnQi b872e973fe 父节点存在性检测 (#1897) 2025-07-25 00:10:32 +08:00
禹仔二号andzdAnQi 7925de3006 readme支持多语言,非简体中文文档添加discord链接 (#1898)
Co-authored-by: zdAnQi <[email protected]>
2025-07-25 00:10:32 +08:00
2bd2f96080 压缩提交
Revert "完成大部分内容本地化显示,重构部分页面 (#1913)"

This reverts commit 9e54b9da

Revert "紧急修正bug (#1917)"

This reverts commit 99f024ba96.

Revert "i18n: 千音雅集修正"

This reverts commit 82c7acb253.

i18n: 千音雅集修正

紧急修正bug (#1917)

Co-Authored-By: DR-lin-eng <@DR-lin-eng>
Co-Authored-By: yuzai <[email protected]>
2025-07-25 00:10:32 +08:00
Small_Ku fe7630e8f3 feat: Discord Webhook notification (#1903) 2025-07-22 13:59:12 +08:00
辉鸭蛋 0397a3f1a6 Merge remote-tracking branch 'origin/main' 2025-07-21 22:35:50 +08:00
辉鸭蛋 233b7e8a0f fix: 脚本仓库更新 2025-07-21 22:35:38 +08:00
Takaranoao 751777128d fix: update TextBox binding for repo URL read-only state (#1900) 2025-07-21 16:05:28 +08:00
秋云 178eaa47ec fix: 部分情况下简易策略报错并丢失 (#1899) 2025-07-21 01:48:03 +08:00
zdAnQiand辉鸭蛋 a0649d05db 脚本仓库配置文件订阅后更新 (#1896)
Co-authored-by: 辉鸭蛋 <[email protected]>
2025-07-20 23:10:03 +08:00
辉鸭蛋 559d88bb6c 可以选择当前的地图追踪方式 2025-07-20 22:59:14 +08:00
辉鸭蛋 4fa4ecc428 是否就近七天神像恢复血量、传送到七天神像之后是否需要移动后回血,两个选项将会默认不开启 @physligl 2025-07-20 21:28:00 +08:00
辉鸭蛋 0cec1aecfa 自动使用兑换码 (#1895) 2025-07-20 20:24:00 +08:00
辉鸭蛋 26d8c9863e Revert "添加 HTTP 服务器配置和服务 (#1873)" (#1892) 2025-07-20 12:39:59 +08:00
xoipz 562fa97679 给telegramNotifier添加代理功能支持 (#1890) 2025-07-20 00:17:54 +08:00
辉鸭蛋 cb4528215c 加入控制台日志输出 2025-07-19 00:01:06 +08:00
辉鸭蛋 7571ac9311 Merge remote-tracking branch 'origin/main' 2025-07-18 23:31:54 +08:00
辉鸭蛋 e3906cb19c 调整命名空间 2025-07-18 23:31:46 +08:00
huiyadanli e678ec5704 Update version to 0.47.2-alpha.3 2025-07-17 14:36:59 +00:00
辉鸭蛋 a75faaf083 Update publish.yml 2025-07-17 22:35:42 +08:00
huiyadanli 31e0dc9954 Update version to 0.47.2-alpha.2 2025-07-17 14:18:28 +00:00
辉鸭蛋 b967c2294e feat: add CNB release uploader workflow and script for automated asset uploads 2025-07-17 22:16:05 +08:00
mfkvfhpdx 36236dedfd 路径追踪支持通过目录中的control.json5文件来覆盖目录json配置。 (#1855) 2025-07-17 21:37:10 +08:00
秋云 231aae0185 fix: 修复部分情况下丢失简易策略 (#1870) 2025-07-17 15:10:03 +08:00
kaedelcb 4da21e5f7d 优化切换队伍点击队伍管理按键 (#1881) 2025-07-16 14:38:56 +08:00
辉鸭蛋 efea496727 纯英文不拾取,解决乐器误识别的问题 2025-07-15 01:33:16 +08:00
辉鸭蛋 0aa8e4f094 Merge remote-tracking branch 'origin/main' 2025-07-14 02:08:38 +08:00
辉鸭蛋 6305d7723e 地图追踪接口修改成多实例,JS调用的实例和地图追踪调用的实例不同 2025-07-14 02:07:56 +08:00
秋云 248c04e7d5 js: 暴露获取当前小地图角度和当前队伍角色的方法 (#1874) 2025-07-14 01:45:53 +08:00
辉鸭蛋 daa4aea7a8 添加 HTTP 服务器配置和服务 (#1873) 2025-07-14 00:58:24 +08:00
qwecxzpoi 900b6aec84 chore: 调度器 - 名称 - 添加鼠标悬浮显示文件夹。 (#1871) 2025-07-13 20:30:02 +08:00
kaedelcb 59b011e378 自动秘境换队改到秘境页面/原粹识别优化 (#1866) 2025-07-12 14:56:35 +08:00
kaedelcb 25b8cc1f42 尘歌壶选择进入方式UI和序号选择UI优化 (#1867) 2025-07-12 14:49:01 +08:00
c4420007a8 检查每日领取情况前点击委托 (#1865)
Co-authored-by: Copilot <[email protected]>
Co-authored-by: 辉鸭蛋 <[email protected]>
2025-07-12 14:48:08 +08:00
Takaranoaoand辉鸭蛋 021d1f937a 选中的更新渠道URL写入配置文件并允许从自定义URL更新脚本仓库 (#1864)
Co-authored-by: 辉鸭蛋 <[email protected]>
2025-07-12 14:32:28 +08:00
辉鸭蛋 54b2094abc chore: update BetterGI.Assets package version to 1.0.5 and add map_info.json to asset paths 2025-07-12 12:30:10 +08:00
kaedelcb ee26055728 修复配置组名称前半段有同名不显示的问题 (#1858) 2025-07-10 23:57:29 +08:00
huiyadanli ea145708c7 Update version to 0.47.2-alpha.1 2025-07-09 15:32:12 +00:00
FishmanTheMurloc d73f21464e 截取物品图标独立任务 (#1856) 2025-07-09 23:26:18 +08:00
Juemin Lin 0a5c8c169a 修复迷烟主成员非飞行状态下四叶印识别失败的Bug。模板匹配的置信度修改为数组。 (#1854) 2025-07-09 23:21:36 +08:00
zdAnQi 07c3a912c5 强化自动点击登录 (#1853) 2025-07-09 23:20:13 +08:00
辉鸭蛋 e23180327d Merge remote-tracking branch 'origin/main' 2025-07-09 23:16:36 +08:00
辉鸭蛋 f4caf02d96 更新 1.0.3 2025-07-09 23:16:04 +08:00
汐 48dedda779 Update SetTimeTask.cs (#1850) 2025-07-09 14:19:35 +08:00
辉鸭蛋 314ea68806 fixed #1791 2025-07-09 00:19:56 +08:00
kaedelcband辉鸭蛋 98c8e6bb72 NewRtry支持OCR/自动秘境优化进入适配限时双倍 (#1841)
Co-authored-by: 辉鸭蛋 <[email protected]>
2025-07-09 00:10:52 +08:00
秋云 c7f30477e4 feat: js支持搜索 (#1843) 2025-07-07 21:17:39 +08:00
mfkvfhpdx 05206b040b 对精英拾取增加更详细的文字说明 (#1844) 2025-07-07 21:17:18 +08:00
uye 5a5fbd584f fix: 规避 WPF 剪贴板卡顿,修复剪切不清除文本的问题 (#1839) 2025-07-06 17:45:44 +08:00
huiyadanli 1a623fbd09 Update version to 0.47.1-alpha.4 2025-07-06 09:36:45 +00:00
辉鸭蛋 2c78bbbfab feat: add CombatScenes and Avatar host types for enhanced script functionality 2025-07-06 17:12:16 +08:00
起个名字好难的喵 ed09c20078 fix: 降低飞行检测时间,自由落体后进入飞行再下落攻击 (#1837) 2025-07-06 13:00:50 +08:00
辉鸭蛋 38a7cfce0b 针对 #1797 新增的尘歌壶进入方式添加配置 2025-07-06 12:29:09 +08:00
hikali8and辉鸭蛋 1e18bbffb2 修复一条龙尘歌壶无法点击传送按钮 #1782 (#1783)
Co-authored-by: 辉鸭蛋 <[email protected]>
2025-07-06 11:56:41 +08:00
iris10086 b0e9c5491a 领取尘歌壶奖励优化 (#1797) 2025-07-06 11:18:18 +08:00
huiyadanli 192f1744fc Update version to 0.47.1-alpha.3 2025-07-05 16:28:41 +00:00
辉鸭蛋 69feef4c65 feat: implement FileAccessBridge for secure file operations 2025-07-06 00:17:40 +08:00
辉鸭蛋 118a649077 修复黑白名单的保存路径 2025-07-05 23:29:47 +08:00
辉鸭蛋 77a22c127d update fetch options to disable proxy during script repository updates #1822 2025-07-03 02:36:26 +08:00
辉鸭蛋 738e9bf5a4 fix: disable parallel processing in tensor selection for improved stability 2025-07-02 20:47:47 +08:00
mfkvfhpdx c83ba79d39 精英拾取增加限制 (#1821) 2025-07-02 20:28:10 +08:00
秋云and起个名字好难的喵 c657e16d4c fix: 荒泷一斗砍4刀 (#1818)
Co-authored-by: 起个名字好难的喵 <[email protected]>
2025-07-02 17:05:05 +08:00
Takaranoao 58cbc8d8ca telegram 通知现在可以支持图片啦 (#1816) 2025-07-02 11:40:59 +08:00
Takaranoao d2b389f0b1 修正OCR參數 (#1814) 2025-07-02 11:38:45 +08:00
huiyadanli c7f669984f Update version to 0.47.1-alpha.2 2025-07-01 16:12:21 +00:00
辉鸭蛋 ecb487628e feat: add right-click selection handling to ScriptsListView 2025-07-02 00:09:06 +08:00
辉鸭蛋 d9d0cbb830 fix: update BetterGI.Assets package version and correct font resource path 2025-07-02 00:04:47 +08:00
辉鸭蛋 a30f1078ad log: update log message for Teyvat map template loading 2025-07-01 23:24:56 +08:00
huiyadanli dcf4c7e6e2 Update version to 0.47.1-alpha.1 2025-07-01 15:02:40 +00:00
辉鸭蛋 25f6763e48 移动相关资源文件 2025-07-01 22:49:53 +08:00
Juemin Lin 2b9a4f111a 视角识别算法优化,启用新的视角识别,分层地图小修改,启用模板匹配分层地图 (#1787)
* 小地图预处理和视角识别算法优化

* 模板匹配的相关类,包括快速带遮罩的SqDiff模板匹配,模板匹配归一化类,简易亚像素模板匹配实现,小地图匹配相关配置,和小地图匹配上下文。

* 实现小地图的分层地图模板匹配,修改 SceneBaseMap 的 GetMiniMapPosition 为 virtual 以便继承覆盖。

* 优化视角识别算法, 消除图标对视角识别影响, 修正上次提交里HImg的范围错误(BGR2HLS_FULL模式下H的范围在0~255), 启用新的视角识别算法。

* 模板匹配分层地图小修改

* 启用模板匹配的分层地图
2025-07-01 01:50:27 +08:00
kaedelcb 3cf6543eee 模版匹配添加颜色遮罩 (#1804) 2025-07-01 01:49:58 +08:00
火山 ea970c29a9 Update MiningHandler.cs (#1802)
更正修复挖矿动作
2025-07-01 01:12:52 +08:00
火山 397c50e1a9 Update MiningHandler.cs (#1799)
优化挖矿动作
2025-06-30 18:48:17 +08:00
Takaranoao bb2dbac080 七胜召唤->七圣召唤 (#1795) 2025-06-30 12:41:58 +08:00
辉鸭蛋 4adb9ca7cd fix: add AutoStygianOnslaughtConfig to property change notifications 2025-06-30 01:53:53 +08:00
ddddng a1bf0a5222 延长换队失败的判断时间 (#1792) 2025-06-29 22:45:47 +08:00
huiyadanli 7eb3e6bfb4 Update version to 0.47.0 2025-06-29 14:19:36 +00:00
辉鸭蛋 41ba8f5271 Merge remote-tracking branch 'origin/main' 2025-06-29 22:17:44 +08:00
辉鸭蛋 ac9ff526f1 修复自动幽境危战完成后分解圣遗物的问题 2025-06-29 22:17:36 +08:00
Jamis 2e9eb7e331 优先使用诺艾尔作为大剑挖矿角色 (#1789) 2025-06-29 11:58:13 +08:00
huiyadanli fda35d5878 Update version to 0.46.3-alpha.4 2025-06-28 16:18:43 +00:00
辉鸭蛋 1a8f7f3dfc fix: update capture rectangle type to use ScaleMax1080PCaptureRect 2025-06-29 00:16:41 +08:00
辉鸭蛋 14366d17df fix: update hyperlink command for task initiation to point to Stygian Onslaught 2025-06-28 21:08:22 +08:00
huiyadanli 7605125972 Update version to 0.46.3-alpha.3 2025-06-28 12:24:53 +00:00
辉鸭蛋 94db5d16cc 自动幽境危战 (#1786)
* feat: add AutoStygianOnslaught task and configuration for resin usage management

* UI

* feat: enhance AutoStygianOnslaught task with improved detection and handling
2025-06-28 20:22:57 +08:00
YongKang Zhou 99d4f58df5 feat: 将自动秘境战斗失败复活次数从常量3修改为可更改的参数 (#1781)
* Disabled retry limit

* feat: Make reviveRetryCount as a editable variable in the config
2025-06-28 10:51:15 +08:00
huiyadanli 0a1e51fb74 Update version to 0.46.3-alpha.2 2025-06-28 02:44:50 +00:00
辉鸭蛋 6b1d64ad09 refactor: update black list handling and improve text processing logic 2025-06-28 00:15:22 +08:00
辉鸭蛋 3d8b8bb043 默认黑名单作为内置配置,用户黑白名单使用改用txt存储。配置可实时生效 2025-06-27 23:51:21 +08:00
辉鸭蛋 cce0ee23d1 优化自动秘境任务日志,调整树脂使用信息的输出 #1776 2025-06-27 20:23:12 +08:00
辉鸭蛋 90fdfcaa09 优化文字识别功能,使用新的文字区域检测方式减少CPU消耗 2025-06-27 20:23:11 +08:00
火山 72e2558747 Update pick_black_lists.json (#1779)
适配幽境危战js
2025-06-27 20:10:28 +08:00
秋云 c44fb6b62e fix: 优化传送点点击的逻辑,增加退出重登的延时 (#1773) 2025-06-27 00:38:13 +08:00
辉鸭蛋 80ef73cc51 脚本仓库更新添加进度条 2025-06-26 01:52:55 +08:00
辉鸭蛋 f83a673280 删除 “允许在jsScript脚本中使用此地图追踪配置” 和 “允许在此调度器中(一般在JS脚本中)调用自动战斗任务时,采用此追踪配置里的战斗策略” 配置。默认启用 2025-06-26 01:14:14 +08:00
辉鸭蛋 07517e518f 优化抽屉关闭后重新开启的体验 2025-06-26 01:04:23 +08:00
kaedelcband辉鸭蛋 fd46fe1917 一条龙页面添加自动秘境树脂选择弹窗 (#1767)
* 一条龙页面自动秘境树脂选择弹窗添加

* 一条龙页面自动秘境树脂选择弹窗添加

* 在自动使用树脂的设置下,不展示指定树脂的内容

---------

Co-authored-by: 辉鸭蛋 <[email protected]>
2025-06-26 00:24:41 +08:00
火山 04d81ce3e1 Update pick_black_lists.json (#1770)
增加「幽境危战」、煎饪
两个高频误触词
2025-06-25 23:54:44 +08:00
kaedelcb 79c6d44e02 根据文件夹删除任务优化 (#1763)
* 根据文件夹删除任务优化

* 不调用删除函数,直接remove
2025-06-25 00:41:25 +08:00
辉鸭蛋 0055b107d4 Merge remote-tracking branch 'origin/main' 2025-06-24 23:34:46 +08:00
辉鸭蛋 202366c675 内嵌 VC++ 运行库 14.44.35208.0
https://github.com/babalae/bettergi-libraries
2025-06-24 23:34:38 +08:00
Juemin Lin 4b5f229006 分层地图的模板匹配坐标识别以及相机视角识别优化和小地图预处理 (#1730)
* 小地图预处理和视角识别算法优化

* 模板匹配的相关类,包括快速带遮罩的SqDiff模板匹配,模板匹配归一化类,简易亚像素模板匹配实现,小地图匹配相关配置,和小地图匹配上下文。

* 实现小地图的分层地图模板匹配,修改 SceneBaseMap 的 GetMiniMapPosition 为 virtual 以便继承覆盖。
2025-06-24 10:39:16 +08:00
kaedelcb bfb09c2a98 一条龙尘歌壶进入添加重试/UI微调/一条龙快捷键修复 #1750 #1752 (#1756)
* 一条龙尘歌壶进入添加重试

* 主页左侧菜单UI微调,修复设置按键超框问题

* 一条龙页面UI微调

* 一条龙快捷键修复

* 尘歌壶购买周期调整为凌晨4点到次日凌晨3点59
2025-06-24 10:37:02 +08:00
秋云 80a490fc0e 缩短换队失败的判断时间 (#1755) 2025-06-23 23:33:43 +08:00
huiyadanli b58f304bd5 Update version to 0.46.3-alpha.1 2025-06-22 19:04:12 +00:00
辉鸭蛋 95ccb463ab fix repository path ' ' is not owned by current user #1746
git config --global --add safe.directory *
2025-06-23 03:02:07 +08:00
辉鸭蛋 1710f62312 feat: add GNU General Public License v3 to the repository model 2025-06-23 00:51:51 +08:00
辉鸭蛋 5abe5f4976 feat: refactor website launch to use dedicated method with versioning 2025-06-22 23:43:27 +08:00
huiyadanli e65c57c486 Update version to 0.46.2 2025-06-22 15:03:17 +00:00
辉鸭蛋 8f2484f336 脚本仓库更新失败时候弹窗 2025-06-22 22:56:37 +08:00
辉鸭蛋 30a774233a fix: 打完秘境后的提示可以直接退出 2025-06-22 22:00:38 +08:00
辉鸭蛋 b97bbd0eee Merge remote-tracking branch 'origin/main' 2025-06-22 21:55:42 +08:00
辉鸭蛋 5e9b78eb55 还原进入秘境的代码 2025-06-22 21:55:33 +08:00
huiyadanli a35fecf579 Update version to 0.46.1-alpha.1 2025-06-22 13:26:21 +00:00
辉鸭蛋 3ca0eb27e3 在无其他树脂,只剩原粹树脂的场景下,利用提示兜底退出秘境 2025-06-22 21:22:58 +08:00
辉鸭蛋 f4fdef9720 Merge remote-tracking branch 'origin/main' 2025-06-22 21:01:36 +08:00
辉鸭蛋 08fbd772b7 修复2K下树脂使用失效的问题,修复无可用树脂的场景 2025-06-22 21:01:28 +08:00
xyToki f937726f86 fix: fix mirrorc 2025-06-22 18:38:00 +08:00
xyToki a7aa62f433 fix: mirrorc release ci 2025-06-22 18:35:46 +08:00
xyToki 0c687840f9 fix: fix mirrorc upload 2025-06-22 18:28:56 +08:00
huiyadanli 36d53a6cb3 Update version to 0.46.0 2025-06-22 09:56:58 +00:00
辉鸭蛋 5e242f2be3 还是水龙王问题,随便点击下 2025-06-22 16:39:06 +08:00
xyToki e0aa5f0821 ci: update mirrorc release pipeline 2025-06-22 16:18:17 +08:00
huiyadanli 64c9f717aa Update version to 0.45.6-alpha.3 2025-06-22 06:58:27 +00:00
辉鸭蛋 f08a53c7cd ci: version for run_name 2025-06-22 14:56:24 +08:00
huiyadanli 1a1141feaa Update version to 0.45.6-alpha.2 2025-06-22 06:12:41 +00:00
辉鸭蛋 b56003fa87 Merge remote-tracking branch 'origin/main' 2025-06-22 13:34:31 +08:00
辉鸭蛋 3b3ac00097 处理刷取次数过多的情况 2025-06-22 13:34:23 +08:00
huiyadanli 82be4d4555 Update version to 0.45.6-alpha.1 2025-06-21 18:34:27 +00:00
辉鸭蛋 8799f34ce8 修复 Yap 无法正常使用的问题 #1459 2025-06-22 02:31:37 +08:00
辉鸭蛋 9284a51ce6 自动秘境支持指定树脂刷取次数 #1440 #1116 #692 #426 2025-06-22 02:15:36 +08:00
xytoki 269869e9d8 Update version to 0.45.5-alpha.10 2025-06-21 15:27:35 +00:00
xyToki 65b5b80a47 ci: fix mirrorc un7z parent folder 2025-06-21 23:25:37 +08:00
xytoki 98ab2089c2 Update version to 0.45.5-alpha.9 2025-06-21 15:04:00 +00:00
xyToki 13a47e64b8 ci: always pass zip to mirrorc 2025-06-21 23:02:04 +08:00
xytoki 71ea62beb6 Update version to 0.45.5-alpha.8 2025-06-21 14:43:16 +00:00
xyToki bc6c0ed3d0 feat(ci): extract metadata from installer 2025-06-21 22:41:26 +08:00
xyToki bd2070b94c ci: fix mirrorc upload exe fail 2025-06-21 22:36:28 +08:00
xytoki 3ed6a04caa Update version to 0.45.5-alpha.7 2025-06-21 14:25:11 +00:00
辉鸭蛋 e7073e5d8a Merge remote-tracking branch 'origin/main' 2025-06-21 22:10:52 +08:00
辉鸭蛋 64b1fa2c2d fix: 七圣召唤元数据加载失败的问题 2025-06-21 22:10:29 +08:00
huiyadanli 93c994570e Update version to 0.45.5-alpha.6 2025-06-21 13:51:28 +00:00
xyToki 255e7bb08e ci: embed dotnet to mirrorc exe 2025-06-21 21:48:51 +08:00
辉鸭蛋 0bb23b9fcc Revert "优化交互界面。 (#1681)" (#1728)
This reverts commit 236c725710.
2025-06-21 21:44:55 +08:00
辉鸭蛋 c04d47f7a7 Merge remote-tracking branch 'origin/main' 2025-06-21 21:40:01 +08:00
辉鸭蛋 0c467d2f97 修复原粹树脂的识别 2025-06-21 21:39:50 +08:00
mfkvfhpdx d2092a6c32 路径追踪增加拾取战斗人次阈值 (#1726)
* 修改调度器任务和部分独立任务失去焦点时,强制切换回游戏窗口,如果用常规的方式无法激活窗口,则第10次会尝试最小化所有窗口后激活游戏。

* 去除未引入的类引用

* 修正战斗结束后,大概率打开队伍界面的问题

* 修复有些电脑上因未知原因,战斗0秒打断

* 把失焦激活放入了设置-通用设置-其他设置中,默认关闭。暂停恢复时,重置移动的起始时间,防止因暂停而导致超时放弃任务。

* 在调度器里面的任务之前,增加月卡处理,解决4点如果未进入任务会卡住的问题。增加了日志分析小怪详细。解决日志分析兜底结束日期不生效的问题。

* 在设置=》其他设置中 增加调度器任务传送过程中自动领取探索奖励功能配置。

* 调整自动派遣后恢复原任务的逻辑

* 自动领取派遣奖励时,跳过异常,防止整个配置组任务被打断。

* 把打开大地图方法从TpTask中抽出为公共方法,自动领取派遣代码调整到了调度器中。

* 去除了未使用的引用

* 暂停恢复逻辑增加恢复中条件和非空判断

* 增加了临时暂停自动拾取的逻辑(RunnerContext.AutoPickTriggerStopCount 为0时不限制,大于0时停止,多次暂停会累加该值,每次恢复-1),支持嵌套情况的暂停,在自动派遣(和结束后5秒)或暂停调度器任务时,同时暂停自动拾取功能。

* 调整暂停拾取方法

* 调整个日志输出

* 路径追踪复苏时,暂停拾取

* 增加根据点位配置,支持能在点位未识别情况下,使用大地图中心点的方式来定位,从而支持像铜锁小岛处这种小地图无法识别的点位。调整了对未识别点位的默认逻辑,未配置点位配置情况下,未识别点位,会取上一个识别的点位,从而支持在某些地方断续小地图能识别情况下的脚本。

* Changes

* 修复暂停后,距离过远,小地图无法识别时,无限取当前一个坐标,导致无法正常恢复的问题。调度器管理增加了按天为单位的周期配置,适用于批量执行时,无需人工判断当天执行哪个任务。

* 调度器配置增加,或开启万叶拾取,并且不存在万叶,但配置了万叶队伍情况下,会切换队伍进行拾取。

* 调度器配置,增加了  只拾取精英掉落模式 ,根据编辑器点位配置,可设定非标记精英或传奇的点位跳过拾取。

* 解决卡换成复活形式的任务卡死

* 判断主界面时,复活界面返回false

* 完全跳过的配置组,不发送通知。给周期配置增加说明。

* 启动参数增加 --no-single ,允许多开,实现特殊需求(重启需要)。增加了一个重启bgi的方法。增加了任务进度的功能,执行调度器任务时,会记录当前任务执行位置,当关闭后(比如F11),下次可以通过继续菜单,选择记录,从上次关闭任务处执行。

* 调整继续执行,最后一次成功的下一个任务执行

* 设置,其他设置,增加了调度器任务,遇到异常时,连续累计一定次数时,重启BGI,和可配置的重启游戏。

* 连续任务支持循环,右键支持从连续的某一个任务开始执行。修改了一些配置变量的写法,使之不会保存到json文件中。

* 修正一条龙,下一个从此执行失效的问题

* 路径追踪增加拾取战斗人次阈值 ,用于配置,战斗次数小于一定次数,会跳过拾取配置,默认不生效。
2025-06-21 11:07:42 +08:00
huiyadanli 3a635524c4 Update version to 0.45.5-alpha.5 2025-06-21 02:23:30 +00:00
辉鸭蛋 5cb032b851 Merge remote-tracking branch 'origin/main' 2025-06-21 10:21:42 +08:00
辉鸭蛋 795c089100 自动秘境:解决水龙王按下左键后没松开,然后后续点击按下就没反应了。使用双击 2025-06-21 10:21:22 +08:00
huiyadanli e81676847c Update version to 0.45.5-alpha.4 2025-06-21 02:20:33 +00:00
辉鸭蛋 d44eaa5312 自动秘境:战斗结束后释放所有按键 2025-06-21 10:18:28 +08:00
辉鸭蛋 008c1b2e03 Merge remote-tracking branch 'origin/main' 2025-06-21 10:16:00 +08:00
辉鸭蛋 26590f7268 自动秘境:解决水龙王按下左键后没松开,然后后续点击按下就没反应了 2025-06-21 10:15:46 +08:00
huiyadanli 909e29f268 Update version to 0.45.5-alpha.3 2025-06-21 01:38:37 +00:00
辉鸭蛋 1ae0db15d3 5.7 model 2025-06-21 09:35:34 +08:00
辉鸭蛋 a520ee8785 修复离线仓库导入不可用的问题 2025-06-21 01:40:00 +08:00
辉鸭蛋 f386b743c3 自动秘境:只剩下原粹树脂,且被刷完的场景 2025-06-21 01:13:03 +08:00
huiyadanli 3575a7274e Update version to 0.45.5-alpha.2 2025-06-20 15:49:38 +00:00
辉鸭蛋 a60229cad2 Update updater command options for stable and alpha channels 2025-06-20 23:47:06 +08:00
huiyadanli 26456bb5ee Update version to 0.45.5-alpha.1 2025-06-20 15:10:28 +00:00
辉鸭蛋 7a41056fc1 适配 5.7 秘境领取奖励 (#1725)
* Improve error message for update failure in ScriptRepoWindow

* 临时提交

* 完成浓缩树脂、原粹树脂的使用兼容
2025-06-20 23:04:46 +08:00
FishmanTheMurloc 32f744538b 用CV的相位相关方法代替旧的方法来检测grid界面是否还能滚动,配有单元测试;封装了一个grid界面的操作类,直接对此类对象进行遍历即可获取所有项 (#1724) 2025-06-20 22:56:21 +08:00
辉鸭蛋 937c86927c 去除轮次判断 2025-06-20 20:55:34 +08:00
huiyadanli abbdfdb710 Update version to 0.45.4-alpha.3 2025-06-20 08:46:36 +00:00
辉鸭蛋 39c1a3155f Update kachina.config.json 2025-06-20 16:15:24 +08:00
huiyadanli 384e05d493 Update version to 0.45.4-alpha.2 2025-06-20 03:35:15 +00:00
kaedelcb e5cc8152f6 尘歌壶进入优化,购买添加重试 (#1722) 2025-06-20 00:34:47 +08:00
辉鸭蛋 01225eda26 Merge remote-tracking branch 'origin/main' 2025-06-19 22:59:19 +08:00
辉鸭蛋 aa43c16d81 5.7 model 2025-06-19 22:59:09 +08:00
辉鸭蛋 a372c93de9 Update README.md 2025-06-19 10:43:57 +08:00
辉鸭蛋 712630acc3 Merge remote-tracking branch 'origin/main' 2025-06-19 00:30:01 +08:00
辉鸭蛋 d7e0af3a57 5.7 角色数据新增 Add new characters Skirk and Dahlia to combat_avatar.json 2025-06-19 00:29:27 +08:00
辉鸭蛋 3408b948b0 5.7 角色数据新增 Add new characters Skirk and Dahlia to combat_avatar.json 2025-06-19 00:12:01 +08:00
郝凯阳 f6540c8e59 auto tcg: update character card config to v5.7 (#1713) 2025-06-18 16:13:53 +08:00
huiyadanli d091bfe7d5 Update version to 0.45.4-alpha.1 2025-06-16 19:17:22 +00:00
辉鸭蛋 6f87a0c4d0 脚本仓库V2 (#1707)
* feat: add custom drawer control and integrate it into the UI

* 更新仓库UI

* feat: implement Git-based repository update mechanism and improve error handling

* feat: add reset repository functionality with confirmation dialog

* 修改打开队伍配置界面的重试次数和日志

* feat: add drawer open/close events and improve drawer closing logic

* feat: enhance WebpagePanel navigation handling and improve initialization logic

* feat: add drawer opened event handling and improve navigation completion logic

* feat: implement dynamic height adjustment for WebpagePanel using Grid container

* feat: update drawer dimensions and apply dynamic sizing based on position

* feat: add CustomDrawer component and integrate with MapPathingViewModel for enhanced navigation

* feat: integrate WebView2 for Markdown file navigation in MapPathingViewModel
2025-06-17 03:13:56 +08:00
FishmanTheMurloc 4787f4f2f9 尝试复现RodNet的训练结果 (#1688)
* 增加RodNet必须支持训练的单元测试;RodNet的torch链路改造成全张量计算,由此把之前忽略的参数dz、h_coeff、offset变得可学习

* 了解到损失函数CrossEntropyLoss内置了softmax,因此从forward方法中移出;offset是手动指定的偏置值,不是学习得到的,因此也移出到单独的PostProcess方法中

* 根据得到的源码整理RodNet;新增在数据集上达到一定准确率的单元测试
2025-06-14 20:03:14 +08:00
Takaranoao dca965e5f0 try to fix IndexOutOfRangeException (#1699) 2025-06-14 14:40:22 +08:00
辉鸭蛋 1d520dc781 Update kachina.config.json 2025-06-14 13:36:04 +08:00
秋云 56d12df1bc add: WaitForElementAppear and WaitForElementDisappear (#1698)
fix: ExitAndRelogin failed in some situation
2025-06-14 10:49:23 +08:00
辉鸭蛋 5bacc495c0 Update mirrorchyan_uploading.yml 2025-06-14 00:54:36 +08:00
辉鸭蛋 9b8aa9e12b Update publish.yml 2025-06-14 00:54:13 +08:00
辉鸭蛋 9664e67d6c Update mirrorchyan_uploading.yml 2025-06-14 00:52:21 +08:00
Uqbc9and辉鸭蛋 368fc6eca6 feat: 支持角色个性化战斗宏优先级设置 (#1669)
* feat: 支持角色个性化战斗宏优先级设置

- 新增角色级别的宏优先级配置(MacroPriority)
- 支持每个角色独立设置使用的宏编号(1-5)
- 优化宏优先级验证和回退逻辑
- 更新UI说明文本和所有角色配置

* feat: update macro settings UI for personalized combat macro numbering

---------

Co-authored-by: 辉鸭蛋 <[email protected]>
2025-06-08 17:47:11 +08:00
Patrick-Ze bea9164c2b 将路径追踪相关的日志改为debug级别 (#1645) (#1684) 2025-06-07 22:13:57 +08:00
Zhicheng Zhang 236c725710 优化交互界面。 (#1681) 2025-06-06 15:14:23 +08:00
Zhicheng Zhang 3012b6de46 将每天的定义更改4点后,优化交互界面。 (#1680) 2025-06-06 11:17:14 +08:00
Zhicheng Zhang 112f49c7d8 将每天的定义更改4点后。 (#1675) 2025-06-04 12:26:24 +08:00
mfkvfhpdx 6d1f3d832e 修正一条龙,下一个从此执行失效的问题 (#1674)
* 修改调度器任务和部分独立任务失去焦点时,强制切换回游戏窗口,如果用常规的方式无法激活窗口,则第10次会尝试最小化所有窗口后激活游戏。

* 去除未引入的类引用

* 修正战斗结束后,大概率打开队伍界面的问题

* 修复有些电脑上因未知原因,战斗0秒打断

* 把失焦激活放入了设置-通用设置-其他设置中,默认关闭。暂停恢复时,重置移动的起始时间,防止因暂停而导致超时放弃任务。

* 在调度器里面的任务之前,增加月卡处理,解决4点如果未进入任务会卡住的问题。增加了日志分析小怪详细。解决日志分析兜底结束日期不生效的问题。

* 在设置=》其他设置中 增加调度器任务传送过程中自动领取探索奖励功能配置。

* 调整自动派遣后恢复原任务的逻辑

* 自动领取派遣奖励时,跳过异常,防止整个配置组任务被打断。

* 把打开大地图方法从TpTask中抽出为公共方法,自动领取派遣代码调整到了调度器中。

* 去除了未使用的引用

* 暂停恢复逻辑增加恢复中条件和非空判断

* 增加了临时暂停自动拾取的逻辑(RunnerContext.AutoPickTriggerStopCount 为0时不限制,大于0时停止,多次暂停会累加该值,每次恢复-1),支持嵌套情况的暂停,在自动派遣(和结束后5秒)或暂停调度器任务时,同时暂停自动拾取功能。

* 调整暂停拾取方法

* 调整个日志输出

* 路径追踪复苏时,暂停拾取

* 增加根据点位配置,支持能在点位未识别情况下,使用大地图中心点的方式来定位,从而支持像铜锁小岛处这种小地图无法识别的点位。调整了对未识别点位的默认逻辑,未配置点位配置情况下,未识别点位,会取上一个识别的点位,从而支持在某些地方断续小地图能识别情况下的脚本。

* Changes

* 修复暂停后,距离过远,小地图无法识别时,无限取当前一个坐标,导致无法正常恢复的问题。调度器管理增加了按天为单位的周期配置,适用于批量执行时,无需人工判断当天执行哪个任务。

* 调度器配置增加,或开启万叶拾取,并且不存在万叶,但配置了万叶队伍情况下,会切换队伍进行拾取。

* 调度器配置,增加了  只拾取精英掉落模式 ,根据编辑器点位配置,可设定非标记精英或传奇的点位跳过拾取。

* 解决卡换成复活形式的任务卡死

* 判断主界面时,复活界面返回false

* 完全跳过的配置组,不发送通知。给周期配置增加说明。

* 启动参数增加 --no-single ,允许多开,实现特殊需求(重启需要)。增加了一个重启bgi的方法。增加了任务进度的功能,执行调度器任务时,会记录当前任务执行位置,当关闭后(比如F11),下次可以通过继续菜单,选择记录,从上次关闭任务处执行。

* 调整继续执行,最后一次成功的下一个任务执行

* 设置,其他设置,增加了调度器任务,遇到异常时,连续累计一定次数时,重启BGI,和可配置的重启游戏。

* 连续任务支持循环,右键支持从连续的某一个任务开始执行。修改了一些配置变量的写法,使之不会保存到json文件中。

* 修正一条龙,下一个从此执行失效的问题
2025-06-04 00:03:31 +08:00
辉鸭蛋 3a754632f8 延长塞西莉亚苗圃的行走时间 #1620
TODO 建议添加行走并遇到F结束的接口
2025-06-02 00:21:01 +08:00
huiyadanli 0ee13aded4 Update version to 0.45.3-alpha.1 2025-06-01 16:08:01 +00:00
辉鸭蛋 e4e6953949 Mirror酱集成 (#1666)
* 更多更新渠道的UI改造

* CDK存储逻辑

* feat: enhance CDK input dialog with left button and update check logic for Alpha channel

* 支持修改cdk

* 支持删除cdk
2025-06-02 00:03:44 +08:00
mfkvfhpdx 468a54e037 执行调度器任务增加继续执行功能 (#1658)
* 完全跳过的配置组,不发送通知。给周期配置增加说明。

* 启动参数增加 --no-single ,允许多开,实现特殊需求(重启需要)。增加了一个重启bgi的方法。增加了任务进度的功能,执行调度器任务时,会记录当前任务执行位置,当关闭后(比如F11),下次可以通过继续菜单,选择记录,从上次关闭任务处执行。

* 调整继续执行,最后一次成功的下一个任务执行

* 设置,其他设置,增加了调度器任务,遇到异常时,连续累计一定次数时,重启BGI,和可配置的重启游戏。

* 连续任务支持循环,右键支持从连续的某一个任务开始执行。修改了一些配置变量的写法,使之不会保存到json文件中。
2025-06-02 00:03:26 +08:00
Patrick-Ze bb0709229f fix: 修复AutoPathing下的非顶层文件夹不显示图标的问题 (#1665) 2025-06-01 22:29:52 +08:00
FishmanTheMurloc 0c02808626 使用TorchSharp重写RodNet,以利后续优化 (#1613)
* 使用TorchSharp重写RodNet,以利后续优化

* 增加一个外部torch加载配置来代替直接的依赖,如配置不生效则使用原先手搓的算法

* BgiOnnxFactory取消单例,改为在App服务类中注册为单例,由此修复了一堆单元测试

* BgiOnnxFactory中几个静态方法改为成员方法以和App解耦;因不再有多个mat源供消耗,FishBite中文字块算法不再改动传入的mat,使得后续串联的算法不受其影响

* 将BehavioursTests中临时的配置读取方式改为读取主项目编译环境中的json文件;新建单元测试的README

* 将RodNet算法更新到 https://github.com/myHuTao-qwq/HutaoFisher/commit/010006a44c6b773d564c4dc3e970176fd3707e6d 的版本;RodNet中关于torch库推理和直接数学计算的校验移至单元测试

* 更新RodNet算法至最新:https://github.com/myHuTao-qwq/HutaoFisher/commit/add567273185a28c91044d08a08a4117ad5f2a4e

* 注释调试用的代码
2025-06-01 15:16:54 +08:00
辉鸭蛋 eae02d6c13 feat: add update check functionality and enhance update options in UI 2025-06-01 01:31:04 +08:00
辉鸭蛋 467fd6d911 灰度更新推送逻辑 2025-06-01 00:18:52 +08:00
辉鸭蛋 57914bb661 强制指定包版本,解决Rider项目标红的问题 2025-05-31 23:55:14 +08:00
辉鸭蛋 119c294f01 fix: enhance RunTask method to support nullable CancellationToken and add linked cancellation token functionality 2025-05-31 23:33:56 +08:00
辉鸭蛋 2f148e06bf fix: update RunTask method to support nullable CancellationTokenSource and add linked cancellation token methods 2025-05-31 23:23:23 +08:00
辉鸭蛋 48045aec2a 修复合成台打开后,等待时间过短导致合成失败的问题 BV1Sfj9z8ESG 2025-05-29 22:47:44 +08:00
辉鸭蛋 5fbd2e700b #1628 删除日志 2025-05-28 23:47:30 +08:00
起个名字好难的喵 9db31c8d45 fix: 挖矿移除卡齐娜,调整大剑挖矿攻击时间 (#1640) 2025-05-27 14:33:01 +08:00
起个名字好难的喵 0cfa46bd9a fix: 大剑挖矿 (#1633)
* fix: 大剑挖矿

* feat: 挖矿e(hold)CD等待
2025-05-26 16:19:29 +08:00
Scarlet 9c458c2443 feat: chasca slower charging aim (#1630) 2025-05-25 22:03:47 +08:00
Scarlet 59bcd1dc9e 优化自动钓鱼拉条时游标弹出目标区间的情形 (#1628)
* feat: autofishing remove abnormal detection

* revert logic change
2025-05-25 21:44:35 +08:00
mfkvfhpdx d3eed426de 解决判断主界面时,卡复活界面的问题 (#1625)
* 修改调度器任务和部分独立任务失去焦点时,强制切换回游戏窗口,如果用常规的方式无法激活窗口,则第10次会尝试最小化所有窗口后激活游戏。

* 去除未引入的类引用

* 修正战斗结束后,大概率打开队伍界面的问题

* 修复有些电脑上因未知原因,战斗0秒打断

* 把失焦激活放入了设置-通用设置-其他设置中,默认关闭。暂停恢复时,重置移动的起始时间,防止因暂停而导致超时放弃任务。

* 在调度器里面的任务之前,增加月卡处理,解决4点如果未进入任务会卡住的问题。增加了日志分析小怪详细。解决日志分析兜底结束日期不生效的问题。

* 在设置=》其他设置中 增加调度器任务传送过程中自动领取探索奖励功能配置。

* 调整自动派遣后恢复原任务的逻辑

* 自动领取派遣奖励时,跳过异常,防止整个配置组任务被打断。

* 把打开大地图方法从TpTask中抽出为公共方法,自动领取派遣代码调整到了调度器中。

* 去除了未使用的引用

* 暂停恢复逻辑增加恢复中条件和非空判断

* 增加了临时暂停自动拾取的逻辑(RunnerContext.AutoPickTriggerStopCount 为0时不限制,大于0时停止,多次暂停会累加该值,每次恢复-1),支持嵌套情况的暂停,在自动派遣(和结束后5秒)或暂停调度器任务时,同时暂停自动拾取功能。

* 调整暂停拾取方法

* 调整个日志输出

* 路径追踪复苏时,暂停拾取

* 增加根据点位配置,支持能在点位未识别情况下,使用大地图中心点的方式来定位,从而支持像铜锁小岛处这种小地图无法识别的点位。调整了对未识别点位的默认逻辑,未配置点位配置情况下,未识别点位,会取上一个识别的点位,从而支持在某些地方断续小地图能识别情况下的脚本。

* Changes

* 修复暂停后,距离过远,小地图无法识别时,无限取当前一个坐标,导致无法正常恢复的问题。调度器管理增加了按天为单位的周期配置,适用于批量执行时,无需人工判断当天执行哪个任务。

* 调度器配置增加,或开启万叶拾取,并且不存在万叶,但配置了万叶队伍情况下,会切换队伍进行拾取。

* 调度器配置,增加了  只拾取精英掉落模式 ,根据编辑器点位配置,可设定非标记精英或传奇的点位跳过拾取。

* 解决卡换成复活形式的任务卡死

* 判断主界面时,复活界面返回false

* 完全跳过的配置组,不发送通知。给周期配置增加说明。
2025-05-24 11:17:37 +08:00
mfkvfhpdx 225f78b769 战斗后拾取支持根据点位标记是否精英,自动关闭拾取 (#1616)
* 修改调度器任务和部分独立任务失去焦点时,强制切换回游戏窗口,如果用常规的方式无法激活窗口,则第10次会尝试最小化所有窗口后激活游戏。

* 去除未引入的类引用

* 修正战斗结束后,大概率打开队伍界面的问题

* 修复有些电脑上因未知原因,战斗0秒打断

* 把失焦激活放入了设置-通用设置-其他设置中,默认关闭。暂停恢复时,重置移动的起始时间,防止因暂停而导致超时放弃任务。

* 在调度器里面的任务之前,增加月卡处理,解决4点如果未进入任务会卡住的问题。增加了日志分析小怪详细。解决日志分析兜底结束日期不生效的问题。

* 在设置=》其他设置中 增加调度器任务传送过程中自动领取探索奖励功能配置。

* 调整自动派遣后恢复原任务的逻辑

* 自动领取派遣奖励时,跳过异常,防止整个配置组任务被打断。

* 把打开大地图方法从TpTask中抽出为公共方法,自动领取派遣代码调整到了调度器中。

* 去除了未使用的引用

* 暂停恢复逻辑增加恢复中条件和非空判断

* 增加了临时暂停自动拾取的逻辑(RunnerContext.AutoPickTriggerStopCount 为0时不限制,大于0时停止,多次暂停会累加该值,每次恢复-1),支持嵌套情况的暂停,在自动派遣(和结束后5秒)或暂停调度器任务时,同时暂停自动拾取功能。

* 调整暂停拾取方法

* 调整个日志输出

* 路径追踪复苏时,暂停拾取

* 增加根据点位配置,支持能在点位未识别情况下,使用大地图中心点的方式来定位,从而支持像铜锁小岛处这种小地图无法识别的点位。调整了对未识别点位的默认逻辑,未配置点位配置情况下,未识别点位,会取上一个识别的点位,从而支持在某些地方断续小地图能识别情况下的脚本。

* Changes

* 修复暂停后,距离过远,小地图无法识别时,无限取当前一个坐标,导致无法正常恢复的问题。调度器管理增加了按天为单位的周期配置,适用于批量执行时,无需人工判断当天执行哪个任务。

* 调度器配置增加,或开启万叶拾取,并且不存在万叶,但配置了万叶队伍情况下,会切换队伍进行拾取。

* 调度器配置,增加了  只拾取精英掉落模式 ,根据编辑器点位配置,可设定非标记精英或传奇的点位跳过拾取。
2025-05-19 23:32:22 +08:00
kaedelcb 1790a640d2 任务列表自动保存,尘歌壶购买优化 (#1615) 2025-05-19 21:05:20 +08:00
辉鸭蛋 0bd8ab02d2 解决 System.Drawing.Common 包版本冲突 2025-05-18 16:31:12 +08:00
Qian23333 dfc33391b1 修复自动秘境的文案错误 (#1607) 2025-05-18 13:02:17 +08:00
stiffmeandjackshan23 60c0f0e26f 修复bark notification group和sound配置不生效的问题 (#1605)
Co-authored-by: jackshan23 <[email protected]>
2025-05-17 11:27:32 +08:00
辉鸭蛋 c5a92752cf Update README.md 2025-05-17 11:27:01 +08:00
辉鸭蛋 ac7b68eb8e Update README.md 2025-05-17 11:25:17 +08:00
Zhicheng Zhang 8eca558134 修复一个命令行启动的bug。 (#1600)
* fix a bug in cli run

* update README.md with full build method
2025-05-17 11:22:31 +08:00
Shatyuka 8b6548fb40 修复Win10下WGC截图COM错误 (#1601) 2025-05-16 10:02:42 +08:00
Zhicheng Zhang 2ab54e50c0 支持在命令行启动一条龙参数时选择配置,配置找不到就用界面指定的。 (#1586)
* 优化命令行一条龙,支持选择配置。

BetterGI.exe startOneDragon <一条龙配置名称>
BetterGI.exe --startOneDragon <一条龙配置名称>

* 优化其它命令行启动逻辑。
2025-05-15 00:33:09 +08:00
Zhicheng Zhang 2d6d7a1479 enable build on forked repo (#1597) 2025-05-15 00:24:41 +08:00
kaedelcb 620331b16b 一条龙列表和尘歌壶购买优化 (#1587)
* 尘歌壶购买修改选择最大数方法

* 一条龙列表允许多选添加
2025-05-15 00:23:34 +08:00
mfkvfhpdx 823f4c6882 修复暂停后恢复异常bug。调度器设置增加周期配置。 (#1590)
* 修改调度器任务和部分独立任务失去焦点时,强制切换回游戏窗口,如果用常规的方式无法激活窗口,则第10次会尝试最小化所有窗口后激活游戏。

* 去除未引入的类引用

* 修正战斗结束后,大概率打开队伍界面的问题

* 修复有些电脑上因未知原因,战斗0秒打断

* 把失焦激活放入了设置-通用设置-其他设置中,默认关闭。暂停恢复时,重置移动的起始时间,防止因暂停而导致超时放弃任务。

* 在调度器里面的任务之前,增加月卡处理,解决4点如果未进入任务会卡住的问题。增加了日志分析小怪详细。解决日志分析兜底结束日期不生效的问题。

* 在设置=》其他设置中 增加调度器任务传送过程中自动领取探索奖励功能配置。

* 调整自动派遣后恢复原任务的逻辑

* 自动领取派遣奖励时,跳过异常,防止整个配置组任务被打断。

* 把打开大地图方法从TpTask中抽出为公共方法,自动领取派遣代码调整到了调度器中。

* 去除了未使用的引用

* 暂停恢复逻辑增加恢复中条件和非空判断

* 增加了临时暂停自动拾取的逻辑(RunnerContext.AutoPickTriggerStopCount 为0时不限制,大于0时停止,多次暂停会累加该值,每次恢复-1),支持嵌套情况的暂停,在自动派遣(和结束后5秒)或暂停调度器任务时,同时暂停自动拾取功能。

* 调整暂停拾取方法

* 调整个日志输出

* 路径追踪复苏时,暂停拾取

* 增加根据点位配置,支持能在点位未识别情况下,使用大地图中心点的方式来定位,从而支持像铜锁小岛处这种小地图无法识别的点位。调整了对未识别点位的默认逻辑,未配置点位配置情况下,未识别点位,会取上一个识别的点位,从而支持在某些地方断续小地图能识别情况下的脚本。

* Changes

* 修复暂停后,距离过远,小地图无法识别时,无限取当前一个坐标,导致无法正常恢复的问题。调度器管理增加了按天为单位的周期配置,适用于批量执行时,无需人工判断当天执行哪个任务。

* 调度器配置增加,或开启万叶拾取,并且不存在万叶,但配置了万叶队伍情况下,会切换队伍进行拾取。
2025-05-15 00:15:55 +08:00
辉鸭蛋 a70fbb86d6 Update README.md 2025-05-13 10:21:22 +08:00
Shatyuka 8cb6641c1e sRGB变换曲线优化 (#1585)
改为更精确的近似,多项式性能也会比pow好
2025-05-13 10:01:58 +08:00
Shatyuka 66afbc83ae 截图优化 (#1573)
* 截图优化

* 窗口选择排除WS_EX_LAYERED

云原神

* 优化原神窗口判断
2025-05-12 22:39:02 +08:00
Takaranoao abd823c4b5 一堆ocr的bug修复 (#1575)
* NormalizeToTensorDnn 优化,可能会有精度损失

* 修复 OCR 强制使用CPU时还会使用GPU缓存模型的问题

* Refactor OCR engine namespaces and improve resource management in Det class

* ocr预热图换成彩色多行文本,热的更彻底。

* BgiYoloPredictor 的 析构函数

* 修复TensorRT下使用CPU OCR的情况下TensorRT缓存被错误命中的问题

* 重构OCR初始化,避免cultureInfoName改变导致的预热失效

* 删掉之前的资源文件

* 修复优化模型的路径设置错误
2025-05-12 22:38:32 +08:00
郝凯阳 7b56d15043 auto tcg: update character card config to v5.6 (#1582) 2025-05-12 18:05:15 +08:00
huiyadanli e20e59b7a2 Update version to 0.45.2-alpha.1 2025-05-11 11:40:39 +00:00
辉鸭蛋 0a4f1ff692 code format 2025-05-11 17:31:14 +08:00
kaedelcband辉鸭蛋 1c706d90e6 合成树脂保留/周日秘境奖励选择/一条龙尘歌壶优化 (#1565)
* 一条龙列表空时添加提示,按钮优化

* 1.自动秘境:添加周日材料本三种奖励选择、优化进入秘境横幅点击
2.合成浓缩树脂:添加合成浓缩后保留原粹树脂数量的功能

* 1.自动秘境:添加周日材料本三种奖励选择、优化进入秘境横幅点击
2.合成浓缩树脂:添加合成浓缩后保留原粹树脂数量的功能

* 1.优化加入浓缩树脂判断,最大合成数量限制。

* 1.优化一条龙页面UI显示。
2.合成树脂次数判断逻辑修复。

* 一条龙任务列表UI微调优化

* 代码微调

* 时间判断错误修复

* 合成树脂数量逻辑调整,应该没啥问题了

* 新增图片识别的图片

* 优化最大合成数的写法

* 一条龙内置尘歌壶添加配置日期和商品名称
优化寻找啊圆逻辑

* 1.自动秘境进入优化

* 优化寻找啊圆的逻辑

* 优化初始状态判断

* 优化购买逻辑判断代码

* 优化确定洞天名称方法

* 优化合成树脂判断为负数归零

* 自动秘境跳过判断删除秘境队伍判断

* OCR修改

* 一些无效using删除

---------

Co-authored-by: 辉鸭蛋 <[email protected]>
2025-05-11 17:01:25 +08:00
辉鸭蛋 130847a60c 修复一条龙不输入队伍会提示配置要刷的秘境 2025-05-11 15:00:45 +08:00
辉鸭蛋 325d612a51 挖矿策略只执行一个角色
Refactor mining combat script for improved readability and execution flow
2025-05-11 11:18:57 +08:00
Shatyuka b2958ac646 用Image<Rgb24>替换Bitmap (#1563) 2025-05-11 11:03:53 +08:00
Shatyuka 7e05e94285 手动管理 CaptureContent Dispose (#1562) 2025-05-11 10:48:47 +08:00
huiyadanli 38baac1ad0 Update version to 0.45.1-alpha.3 2025-05-10 17:28:23 +00:00
mfkvfhpdx 040cb5080b 通过点位配置,支持在未识别点位情况下,从大地图中心点来识别坐标。 (#1526)
* 修改调度器任务和部分独立任务失去焦点时,强制切换回游戏窗口,如果用常规的方式无法激活窗口,则第10次会尝试最小化所有窗口后激活游戏。

* 去除未引入的类引用

* 修正战斗结束后,大概率打开队伍界面的问题

* 修复有些电脑上因未知原因,战斗0秒打断

* 把失焦激活放入了设置-通用设置-其他设置中,默认关闭。暂停恢复时,重置移动的起始时间,防止因暂停而导致超时放弃任务。

* 在调度器里面的任务之前,增加月卡处理,解决4点如果未进入任务会卡住的问题。增加了日志分析小怪详细。解决日志分析兜底结束日期不生效的问题。

* 在设置=》其他设置中 增加调度器任务传送过程中自动领取探索奖励功能配置。

* 调整自动派遣后恢复原任务的逻辑

* 自动领取派遣奖励时,跳过异常,防止整个配置组任务被打断。

* 把打开大地图方法从TpTask中抽出为公共方法,自动领取派遣代码调整到了调度器中。

* 去除了未使用的引用

* 暂停恢复逻辑增加恢复中条件和非空判断

* 增加了临时暂停自动拾取的逻辑(RunnerContext.AutoPickTriggerStopCount 为0时不限制,大于0时停止,多次暂停会累加该值,每次恢复-1),支持嵌套情况的暂停,在自动派遣(和结束后5秒)或暂停调度器任务时,同时暂停自动拾取功能。

* 调整暂停拾取方法

* 调整个日志输出

* 路径追踪复苏时,暂停拾取

* 增加根据点位配置,支持能在点位未识别情况下,使用大地图中心点的方式来定位,从而支持像铜锁小岛处这种小地图无法识别的点位。调整了对未识别点位的默认逻辑,未配置点位配置情况下,未识别点位,会取上一个识别的点位,从而支持在某些地方断续小地图能识别情况下的脚本。
2025-05-11 01:25:08 +08:00
kaedelcband辉鸭蛋 a5473aa129 合成树脂保留,周日副本奖励选择和一条龙UI微调 (#1531)
* 一条龙列表空时添加提示,按钮优化

* 1.自动秘境:添加周日材料本三种奖励选择、优化进入秘境横幅点击
2.合成浓缩树脂:添加合成浓缩后保留原粹树脂数量的功能

* 1.自动秘境:添加周日材料本三种奖励选择、优化进入秘境横幅点击
2.合成浓缩树脂:添加合成浓缩后保留原粹树脂数量的功能

* 1.优化加入浓缩树脂判断,最大合成数量限制。

* 1.优化一条龙页面UI显示。
2.合成树脂次数判断逻辑修复。

* 一条龙任务列表UI微调优化

* 代码微调

* 时间判断错误修复

* 合成树脂数量逻辑调整,应该没啥问题了

* 新增图片识别的图片

* 优化最大合成数的写法

---------

Co-authored-by: 辉鸭蛋 <[email protected]>
2025-05-11 01:23:25 +08:00
huiyadanli cb5997c25d Update version to 0.45.1-alpha.2 2025-05-10 17:19:41 +00:00
Shatyukaand辉鸭蛋 0bea2d095a 截图优化 (#1480)
* BitBlt 优化

* BitBlt恢复Top-down

* 渲染时翻转图像

* CaptureSession引用计数

* 恢复成无拷贝Mat

* 合法性检查

* 优化截图预览窗口

* 保存截图文件必要时需要克隆一份Mat

* BitBlt内存池

* 返回拷贝就不用对Session做引用计数了

* 移除CaptureImageRes

* 优化DirectX

* 更好地处理padding

* BitBlt去掉padding

1920*1080的游戏窗口是4字节对齐的,因此不会有性能影响。这里主要用于测试。

* 修复修改窗口大小

* 合并CreateStagingTexture

* 修复设备丢失崩溃

* WGC截图支持HDR

* fix typo

* CodeQA

* 去掉1px窗口边框

* DirectX截图去掉A通道

* HDR转换使用GPU加速

---------

Co-authored-by: 辉鸭蛋 <[email protected]>
2025-05-11 01:17:18 +08:00
Takaranoaoand辉鸭蛋 5b3bac478d 升级多个依赖&增加额外的推理加速功能&迁移OCR (#1459)
* 更新多个NuGet包至最新版本

* 重构模型加载以适应yolosharp

* feat: 改变接口。TensorRT缓存的初步支持,修改配置项。

* 更新依赖并调整变量顺序,修复加载问题

* 更新AvalonEdit和Microsoft.ML.OnnxRuntime包至最新版本,以修复问题

* fix: downgrade Microsoft.ML.OnnxRuntime.DirectML to version 1.21.0

* typo

* fix: change log level from warning to error for ONNX provider loading failure

* 增加 paddle ocr 的 onnx 模型

* feat: add PaddleOCR models for Chinese, English, and Latin recognition

* 使用cv的DNN生成Tensor,加速Yap文字识别

* feat: 尝试搓一个onnx的ocr

* clean up code

* chore: update OpenCvSharp4 package versions to 4.10.0.20241108

* 修复因格式化代码而丢的引用

* chore: update Microsoft.ML.OnnxRuntime.DirectML package to version 1.21.1 and improve logging for ONNX provider initialization

* chore: 等yolosharp更新再升级onnx

* chore: add Microsoft.ML.OnnxRuntime.Managed package and clean up logging in Det class

* fix: refactor output tensor handling in Det class for improved clarity

* 补充注释,修复DML的OCR问题

* 默认OCR推理使用CPU,整理配置

* fix error NETSDK1152: 找到了多个具有相同相对路径的发布输出文件

* fix(logging): enhance debug log for ONNX initialization with provider details

* 修复TensorRT模型缓存的加载问题

* fix(onnx): improve cached model retrieval and add file existence check

* fix(ocr): replace SrcGreyMat with SrcMat for region of interest processing

* fix(onnx): add file existence check for cached model and adjust session options for DirectML provider

* 增加硬件加速配置UI界面

* 移除旧的OCR模型

* 错别字

---------

Co-authored-by: 辉鸭蛋 <[email protected]>
2025-05-11 01:08:37 +08:00
xyToki 736abd08ec fix: check ver number on manual republish 2025-05-10 23:10:07 +08:00
xyToki b32ca2c735 fix: upload mirrorc again when release editg 2025-05-10 23:04:12 +08:00
xyToki e78b3db1e3 fix: fix ci 2025-05-10 22:58:22 +08:00
xyToki 5e206a6622 fix: ci 2025-05-10 22:55:30 +08:00
xyToki 1e441fbd07 fix: do not replace 'v' 2025-05-10 22:51:23 +08:00
xyToki 5f3cb7adbb fix: remove 'v' from mirroc version name 2025-05-10 22:49:02 +08:00
辉鸭蛋 df3616f337 Update publish.yml 2025-05-10 22:43:09 +08:00
xyToki c5ff082fd5 fix: fix mirrorc metadata 2025-05-10 22:35:50 +08:00
xytoki 43e49ef0b0 Update version to 0.45.1-alpha.1 2025-05-10 14:26:28 +00:00
辉鸭蛋 e03b62789b 修复更新文本下白边的问题 2025-05-10 20:00:45 +08:00
辉鸭蛋 8aec25d6e9 自动拾取添加黑名单 #1545 2025-05-10 19:16:38 +08:00
huiyadanli ece83f4fa9 Update version to 0.45.1 2025-05-10 07:05:44 +00:00
辉鸭蛋 391579ba39 Update publish.yml 2025-05-10 11:55:39 +08:00
辉鸭蛋 226ed5f451 Update publish.yml 2025-05-10 11:37:40 +08:00
辉鸭蛋 0b1ba8e447 Update publish.yml 2025-05-10 11:36:39 +08:00
辉鸭蛋 d85ee80f85 Update publish.yml 2025-05-10 11:14:14 +08:00
huiyadanli ccfa95d180 Update version to 0.45.1-alpha.1 2025-05-10 03:12:57 +00:00
辉鸭蛋 76ff95a317 Update publish.yml 2025-05-10 11:09:02 +08:00
辉鸭蛋 84c8b01abe Update publish.yml 2025-05-10 10:51:19 +08:00
辉鸭蛋 251c0f8e10 Update kachina.config.json 2025-05-10 10:47:43 +08:00
起个名字好难的喵 56a4c17efd 按住滑条顶端替代滚轮到最上方 (#1546) 2025-05-10 10:15:59 +08:00
辉鸭蛋 7e69867683 streambird url 2025-05-10 03:09:51 +08:00
辉鸭蛋 47e82a7438 fix build_setup 2025-05-10 02:57:02 +08:00
辉鸭蛋 4ef5481047 配置文件 2025-05-10 02:42:41 +08:00
辉鸭蛋 bc134d4bc7 补充构建配置 2025-05-10 02:39:52 +08:00
辉鸭蛋 180044cf1d 修正依赖 2025-05-10 02:22:51 +08:00
辉鸭蛋 90169dceb8 输出版本号 2025-05-10 02:14:39 +08:00
辉鸭蛋 6c580b18f8 使用产品版本号,本地版本号改成0.0.1 2025-05-10 02:01:43 +08:00
辉鸭蛋 527dd98014 Revert "打包测试文件"
This reverts commit 349bc1b36a.
2025-05-09 01:50:45 +08:00
辉鸭蛋 349bc1b36a 打包测试文件 2025-05-09 01:07:39 +08:00
辉鸭蛋 cfde99383b 0.45.0 2025-05-08 23:16:49 +08:00
辉鸭蛋 8f74ae77b3 黑名单添加 调味 2025-05-08 23:16:09 +08:00
辉鸭蛋 4a745f2603 如果首个点是非TP点位,强制设置在这个点位附近优先做局部匹配 2025-05-06 23:49:58 +08:00
辉鸭蛋 37493d04c4 调用切换队伍方法后,清除队伍缓存 2025-05-06 23:44:28 +08:00
辉鸭蛋 0f6b82110e 5.6 model 2025-05-06 22:50:52 +08:00
MistEO f7cbd7c7ea ci: Create mirrorchyan_uploading.yml (#1520) 2025-05-06 00:07:52 +08:00
辉鸭蛋 ed79015024 更新5.6角色信息,爱可菲、伊法 2025-05-06 00:05:41 +08:00
辉鸭蛋 d81d962dd3 5.6 dataset gen 2025-05-05 23:18:04 +08:00
辉鸭蛋 0e5aba7ad6 处理越界 2025-05-05 22:30:05 +08:00
辉鸭蛋 7305c9f58d 在打开地图时候判断领取自动派遣奖励的判断方式添加时间间隔 2025-05-05 22:16:20 +08:00
辉鸭蛋 d24404dc2a 录制编辑器修改地图的时候,同步修改开发者工具内的地图选择 2025-05-05 21:08:36 +08:00
辉鸭蛋 77d10fb98e 修复 #1499 2025-05-05 01:08:01 +08:00
Bread Grocery a004fcfadd fix(ui): 修复Prompt的TxtQuestion过长时,对话框无法完整显示 (#1513) 2025-05-04 18:57:14 +08:00
kaedelcb 222956f5db 一条龙列表空时添加提示,按钮优化 (#1512) 2025-05-04 13:09:04 +08:00
辉鸭蛋 8ac795680b 修复大地图位置识别不正确的问题 2025-05-03 20:22:22 +08:00
辉鸭蛋 eb11ec79e2 0.44.9 2025-05-03 23:12:57 +08:00
辉鸭蛋 3a46be366b 一条龙新增添加按钮 2025-05-03 23:10:31 +08:00
辉鸭蛋 64e77fa8f6 修复显示东西南北,东西相反的问题 2025-05-03 22:41:06 +08:00
辉鸭蛋 34d89137b7 修复自动秘境 塞西莉亚苗圃 可能无法自动走到的问题 2025-05-03 22:38:06 +08:00
iris10086and辉鸭蛋 07977dc6a3 领取尘歌壶奖励 简单实现 (#1506)
* 领取尘歌壶奖励 功能实现。 - 未实现配置管理

* 领取尘歌壶奖励 小经验书适配

* 优化日志提示等

* 领取尘歌壶奖励 -优化逻辑,删除不必要的资源。

* 领取尘歌壶奖励 阿圆识别修改 兼容其他类型壶。 绘绮亭 还是无法适配

* 代码格式化

---------

Co-authored-by: 辉鸭蛋 <[email protected]>
2025-05-03 22:29:56 +08:00
辉鸭蛋 9e41808326 独立与分层地图支持 (#1503)
* 抽象基础类

* 修改定义

* 抽象出Feature2D相关能力

* 新增地图基类实现

* 临时提交

* 迁移坐标计算

* 加载分层特征数据

* 新增独立地图 层岩巨渊,渊下宫,旧日之海

* 支持不切分特征点匹配

* 添加远古圣山,修改地图参数

* 提瓦特大陆的大地图匹配

* 提瓦特大陆地图大地图位置获取使用256级别的地图

* 替换大地图匹配类 BigMap.cs

* 替换小地图匹配类 EntireMap

* 修改tp的入参方式,删除无用类

* 兼容新提交的内容

* 修复类方法覆盖不生效的问题

* 修复定位问题,迁移部分 MapCoordinate 的代码。MapCoordinate 标记为废弃

* 更多坐标方法的迁移

* 修复不正确的坐标转换

* 是用正确的特征匹配

* 体积较小的地图动态生成特征

* 路径追踪窗体支持多地图

* 传送时切换独立地图地区

* 更新传送点信息

* 修改独立地图相关命名,使用 Scene(场景) 命名,和原神内部命名保持一致

* 录制支持多独立地图

* 修复地区切换失败的问题
2025-05-03 21:59:37 +08:00
秋云 617254cb74 fix #1498 and _mapScaleFactor (#1505) 2025-05-02 13:37:51 +08:00
Patrick-Ze 51db568e5f 支持使用G键进行自动拾取 (#1502) 2025-05-01 23:33:15 +08:00
秋云 dec1509ec9 fix: 更高效的四叶印 (#1497)
* fix: 更高效的四叶印

* 增加检测一次四叶印,确保稳定按T
2025-05-01 22:25:01 +08:00
辉鸭蛋 b429fab878 明确提示原神启动路径错误 2025-05-01 19:55:53 +08:00
辉鸭蛋 6b2368c875 #1492 #1482 一条龙调用调度器时支持【下一任务从此执行】 2025-05-01 16:13:44 +08:00
辉鸭蛋 57419b61fa Merge remote-tracking branch 'origin/main' 2025-05-01 16:11:04 +08:00
辉鸭蛋 a16f405e38 #1492 添加taskListCopy 2025-05-01 16:10:53 +08:00
kaedelcb d874b0b775 释放切换队伍失败状态到JS,未找到换队页面抛出异常。 (#1491)
* 释放切换队伍失败状态到JS,未找到换队页面抛出异常。

* 释放切换队伍失败状态到JS,未找到换队页面抛出异常。
2025-05-01 15:55:55 +08:00
Shatyuka 2b408b4f24 fix: 修复拾取过程中文字识别错误 (#1496)
检测梯度,拾取时会有个明显的渐变
2025-05-01 10:24:29 +08:00
起个名字好难的喵 fbad8ae066 perf: Mining&企业微信通知 (#1493)
* 双手剑天下第一!

* perf: 添加延迟让图片先发送,时间戳与事件之间添加换行
2025-04-30 13:31:11 +08:00
Shatyuka 7bb58ca37f 修复高DPI下TP地图移动 (#1469) 2025-04-29 11:16:52 +08:00
秋云 0ea5b2ce7e feat(action): set_time (#1486)
* feat(action): set_time

* fix: 使用returnmainui回到主界面,增加returnmainui的尝试次数,确保即使时瞬失败也能返回主界面
2025-04-29 11:00:16 +08:00
秋云 330e59e96f fix: 恢复战斗后拾取开关,解决配置组战斗后拾取数据绑定错误 (#1484)
* fix: 战斗后拾取配置ui未对齐修复,配置组战斗后自动拾取数据绑定错误修复

* fix: 保留拾取开关,以兼容原配置。
2025-04-27 18:09:59 +08:00
辉鸭蛋 cd4d0a4d58 删除无用debug日志 2025-04-26 23:26:42 +08:00
辉鸭蛋 2c7266535c 0.44.8 2025-04-26 23:16:10 +08:00
辉鸭蛋 65b2523795 关闭弹出页前判断是否是大地图的弹出页面,以防误识别 #1466 2025-04-26 22:26:32 +08:00
辉鸭蛋 59bf047a81 fixed #1130 修复快速传送(手动触发)后自动拾取失效的问题 2025-04-26 22:22:03 +08:00
辉鸭蛋 b9e1ef7cfa 识别选择队伍后队伍切换成功的场景,减少因为切换时间过长而引发的队伍切换失败的问题 #1457 2025-04-26 22:15:52 +08:00
Scarlet 57c7c5f477 feat: efficient scan pick (#1393)
* feat: efficient scan pick

* feat: start by move backforward to avoid falling

* fix an unspotted bug

* refine logic
2025-04-26 21:50:10 +08:00
Bread Grocery 138e4f8d34 fix(js): 修复创建配置组添加js脚本后,首次编辑js脚本自定义配置时,组件无法正确绑定到setting.json中的默认值 (#1449) 2025-04-26 21:48:56 +08:00
mfkvfhpdx 4760752e70 在调度器里面的任务之前,增加月卡处理,解决4点如果未进入任务会卡住的问题。增加了日志分析小怪详细。解决日志分析兜底结束日期不生效的问题。 (#1433)
* 修改调度器任务和部分独立任务失去焦点时,强制切换回游戏窗口,如果用常规的方式无法激活窗口,则第10次会尝试最小化所有窗口后激活游戏。

* 去除未引入的类引用

* 修正战斗结束后,大概率打开队伍界面的问题

* 修复有些电脑上因未知原因,战斗0秒打断

* 把失焦激活放入了设置-通用设置-其他设置中,默认关闭。暂停恢复时,重置移动的起始时间,防止因暂停而导致超时放弃任务。

* 在调度器里面的任务之前,增加月卡处理,解决4点如果未进入任务会卡住的问题。增加了日志分析小怪详细。解决日志分析兜底结束日期不生效的问题。

* 在设置=》其他设置中 增加调度器任务传送过程中自动领取探索奖励功能配置。

* 调整自动派遣后恢复原任务的逻辑

* 自动领取派遣奖励时,跳过异常,防止整个配置组任务被打断。

* 把打开大地图方法从TpTask中抽出为公共方法,自动领取派遣代码调整到了调度器中。

* 去除了未使用的引用

* 暂停恢复逻辑增加恢复中条件和非空判断

* 增加了临时暂停自动拾取的逻辑(RunnerContext.AutoPickTriggerStopCount 为0时不限制,大于0时停止,多次暂停会累加该值,每次恢复-1),支持嵌套情况的暂停,在自动派遣(和结束后5秒)或暂停调度器任务时,同时暂停自动拾取功能。

* 调整暂停拾取方法

* 调整个日志输出

* 路径追踪复苏时,暂停拾取
2025-04-26 21:47:57 +08:00
辉鸭蛋 50e66a4326 新版本删除老特征数据 2025-04-26 20:27:42 +08:00
辉鸭蛋 02dfd67fa0 新的特征点转换 2025-04-26 20:17:44 +08:00
Shatyuka fbac55b40c 二进制特征文件 (#1473) 2025-04-26 18:49:21 +08:00
kaedelcband辉鸭蛋 ad6c854c06 一条龙菜单、自动秘境、切换队伍相关修改 (#1465)
* 1.一条龙菜单增加配置组,每周7天单独配置。
2.自动秘境执行条件,到达秘境向前走的时间加长。
3.切换队伍API,失败重试3次,切换识别不退出任务。

* Update AutoFightTask.cs

恢复错误提示

* 一条龙配置名称的函数误删恢复

* 格式化代码,消除警告

* 修改配置组的启动调用

* 命名修改 & 如果任务已经被取消,中断所有任务

---------

Co-authored-by: 辉鸭蛋 <[email protected]>
2025-04-26 18:49:00 +08:00
Shatyuka 1bd070bf5c 遮罩窗口自动缩放 (#1478)
* 遮罩窗口自动缩放

* 怎么丢了一行
2025-04-26 17:35:21 +08:00
Shatyuka ce35867b29 遮罩窗口添加阴影 (#1477) 2025-04-26 09:40:58 +08:00
提瓦特钓鱼玳师 5cfabcf6fa 文件读取支持读取文件夹,添加方法判断路径是否为文件夹 (#1475)
* 添加异步目录读取

* 文件夹读取添加读取文件夹,添加方法判断路径是否为文件夹
2025-04-25 12:36:53 +08:00
提瓦特钓鱼玳师 cb9d53fe57 添加异步目录读取 (#1472) 2025-04-24 23:15:10 +08:00
辉鸭蛋 8496cafbe1 0.44.7 2025-04-21 22:00:44 +08:00
辉鸭蛋 2243dff12f Merge remote-tracking branch 'origin/main' 2025-04-17 23:37:57 +08:00
辉鸭蛋 2ad9c2b6f6 fixed #1452 2025-04-17 23:18:18 +08:00
Bread Grocery 25cff98c04 feat(js): 全局方法暴露鼠标滚动操作verticalScroll (#1450) 2025-04-17 10:10:32 +08:00
辉鸭蛋 b51f00a259 修复4号位地图追踪时不切人的放技能的问题 2025-04-15 01:52:06 +08:00
辉鸭蛋 be13b9a089 删除 BitBlt 稳定版(实际也不稳定) 2025-04-15 01:45:48 +08:00
辉鸭蛋 e1b7c57a45 Merge remote-tracking branch 'origin/main' 2025-04-14 23:00:15 +08:00
辉鸭蛋 5024ddbb61 修复自动秘境超时的时候重试 2025-04-14 23:00:07 +08:00
Takaranoao 066aa81d65 让 bitblt 极速 使用GDI+ 生成 Bitmap 而不是 使用OpenCvSharp 生成 Mat (#1441)
* 让 bitblt 极速 使用GDI+ 生成 Bitmap 而不是 使用OpenCvSharp 生成 Mat

* typo
2025-04-14 22:11:24 +08:00
辉鸭蛋 1097d5a27f update ux 2025-04-13 21:43:51 +08:00
辉鸭蛋 679e2736ab update ui 2025-04-13 16:46:11 +08:00
辉鸭蛋 640f393bee 延长合成树脂的时间 #1432 2025-04-13 14:00:09 +08:00
秋云 4c4f3bb05e feat(js): 独立任务支持传入取消令牌 (#1430) 2025-04-12 19:19:57 +08:00
FishmanTheMurloc 13a797c645 界面数据绑定漏洞修复 (#1427) 2025-04-11 22:39:51 +08:00
辉鸭蛋 8765a6f2b4 0.44.6 2025-04-11 00:56:23 +08:00
辉鸭蛋 fca2381787 拾取列表已满时候,滑动滚轮 2025-04-11 00:55:53 +08:00
辉鸭蛋 c160923795 修复飞行过程中CPU飙升的问题 2025-04-11 00:23:16 +08:00
辉鸭蛋 9f3915d748 默认使用旧版截图器 2025-04-11 00:18:32 +08:00
辉鸭蛋 1df15bb83c 提供老版本的稳定 BitBlt 功能 2025-04-11 00:11:42 +08:00
辉鸭蛋 6b306582d0 pathingScript.runFile 捕获报错 2025-04-10 01:37:53 +08:00
辉鸭蛋 17250e0b2e 0.44.5 2025-04-10 01:25:25 +08:00
辉鸭蛋 3f4297c282 修复inputText接口 2025-04-10 01:17:32 +08:00
辉鸭蛋 636ef3f71a 删除无用的释放内容,修复wgc关闭时候报错 #1419 2025-04-10 00:46:13 +08:00
Qian23333 cf9c964c7c 添加OneBot通知 (#1418) 2025-04-08 21:31:19 +08:00
Takaranoao 1d17d7f12c 加了一堆爆炸时候的判断,希望能抵挡住汹涌的bug (#1415) 2025-04-08 00:52:25 +08:00
richex-cn 2808652b22 fix: 发现新版本窗口下方一大块白色 (#1413) 2025-04-08 00:52:14 +08:00
辉鸭蛋 665ee51103 修复 inputText 未暴露给 js 脚本的问题 2025-04-07 00:35:35 +08:00
辉鸭蛋 877074b303 js 按键模拟支持功能键 2025-04-06 22:27:51 +08:00
辉鸭蛋 fee2bd7ade update ui 2025-04-06 16:13:17 +08:00
Takaranoao 7cf826a80b 修复手动设置cd不生效和快速跳过战斗时有时会导致刷屏的问题。 (#1410) 2025-04-06 14:36:53 +08:00
辉鸭蛋 94b6b3b0c9 0.44.4 2025-04-06 13:09:59 +08:00
Takaranoao e9f0294286 优化BitBlt截图逻辑,增加失败重试机制以提高截图成功率 (#1407)
* 优化BitBlt截图逻辑,增加失败重试机制以提高截图成功率

* 增加Capture0方法的XML注释,明确其用途和调用要求
2025-04-06 12:36:02 +08:00
辉鸭蛋 f5509dd540 关闭截图器 切换分辨率 开启截图器 后分辨率不正常的问题 2025-04-06 12:35:41 +08:00
辉鸭蛋 f8c870b8ca js 输入文字 2025-04-06 02:57:43 +08:00
FishmanTheMurloc fce70c0e96 分解5星圣遗物 (#1383)
* 分解圣遗物基础设施建设

* 分解圣遗物独立任务基本功能完成:单独的启动按钮,正则表达式逐一筛选;代码文件整理到单独的文件夹

* 自动分解5星圣遗物功能初步完成

* 修复上次修改快速分解产生的问题,主要点击分解按钮时的bug,还有与五星分解步骤衔接的问题

* 针对切换队伍时,多语言识别效果不佳的情况,将用户设定的队伍名作为正则表达式进行模糊匹配,并在LogInfo输出相关提示;传送任务对任务取消进行单独的异常处理

* 一个便于测试分解圣遗物OCR识别和正则匹配结果的弹窗
2025-04-05 19:53:52 +08:00
秋云 1a71d052eb js(file): 文件写入支持 (#1403)
允许的文件类型:[".txt", ".json", ".log", ".csv", ".xml", ".html", ".css"];
2025-04-05 19:40:22 +08:00
辉鸭蛋 b276509109 Merge remote-tracking branch 'origin/main' 2025-04-05 12:22:50 +08:00
辉鸭蛋 91963a2507 0.44.3 2025-04-05 12:22:42 +08:00
Takaranoao bc5ae1177c 修复UseSkill调用之后没有正确调用cd计算函数的问题,增加注释 (#1400) 2025-04-05 12:15:12 +08:00
辉鸭蛋 177c0f9aa7 Merge remote-tracking branch 'origin/main' 2025-04-05 11:51:15 +08:00
辉鸭蛋 4ba2c8d7ed 树脂不足提示检测 #1385 2025-04-05 11:50:44 +08:00
ddaodan b2d8e8a512 add pick black item (#1399) 2025-04-04 20:53:40 +08:00
辉鸭蛋 b72024de04 fix 其他界面关闭后没有延时,以及大地图界面不应该被关闭的问题 2025-04-04 14:36:52 +08:00
Takaranoaoand辉鸭蛋 399441b9e8 优化技能冷却处理逻辑 (#1321)
* 在路径追踪重构了部分冷却处理逻辑,战斗脚本e增加wait参数可等待技能冷却而不是跳过。采矿e增加等待。尝试修复路径追踪 UseElementalSkill 与采矿脚本冲突的问题。

* 给CombatCommand加入快速跳过e的选项

* 优化技能冷却处理逻辑,增加OcrSkillCd属性以支持OCR识别的技能冷却时间,并调整相关技能CD计算和等待逻辑,尝试修复纳西妲采集终止时按键未弹起的问题

* 优化战斗任务中的技能冷却处理逻辑

* 更新纳西妲技能冷却时间记录,改为使用UTC时间并增加日志输出以便调试

* 增加最大技能CD检查,以排除系统时间/日期同步导致无限卡死。修复跑图路切人。(ps:主板电池没电应该去修主板)

* 修复CheckAvatarAvailable

* fix AutoFightTask skill cooldown logic and improve comments

* 尝试修复脚本在"当前角色"下的小问题

* 尝试修复脚本在"当前角色"下的小问题,Avatar类结构调整,重新做了"根据技能cd优化出招"部分。

* Refactor avatar retrieval in PathingConditionConfig to use GetAvatars method and update skill cooldown references

* Fix variable naming for clarity in CombatScenes

* 在自动战斗执行前预先过滤不可执行的脚本。

---------

Co-authored-by: 辉鸭蛋 <[email protected]>
2025-04-04 13:54:44 +08:00
可耐的小伙纸 0f2b1a5fe7 fix:左Ctrl名称错误 (#1398) 2025-04-04 13:02:24 +08:00
Takaranoao 9af7575d2b bitblt 还能更快 (#1395)
* Bitblt:GDI直接返回转换后的位图,不再由CV二次转换

* update documentation for clarity

* typo
2025-04-03 21:28:13 +08:00
秋云 db06c771cd feat(js): 获取大地图和小地图中心点坐标 (#1392)
* feat(js): 获取大地图和小地图中心点坐标

* fix: 直接返回 Point2f 类
2025-04-03 13:36:46 +08:00
辉鸭蛋 b146743c57 0.44.2 2025-04-03 02:08:12 +08:00
辉鸭蛋 b0ec7eadd6 fix _frameTimer not start 2025-04-03 02:06:13 +08:00
Takaranoao 8951cc1adc bitblt截图修改:复用缓冲区以减少每次截图时的内存分配 (#1387)
* Refactor BitBltCapture and add BitBltSession for improved thread safety and resource management

* 删掉无用的锁

* Fix session invalidation handling in BitBltCapture and add IsInvalid method to BitBltSession

* Refactor resource release logic in BitBltSession to ensure proper order of operations

* Refactor IsInvalid method and clean up resource release logic in BitBltSession

* 析构函数加满

* 截图失败的时候重置会话避免卡死,改善锁的范围

* Use static Console for error logging in BitBltCapture

* Improve error logging format in BitBltCapture for session creation failure
2025-04-03 01:46:20 +08:00
辉鸭蛋 c5e34a3d39 Update README.md 2025-04-03 01:17:26 +08:00
秋云 06364325b0 feat: 暴露部分大地图操作给js (#1390) 2025-04-02 22:30:21 +08:00
秋云 ffd7cfabbc feat: js 通知支持 (#1376)
* feat: js 通知支持

* feat: 添加全局或者在配置组中单独禁用js的通知功能
2025-04-02 21:40:14 +08:00
FishmanTheMurloc 057efe78a9 静态化SharpDX.Direct3D11.Device的实例、恢复GraphicsCapture.cs的Stop方法中被注释的清理frame的代码,以期降低WGC反复启停的时观察到的内存泄漏;WGC方法传入的截图似乎是4通道的,paddle吃不进,故做4转3处理 (#1386) 2025-04-02 21:39:56 +08:00
Takaranoao 0fb59b19ef 更新OpenCvSharp4相关包版本到4.10.0.20240616(据说这样OCR不容易爆炸) (#1388) 2025-04-02 20:37:50 +08:00
辉鸭蛋 ca3deb42cc 优化帧率控制,使用更精确的计时器 2025-04-02 01:10:02 +08:00
辉鸭蛋 f23975f04c 地图追踪:没有按下前进键时,按下前进键 2025-04-02 00:43:25 +08:00
辉鸭蛋 2662e7e01e Update BetterGenshinImpact.csproj 2025-04-01 14:48:26 +08:00
Takaranoao cbaf1f6c36 更新OpenCvSharp4版本到4.10.0,PaddleOCR到2.7.0.3,尝试修复bitblt导致崩溃的问题 (#1381) 2025-04-01 14:47:13 +08:00
辉鸭蛋 98b46e8f1b 0.44.0 2025-03-31 10:54:22 +08:00
FishmanTheMurloc 8f8aad4130 分解圣遗物支持多语言,顺便修了一下5.5版本快速选择筛选星级逻辑 (#1369) 2025-03-30 16:23:08 +08:00
辉鸭蛋 ad73198125 js 图像识别的补充 2025-03-30 15:34:25 +08:00
辉鸭蛋 f7e7320461 #1366 2025-03-30 13:26:07 +08:00
Feiran Zhang 470eb364db 通过调度器启动时,添加sleep防止闪退 (#1366)
发现通过调度器直接原神启动时,进入主界面前有概率闪退,可能是while (true)里的截图太频繁导致,添加sleep后测试该问题已解决
2025-03-30 13:23:57 +08:00
辉鸭蛋 282f664c27 Merge remote-tracking branch 'origin/main' 2025-03-30 01:18:44 +08:00
辉鸭蛋 bae42f84c6 typo 2025-03-30 01:07:14 +08:00
起个名字好难的喵 79d379f579 Add 安饶之野 Teleport (#1365) 2025-03-29 19:41:17 +08:00
辉鸭蛋 2e5a933a61 修复自动秘境选择火本(无妄引咎密宫)后,行走配置不正确的问题 #1345 2025-03-29 16:44:41 +08:00
辉鸭蛋 84cea2d2e0 update ui 2025-03-29 16:16:16 +08:00
辉鸭蛋 535e879446 调度器设置中的战斗配置,如果开启则自动开启上面的地图追踪配置 2025-03-29 14:32:36 +08:00
辉鸭蛋 4f0af583c2 0.43.6 2025-03-29 13:07:19 +08:00
FishmanTheMurloc 40cd76fbdc Feat/multi lan (#1364)
* 多语言下拉框挪到其他设置下

* 使用正经的Fixture写法,杜绝并行测试时paddle崩溃的问题

* 适配不同主城的合成台的不同法语名

* 修正语言资源的正则表达式,好久没用了写错了好多;为AutoDomainTask新增的“地脉异常”、“点击任意位置关闭”添加多语言适配
2025-03-29 12:54:27 +08:00
辉鸭蛋 8240748c95 remove MicaSetup, it's in https://github.com/babalae/bettergi-publish 2025-03-29 12:53:37 +08:00
辉鸭蛋 1538b3f8fb 5.5 avatar model 2025-03-29 12:47:08 +08:00
辉鸭蛋 11f0a8528d Merge remote-tracking branch 'origin/main' 2025-03-28 21:23:21 +08:00
FishmanTheMurloc 2cfaf9335e 多语言下拉框挪到其他设置下 (#1362) 2025-03-28 14:01:38 +08:00
郝凯阳 bd67d4df30 auto tcg: update character card config to v5.5 (#1359) 2025-03-28 12:11:14 +08:00
FishmanTheMurloc 6d4f8b80e8 Feat/multi lan (#1336)
* 记录一次对hutaofisher的访谈,帮助开发者理解其算法

* 本地化HelloWorld

* .csproj取消windows版本号,此处导致了IDE在新建代码文件和自动生成代码时,默认命名空间丢失的问题。已知VisualStudio和ReSharper存在这个问题。

* 优化扩展方法写法,改为从localizer扩展;Converter优化写法,避免冲突;新增两种语言,待测试ocr效果

* Revert ".csproj取消windows版本号,此处导致了IDE在新建代码文件和自动生成代码时,默认命名空间丢失的问题。已知VisualStudio和ReSharper存在这个问题。"

This reverts commit 8bd7ee74c5.

* localizer改为由构造函数传入以支持单元测试;一个英语上钩的单元测试

* 传送任务支持英语游戏界面;本地化参数挪至OtherConfig类下,但界面位置暂不挪动,待定

* 调整resx位置风格,放在直接使用字符串的类下;一条龙合成树脂及领取每日奖励支持游戏内中英双语

* 删除无用碎片文件

* 删去两个不必要的Sdcb包引用

* Paddle服务类去掉分类模型;检测和识别新增支持繁中和法语,配有单元测试;因小语种识别效果不理想,使用正则匹配替换多处识别文本相等或包含判断;钓鱼、一条龙合成树脂及领取每日奖励支持游戏内繁中和法语;

* 检查今日奖励任务的多语言化;右侧联机的P图标检测区域宽度缩减,避免英语角色名被误识别成P

* AutoDomainTask的游戏多语言化,由于我的游戏账号无法测试,仅配一些测试用例

* 修复有3个Mizuki导致异常的bug,临时用拼音代替新角色英文名,并为该数据初始化方法添加单元测试

* 瓦雷莎删去别名“牛牛”,因荒泷一斗已占用此别名;别名加载和读取优化

* 加个锁避免单元测试中多线程初始化paddle崩溃
2025-03-28 11:00:08 +08:00
辉鸭蛋 47ffbe9c89 5.5 avatar 2025-03-28 01:07:59 +08:00
辉鸭蛋 de50acd758 1024 map 2025-03-28 00:46:34 +08:00
起个名字好难 b6a54c5272 ElementalCollect Electro:Varesa (#1355) 2025-03-27 22:06:47 +08:00
秋云 2423e36456 自动秘境添加【荒废砌造坞】,仅供临时使用 (#1354)
* fix: typos

* fix: 自动秘境添加【荒废砌造坞】,仅供临时使用
2025-03-27 20:30:52 +08:00
秋云 325b54ef9c fix: typos (#1353) 2025-03-27 09:53:39 +08:00
辉鸭蛋 055f46f4c0 +5.5 avatar 2025-03-27 01:52:56 +08:00
辉鸭蛋 1e288ffda4 0.43.5 2025-03-27 01:32:55 +08:00
辉鸭蛋 892f0f0fa6 ui: 迁移按键绑定页面到设置中 2025-03-27 01:03:19 +08:00
辉鸭蛋 d000981be5 about page #317 2025-03-27 00:15:19 +08:00
辉鸭蛋 55a7dec210 Add About option to settings page (#1348)
---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/babalae/better-genshin-impact?shareId=XXXX-XXXX-XXXX-XXXX).
2025-03-26 22:36:39 +08:00
辉鸭蛋 d3b2f62083 抽离出方法给脚本调用 #1349 2025-03-26 22:32:20 +08:00
辉鸭蛋 917e412d49 5.5 分解功能变成反选 2025-03-26 22:00:27 +08:00
秋云 5a8f38e121 feat: new action exit and relogin and 5.5 fix. (#1349)
* feat: new action exit and relogin and 5.5 fix.

* fix: confirm exit button.
2025-03-26 16:39:09 +08:00
秋云 c79e919d17 fix: 日志分析修改namespace,修改配色,code clean。 (#1346) 2025-03-25 21:01:22 +08:00
Takaranoaoand辉鸭蛋 00304d48c4 增加对WaypointForTrack的DisablePickupAround属性支持,可以关闭挖矿动作的周围拾取 (#1322)
* 增加对WaypointForTrack的DisablePickupAround属性支持,可以关闭挖矿动作的周围拾取

* 移动变量解析位置

---------

Co-authored-by: 辉鸭蛋 <[email protected]>
2025-03-25 00:55:05 +08:00
辉鸭蛋 e5629f1bb4 5.5 map 2025-03-25 00:37:58 +08:00
辉鸭蛋 e77c143f6b Merge branch 'pr/1320'
# Conflicts:
#	BetterGenshinImpact/GameTask/GameTaskManager.cs
2025-03-23 23:35:22 +08:00
辉鸭蛋 0d5d1292c8 code clean 2025-03-23 23:33:40 +08:00
辉鸭蛋 dfbc05599f 秘境走到最后领取奖励超时将会自动重试秘境 #1202 #1270 2025-03-23 22:52:33 +08:00
辉鸭蛋 33e9ebbc91 体力不足时,放弃继续进行自动秘境 #1008 #1134 2025-03-23 22:28:23 +08:00
辉鸭蛋 9bfdfd041e 一些优化
1. 一条龙未选择要刷的秘境时,直接提示
2. 修复独立任务运行时,实时任务仍在运行的问题
2025-03-23 22:04:43 +08:00
秋云 ad3f4c3915 feat: 日志分析界面添加排序逻辑,添加单个任务拾取物显示,添加表头锁定,更换现代化配色方案 (#1341)
* feat: 添加排序逻辑,添加单个任务拾取物显示

* feat: 表头锁定

* feat: 优化样式,修改排序

* feat: 文件过大时会进行保存,并提示保存的路径

* fix: 错误的弹窗

* fix: 修复表头固定

* feat: 修改配色

* fix: 优化显示

* fix: 删除重复分析。

* add: 增加单日分析
2025-03-23 21:12:59 +08:00
niuhuanand辉鸭蛋 f81f628046 ✨ 飞书通知时带有图片(需要配置app,并且在飞书后台增加上传图片权限) (#1334)
* ✨ feishu image notify

* typo

---------

Co-authored-by: 辉鸭蛋 <[email protected]>
2025-03-20 22:11:42 +08:00
辉鸭蛋 cbcd9a114e fix NPE 2025-03-19 23:34:51 +08:00
辉鸭蛋 e4163e773c 修复4k自动秘境不生效的问题 2025-03-18 23:49:39 +08:00
FishmanTheMurlocand辉鸭蛋 57d33c4312 又一波钓鱼优化 (#1301)
* GetFishBarRect方法添加更复杂的算法,并为其配备独立的单元测试,和分离难度较大的测试用例(未熟练时两侧出现黄色动态折线的情况);GetFishBoxArea行为去掉拉条框初始位置必须位于屏幕中轴线的条件,并添加其后续Fishing行为的单元测试来验证可行性;EnterFishingMode行为使用结束时间来代替Sleep,并添加整体超时时间;添加一个鱼咬钩的假阳性测试用例仅供娱乐

* 补充GetFishBarRect算法,使通过遗漏的测试"20250314002439020_Fishing_Succeeded.png"

* 拉条增加1秒未检测持续时间以应对瞬间丢失拉条框的情况;新增一个检查提竿结果的行为;新增一个检查开始钓一条鱼的初始状态的方法,以应对行为状态错配的情况;一些行为将Sleep优化为DateTime;修改上述改动对应的单元测试

* 解决合并冲突剩余问题,删掉ImageRegion的Bitmap构造函数重载

* 提供给测试用例初始化的 SystemInfo、TaskContext 方法,使用 InitForTest 即可

* InitForTest

* 和鸭蛋昨夜的提交撞车了。。。抽象了ISystemInto供单元测试实例化Fake类;给BaseAssets类定义了成员字段systemInfo(我想,既然都是图片模板数据集,如此定义是合理的),供继承类AutoFishingAssets使用,并定义了其在单元测试的派生类;添加了一个900p的选取鱼饵测试用例;blackboard改为负责携带AutoFishingAssets,并将其实例化时机挪到独立任务的Start方法中,避免由于TaskContext尚未初始化导致获取到的SystemInfo为空

* 一个特殊的测试用例:抛竿的瞬间、开始检测咬杆时遇到了假阳性

* Revert "InitForTest"

This reverts commit 225e9783a7.

* Revert "提供给测试用例初始化的 SystemInfo、TaskContext 方法,使用 InitForTest 即可"

This reverts commit 610c57263a.

* 为始终没有找到落点的情况添加计数,在第3次时直接退出,并添加此情况的单元测试

---------

Co-authored-by: 辉鸭蛋 <[email protected]>
2025-03-18 19:51:42 +08:00
起个名字好难 f5dbe30e25 企业微信通知增加时间戳 (#1326)
* 凝光Mining+伐木增加木材

* 企业微信通知增加时间戳
2025-03-18 17:45:55 +08:00
Takaranoao 58aedbf9d6 修复AddTimer方法中的异常处理,保持js脚本兼容性 2025-03-16 20:06:21 +08:00
Takaranoao 2aefabe09c 添加实时任务,不会清理之前的任务 2025-03-16 20:00:25 +08:00
DR-lin-engandDR-lin-eng cbe90a7003 优化推送逻辑,加入异步推送策略,降低在多开渠道下的瞬间性能负载。提升推送速度。 (#1315)
Signed-off-by: DR-lin-eng <@DR-lin-eng>
Co-authored-by: DR-lin-eng <@DR-lin-eng>
2025-03-16 14:30:11 +08:00
929f4a30b3 添加dingding通知 (#1312)
* 新增图片作为email附件发送功能

* feat(notification): 为 WebhookNotifier 添加 send_to 功能

- 在 WebhookNotifier 类中添加 send_to 属性
- 修改 TransformData 方法,增加 send_to 字段
- 在 NotificationConfig 中添加 webhook_endpoint 和 websocket_endpoint 属性

* refactor(WebhookNotifier): 添加 send_to 属性并调整访问修饰符

* refactor(notification): 重构 WebhookNotifier 并更新 NotificationConfig

- 在 NotificationConfig 中添加 WebhookSendTo 属性
- 重构 WebhookNotifier 构造函数,使用 NotificationConfig 对象进行初始化
- 更新 WebhookNotifier 发送逻辑,使用新的配置属性

* feat: add webhook ui.

* refactor(WebhookNotifier): 重构 TransformData 方法以优化数据结构- 将 notification_data 的内容合并到外层字典,以便于 webhook 接收端获取数据- 新增 event、result、timestamp 等字段,使数据结构

* fix(WebSocketNotifier): 添加消息发送后关闭连接的功能

- 在 SendAsync 方法中添加了 CloseAsync() 调用,确保消息发送后关闭 WebSocket 连接
- 此修改解决了消息发送后未关闭连接的问题,提高了资源利用率和系统稳定性

* fix: implement unified webhook ui

* fix: typos.

* 优化通知前端显示

* feat(notification): 添加钉钉 Webhook 通知支持

- 实现了钉钉 Webhook 通知的发送功能
- 在通知配置中添加了钉钉 Webhook URL 和密钥的设置选项
- 在通知服务中集成了钉钉通知的初始化和注册
- 优化了 WebhookNotifier 类的代码结构

* 新增钉钉通知ui

Signed-off-by: DR-lin-eng <@DR-lin-eng>

* 修正图标

Signed-off-by: DR-lin-eng <@DR-lin-eng>

---------

Signed-off-by: DR-lin-eng <@DR-lin-eng>
Co-authored-by: DR-lin-eng <@DR-lin-eng>
Co-authored-by: 秋云 <[email protected]>
Co-authored-by: DR-lin-eng <[email protected]>
Co-authored-by: 辉鸭蛋 <[email protected]>
2025-03-16 03:18:02 +08:00
辉鸭蛋 2cb2604de0 Merge remote-tracking branch 'origin/main' 2025-03-16 03:09:25 +08:00
辉鸭蛋 11421cbd63 + MapPuzzleOther 2025-03-16 03:09:15 +08:00
DR-lin-engandDR-lin-eng f66c9a2aab 修正变量正确性,修正api端点反代使用 (#1314)
Signed-off-by: DR-lin-eng <@DR-lin-eng>
Co-authored-by: DR-lin-eng <@DR-lin-eng>
2025-03-16 03:01:53 +08:00
辉鸭蛋 0bbc851ba0 优化合成树脂,不阻塞任务 2025-03-16 01:49:37 +08:00
辉鸭蛋 377326f492 卡齐娜e 2025-03-16 01:29:43 +08:00
DR-lin-engandDR-lin-eng 8d3acfc668 优化通知前端显示 (#1311)
Co-authored-by: DR-lin-eng <@DR-lin-eng>
2025-03-16 01:18:57 +08:00
Takaranoao a9150054c4 从命令行启动调度器,暂不支持URL(--startGroups 组1 组2 ...) (#1309)
* 从命令行启动调度器,暂不支持URL(--startGroups 组1 组2 ...)

* 修改:log&执行顺序和传入顺序相同
2025-03-16 00:20:33 +08:00
DR-lin-engandDR-lin-eng de0a77b655 优化前端显示 (#1310)
Co-authored-by: DR-lin-eng <@DR-lin-eng>
2025-03-16 00:19:20 +08:00
Takaranoao 315318e2fe 配置组增加ShellTask配置的UI (#1308)
* Shell抽象成为一个Task,并抽出Config

* 代码格式化

* 格式化代码

* 配置组增加ShellTask配置的UI
2025-03-15 20:35:53 +08:00
Takaranoao 981068b38c draft:执行shell抽成task,并支持配置 (#1306)
* Shell抽象成为一个Task,并抽出Config

* 代码格式化

* 格式化代码
2025-03-15 20:09:59 +08:00
DR-lin-engandDR-lin-eng 6eb1d33965 新增xxtui通知方法 (#1305)
Co-authored-by: DR-lin-eng <@DR-lin-eng>
2025-03-15 20:06:28 +08:00
辉鸭蛋 e1bd3393b8 WGC 去掉HDR处理,增加处理帧率限制 2025-03-15 19:54:53 +08:00
辉鸭蛋 12617e18e9 0.43.3 2025-03-15 13:19:45 +08:00
辉鸭蛋 807288ab90 重构底层截图器,大幅提升截图器耗时 (#1302)
* to mat init

* BitBlt 加锁

* 使用读写锁重构 Windows.Graphics.Capture,删除BGI自己命名的缓存设置

* dwm加锁并返回mat

* 队伍中没有对应元素角色修复日志问题

* 清除所有 DispatcherTimerOperationEnum 内容

* 修复单测的编译错误

* HDR Support

* 清理无用的截图器模式
2025-03-15 13:18:19 +08:00
f7903f8e9b webhook添加了sendto发送对象,修复了webhook通知ui显示错误问题,修复了websocket服务端错误关闭链接问题 (#1300)
* 新增图片作为email附件发送功能

* feat(notification): 为 WebhookNotifier 添加 send_to 功能

- 在 WebhookNotifier 类中添加 send_to 属性
- 修改 TransformData 方法,增加 send_to 字段
- 在 NotificationConfig 中添加 webhook_endpoint 和 websocket_endpoint 属性

* refactor(WebhookNotifier): 添加 send_to 属性并调整访问修饰符

* refactor(notification): 重构 WebhookNotifier 并更新 NotificationConfig

- 在 NotificationConfig 中添加 WebhookSendTo 属性
- 重构 WebhookNotifier 构造函数,使用 NotificationConfig 对象进行初始化
- 更新 WebhookNotifier 发送逻辑,使用新的配置属性

* feat: add webhook ui.

* refactor(WebhookNotifier): 重构 TransformData 方法以优化数据结构- 将 notification_data 的内容合并到外层字典,以便于 webhook 接收端获取数据- 新增 event、result、timestamp 等字段,使数据结构

* fix(WebSocketNotifier): 添加消息发送后关闭连接的功能

- 在 SendAsync 方法中添加了 CloseAsync() 调用,确保消息发送后关闭 WebSocket 连接
- 此修改解决了消息发送后未关闭连接的问题,提高了资源利用率和系统稳定性

* fix: implement unified webhook ui

* fix: typos.

---------

Co-authored-by: DR-lin-eng <@DR-lin-eng>
Co-authored-by: 秋云 <[email protected]>
2025-03-15 10:33:33 +08:00
DR-lin-engandDR-lin-eng 45fc9fe7f4 新增图片作为email附件发送功能 (#1298)
Co-authored-by: DR-lin-eng <@DR-lin-eng>
2025-03-15 10:33:13 +08:00
a662791b6b Tgbot推送机器人 (#1296)
* feat: add email and websocket notification

* fix typos.

* refactor(notifiers): 重构邮件和 WebSocket 通知器

- 提升 EmailNotifier 中的 SmtpClient 为类的成员变量,并在构造函数中初始化,优化资源使用
- 改进 WebSocketNotifier 的连接和重连逻辑,提高稳定性
- 优化通知器的错误处理和日志记录,增强可维护性

* Create BarkNotifier.cs

* Update NotificationConfig.cs

* Update NotificationService.cs

* Update CommonSettingsPageViewModel.cs

* Add files via upload

* Add files via upload

* Add files via upload

* Update CommonSettingsPage.xaml

* Delete BetterGenshinImpact/Service/Notifier/BarkNotifier.cs

* Add files via upload

* Update BarkNotifier.cs

* Update NotificationService.cs

* Update CommonSettingsPageViewModel.cs

* Update CommonSettingsPage.xaml

* Delete BetterGenshinImpact/Service/BarkNotifier.cs

* Add files via upload

* Add files via upload

* Add files via upload

* Update CommonSettingsPage.xaml

* fix: 回退部分代码,修复了程序崩溃的错误

* fix: remove api.day.app

* Update CommonSettingsPageViewModel.cs

* Update CommonSettingsPage.xaml

* Update CommonSettingsPage.xaml

* Update CommonSettingsPageViewModel.cs

* Update EmailNotifier.cs

* Update EmailNotifier.cs

* Update BarkNotifier.cs

* 修正并更新前端介绍

* Revert "1"

* 修正公益服务器请求兼容性

* Revert "Revert "1""

This reverts commit 8c6effb1

* 新增tg推送但是有发送问题?(疑似我的电脑问题,稍后解决)

Signed-off-by: DR-lin-eng <@DR-lin-eng>

* feat: Telegram notification and ui.

* 修正tgbot推送,修正变量

Signed-off-by: DR-lin-eng <@DR-lin-eng>

---------

Signed-off-by: DR-lin-eng <@DR-lin-eng>
Co-authored-by: 秋云 <[email protected]>
Co-authored-by: 禹仔二号 <[email protected]>
Co-authored-by: yuzai <[email protected]>
Co-authored-by: DR-lin-eng <@DR-lin-eng>
Co-authored-by: 辉鸭蛋 <[email protected]>
2025-03-14 19:39:16 +08:00
秋云 76445ab19d fix: 修复换队时爬七天神像导致换队失败的问题 (#1295) 2025-03-14 11:43:58 +08:00
起个名字好难 3df45ea6ed 统计增加卡死和异常 (#1293) 2025-03-14 09:50:24 +08:00
辉鸭蛋 616293432d Update README.md 2025-03-14 00:39:59 +08:00
辉鸭蛋 7250ef111d Update README.md 2025-03-14 00:37:23 +08:00
辉鸭蛋 19fb0022c1 Merge remote-tracking branch 'origin/main' 2025-03-14 00:26:45 +08:00
辉鸭蛋 f284a5331a 0.43.2 2025-03-14 00:23:27 +08:00
FishmanTheMurloc 29a2c0069e bug fix:拉条过程中内存没有及时释放 (#1266)
* bug fix:拉条过程中内存没有及时释放

* 新增LiftAndHold行为用于举竿、检测预抛竿时鼠标左键是否被意外松开、终止任务;抛竿开始后5秒内如从未找到落点,则返回失败,并配有单元测试;添加抛竿时无鱼饵适用鱼的单元测试;调整变量名

* 新增一个钓鱼昼夜设置枚举DontChange及其逻辑(枚举值为3),表示不调整时间直接开钓

* 针对可能是游戏中的雾气/滤镜/小黄鸭之类不明原因干扰了钓鱼拉条框的识别,修改了CV算法,使其不严格按照黄色(255,255,192)找矩形,而是按一定HSV范围寻找,并加强过滤;添加上述不明原因案例的测试用例

* 将MySimpleParallel改造为支持两个以上子行为;将“检查抛竿结果”行为合并到“下杆中”并行节点,以去除检查的等待时间,由此希望能应对鱼过快上钩的情况
2025-03-14 00:17:37 +08:00
秋云and辉鸭蛋 22fe431880 feat: add action_params(StopFlyingWaitTime) to stop_flying (#1277)
* feat: add action_params(StopFlyingWaitTime) to stop_flying;
fix: ensure next step only proceeds after stop_flying.

* add StopFlyingHandler

* use int.TryParse

---------

Co-authored-by: 辉鸭蛋 <[email protected]>
2025-03-14 00:15:17 +08:00
a172ba6941 修正bark推送参数和前端 (#1289)
* feat: add email and websocket notification

* fix typos.

* refactor(notifiers): 重构邮件和 WebSocket 通知器

- 提升 EmailNotifier 中的 SmtpClient 为类的成员变量,并在构造函数中初始化,优化资源使用
- 改进 WebSocketNotifier 的连接和重连逻辑,提高稳定性
- 优化通知器的错误处理和日志记录,增强可维护性

* Create BarkNotifier.cs

* Update NotificationConfig.cs

* Update NotificationService.cs

* Update CommonSettingsPageViewModel.cs

* Add files via upload

* Add files via upload

* Add files via upload

* Update CommonSettingsPage.xaml

* Delete BetterGenshinImpact/Service/Notifier/BarkNotifier.cs

* Add files via upload

* Update BarkNotifier.cs

* Update NotificationService.cs

* Update CommonSettingsPageViewModel.cs

* Update CommonSettingsPage.xaml

* Delete BetterGenshinImpact/Service/BarkNotifier.cs

* Add files via upload

* Add files via upload

* Add files via upload

* Update CommonSettingsPage.xaml

* fix: 回退部分代码,修复了程序崩溃的错误

* fix: remove api.day.app

* Update CommonSettingsPageViewModel.cs

* Update CommonSettingsPage.xaml

* Update CommonSettingsPage.xaml

* Update CommonSettingsPageViewModel.cs

* Update EmailNotifier.cs

* Update EmailNotifier.cs

* Update BarkNotifier.cs

* 修正并更新前端介绍

* Revert "1"

* 修正公益服务器请求兼容性

* Revert "Revert "1""

This reverts commit 8c6effb1

---------

Co-authored-by: 秋云 <[email protected]>
Co-authored-by: 禹仔二号 <[email protected]>
Co-authored-by: yuzai <[email protected]>
Co-authored-by: DR-lin-eng <@DR-lin-eng>
Co-authored-by: 辉鸭蛋 <[email protected]>
2025-03-14 00:04:58 +08:00
80b8c968d4 校对修复所有邀约文本 (#1290)
* feat: add email and websocket notification

* fix typos.

* refactor(notifiers): 重构邮件和 WebSocket 通知器

- 提升 EmailNotifier 中的 SmtpClient 为类的成员变量,并在构造函数中初始化,优化资源使用
- 改进 WebSocketNotifier 的连接和重连逻辑,提高稳定性
- 优化通知器的错误处理和日志记录,增强可维护性

* Create BarkNotifier.cs

* Update NotificationConfig.cs

* Update NotificationService.cs

* Update CommonSettingsPageViewModel.cs

* Add files via upload

* Add files via upload

* Add files via upload

* Update CommonSettingsPage.xaml

* Delete BetterGenshinImpact/Service/Notifier/BarkNotifier.cs

* Add files via upload

* Update BarkNotifier.cs

* Update NotificationService.cs

* Update CommonSettingsPageViewModel.cs

* Update CommonSettingsPage.xaml

* Delete BetterGenshinImpact/Service/BarkNotifier.cs

* Add files via upload

* Add files via upload

* Add files via upload

* Update CommonSettingsPage.xaml

* fix: 回退部分代码,修复了程序崩溃的错误

* fix: remove api.day.app

---------

Co-authored-by: 秋云 <[email protected]>
Co-authored-by: DR-lin-eng <[email protected]>
2025-03-13 22:48:02 +08:00
辉鸭蛋 bad6db6e8a WPF-UI.Violeta 4.0.0 2025-03-13 22:44:20 +08:00
辉鸭蛋 46ebdfc452 wpfui 4.0.0 (#1255)
* new INavigationAware, remove PageService

* fix run

* fix title bar

* override OnNavigatedTo

* try fix WindowStartupLocation
2025-03-13 00:33:31 +08:00
6becb9dd5a 添加websocket和smtp通知方法,添加bark通知,websocket为qq机器人预留。 (#1254)
* feat: add email and websocket notification

* fix typos.

* refactor(notifiers): 重构邮件和 WebSocket 通知器

- 提升 EmailNotifier 中的 SmtpClient 为类的成员变量,并在构造函数中初始化,优化资源使用
- 改进 WebSocketNotifier 的连接和重连逻辑,提高稳定性
- 优化通知器的错误处理和日志记录,增强可维护性

* Create BarkNotifier.cs

* Update NotificationConfig.cs

* Update NotificationService.cs

* Update CommonSettingsPageViewModel.cs

* Add files via upload

* Add files via upload

* Add files via upload

* Update CommonSettingsPage.xaml

* Delete BetterGenshinImpact/Service/Notifier/BarkNotifier.cs

* Add files via upload

* Update BarkNotifier.cs

* Update NotificationService.cs

* Update CommonSettingsPageViewModel.cs

* Update CommonSettingsPage.xaml

* Delete BetterGenshinImpact/Service/BarkNotifier.cs

* Add files via upload

* Add files via upload

* Add files via upload

* Update CommonSettingsPage.xaml

* fix: 回退部分代码,修复了程序崩溃的错误

* fix: remove api.day.app

---------

Co-authored-by: 秋云 <[email protected]>
Co-authored-by: DR-lin-eng <[email protected]>
2025-03-13 00:06:09 +08:00
辉鸭蛋 3312837129 Merge pull request #1274 from MisakaAldrich/main
小改正则表达以支持JS脚本统计
2025-03-13 00:02:10 +08:00
起个名字好难 5272c44a44 Mining新增凝光平A 2025-03-12 23:16:44 +08:00
起个名字好难 61d635d2e2 日志分析:小改正则表达以支持JS脚本统计 2025-03-11 23:53:26 +08:00
辉鸭蛋 8298e5f827 0.43.1 2025-03-11 23:07:37 +08:00
辉鸭蛋 51ee8dc54e 修复地图追踪中的 up_down_grab_leaf 四叶印 action 不生效的问题 2025-03-11 23:04:55 +08:00
辉鸭蛋 b0c12d567b 暴力GC 2025-03-11 22:12:29 +08:00
辉鸭蛋 14a55c1204 Revert "添加暴力GC"
This reverts commit 203ae22e7b.
2025-03-11 21:16:49 +08:00
辉鸭蛋 9724b158a7 Merge pull request #1263 from Takaranoao/main-fix1262
修复 #1262 自动拾取按文档指引改键无效
2025-03-11 21:11:14 +08:00
Takaranoao a01cc93ba7 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2025-03-11 20:14:23 +08:00
Takaranoao 40f8f191a0 格式化代码 2025-03-11 20:13:18 +08:00
辉鸭蛋 4cf2085e90 Merge pull request #1267 from physligl/main
fix: move mouse to center after adjust zoom level
2025-03-11 15:42:39 +08:00
辉鸭蛋 5bfbe7f8a2 Merge pull request #1269 from Daydreamer114/patch-1
docs(fix): readme 中失效链接、跳转链接;自动钓鱼拆分
2025-03-11 15:39:23 +08:00
晓丶梦丶仁 99a769f3fc docs(fix): 失效链接、拆分(半|全)自动钓鱼 2025-03-11 13:57:22 +08:00
晓丶梦丶仁 7a9f0c68bc fix: readme 中 自动秘境 链接失效 2025-03-11 13:47:46 +08:00
秋云 54e3db9228 fix: move mouse to center after adjust zoom level 2025-03-11 11:57:03 +08:00
辉鸭蛋 203ae22e7b 添加暴力GC 2025-03-11 02:18:08 +08:00
Takaranoao f3e0c68f3e fix: update pick button names binding and initialize pick button list 2025-03-11 02:02:56 +08:00
辉鸭蛋 807dd28c04 Merge pull request #1252 from FishmanTheMurloc/main
咬钩后拉扯框识别的优化,以及着手优化抛竿
2025-03-10 20:12:40 +08:00
FishmanTheMurloc c5dd67e854 bug fix 严重的内存占用暴涨 2025-03-10 18:54:00 +08:00
FishmanTheMurloc 79257b3d3a Merge branch 'babalae:main' into main 2025-03-10 18:34:55 +08:00
FishmanTheMurloc 699ed8fc0b 选择鱼饵失败超限后不再直接判定没有鱼;抛竿逻辑不再使用prevTargetFishRect设计,改为直接取离落点最近的鱼,并由此通过了先前的三条炮鲀鱼单元测试;抛竿也采取在无目标鱼时记录失败鱼饵的设计;获取鱼群时,忽略选择鱼饵失败超限及抛竿无目标鱼超限的鱼,配有忽略时的单元测试 2025-03-10 18:25:46 +08:00
FishmanTheMurloc 34e6f4741a 钓鱼添加逻辑:选择鱼饵失败2次后,忽略该种鱼饵,且如果鱼塘中所有鱼的鱼饵被忽略就当没有鱼退出任务;并配有单元测试 2025-03-10 09:59:22 +08:00
辉鸭蛋 ad5aa1b118 fix script bug 2025-03-10 02:15:44 +08:00
辉鸭蛋 94ae0e216f update ui 2025-03-09 22:53:20 +08:00
辉鸭蛋 991da1cb69 fix fish js object 2025-03-09 22:14:27 +08:00
辉鸭蛋 fe8aeb610d fix js fish anonymous class input 2025-03-09 21:31:46 +08:00
辉鸭蛋 60b4d65f21 0.43.0 2025-03-09 20:34:59 +08:00
辉鸭蛋 abfddea2e5 暴露钓鱼的参数给脚本 2025-03-09 20:33:51 +08:00
辉鸭蛋 366e5d140a add WelcomeDialog 2025-03-09 18:55:25 +08:00
辉鸭蛋 4fc2417f26 增加自动钓鱼的提示 2025-03-08 23:57:30 +08:00
辉鸭蛋 7d0649b358 一些自动钓鱼的优化 2025-03-08 23:41:48 +08:00
FishmanTheMurloc 5bb0144c30 由于偶尔观测到抛竿时“摇摆”行为的出现,设计了一种单元测试来为修改算法做准备。此commit中,改新添加的单元测试是通过不了的。 2025-03-08 23:28:04 +08:00
辉鸭蛋 df9c4e106e 修改shell的部分内容 2025-03-08 21:55:24 +08:00
辉鸭蛋 4c820d09c5 replace: 路径追踪 -> 地图追踪 2025-03-08 20:56:36 +08:00
FishmanTheMurloc b575474cb1 获取钓鱼框成功以及超时失败的两个单元测试 2025-03-08 17:11:23 +08:00
FishmanTheMurloc b76974aa73 给钓鱼框识别增加5秒的超时限制,以应对在雷鸣仙鱼池提竿识别了假阳性而卡在钓鱼框的情况;将抛竿行为中的由于修改代码失误而实际没有起效的prevTargetFishRect变量及其逻辑恢复,并在运行中将其绘制出以观察效果;因“获得”的图标消散速度实在太慢,抛竿时改为前6秒也对其进行忽略 2025-03-08 15:29:42 +08:00
辉鸭蛋 e7ceaa7486 Merge pull request #1248 from Takaranoao/main-baolan
给配置组增加执行shell的功能,可以调用外部程序实现复杂调度
2025-03-08 15:05:23 +08:00
辉鸭蛋 f356c61051 delete no usage code 2025-03-08 14:37:57 +08:00
Takaranoao 90590b68b8 给配置组增加执行shell的功能,可以调用外部程序实现复杂调度 2025-03-07 16:39:21 +08:00
辉鸭蛋 2a173e734d Merge pull request #1245 from FishmanTheMurloc/feat/fishing_config
给js脚本的genshin.autofishing方法暴露参数 等一波优化
2025-03-06 20:51:37 +08:00
FishmanTheMurloc 2a548ecb1b 过滤“获得”图标的条件数值优化,配有单元测试用例;完善超时收杆行为,使能应对收杆的同时鱼咬杆的情况,并配有单元测试; 2025-03-06 20:32:17 +08:00
FishmanTheMurloc 462e89731d 给js脚本的genshin.autofishing方法暴露了昼夜参数、两个超时参数取独立任务页面中配置的值、关键帧截图开关常关;将BaseBehaviour<TImageRegion>中saveScreenshotOnTerminate字段由不合理的静态字段改为构造函数传入,修复关键帧截图开关在不同入口交替使用的情况下错乱的bug 2025-03-06 12:11:12 +08:00
辉鸭蛋 4305310d2d js settings ui 2025-03-06 01:26:16 +08:00
辉鸭蛋 785f5b7903 fix MessageBox ui location 2025-03-06 01:02:46 +08:00
辉鸭蛋 e602995b07 缩减单个脚本解析异常产生的影响 #1235 2025-03-06 00:54:31 +08:00
辉鸭蛋 c63439bb29 fix #1131 2025-03-06 00:35:52 +08:00
辉鸭蛋 5b5eeee9e0 Merge pull request #1237 from FishmanTheMurloc/feat/fishing_config
钓鱼任务添加整个任务的超时参数、昼夜参数
2025-03-06 00:27:47 +08:00
辉鸭蛋 8246d1a2f2 Merge remote-tracking branch 'origin/main' 2025-03-06 00:25:11 +08:00
辉鸭蛋 fc2c809702 release all key before tp & release all key after auto fight 2025-03-06 00:22:12 +08:00
FishmanTheMurloc 939c0a5106 添加了一个开关来控制是否在钓鱼的关键帧上保存截图 2025-03-05 21:32:43 +08:00
FishmanTheMurloc f8c05d2c33 合并代码修补;将退出钓鱼模式封装成行为并优化;将许多行为的日志时机从每次Tick时精简为初始化时;联机时不使用昼夜设置 2025-03-05 16:10:58 +08:00
FishmanTheMurloc d3659f3b43 Merge branch 'main' into feat/fishing_config 2025-03-05 10:26:20 +08:00
辉鸭蛋 612474e367 Merge pull request #1240 from physligl/main
feat: add _autoPickEnabled to script group
2025-03-05 09:55:42 +08:00
秋云 6f6ddf129b feat: add _autoPickEnabled to script group 2025-03-05 05:34:28 +08:00
秋云 4e44bb0e78 fix: resolve mouse simulation issue due to resolution change on screen off (#1230)
* fix: resolve mouse simulation issue due to resolution change on screen off

* fix: typo
2025-03-05 00:30:35 +08:00
FishmanTheMurloc aead279c78 单元测试HelloWorld (#1219)
* AutoFishing为单元测试重构;一个简单的单元测试GetFishpondTest

* 将鼠标操作的注入挪到DesktopRegion中;提供LoadAssetImage的一个不依赖配置的重载;ChooseBait的代码中将Bv的方法替换成不依赖配置的写法;完成ChooseBait的单元测试

* 使用TimeProvider改写ChooseBait以适用单元测试;添加假的绘图上下文类;添加抛竿行为的单元测试

* 选择鱼饵行为比对上次选择的鱼饵,如果相同则直接抛竿(之前的版本曾有此逻辑),但测下来有时会选错饵导致无限抛竿,调整了相关步骤的等待间隔,希望能简单地压制此bug

* 获取鱼群时过滤“获得”界面的鱼图标:1、在Fishpond构造函数中实现。2、配有此类情况的单元测试。3、并由此降低鱼钓上后的等待时间;
修复绘制鱼群时索引不正确导致遗漏的bug;获取鱼群时绘制鱼群供分析
2025-03-05 00:30:11 +08:00
FishmanTheMurloc e634a54913 钓鱼任务添加整个任务的超时参数、昼夜参数 2025-03-04 21:06:16 +08:00
辉鸭蛋 99df54607d 0.42.4 2025-03-02 17:14:09 +08:00
辉鸭蛋 052d8f095a fix bug 2025-03-02 13:11:46 +08:00
辉鸭蛋 ec9c17209f Merge remote-tracking branch 'origin/main' 2025-03-02 12:36:01 +08:00
辉鸭蛋 e96214f5c4 新增结束后的操作 2025-03-02 12:35:48 +08:00
秋云 1adad8149b Fix: Update tp.json configuration and fix _selectedArea update (#1227)
* fix: new tp.json

* fix: _selectedArea only update when _selecteCountry change.

* fix(config): Change default _shouldMove from true to false
2025-03-02 09:41:31 +08:00
辉鸭蛋 62c4d3e54e 新增检查每日奖励任务 2025-03-02 01:47:44 +08:00
辉鸭蛋 9c55a929ef 调度器清空所有任务添加提示 2025-03-01 23:06:59 +08:00
辉鸭蛋 31332f76b3 fix compilation errors 2025-03-01 22:27:18 +08:00
辉鸭蛋 f9c4298fac 修复火元素采集不生效的问题 2025-03-01 22:18:47 +08:00
秋云 62da52d5d8 feat: add configurable HP restoration options at Statue of the Seven (#1223)
* feat: add configurable HP restoration options at Statue of the Seven

* fix: Create GiTpPosition as subclass of GiWorldPosition

* fix: Update teleport point selection logic in ViewModel

* fix: Change log info
2025-03-01 22:04:16 +08:00
辉鸭蛋 b46836741d Merge remote-tracking branch 'origin/main' 2025-03-01 21:31:30 +08:00
辉鸭蛋 8e3f26f45c 5.4 model 2025-03-01 21:31:16 +08:00
起个名字好难 f70524b0a2 添加企业微信图片通知 (#1222)
* 添加企业微信图片通知

* 移除多余代码,修复CA1850规则
2025-02-28 13:03:58 +08:00
秋云 4932c52af9 fix: remove while loop in TpTask (#1221)
* fix: prevent infinite loop in TpTask.cs

* fix: prevent redundant zoom operation

* fix: handle party switching failures in PathExecutor; add pre-switch check for switch party task

* fix: typos.
2025-02-28 10:00:59 +08:00
辉鸭蛋 4dceb19bbe add Mizuki 5.4 2025-02-27 00:19:27 +08:00
辉鸭蛋 509ff4dce6 fix bug
1. 修复自动伐木空指针
2. 修复火神秘境
2025-02-25 01:09:49 +08:00
辉鸭蛋 5fbd10e1a9 CheckAndActivateGameWindow opt 2025-02-25 00:42:03 +08:00
mfkvfhpdx 91a0e771b9 修改调度器任务和部分独立任务失去焦点时,强制切换回游戏窗口,如果用常规的方式无法激活窗口,则第10次会尝试最小化所有窗口后激活游戏。 (#1185)
* 修改调度器任务和部分独立任务失去焦点时,强制切换回游戏窗口,如果用常规的方式无法激活窗口,则第10次会尝试最小化所有窗口后激活游戏。

* 去除未引入的类引用

* 修正战斗结束后,大概率打开队伍界面的问题

* 修复有些电脑上因未知原因,战斗0秒打断

* 把失焦激活放入了设置-通用设置-其他设置中,默认关闭。暂停恢复时,重置移动的起始时间,防止因暂停而导致超时放弃任务。
2025-02-25 00:01:33 +08:00
辉鸭蛋 75741cd115 fix bug 2025-02-24 01:26:34 +08:00
辉鸭蛋 7efcf02051 修改 切换队伍前强制前往安全的神像区域 的默认配置 2025-02-24 00:08:10 +08:00
辉鸭蛋 2b233b7e8e pathing: 延长回到神像回血的时间 #1213 2025-02-23 23:45:45 +08:00
秋云 a9896f0ff1 修改部分细节 (#1189)
* 1. MoveMapTo之前保证缩放大于2,以保证初始中心点识别不会出错;
2. 重构MoveMapTo,主要去除了首次的试探过程(由于直接使用游戏坐标来确定需要移动的距离,试探已经不再需要)。

* 直接抛出异常而不是break

* 首次切换队伍时不会触发传送,而后续切换其他队伍时(RunnerContext.Instance.PartyName 已非空)才会触发传送。修改为任何时候都触发传送。

* 打开编队前添加少许延时

* 添加配置项 切换队伍前是否前往须弥七天神像
2025-02-23 23:39:57 +08:00
辉鸭蛋 e00f0b3fa0 change project structure 2025-02-23 22:03:52 +08:00
辉鸭蛋 55442418aa 设置时间结束时,立即关闭退出 2025-02-23 21:17:16 +08:00
辉鸭蛋 82eaa86121 异常场景处理添加 遇到 x 按钮时候 按下esc 2025-02-23 20:38:34 +08:00
辉鸭蛋 56d0463510 fishing: UI调整与优化
1. 实时任务只支持半自动
2. 半自动钓鱼恢复自动提杆的能力
3. UI调整
4. 添加自动钓鱼独立任务快捷键
2025-02-23 20:33:16 +08:00
辉鸭蛋 b63ceaa88a refactor: duplicated code 2025-02-23 18:21:43 +08:00
辉鸭蛋 8babe59066 fix throw 2025-02-23 17:10:23 +08:00
辉鸭蛋 7ec2e08d3a pathing: 修复简易策略脚本异常时,RetryException没有向外抛出的问题 2025-02-23 15:58:46 +08:00
辉鸭蛋 375d796db4 more log
地图追踪中当前配队无法满足简易策略脚本时,日志提示所需角色
2025-02-22 19:10:12 +08:00
可耐的小伙纸 9f6299df88 add:使用Starward记录游戏时间 (#1164)
* add:使用Starward记录游戏时间

* feat:修复了多余的参数(手滑

* add:添加了Starward协议检测
feat:使用正则解析ini
feat:删去RegistryGameLocator.GameServer

* feat:将重复操作分离为方法

* feat:从文件读取不启动记录
2025-02-22 18:56:25 +08:00
Scarlet ad2c61590e bugfix: handle unhandled cases (#1203) 2025-02-21 13:33:38 +08:00
秋云 b82395cc3a 1. MoveMapTo之前保证缩放大于2,以保证初始中心点识别不会出错; (#1187)
2. 重构MoveMapTo,主要去除了首次的试探过程(由于直接使用游戏坐标来确定需要移动的距离,试探已经不再需要)。
2025-02-19 09:56:05 +08:00
Ayu0K 675206e9da fix #1178 修复保存键鼠脚本时丢失最后一个MacroEvent的问题 (#1188) 2025-02-19 09:55:04 +08:00
Ayu0K 7abd066b15 feat: 全局按键映射支持 (#1159)
* 更改了按键绑定UI的相关文本,增加通用设置项“启用全局按键映射”

* 全局改键功能实现
2025-02-17 22:02:39 +08:00
辉鸭蛋 95e17bdef0 fix ra 2025-02-17 21:55:57 +08:00
Scarlet 1aa23df648 feat: Chasca charged attack support (#1175) 2025-02-17 13:34:28 +08:00
辉鸭蛋andFishmanTheMurloc 2135189bf6 新版本自动钓鱼 @FishmanTheMurloc (#1176)
* Revert "Revert #1059"

This reverts commit 4b65370e9f.

* natlan fish model

* 新增调整时间的功能

* test

* Feat/new fishing (#1060)

* 没有找到鱼饵时不再抛异常而是返回行为失败;细小优化;测试分支是否配置正确

* 恢复半自动钓鱼功能(仅自动拉条);将CheckFishingUserInterface方法添加到行为树,使其直接控制启停;PutRects方法增加筛选,避免画出没有高度的框框导致残留红点在画布上;去掉局部变量_currContent;钓鱼结束不再依据_noRectsCount判断

* 添加一步抛竿后检查,避免往红色靶点抛竿导致失败

* 大家终于炼出了好用的适用纳塔版本的鱼模型;实现注释描述的“选择最多鱼吃的饵料”;添加koihead鱼类,进入抛竿时忽略koi,只看koihead;Fishpond.TargetRect补上空值处理;去掉_switchBaitContinuouslyFrameNum,目前该段代码有时候会导致发呆;钓鱼结束时多等5秒,避免“获得鱼”的提示图被错误地计入下一次抛竿找鱼的预测

* 注释了AutoFishingTrigger中,FishBite和Fishing方法中的一些代码,解除了对CaptureContent.FrameRate的引用以方便开新坑;开了个新坑AutoFishingTask

* 新增全自动钓鱼独立任务的ui界面

* 封装了所有钓鱼行为,消灭了AutoFishingTrigger中大部分私有变量,剩余一些用来在行为之间传递信息的变量被丢到Blackboard中

* 代码清理:删除AutoFishingTrigger中被注释的私有变量;行为树扩展方法移动到单独的文件中

* 封装好的行为都搬家到Behaviours.cs去了;钓鱼独立任务基本完成;Blackboard添加chooseBaitUIOpening字段以避免在选择鱼饵界面时因图标被灰色遮罩而影响图像匹配;抛竿行为添加OnTerminate方法修复合并预抛竿和抛竿行为时产生的bug

* 优化VisionContext框框的代码

* AutoFishingTask加了个转圈圈找鱼的动作

* 钓鱼任务时如果有F键以及确认键,就交互一下进入钓鱼模式

* 添加供js调用的钓鱼任务方法

* 调整视角时也调整游戏角色的朝向;因为错误率较高,抛竿前找鱼时不再对右下角图标进行模板匹配检查

* 把MoveViewpointDown封装成行为了,黑板新增字段pitchReset,改进了流程中调整视角俯仰的部分;钓鱼任务中为了避免人物待机动作吃掉钓鱼F键,ChangeView方法改成始终都按S和W键

* ThrowRod行为删去对鱼群位置的校验,该段校验经常导致发呆;并将该行为更名为GetFishpond

* 对EnterFishingMode行为进行优化并修复bug;钓鱼循环修正

* 将螺旋视角找鱼的行为简化为低头转圈找,以适应路径任务完成时经常无法朝向鱼的情况;按下钓鱼键后等待界面出现时间延长至2秒

* 添加js独立任务调用自动钓鱼

* 新增`fishing`的Action用于触发钓鱼

* AutoFishingTask删去右下角ExitFishingButtonRo的模板匹配校验,因为错误的未识别有点多;添加当前焦点窗口校验

* AutoFishingTask增加设置昼夜功能,在7点和19点各钓一轮

---------

Co-authored-by: 辉鸭蛋 <[email protected]>

---------

Co-authored-by: FishmanTheMurloc <[email protected]>
2025-02-17 11:36:10 +08:00
Scarlet 1f2ed388d6 feature:自动战斗增加换队延迟 (#1174)
* feat: increase the delay before switching party

* feat: expose the delay before checking fight ended to user

* add example value to prompt text
2025-02-17 11:33:48 +08:00
辉鸭蛋 56853c541b update 2025-02-16 00:47:00 +08:00
af8562327f 添加了项目结构说明书 (#1163)
* 添加了项目结构说明图

* 添加了项目结构说明图

* Update README.md

* Delete ProjectStructureWord/Structure.md

* 更新

* 完善了项目结构图说明书

* Update README.md

* Update README.md

* replace

---------

Co-authored-by: Because66666 <[email protected]>
Co-authored-by: 辉鸭蛋 <[email protected]>
2025-02-16 00:44:54 +08:00
Scarlet 73c73b63dd feat: drop climbing before actions that could be blocked (#1150) 2025-02-15 12:16:43 +08:00
辉鸭蛋 9748ccd9ea 0.42.0 2025-02-12 23:30:07 +08:00
辉鸭蛋 ccf1c37283 tp: expand non clickable areas 2025-02-12 23:12:26 +08:00
辉鸭蛋 aabd1e0c01 fix kale 2025-02-12 23:02:16 +08:00
辉鸭蛋 3fcc11a617 edit tp config 2025-02-12 22:41:04 +08:00
辉鸭蛋 717bd931f7 edit tp config #1145 2025-02-12 22:13:08 +08:00
Scarlet cb8a743d34 修复因原神更新引起的地图缩放问题 (#1151)
* bugfix: fix map navigation problem caused by Genshin update

* constant adjust
2025-02-12 20:53:41 +08:00
郝凯阳andhaokaiyang dccc116ea8 auto tcg: update character card config to v5.4 (#1148)
Co-authored-by: haokaiyang <[email protected]>
2025-02-12 15:31:20 +08:00
辉鸭蛋 79493b4407 Update README.md 2025-02-11 14:49:42 +08:00
辉鸭蛋 2c554ab2f4 delete debug code 2025-02-09 17:05:11 +08:00
辉鸭蛋 51216d6b84 pathing: auto skip config3 2025-02-09 15:16:22 +08:00
辉鸭蛋 040f40d94b fix notify bug 2025-02-08 22:25:00 +08:00
Houning_YA 3053e1aeb3 支持鼠标虚拟键代码 (#1124) 2025-02-08 20:42:38 +08:00
秋云 6bf0d886ca Merge pull request #1114 from physligl/main
Fix typos.
2025-02-08 13:49:11 +08:00
辉鸭蛋 f1cc1cdb94 Merge pull request #1117 from HZYgrandma/patch-6
添加迪希雅作为主要行走角色
2025-02-08 13:48:51 +08:00
辉鸭蛋 11ac1f3cfa Merge pull request #1119 from Uqbc9/main
Update avatar_macro.json  补充新角色;增加玛薇卡跳喷宏,按住极限平地9次跳喷
2025-02-08 13:47:51 +08:00
Uqbc9 ea8468b999 Update avatar_macro.json 补充新角色;增加玛薇卡跳喷宏,按住极限平地9次跳喷
补充新角色
增加玛薇卡跳喷宏,按住极限平地9次跳喷
2025-02-08 13:30:01 +08:00
洪籽阳外婆 8f5529f79d 添加迪希雅作为主要行走角色 2025-02-07 12:56:00 +08:00
辉鸭蛋 0351cc7410 0.41.0 2025-02-06 16:51:00 +08:00
辉鸭蛋 33dc5f7d42 fix tptask 2025-02-06 14:11:19 +08:00
辉鸭蛋 bb49feb19e offline package 2025-02-06 02:38:46 +08:00
辉鸭蛋 749cae4dc2 improve the recognition rate of orange option text 2025-02-06 02:16:57 +08:00
辉鸭蛋 472c169603 use R2 to distribute script files 2025-02-06 01:37:42 +08:00
辉鸭蛋 f76c877882 support only local script repo 2025-02-05 22:23:31 +08:00
辉鸭蛋 328b5f21cc add pyro_collect 2025-02-05 21:59:42 +08:00
辉鸭蛋 5118308e9d fight: kazuha cd opt 2025-02-05 21:43:05 +08:00
辉鸭蛋 d3bd62b2c4 fix party switch task
修复切换队伍时,第五个队伍无法被选中的问题
2025-02-05 21:10:08 +08:00
辉鸭蛋 9463827582 new banner 2025-02-05 10:51:05 +08:00
辉鸭蛋 445e9b8030 Merge remote-tracking branch 'origin/main' 2025-02-05 10:32:51 +08:00
辉鸭蛋 7fb04270b1 update warning text 2025-02-05 10:30:18 +08:00
辉鸭蛋 46d4045fd5 Merge pull request #1106 from MisakaAldrich/main
添加企业微信通知
2025-02-05 10:26:54 +08:00
起个名字好难 2c59fe70ad Merge branch 'babalae:main' into main 2025-02-05 00:10:12 +08:00
起个名字好难 8afcf9ddff 添加企业微信通知 2025-02-05 00:08:52 +08:00
起个名字好难 184d186c9c 添加企业微信通知 2025-02-04 23:10:58 +08:00
辉鸭蛋 eeecb5b44f pathing: auto skip config2 2025-02-04 21:48:25 +08:00
辉鸭蛋 31fcf9cedf fix WindowStartupLocation without Owner
修复脚本订阅和配置组运行的提示框在高DPI显示屏下跑到屏幕外的问题
2025-02-04 21:06:13 +08:00
辉鸭蛋 75449f8ced pathing: auto skip config 2025-02-04 20:46:14 +08:00
辉鸭蛋 202ac61242 fix #1100 2025-02-04 20:25:31 +08:00
辉鸭蛋 7ec0d649cb Merge pull request #1054 from Scarlet1ssimo/webhook
[Test In Progress] Feature: Notification-based Webhook Infrastructure
2025-02-04 17:12:55 +08:00
辉鸭蛋 92516c26d2 支持配置要通知的事件 2025-02-04 17:11:53 +08:00
辉鸭蛋 151b383c40 添加飞书通知 2025-02-03 19:28:09 +08:00
辉鸭蛋 644c3d0193 更多任务支持 2025-02-03 15:54:19 +08:00
辉鸭蛋 1efd8d9454 重构通知模块 2025-02-03 15:02:25 +08:00
辉鸭蛋 f8bcbcedf7 Merge pull request #1098 from Scighost/main
Fix the issue of WebView2 UserDataFolder cannot be created
2025-02-02 23:15:10 +08:00
Scighost e44c55eb03 Fix the issue of WebView2 UserDataFolder cannot be created 2025-02-02 22:46:43 +08:00
辉鸭蛋 7040a441f2 Merge pull request #1086 from Yang-z/main
auto pathing: add `Orientation` to `WaypointType`
2025-02-02 15:07:00 +08:00
辉鸭蛋 297618b95f fix windows notify 2025-02-01 23:03:25 +08:00
辉鸭蛋 33d742bd4d Merge branch 'main' into pr/1054 2025-02-01 22:16:36 +08:00
辉鸭蛋 1eee073adb 1. 修正 Orientation 大写的问题
2. 美化了是否作为 target 点位接近的
2025-02-01 18:11:51 +08:00
辉鸭蛋 0fe4e86bc0 more genshin settings check 2025-02-01 16:01:07 +08:00
辉鸭蛋 c2709544fa allow full folder security 2025-02-01 13:33:05 +08:00
辉鸭蛋 f109ac5a14 MSIAfterburner warning 2025-02-01 10:43:52 +08:00
辉鸭蛋 e735cacb17 fix bettergi://start not valid 2025-02-01 10:23:05 +08:00
辉鸭蛋 06b142b8b2 more check for script repo 2025-02-01 08:59:24 +08:00
辉鸭蛋 98ef56b233 Merge pull request #1087 from Scarlet1ssimo/ffopt
bugfix: 战斗结束检测
2025-02-01 07:58:28 +08:00
Scarlet c2e028c529 optimize: fight finish detection 2025-01-31 16:41:42 -06:00
Yang-z 90b8a37389 auto pathing: add Orientation to WaypointType 2025-01-31 22:19:02 +08:00
辉鸭蛋 09a520a92f remove invalid link 2025-01-31 19:06:28 +08:00
辉鸭蛋 a9f9946db6 Merge remote-tracking branch 'origin/main' 2025-01-31 19:03:10 +08:00
辉鸭蛋 982aa7834b Merge pull request #1085 from Yang-z/main
auto pathing: reduce the startup time of `MoveCloseTo`
2025-01-31 19:02:53 +08:00
辉鸭蛋 dfa0c75a15 0.40.1 2025-01-31 18:13:21 +08:00
辉鸭蛋 854baad420 test code 2025-01-31 18:13:09 +08:00
Yang-z 547a56b932 auto pathing: reduce the startup time of MoveCloseTo 2025-01-31 18:03:48 +08:00
辉鸭蛋 7d7289ac16 release all key after fight #1073 2025-01-30 10:36:49 +08:00
辉鸭蛋 70a8d544fd ui: win10 not display switch blur button 2025-01-30 10:29:14 +08:00
辉鸭蛋 137ba4384a new e detect 2025-01-30 09:55:52 +08:00
辉鸭蛋 99932e972d Merge remote-tracking branch 'origin/main' 2025-01-30 08:08:09 +08:00
辉鸭蛋 b14de9ed20 auto domain: SendInput instead of PostMessage 2025-01-30 08:07:51 +08:00
辉鸭蛋 bc286d3b47 Merge pull request #1066 from mfkvfhpdx/main
修改了几个warning警告的地方,添加路径追踪任务时,增加排除已选择目录的筛选条件,调度器任务右键新增根据文件夹移除功能。
2025-01-29 22:59:56 +08:00
辉鸭蛋 2536b14af1 fist run not init key binding 2025-01-29 22:58:23 +08:00
辉鸭蛋 c3cffff4f3 fix CheckInBigMapUi 2025-01-29 22:23:12 +08:00
辉鸭蛋 8cffb01f0a fix method confusion 2025-01-29 17:44:38 +08:00
辉鸭蛋 9694919759 new orange option judge 2025-01-29 16:17:52 +08:00
辉鸭蛋 67df9f298a if it is a target waypoint type, it will continue to approach the target after a falling attack
如果是target路径点类型,下落攻击后会继续靠近目标
2025-01-29 15:03:37 +08:00
辉鸭蛋 47d88e67c9 opt 2025-01-29 14:34:07 +08:00
辉鸭蛋 b130351d8d bgi.huiyadan.com -> bettergi.com 2025-01-29 08:41:11 +08:00
辉鸭蛋 8b52aea9a3 ui dispatcher 2025-01-29 08:12:48 +08:00
辉鸭蛋 efde38439d tp exception 2025-01-29 08:12:32 +08:00
辉鸭蛋 e42c886bbe fix domain tp 2025-01-28 16:23:43 +08:00
辉鸭蛋 3e114ad358 添加windows通知 2025-01-28 13:12:14 +08:00
辉鸭蛋 4196f05f21 replace HttpContent with another data structure 2025-01-28 08:49:24 +08:00
辉鸭蛋 2cdabcf689 Merge pull request #1071 from physligl/main
修改传送任务中大地图移动的逻辑
2025-01-28 06:56:12 +08:00
秋云 f7cbc03f3d Merge branch 'babalae:main' into main 2025-01-28 02:39:58 +08:00
秋云 ce7c88f8e8 根据临近传送点的距离确定地图缩放,根据缩放等级确定当前剩余的距离。 2025-01-28 02:38:26 +08:00
辉鸭蛋 670bb3adad 修改序列化方式,添加测试数据 2025-01-27 20:47:17 +08:00
辉鸭蛋 6c16296b1b 修改 notify config 的获取方式 2025-01-27 20:13:53 +08:00
mfkvfhpdx 770edfab8a Merge branch 'babalae:main' into main 2025-01-27 15:15:26 +08:00
zjl 6a14a8c342 修改了几个warning警告的地方,添加路径追踪任务时,增加排除已选择目录的筛选条件,调度器任务右键新增根据文件夹移除功能。 2025-01-27 15:14:28 +08:00
辉鸭蛋 f19ee557b2 Merge branch 'main' into webhook 2025-01-27 13:57:23 +08:00
辉鸭蛋 2d0a7b5da8 typo 2025-01-27 13:56:27 +08:00
辉鸭蛋 ff92365bb4 Merge remote-tracking branch 'origin/main' 2025-01-27 12:32:16 +08:00
辉鸭蛋 81c84b94a5 Merge pull request #984 from babalae/readme-fix
Update README.md
2025-01-27 10:44:37 +08:00
辉鸭蛋 3fea7963ce Update README.md 2025-01-27 10:44:19 +08:00
辉鸭蛋 3ce54801c6 notify icon: check update 2025-01-27 09:22:11 +08:00
mfkvfhpdx 7b259e0329 Merge branch 'babalae:main' into main 2025-01-27 08:43:31 +08:00
zjl 8fdc664400 恢复版本 2025-01-27 08:42:33 +08:00
zjl 247580c04f Merge remote-tracking branch 'origin/main' 2025-01-27 08:28:21 +08:00
zjl 9de4fd4dfa 恢复代码 1 2025-01-27 08:17:41 +08:00
zjl bdaace9c8b 修正一个可能引发空指针的问题 2025-01-27 08:16:23 +08:00
辉鸭蛋 e30e919539 fix NullReferenceException #1063 2025-01-27 08:14:23 +08:00
zjl 3019d1aefa 修正一个可能引发空指针的问题 2025-01-27 08:14:14 +08:00
辉鸭蛋 8d4038d2e8 new appveyor build 2025-01-27 08:03:16 +08:00
辉鸭蛋 489d13dbcf add 蓝砚 in ElementalCollectAvatarConfigs 2025-01-26 23:48:13 +08:00
辉鸭蛋 7091da2c9f Merge remote-tracking branch 'origin/main' 2025-01-26 23:20:13 +08:00
辉鸭蛋 945085c34c typo 2025-01-26 23:10:17 +08:00
mfkvfhpdx 5513931fb6 Merge branch 'babalae:main' into main 2025-01-26 22:19:14 +08:00
辉鸭蛋 9a421860d0 Merge pull request #1062 from cx05121/main
拾取黑名单添加“蓝砚”
2025-01-26 21:43:51 +08:00
曦 edaf5ac443 more pick black item 2025-01-26 21:35:20 +08:00
mfkvfhpdx 8e9776f17c Merge branch 'babalae:main' into main 2025-01-26 18:49:27 +08:00
zjl 54e062d490 恢复上一个版本 2025-01-26 18:48:28 +08:00
辉鸭蛋 0468854ac5 fix auto fight NPE 2025-01-26 18:47:35 +08:00
zjl 10cb31af57 修正当战斗脚本中人员不在队伍是引发的异常 2025-01-26 18:46:42 +08:00
mfkvfhpdx 3cca2f329d Merge branch 'babalae:main' into main 2025-01-26 18:42:50 +08:00
辉鸭蛋 af0a869c70 shutdown when user config migrate 2025-01-26 17:09:19 +08:00
辉鸭蛋 f0baf74dc8 0.40.0 2025-01-26 14:02:17 +08:00
辉鸭蛋 8862f57958 Merge remote-tracking branch 'origin/main' 2025-01-26 12:56:21 +08:00
辉鸭蛋 bd72e6420d fist run old version clear 2025-01-26 12:55:57 +08:00
mfkvfhpdx 8c45a02deb 调整日志分析一些字段为0时显示为空,增加了异常情况统计(复活、重试、传送失败、战斗超时)。 (#1056)
* 调整日志分析一些字段为0时显示为空,增加了异常情况统计(复活、重试、传送失败、战斗超时)。

* 修正一个赋值错误

* 日志分析表格,使隔行颜色样式不一样

* 增加了锄地延时,通过控制延时相对精确的显示怪物数量

* 删除不必要的输出

* 调度器任务,增加 任务倒序排列功能。调度器配置增加“不在某时执行”,当执行完一个路线后,如果时间为当前配置的时间(范围:0-23),则此路径追踪任务后续都将都跳过,适用于连续执行的兜底任务,例如想通宵挂机,并且在4点后,开始执行新的任务。
2025-01-26 11:17:19 +08:00
mfkvfhpdx 0dd1dffccb Merge branch 'babalae:main' into main 2025-01-26 08:55:08 +08:00
辉鸭蛋 9ba3447ab1 modify the position of the UI for map teleportation settings
修改地图传送设置ui的位置
2025-01-26 00:20:01 +08:00
辉鸭蛋 218029b2e6 0.39.7 2025-01-25 23:53:15 +08:00
辉鸭蛋 718db28e51 update ui icon 2025-01-25 23:48:14 +08:00
辉鸭蛋 b639b1902e fix solo task run 2025-01-25 23:36:24 +08:00
辉鸭蛋 e97e04f9db auto music: more config
千音雅集支持更多的参数控制,以及文案和界面优化
2025-01-25 23:03:50 +08:00
mfkvfhpdx 7a07719bf8 Merge branch 'babalae:main' into main 2025-01-25 22:30:57 +08:00
zjl d0f985408e 调度器任务,增加 任务倒序排列功能。调度器配置增加“不在某时执行”,当执行完一个路线后,如果时间为当前配置的时间(范围:0-23),则此路径追踪任务后续都将都跳过,适用于连续执行的兜底任务,例如想通宵挂机,并且在4点后,开始执行新的任务。 2025-01-25 22:29:37 +08:00
辉鸭蛋 4b65370e9f Revert #1059 2025-01-25 16:54:37 +08:00
辉鸭蛋 5259b1f351 startOneDragon command line #998 2025-01-25 16:49:05 +08:00
辉鸭蛋 1afeb0818a #974 2025-01-25 15:55:36 +08:00
辉鸭蛋 99ab38d950 Merge remote-tracking branch 'origin/main' 2025-01-25 13:57:59 +08:00
辉鸭蛋 1d5f5c772e update ui 2025-01-25 13:55:19 +08:00
辉鸭蛋 869050283b Merge pull request #1045 from FishmanTheMurloc/main
使用行为树对自动钓鱼进行了改写,以利往后的优化
2025-01-25 13:53:15 +08:00
FishmanTheMurloc bb692a476e 添加纳塔鱼和鱼饵;添加鱼大类ray以合并两种细分的formalo ray和divda ray 2025-01-25 13:06:04 +08:00
FishmanTheMurloc 518ed95dbe Merge branch 'babalae:main' into main 2025-01-25 12:05:46 +08:00
辉鸭蛋 987e723b8c BetterGI.exe startOneDragon 2025-01-25 10:31:30 +08:00
辉鸭蛋 3c84f3817d auto tcg: fix error 2025-01-24 22:48:25 +08:00
mfkvfhpdx 319e88bb0c Merge branch 'babalae:main' into main 2025-01-24 22:39:45 +08:00
辉鸭蛋 6beb9fddba Merge pull request #1058 from physligl/main
增加了地图移动的相关参数设置的界面
2025-01-24 22:00:18 +08:00
秋云 020c841bc2 Merge branch 'babalae:main' into main 2025-01-24 20:42:18 +08:00
秋云 b445c71e52 增加了地图移动的相关参数设置。 2025-01-24 20:38:45 +08:00
mfkvfhpdx 56e110d11f Merge branch 'babalae:main' into main 2025-01-24 20:30:14 +08:00
辉鸭蛋 a5e1478ecf revert & dash 2025-01-24 19:48:45 +08:00
zjl 72cc9d8d01 Merge remote-tracking branch 'origin/main' 2025-01-24 19:20:59 +08:00
zjl 39b7176b4d 删除不必要的输出 2025-01-24 19:20:47 +08:00
mfkvfhpdx 6fcf213631 Merge branch 'babalae:main' into main 2025-01-24 19:20:08 +08:00
zjl 7c620429c3 增加了锄地延时,通过控制延时相对精确的显示怪物数量 2025-01-24 19:19:09 +08:00
辉鸭蛋 158688d435 fix patch 1 2025-01-24 18:08:56 +08:00
辉鸭蛋 8caa52e988 Acrylic first 2025-01-24 01:21:09 +08:00
辉鸭蛋 82275bd1e5 Merge remote-tracking branch 'origin/main' 2025-01-24 00:16:49 +08:00
辉鸭蛋 4129510029 0.39.6 2025-01-24 00:16:25 +08:00
辉鸭蛋 917ba1460d fix some bug 2025-01-24 00:16:11 +08:00
zjl d70ed4314a 日志分析表格,使隔行颜色样式不一样 2025-01-23 23:04:58 +08:00
秋云 3cc3eb44a4 fix typos. 2025-01-23 23:00:57 +08:00
zjl 07efcbde4f 修正一个赋值错误 2025-01-23 22:58:38 +08:00
zjl d33e54c50f Merge remote-tracking branch 'origin/main' 2025-01-23 22:54:15 +08:00
zjl f7779af01b 调整日志分析一些字段为0时显示为空,增加了异常情况统计(复活、重试、传送失败、战斗超时)。 2025-01-23 22:53:59 +08:00
辉鸭蛋 29f219aee9 Merge pull request #1055 from mfkvfhpdx/main
调整删除逻辑,软链接目录直接删除目录而非文件递归删除,方便引入自己的目录,防止订阅全部时被删除。
2025-01-23 12:50:36 +08:00
Scarlet cb84ae36d0 feat: integrate send() method into notification to allow for shorter call 2025-01-22 12:34:42 -06:00
zjl 1af75ecc64 调整删除逻辑,软链接目录直接删除目录而非文件递归删除,方便引入自己的目录,防止订阅全部时被删除。 2025-01-22 22:31:19 +08:00
Scarlet 2181e74a30 feat: unify factories; allow creating from actual params to instantiate a builder 2025-01-21 23:42:31 -06:00
Scarlet ec7ecbf9e0 remove unused references 2025-01-21 22:54:51 -06:00
Scarlet 50513613de feature: notification-based webhook 2025-01-21 22:22:27 -06:00
辉鸭蛋 39d7422ab9 new world model 2025-01-21 23:09:47 +08:00
辉鸭蛋 12cc958705 updater 2025-01-21 23:01:35 +08:00
辉鸭蛋 197e991a89 0.39.5 2025-01-21 22:51:57 +08:00
辉鸭蛋 6ee4318d24 Merge pull request #1036 from mfkvfhpdx/main
调整“按日锄地摩拉统计”为“按日摩拉收益统计”,并增加统计突发事件委托收益。
2025-01-21 22:47:09 +08:00
mfkvfhpdx 6fcc0685e6 Merge branch 'babalae:main' into main 2025-01-21 08:33:33 +08:00
辉鸭蛋 7f7d28825e fixed #1043 #1044 2025-01-21 02:00:26 +08:00
辉鸭蛋 ccb8025676 auto start capture on solo task start2 #1048 2025-01-21 01:56:42 +08:00
辉鸭蛋 2ff5a8930d Revert "auto start capture on solo task start #1048"
This reverts commit ef92586af6.
2025-01-21 01:46:53 +08:00
辉鸭蛋 ef92586af6 auto start capture on solo task start #1048 2025-01-21 01:43:48 +08:00
辉鸭蛋 bd1702af23 quick tp: support Obsidian Totem Pole 2025-01-21 00:03:05 +08:00
辉鸭蛋 23c922d67a Merge pull request #1039 from Scarlet1ssimo/betterscan
优化锄地战斗后捡掉落物的逻辑
2025-01-20 23:46:23 +08:00
辉鸭蛋 89acd1fc65 fix daily reward 2025-01-20 23:17:59 +08:00
mfkvfhpdx 0b17dc30fe Merge branch 'babalae:main' into main 2025-01-20 13:39:56 +08:00
辉鸭蛋 c61691ec1e init key binding on first run 2025-01-20 00:56:12 +08:00
辉鸭蛋 ca96204e01 install path 2025-01-20 00:22:40 +08:00
zjl 919818a424 调度器配置增加 “根据技能CD优化出招人员”配置。根据填入人或人和cd,来决定当此人元素战技cd未结束时,跳过此人出招,来优化战斗流程,可填入人名或人名数字(用逗号分隔),多种用分号分隔,例如:白术;钟离,12;,如果人名,则用内置cd检查(或填入数字也小于0),如果是人名和数字,则把数字当做出招cd(秒)。 2025-01-19 22:11:47 +08:00
FishmanTheMurloc 28cc3fb3e3 使用行为树对自动钓鱼进行了改写,以利往后的优化 2025-01-19 17:46:11 +08:00
Scarlet fb61b83df5 remove extra logging; refine comments 2025-01-18 21:30:30 -06:00
Scarlet 79aa1505d3 feature: better scan pick 2025-01-18 21:20:02 -06:00
zjl ae954fceb8 调整“按日锄地摩拉统计”为“按日摩拉收益统计”,并增加统计突发事件委托收益。 2025-01-18 22:37:57 +08:00
辉鸭蛋 dcafd64139 save theme 2025-01-18 17:54:59 +08:00
辉鸭蛋 5ab63a9e76 retry for open party choose ui 2025-01-18 15:53:40 +08:00
辉鸭蛋 9ddd3c5564 code clean 2025-01-18 15:12:35 +08:00
辉鸭蛋 a36f938e8a Merge pull request #1025 from mfkvfhpdx/main
路径追踪增加增加  允许在jsScript脚本中启用此路径追踪配置、覆盖JS中的自动战斗配置 。
2025-01-18 15:06:58 +08:00
辉鸭蛋 5a7721c534 Merge pull request #1022 from physligl/main
修复传送时遇到的部分问题
2025-01-18 15:06:49 +08:00
辉鸭蛋 12beabc6a2 fixed #971 2025-01-18 12:25:08 +08:00
辉鸭蛋 3da43f3543 fixed #997 2025-01-18 12:05:58 +08:00
辉鸭蛋 ba3f97c63f pathing: run -> dash
持续跑动改成多次冲刺
2025-01-18 11:16:12 +08:00
zjl f14c61145f 重试时战斗策略不跳过 2025-01-18 09:15:41 +08:00
辉鸭蛋 daf6525172 pathing opt
stop_flying下落后都会有个类似target逼近的过程,path类型节点可以取消这个表现
2025-01-18 01:13:28 +08:00
辉鸭蛋 38ea7833c1 opt
优化月卡的的领取
减少获取历练点的点击次数
2025-01-18 01:08:39 +08:00
辉鸭蛋 39da7b489f lock start 2025-01-18 00:53:47 +08:00
辉鸭蛋 e08b0875ee fix lag 2025-01-17 23:12:14 +08:00
zjl e2d0ca5974 去掉战斗部分,主界面判断,减少误判 2025-01-17 14:07:47 +08:00
秋云 89e00207cb 优化传送到七天神像回血的体验。 2025-01-17 03:27:58 +08:00
辉鸭蛋 02f6309a11 fix auto domain dont walk to F 2025-01-17 01:52:43 +08:00
zjl 1a0d61ac94 路径追踪增加 允许在jsScript脚本中启用此路径追踪配置、覆盖JS中的自动战斗配置 。默认为否,开启后可以使JS脚本中的路径追踪和自动战斗,使用该调度器所配置的参数运行 2025-01-16 23:53:17 +08:00
秋云 1538445990 把原本删除的INF级别时间显示回复,并改为DBG级别。 2025-01-16 10:16:43 +08:00
秋云 8a63ac8914 fix typo. 2025-01-16 08:24:08 +08:00
秋云 c87ba278e9 修复了影向山和太山府附近点错传送锚点的问题。 2025-01-16 08:18:50 +08:00
秋云 55b2b48e43 修改日志中时间的时间显示格式。 2025-01-16 08:16:39 +08:00
秋云 30a1b4d40f Merge branch 'main' of https://github.com/physligl/better-genshin-impact 2025-01-16 01:27:37 +08:00
辉鸭蛋 4f6724613a fix some bug 2025-01-16 01:13:05 +08:00
辉鸭蛋 04399c1780 fix log 2025-01-15 23:44:02 +08:00
辉鸭蛋 48ddd1751c + elemental collect avatar
早柚
2025-01-15 23:18:41 +08:00
辉鸭蛋 ccc5c68c1c auto tcg force check resolution 2025-01-15 01:05:28 +08:00
辉鸭蛋 340c4caf49 fix 4 am skip blessing of the welkin moon 2025-01-15 01:03:16 +08:00
辉鸭蛋 9ef5cff886 0.39.3 2025-01-13 22:55:10 +08:00
秋云 ad4993c3cf Add some comments 2025-01-13 08:38:10 +08:00
秋云 01fe05e0c8 Remove unused code from FeatureStorage.cs 2025-01-13 08:36:03 +08:00
辉鸭蛋 a22002966e auto update 2025-01-13 01:17:11 +08:00
辉鸭蛋 8666c931d9 auto path opt
1. 超时直接放弃路径点
2. 所有时间都现取现用
2025-01-12 22:55:51 +08:00
辉鸭蛋 1b7ea8b16b Merge remote-tracking branch 'origin/main' 2025-01-12 22:29:37 +08:00
辉鸭蛋 5552813d61 more pick black item 2025-01-12 22:08:18 +08:00
辉鸭蛋 5e03a29a8e Merge pull request #996 from mfkvfhpdx/main
功能调整和日志分析增加锄地统计
2025-01-12 22:00:05 +08:00
辉鸭蛋 dd9e700485 more game resolution check 2025-01-12 21:45:02 +08:00
辉鸭蛋 d5838017d7 fix script import bug 2025-01-12 21:09:48 +08:00
mfkvfhpdx 64feced367 Merge branch 'babalae:main' into main 2025-01-11 22:43:53 +08:00
辉鸭蛋 9d504443f7 Merge pull request #1001 from physligl/main
添加路径追踪中输出日志的功能。
2025-01-11 11:04:39 +08:00
秋云 1f70cfb364 Merge branch 'main' of https://github.com/physligl/better-genshin-impact 2025-01-11 01:58:30 +08:00
秋云 5f18901e22 添加路径追踪中输出日志的功能。 2025-01-11 01:58:23 +08:00
mfkvfhpdx c4e2f49f4b Merge branch 'babalae:main' into main 2025-01-11 00:33:16 +08:00
辉鸭蛋 1fe5281018 Merge pull request #994 from atiasn/auto-music
增加所有乐曲达成【大音天籁】
2025-01-11 00:06:03 +08:00
辉鸭蛋 dfc8c61c8d test code 2025-01-11 00:01:02 +08:00
NextKale 21bef81374 remove old code 2025-01-10 22:55:26 +08:00
NextKale a90f22a8d5 music level 2025-01-10 22:52:18 +08:00
mfkvfhpdx 31994ce2f4 更多功能增加脚本仓库入口,方便订阅更新。 2025-01-10 22:00:21 +08:00
mfkvfhpdx b0f0b26092 增加了复制组功能,和根据文件夹更新功能 2025-01-10 21:52:01 +08:00
mfkvfhpdx 58db3ad04c 修正分析计时 2025-01-10 17:54:49 +08:00
mfkvfhpdx b686d88134 日志分析开放更多的天数选择 2025-01-10 17:13:59 +08:00
mfkvfhpdx 017f8ed5b0 调整统计排序 2025-01-10 15:07:30 +08:00
mfkvfhpdx 2c727d5e6d 调整使用真正的gameinfo 2025-01-10 11:08:16 +08:00
mfkvfhpdx ebd8031f2c Merge branch 'main' into main 2025-01-10 10:29:53 +08:00
mfkvfhpdx 7d872704c2 日志分析增加锄地分析,锄地分析基于米游社旅行札记,需要输入token才能看到锄地分析地数据。 2025-01-10 10:25:30 +08:00
辉鸭蛋 6e7c7fb78e eye catching tips 2025-01-10 01:56:19 +08:00
辉鸭蛋 1469da4699 ui #936 2025-01-10 01:32:21 +08:00
辉鸭蛋 fcac4aa811 tp wait 1 min #932 2025-01-10 01:18:40 +08:00
辉鸭蛋 072943baf9 #955 2025-01-10 01:07:15 +08:00
辉鸭蛋 6591c8a387 fixed #951 2025-01-10 01:04:31 +08:00
辉鸭蛋 9f11fc984d add no select domain option 2025-01-10 00:59:31 +08:00
辉鸭蛋 902b319211 触发器触发频率必须大于0 2025-01-10 00:51:35 +08:00
辉鸭蛋 2e27154871 mandatory verification of game resolution
自动战斗 秘境 强制校验游戏分辨率
2025-01-10 00:11:22 +08:00
辉鸭蛋 e2afabc7f6 fixed #988
修复战斗策略参数校验提示在()不存在时未正确展示的问题
2025-01-10 00:04:14 +08:00
辉鸭蛋 7853901137 log text optimization
文本优化(战斗策略文件不存在、sendInput被拦截、路径追踪中战斗策略日志打印修改)
2025-01-09 23:58:28 +08:00
辉鸭蛋 cd3713175a auto pathing: don't get close during the battle.
战斗时不需要接近点位
2025-01-09 23:49:49 +08:00
辉鸭蛋 3f2a3b118a auto pathing: add auto run config
并且枫丹合成台不自动跑步
2025-01-09 23:41:53 +08:00
NextKale 7edd0c2565 music 2025-01-09 21:16:31 +08:00
NextKale 66fc5fc080 music 2025-01-09 21:10:19 +08:00
NextKale a52dddb70a Merge branch 'main' into auto-music 2025-01-09 21:00:53 +08:00
NextKale 2df7598304 Merge branch 'main' of github.com:atiasn/better-genshin-impact 2025-01-09 21:00:18 +08:00
mfkvfhpdx a9d8659be7 界面去除了偏色调整,战斗识别颜色调整为范围白和范围黄。当万叶技能cd大于3秒或当前一人次就结束了战斗(基本为没有怪物情况),则跳过此次万叶也拾取。未知界面检查,支持暂停情况。 2025-01-09 19:25:42 +08:00
辉鸭蛋 74f0aa71c3 Merge pull request #989 from physligl/main
添加日志分析匹配日志文件带后缀的情况。
2025-01-08 23:57:56 +08:00
秋云 3239003b22 Merge branch 'babalae:main' into main 2025-01-08 22:33:35 +08:00
秋云 4415e85856 添加匹配日志文件带后缀的情况。 2025-01-08 22:29:46 +08:00
NextKale 291652d75f Merge branch 'babalae:main' into auto-music 2025-01-08 11:46:38 +08:00
辉鸭蛋 a6fc3aac76 Update README.md 2025-01-08 01:21:56 +08:00
辉鸭蛋 828d673509 Merge pull request #983 from physligl/main
修复地图移动的一些已知问题
2025-01-08 01:16:07 +08:00
秋云 b92c52cb5c 合并。 2025-01-08 00:56:31 +08:00
秋云 e11af29b45 Merge branch 'main' of https://github.com/physligl/better-genshin-impact 2025-01-08 00:54:03 +08:00
秋云 b9dd66f87a 合并。 2025-01-08 00:53:49 +08:00
秋云 65e2da4123 Merge branch 'babalae:main' into main 2025-01-08 00:47:42 +08:00
秋云 a85129b087 修复移动地图时概率持续点击标记。 2025-01-08 00:47:07 +08:00
辉鸭蛋 be31d0962f Merge pull request #976 from Womsxd/fix/nested-directories-installer
fix(Setup): 修复BGI安装包多一层文件夹
2025-01-07 23:34:26 +08:00
NextKale 64efabde8f auto music 2025-01-07 23:06:51 +08:00
NextKale a0993b172b Merge branch 'main' of github.com:atiasn/better-genshin-impact 2025-01-07 22:41:00 +08:00
辉鸭蛋 2a6f8fcab2 Merge pull request #980 from HZYgrandma/patch-5
Update README.md
2025-01-07 16:18:00 +08:00
洪籽阳外婆 887e812b28 Update README.md 2025-01-07 14:57:05 +08:00
Womsxd 48b51a60e1 fix(Setup): 修复BGI安装包多一层文件夹 2025-01-07 11:49:05 +08:00
辉鸭蛋 3fb35051d1 update UnityLogGameLocator 2025-01-07 01:08:52 +08:00
秋云 e2530a1001 Merge branch 'main' of https://github.com/physligl/better-genshin-impact 2025-01-07 01:03:20 +08:00
辉鸭蛋 07b8899a51 auto domain: extend the waiting time 2025-01-07 00:33:21 +08:00
辉鸭蛋 55fb63782e remove force team names 2025-01-07 00:22:51 +08:00
辉鸭蛋 1b46502374 0.39.2 2025-01-07 00:19:07 +08:00
辉鸭蛋 580c4754a4 Merge pull request #914 from mfkvfhpdx/main
路径追踪支持 未知界面检查关闭,主要用来解决狗粮、或锄地捡物品,有小概率误触烹饪界面的问题。
2025-01-07 00:17:03 +08:00
辉鸭蛋 30827b2ff4 fix conflicts 2025-01-07 00:14:39 +08:00
辉鸭蛋 9f46fb00be Merge branch 'main' into main 2025-01-07 00:12:41 +08:00
辉鸭蛋 b0236a7a04 Merge pull request #956 from Ayu0K/feat/key-binding-config
[feature] 添加按键绑定自定义功能
2025-01-07 00:09:38 +08:00
Ayu0K 608f135640 mod: 修改打开派蒙界面的按键,使其支持改键 2025-01-06 23:59:55 +08:00
辉鸭蛋 b776ec73a4 Merge pull request #973 from chisato2233/main
美化了部分窗口表现
2025-01-06 23:46:51 +08:00
Ayu0K 2bf74c466b fix: 删除了中途更改全局改键功能的实现方式时遗留的无用代码 2025-01-06 23:30:36 +08:00
辉鸭蛋 76829bd3e1 Merge branch 'main' into feat/key-binding-config 2025-01-06 23:24:09 +08:00
Ayu0K 00ece6ce7a mod: 修改了界面绑定设置UI的描述 2025-01-06 22:55:08 +08:00
Ayu0K 71876a5e65 mod: 更改开书按键 2025-01-06 22:55:08 +08:00
Ayu0K 89109958a2 mod: 更改纪行按键 2025-01-06 22:55:08 +08:00
Ayu0K d179eb9949 mod: 修改剧情选项交互按键 2025-01-06 22:55:08 +08:00
Ayu0K be98f10851 mod: 修改按键方式 2025-01-06 22:55:08 +08:00
Ayu0K 6067058530 mod: 更改移动、跳跃、下落的方式 2025-01-06 22:55:08 +08:00
Ayu0K 19f1315d0a mod: 更改打开任务菜单、开启任务追踪、控制角色前进的方法 2025-01-06 22:55:08 +08:00
Ayu0K 56e4dc2dd6 mod: 修改控制角色前进的方法 2025-01-06 22:55:08 +08:00
Ayu0K e37be52f0e mod: 修改向前移动和跳起的方式 2025-01-06 22:55:08 +08:00
Ayu0K 543e36f77e mod: 更改打开地图的方式 2025-01-06 22:55:08 +08:00
Ayu0K 3b54844e6b mod: 修改打开背包的方式 2025-01-06 22:55:08 +08:00
Ayu0K 8822346f3b mod: 修改ScanPickTask控制角色向前的方式 2025-01-06 22:55:08 +08:00
Ayu0K d54d31454d mod: 修改SwitchPartyTask打开编队界面的方式 2025-01-06 22:55:08 +08:00
Ayu0K 5f525f82d7 mod: 修改QuickSereniteaPotTask发送虚拟按键的方式 2025-01-06 22:55:08 +08:00
Ayu0K f78d7bfcec mod: 修改PathExecutor发送虚拟按键的方式 2025-01-06 22:55:08 +08:00
Ayu0K 2e331dbbc6 fix: 修改了KeyBindingSettingModel的命名空间 2025-01-06 22:55:08 +08:00
Ayu0K f77251551e mod: 修改115行中写死的VK_F为PickVK 2025-01-06 22:55:08 +08:00
Ayu0K 68d6cb18ef mod: 替换为使用扩展方法,不直接调用SimulateKeyHelper 2025-01-06 22:55:07 +08:00
Ayu0K 6d430429f7 add: 为GIActions扩展转换为KeyId的方法 2025-01-06 22:55:07 +08:00
Ayu0K bd811b1bdf mod: 使用新方案替代直接从KeyBindingsConfig中取值 2025-01-06 22:55:07 +08:00
Ayu0K 15f363196c mod: 使用新方案替代直接从KeyBindings中读取按键 2025-01-06 22:55:07 +08:00
Ayu0K c904ae5150 mod: 使用新方案改写自动战斗逻辑Avatar 2025-01-06 22:55:07 +08:00
Ayu0K c7e2d83fb8 mod: 使用新方案改写AutoFightTask 2025-01-06 22:55:07 +08:00
Ayu0K a11639f243 mod: 使用新的方案改写AutoDomain 2025-01-06 22:55:07 +08:00
Ayu0K 19558c9c53 add&mod: 将SimulateAction改为扩展方法,不再继承PostMessageSimulator和InputSimulatorExtension;对于部分不支持的按键和功能(如PostMessageSimulator中的鼠标侧键)予以忽略处理 2025-01-06 22:55:07 +08:00
Ayu0K b183762df7 行尾字符标准化 2025-01-06 22:55:07 +08:00
Ayu0K b32b0f8af1 fix: 监听按键松开时未使用配置的值 2025-01-06 22:55:07 +08:00
Ayu0K daf2b3d1ba add: 添加Simulation2用于根据需要的操作进行按键 2025-01-06 22:55:07 +08:00
Ayu0K c4b705c350 mod: 修改UpDownGrabLeaf中的抓取四叶印(某些模式下的交互)按键,直接使用KeyBindingsConfig中的值 2025-01-06 22:55:07 +08:00
Ayu0K e7d76cdae1 mod: 修改PickAroundHandler,直接使用KeyBindings中的值 2025-01-06 22:55:07 +08:00
Ayu0K 8d577050d1 mod: 修改NahidaCollectHandler中元素战技的按键,直接从KeyBindingsConfig中获取值 2025-01-06 22:55:07 +08:00
Ayu0K 242832edc9 mod: 修改ElementalSkillHandler使用的按键,直接获取KeyBindingsConfig中的值 2025-01-06 22:55:07 +08:00
Ayu0K e39eb9ef93 mod: 修改AutoFight下Avatar(角色战斗逻辑)中的按键,由于该类不是Base On ISoloTask接口的,因此将读取配置文件的操作放在构造函数中。 2025-01-06 22:55:07 +08:00
Ayu0K 2db2c1957a mod: 为连发功能提供改键支持 2025-01-06 22:55:07 +08:00
Ayu0K 60ccbfbace fix: 删除不需要的异常处理结构 2025-01-06 22:55:07 +08:00
Ayu0K 5786ba7634 mod: 修改提示文本 2025-01-06 22:55:07 +08:00
Ayu0K bc6970b6c5 mod: 更改KeyBindingTextBox的行为,在获得焦点时显示输入提示,并忽略取得焦点前的鼠标左键单击事件 2025-01-06 22:55:07 +08:00
Ayu0K 06ee8ab1cc mod: 修改了注释 2025-01-06 22:55:07 +08:00
Ayu0K ac866f9293 fix: 按键名称Unknown 2025-01-06 22:55:07 +08:00
Ayu0K ca3b31f84e mod: 将按键设置与VK解耦合,并提供KeyId向WPF按键、WPF鼠标按键以及VK的互相转换。 2025-01-06 22:55:07 +08:00
Ayu0K a80f6fc423 fix: 修改VK_OEM_PLUS对应的按键名称 2025-01-06 22:55:07 +08:00
Ayu0K 4cfff57b2c mod: 修改AutoFightTask中检测战斗结束使用的打开编队界面和取消攀爬的按键为KeyBindingsConfig记录的按键;修改方案参考AutoWood,在调用Start方法时将该模块需要用到的按键从KeyBindingsConfig中取出 2025-01-06 22:55:07 +08:00
Ayu0K 114a84a9e8 fix: 修正默认的编队键位 2025-01-06 22:55:07 +08:00
Ayu0K 9fa2bcb5a7 mod: 将AutoDomain启动秘境与领取奖励的识别目标和拾取按键与AutoPick统一 2025-01-06 22:55:07 +08:00
Ayu0K 5d80d6d53b mod: 修改AutoDomain中角色移动(用于支持非QWERTY布局的键盘)、冲刺、吃药的按键为KeyBindingsConfig记录的按键;修改方案参考AutoWood,在调用Start方法时将该模块需要用到的按键从KeyBindingsConfig中取出 2025-01-06 22:55:07 +08:00
Ayu0K 5a19b7d2ef mod: 将AutoDomain启动秘境与领取奖励的识别目标和拾取按键与AutoPick统一 2025-01-06 22:55:07 +08:00
Ayu0K accd0280bb add: 添加从注册表中读取按键的功能(待完善:星之归还、隐藏UI按键无法获取;拾取按键、派蒙菜单按键可能存在错误) 2025-01-06 22:55:07 +08:00
Ayu0K 317a526f16 add: 按键绑定的GUI实现(初步) 2025-01-06 22:55:07 +08:00
Ayu0K 8dd6131c94 add: 集成按键绑定配置 2025-01-06 22:55:07 +08:00
Feiran Zhang 0a04734a40 添加茜特菈莉作为循环短E角色 2025-01-06 22:55:07 +08:00
辉鸭蛋 38e5de35a2 Delete 1岩水雷火四神.txt 2025-01-06 22:55:07 +08:00
洪籽阳外婆 5353231810 Update README.md
Update Screenshot
2025-01-06 22:55:07 +08:00
秋云 476f36a19a 确保传送任务开始前一定位于地图界面。 2025-01-06 22:55:07 +08:00
Baisbt 8a6bb597c4 Add files via upload 2025-01-06 22:55:07 +08:00
masm611 b90a6c4227 修正windows10_1909版本WGC故障
windows10_1909版本的WGC不支持IsCursorCaptureEnabled,加了个动态判断防止异常与抓屏失败等。
但是这样就有可能会抓到光标导致图像识别失败,但是个人认为瘦死的骆驼比马大,没有这个api就不调用即可,好歹还能用一下
如果有必要,后面可以考虑加一个弹窗警告一下啥的,但是这样可能会让用户糟心,总不能逼人家换个系统吧?但是不弹窗呢又好像向用户隐藏了某些可能存在的错误,好像又不太对啥的。
只能说云原神的限制还是大了一点,要不要加弹窗我无法决策,还是由大佬来吧
2025-01-06 22:55:07 +08:00
辉鸭蛋 0650bebefa fix genshin install path get 2025-01-06 22:55:07 +08:00
__Chisato__ 6536cad9fd 增加了更改窗口模糊的选项 2025-01-06 20:11:51 +08:00
__Chisato__ 63d7d230dc 优化了PickerWindow的表现效果 2025-01-06 18:35:11 +08:00
zjl abea63bcda Merge branch 'main' of https://github.com/mfkvfhpdx/better-genshin-impact 2025-01-06 14:24:16 +08:00
zjl 653df2f7cc 去掉一个信息提示 2025-01-06 14:22:34 +08:00
zjl ebc8870478 调度器,更多功能中增加日志分析,以列表形式展示配置组耗时和拾取物。 2025-01-06 14:20:05 +08:00
mfkvfhpdx 958c5ab7cd Merge branch 'babalae:main' into main 2025-01-06 14:08:08 +08:00
秋云 99831beb40 修复了地图移动的时候狂点标记问题,修复了移动次数从0开始计算的问题。 2025-01-06 11:51:14 +08:00
辉鸭蛋 a7fae09464 Merge pull request #969 from zhangfeiran/patch-1
添加茜特菈莉作为循环短E角色
2025-01-06 03:22:11 +08:00
Feiran Zhang 57a83cc171 添加茜特菈莉作为循环短E角色 2025-01-06 03:00:04 +08:00
辉鸭蛋 f0af8134ce Delete 1岩水雷火四神.txt 2025-01-05 19:09:59 +08:00
辉鸭蛋 463555c054 Merge pull request #960 from HZYgrandma/patch-3
Update README.md
2025-01-05 18:58:19 +08:00
洪籽阳外婆 01eaa190d8 Update README.md
Update Screenshot
2025-01-05 18:54:35 +08:00
辉鸭蛋 0c487dafd4 Merge pull request #948 from physligl/main
确保传送任务开始前一定位于地图界面。
2025-01-05 17:39:48 +08:00
zjl 1f6e3b78a5 去掉异常处理中的派蒙检查,对于战斗脚本,结束后会误触发 2025-01-05 15:08:50 +08:00
辉鸭蛋 a7da741342 Merge remote-tracking branch 'origin/main' 2025-01-05 14:58:58 +08:00
辉鸭蛋 a57aed9ce7 fix genshin install path get 2025-01-05 14:57:54 +08:00
zjl aa164adb52 Merge remote-tracking branch 'origin/main' 2025-01-05 14:57:46 +08:00
zjl e8b939fbee 未知界面检查常驻于pathing中,去除了该可配置项,以支持js中的路径追踪。pathing逻辑用try块包了起来,最后finally保证,额外开启的线程必定关闭。异常界面检查,当不存在派蒙时尝试按ESC(即使判断错误,也会由未知界面检查,关闭该弹出)。 2025-01-05 14:57:32 +08:00
mfkvfhpdx d872b511d0 Merge branch 'babalae:main' into main 2025-01-05 14:31:16 +08:00
辉鸭蛋 c2dbbe85cd Merge pull request #949 from Baisbt/main
战斗脚本:岩水雷火四神
2025-01-05 13:09:35 +08:00
辉鸭蛋 a75cc84773 Merge pull request #954 from masm611/main
修正windows10_1909版本WGC故障
2025-01-05 13:05:02 +08:00
masm611 1ceb991c1b 修正windows10_1909版本WGC故障
windows10_1909版本的WGC不支持IsCursorCaptureEnabled,加了个动态判断防止异常与抓屏失败等。
但是这样就有可能会抓到光标导致图像识别失败,但是个人认为瘦死的骆驼比马大,没有这个api就不调用即可,好歹还能用一下
如果有必要,后面可以考虑加一个弹窗警告一下啥的,但是这样可能会让用户糟心,总不能逼人家换个系统吧?但是不弹窗呢又好像向用户隐藏了某些可能存在的错误,好像又不太对啥的。
只能说云原神的限制还是大了一点,要不要加弹窗我无法决策,还是由大佬来吧
2025-01-05 12:53:03 +08:00
NextKale 1226f85196 Merge branch 'main' of github.com:atiasn/better-genshin-impact 2025-01-05 11:35:09 +08:00
Baisbt e3a5c491be Add files via upload 2025-01-05 02:36:00 +08:00
秋云 7137e52605 确保传送任务开始前一定位于地图界面。 2025-01-05 01:57:16 +08:00
zjl 3174dc75c8 删除了错误的注释 2025-01-03 20:51:25 +08:00
zjl 4c0d9955b3 阵亡后,重试该路线。但重试,准备传回来时,有几率未打开地图界面,导致传送失败,所以加了每次重试都检查是否打开地图界面。 2025-01-03 20:50:50 +08:00
zjl 8345eb4bdc Merge remote-tracking branch 'origin/main' 2025-01-03 20:14:07 +08:00
zjl 57953933d3 由于地图关闭按钮和烹饪关闭按钮一样,无法作为通用判断,所以依旧使用单个界面检查,调整了检查烹饪的图片范围,增加了按ESC出uid的那个界面也会ESC返回,未知界面检查默认开启。 2025-01-03 20:13:51 +08:00
mfkvfhpdx a0af8405b7 Merge branch 'babalae:main' into main 2025-01-03 08:32:50 +08:00
辉鸭蛋 e6e549814d Merge remote-tracking branch 'origin/main' 2025-01-02 22:51:04 +08:00
辉鸭蛋 c80799cbee 0.39.1 & fix some bug 2025-01-02 22:49:38 +08:00
辉鸭蛋 c2fce8618d Merge pull request #916 from haokaiyang/main
auto tcg: update character card config to v5.3
2025-01-02 12:50:07 +08:00
haokaiyang 663277a990 auto tcg: update character card config to v5.3 2025-01-02 11:55:57 +08:00
mfkvfhpdx 3d775241cc Merge branch 'babalae:main' into main 2025-01-02 07:30:31 +08:00
辉鸭蛋 c0fecd079e 0.39.0 2025-01-02 01:16:05 +08:00
辉鸭蛋 97f1000370 fix auto album task end 2025-01-02 01:15:31 +08:00
辉鸭蛋 02f2c1321a auto album 2025-01-02 01:05:03 +08:00
辉鸭蛋 f9d0bd4521 music test 2025-01-01 23:08:01 +08:00
辉鸭蛋 5e929d3d07 fix walk to domain 2025-01-01 23:07:12 +08:00
zjl b52af1e9a7 把检查移入pathing中,对烹饪做了二次判断,第一可能会在战斗时,误判 2025-01-01 22:15:53 +08:00
mfkvfhpdx 942bb3a6dd Merge branch 'babalae:main' into main 2025-01-01 20:56:24 +08:00
zjl 3eecea21aa 路径追踪支持 未知界面检查关闭,主要用来解决狗粮、或锄地捡物品,有小概率误触烹饪界面的问题。 2025-01-01 20:54:19 +08:00
辉鸭蛋 3c393087eb auto music opt 2025-01-01 19:34:39 +08:00
辉鸭蛋 85c7707c7a avatar 5.3 2025-01-01 19:33:14 +08:00
辉鸭蛋 a41a0bdba1 5.3 avatar 2025-01-01 14:10:02 +08:00
辉鸭蛋 5de2067489 auto music opt 2025-01-01 13:59:06 +08:00
辉鸭蛋 c95343e953 #846 daily reward party 2025-01-01 10:48:29 +08:00
mfkvfhpdx f34e6c3530 当最后出招人为万叶,并且剩余cd>3时,跳过此次万叶拾取 (#906) 2025-01-01 09:20:08 +08:00
辉鸭蛋 2d3395b491 typo & ui 2025-01-01 01:52:41 +08:00
zjl ed3cbd47f5 当最后出招人为万叶,并且剩余cd>3时,跳过此次万叶拾取 2024-12-31 22:33:45 +08:00
辉鸭蛋 d86959297c fix skip blessing of the welkin moon 2024-12-31 01:50:38 +08:00
辉鸭蛋 726863462a 0.38.1 2024-12-31 01:00:09 +08:00
辉鸭蛋 9971817e44 fixed #609 2024-12-31 00:59:48 +08:00
辉鸭蛋 bfeaa1b14a fix pathing bug 2024-12-31 00:44:27 +08:00
秋云 71fa4eaf3a Merge pull request #899 from physligl/main
新的传送点数据集 @Limint
2024-12-31 00:28:34 +08:00
辉鸭蛋 9049c85be7 Merge pull request #897 from mfkvfhpdx/main
修正开启万叶拾取后,不生效的问题。修正战斗检查时间的换算问题,以及一个逻辑判断问题。
2024-12-30 22:23:03 +08:00
zjl ac85cda170 修正开启万叶拾取后,不生效的问题。修正战斗检查时间的换算问题,以及一个逻辑判断问题。 2024-12-30 21:42:03 +08:00
辉鸭蛋 178d253c38 Merge pull request #894 from greepar/greepar-patch-3
修复虹灵的净土秘境消失的问题
2024-12-30 14:08:15 +08:00
greepar 8ba5b16710 Update tp.json
修复了自动秘境中纳塔-虹灵的净土秘境消失的问题
2024-12-30 12:26:40 +08:00
辉鸭蛋 25373cac2a 0.38 2024-12-30 00:12:01 +08:00
辉鸭蛋 2411e1dbef Merge remote-tracking branch 'origin/main' 2024-12-29 22:04:09 +08:00
辉鸭蛋 4118e7b6f2 opt 2024-12-29 22:03:26 +08:00
辉鸭蛋 d6c4f5ab57 Merge pull request #892 from mfkvfhpdx/main
战斗未检查成功时,如果按空格会跳跃,导致队伍切换失败。改成x后,应不会影响其他操作
2024-12-29 21:40:26 +08:00
zjl ac2c7e7ac7 战斗未检查成功时,如果按空格会跳跃,导致队伍切换失败。改成x后,应不会影响其他操作 2024-12-29 21:13:22 +08:00
辉鸭蛋 07e5ea643a Merge pull request #891 from mfkvfhpdx/main
增加针对战斗的细化配置
2024-12-29 21:04:24 +08:00
mfkvfhpdx f4f9f22977 Merge branch 'babalae:main' into main 2024-12-29 21:01:27 +08:00
zjl e6c8804b09 1、判断战斗结束、万叶捡材料、自动拾取,三个配置独立执行。
2、增加 更快检查结束战斗配置,可以根据时间或角色,在一轮角本未走完情况下检查,而加快检查战斗速度。
3、增加了万叶拾取的配置
4、增加 检查战斗结束的延时 ,可根据不同人物更精细的制定策略。
2024-12-29 20:59:05 +08:00
辉鸭蛋 d71ff06868 fix domain and map retry 2024-12-29 20:54:31 +08:00
辉鸭蛋 741da4e0c7 #869 2024-12-29 20:22:00 +08:00
辉鸭蛋 a66b802bbd fixed #661 2024-12-29 19:00:26 +08:00
辉鸭蛋 60f1a271c4 Merge remote-tracking branch 'origin/main' 2024-12-29 18:07:32 +08:00
辉鸭蛋 2396daf206 #767 2024-12-29 18:07:00 +08:00
辉鸭蛋 d8f06598aa Merge pull request #890 from physligl/main
更新5.2的传送锚点和神像。
2024-12-29 17:16:13 +08:00
辉鸭蛋 6127fab70b auto domain retry 2024-12-29 17:10:02 +08:00
辉鸭蛋 6432ff1aed fix key mouse 2024-12-29 17:08:08 +08:00
秋云 0670fd9c0d fix typos 2024-12-29 16:37:32 +08:00
秋云 c14025181c 更新5.2的传送锚点和神像。 2024-12-29 16:31:57 +08:00
辉鸭蛋 2b658afad6 fix the character is still fighting after resurrection 2024-12-29 16:27:14 +08:00
辉鸭蛋 54eecbe046 ui & log 2024-12-29 16:20:27 +08:00
辉鸭蛋 9d807e1e42 1. walk to F 2. auto music 2024-12-29 16:02:35 +08:00
辉鸭蛋 c3ef67f57a Merge branch 'pr/884' 2024-12-29 00:52:01 +08:00
辉鸭蛋 13f3272b9c Merge pull request #887 from physligl/main
优化鼠标移动逻辑。
2024-12-29 00:48:50 +08:00
辉鸭蛋 7e04d77f88 kazuha e hold when fight end 2024-12-29 00:28:53 +08:00
秋云 8f1cf62449 优化鼠标移动逻辑。 2024-12-29 00:20:56 +08:00
辉鸭蛋 cad2cf039d more daily path 2024-12-29 00:08:29 +08:00
辉鸭蛋 215f2ce450 Merge pull request #884 from mfkvfhpdx/main
路径追踪支持战斗配置
2024-12-28 23:02:17 +08:00
辉鸭蛋 0a5c78ebbe code format 2024-12-28 23:01:22 +08:00
辉鸭蛋 f9671467fc fix script control low level check 2024-12-28 22:32:44 +08:00
辉鸭蛋 621a91638a support weekly domain config 2024-12-28 22:06:50 +08:00
秋云 34d0917818 合并分支。 2024-12-28 22:05:12 +08:00
秋云 2b371cce33 fix typos. 2024-12-28 22:01:06 +08:00
mfkvfhpdx 510ca82304 Merge branch 'babalae:main' into main 2024-12-28 21:48:21 +08:00
辉鸭蛋 b83017f52e add GetBigMapZoomLevel 2024-12-28 21:29:42 +08:00
秋云 dd6b26ae8d 提高了MouseMoveMap中最小的steps数量以避免除0错误。 2024-12-28 19:22:03 +08:00
mfkvfhpdx cb19255fb4 Merge branch 'babalae:main' into main 2024-12-28 18:23:01 +08:00
辉鸭蛋 71f2c2f52e Merge pull request #885 from physligl/main
fix typos.
2024-12-28 18:21:51 +08:00
秋云 5d780ec4f8 fix typos. 2024-12-28 18:10:48 +08:00
mfkvfhpdx a091bb6734 Merge remote-tracking branch 'origin/main' 2024-12-28 17:21:14 +08:00
mfkvfhpdx 81a7518f72 暂停后按下的键会释放,增加战斗检查偏色配置,由于跟队伍无关,只在独立任务,自动战斗处设置。 2024-12-28 17:12:47 +08:00
mfkvfhpdx 340a3142e5 Merge branch 'babalae:main' into main 2024-12-28 06:16:34 +08:00
辉鸭蛋 dfad3022c2 Merge pull request #882 from physligl/main
修复移动地图时遇到的部分问题
2024-12-28 00:39:55 +08:00
秋云 bb8ccd2297 fix typos. 2024-12-27 23:57:00 +08:00
秋云 17282a3cef 回退修改。 2024-12-27 23:51:40 +08:00
mfkvfhpdx bb7d84ffe3 战斗配置增加超时,调度器增加清空功能 2024-12-27 23:47:58 +08:00
秋云 28ceb3dd85 未知原因导致合并冲突。 2024-12-27 23:24:14 +08:00
秋云 ce75d038b2 修复地图移动前伟打开主界面的问题(上个修改导致)。限制地图最小缩放等级,以节约时间。合并冲突。 2024-12-27 23:21:22 +08:00
秋云 17dd19aa47 合并冲突。 2024-12-27 23:08:59 +08:00
unknown a861a335ac 1. 修复移动到部分传送点时经过开放区域导致移动失败的问题。2. 修复因为初始地图缩放等级过大无法点击传送点的问题。 2024-12-27 22:54:47 +08:00
mfkvfhpdx c439403231 Merge branch 'babalae:main' into main 2024-12-27 21:48:28 +08:00
zjl a63ed2f2d2 路径追踪支持可配置 2024-12-27 21:46:52 +08:00
辉鸭蛋 c9634abebb fix install path get 2024-12-27 02:37:46 +08:00
辉鸭蛋 1214ca2d65 Merge remote-tracking branch 'origin/main' 2024-12-27 00:58:33 +08:00
辉鸭蛋 dc853f2307 new game path loader 2024-12-27 00:57:18 +08:00
辉鸭蛋 875058ae5b Merge pull request #876 from physligl/main
修复地图移动的已知问题。
2024-12-25 00:28:59 +08:00
辉鸭蛋 e9d715876b Merge pull request #874 from mfkvfhpdx/main
降低L识别结束精度,更快的检查战斗结束。
2024-12-25 00:27:49 +08:00
unknown 57bcb3cd6b 修复地图移动的已知问题。 2024-12-25 00:24:08 +08:00
unknown ff993f642f Revert "修复地图移动的已知问题。"
This reverts commit 4aa8c69d0e.
2024-12-25 00:19:42 +08:00
unknown 4aa8c69d0e 修复地图移动的已知问题。 2024-12-25 00:17:39 +08:00
mfkvfhpdx 7511ccc637 Merge branch 'babalae:main' into main 2024-12-24 18:30:23 +08:00
辉鸭蛋 e9d206eca0 0.37.8 2024-12-24 01:33:55 +08:00
辉鸭蛋 88110a21cc ui: more script repo button 2024-12-24 01:33:28 +08:00
辉鸭蛋 84c7fcec21 fix ui bug 2024-12-24 01:26:11 +08:00
zjl b19adcfba4 更快的检查战斗结束,以及降低L识别结束精度。 2024-12-23 23:37:56 +08:00
辉鸭蛋 404457922d 0.37.7 2024-12-23 00:38:02 +08:00
辉鸭蛋 733e5fb98a more settings 2024-12-23 00:37:04 +08:00
辉鸭蛋 a04d2e437a persistent configuration 2024-12-23 00:01:51 +08:00
辉鸭蛋 08b921b982 one dragon configs 2024-12-22 23:24:11 +08:00
辉鸭蛋 e6e78aded0 fix pathing config ineffective 2024-12-22 21:07:06 +08:00
辉鸭蛋 df600c6016 start game when start one dragon 2024-12-22 20:52:39 +08:00
辉鸭蛋 d374a95bb8 new game loading 2024-12-22 14:56:25 +08:00
辉鸭蛋 f5e8edccb8 collapse multiple checkboxes and add filter 2024-12-22 00:17:34 +08:00
辉鸭蛋 f690bc849b Merge pull request #868 from physligl/main
降低鼠标后半部分移动速度,以避免惯性,作为补偿前面一半的速度变快了。
2024-12-21 18:57:16 +08:00
unknown c3c272c241 降低鼠标后半部分移动速度,以避免惯性,作为补偿前面一半的速度变快了。 2024-12-21 16:20:58 +08:00
辉鸭蛋 537f647ba7 fix auto skip plot when pathing 2024-12-21 15:19:01 +08:00
辉鸭蛋 ca353fea70 remove log 2024-12-21 15:06:52 +08:00
辉鸭蛋 9bf82a1bbb Merge pull request #861 from mfkvfhpdx/main
参考失焦,增加了快捷键暂停。调度器任务支持从指定任务开始(右键 下一个任务从此执行,重启软件,或取出待执行任务后,该状态将会清空)。
2024-12-21 14:41:42 +08:00
辉鸭蛋 e497f6ec79 1. 抽离部分内部类,格式化代码
2. ValueTuple 已过时,元组建议使用 ()
3. 暂停变量不建议放在 TaskContext.Instance().Config.Suspend 中,会被持久化到配置内
4. 修改一些方法和变量的存放位置
2024-12-21 14:35:42 +08:00
zjl 36e49bcbc7 1、战斗优化,只保留按L的情况下
2、暂停功能根据点位状态记录,支持暂停后,当判断路径过于远时,会不消耗重试次数重试此任务
3、重试点位时,将只保留跑图的那部分,跳过如打架、挖矿等操作,提升效率
2024-12-21 12:49:39 +08:00
mfkvfhpdx 7c1568a809 Merge branch 'babalae:main' into main 2024-12-20 20:14:43 +08:00
zjl b99144cd3d 调整暂停为sleep方式,能一直维持,除了离开太远,会跳过当前任务,应该没多大问题。低血量尝试队伍回血。调度器右键重命名。 2024-12-20 20:13:51 +08:00
辉鸭蛋 d5d65b7820 use system tick count instead of DateTime 2024-12-20 02:52:00 +08:00
zjl 7d04997300 去掉遗留的注释 2024-12-17 23:16:33 +08:00
zjl 36cbd168ed Merge branch 'main' of https://github.com/mfkvfhpdx/better-genshin-impact 2024-12-17 23:14:55 +08:00
zjl 5162bcc88f 参考失焦,增加了快捷键暂停。调度器任务支持从指定任务开始(右键 下一个任务从此执行,重启软件,或取出待执行任务后,该状态将会清空)。 2024-12-17 23:12:56 +08:00
zjl 1a2cdbbfd7 参考失焦,简易的实现了快捷键暂停。调度器任务配置支持指定下一次从某个任务开始执行。右键下一次从此任务开始执行,同时名称颜色变绿。重启软件,或执行过滤操作后,清空该状态。 2024-12-17 23:06:30 +08:00
辉鸭蛋 ec8fa6e824 KeyDown -> KeyUp 2024-12-14 20:52:19 +08:00
辉鸭蛋 3266b63187 alt use sendInput 2024-12-14 19:56:38 +08:00
辉鸭蛋 294d096229 fixed Alt does not take effect when playing macros 2024-12-14 18:59:16 +08:00
辉鸭蛋 48b5ab8af6 macro: add mouse wheel 2024-12-14 18:40:14 +08:00
辉鸭蛋 e00b38eb66 remove library 2024-12-14 01:23:26 +08:00
辉鸭蛋 0c435a9393 fix #852 2024-12-13 02:23:57 +08:00
辉鸭蛋 3ca7ab6d4c Merge pull request #851 from physligl/main
修复部分已知问题,调快了鼠标移动速度。
2024-12-12 01:09:15 +08:00
unknown c480cf484e 同上 2024-12-11 05:04:32 +08:00
unknown 2ce4e6d665 同上 2024-12-11 04:47:31 +08:00
unknown 7b158c442e 由于修改,默认初始zoomLevel=4,部分传送点识别到之后无法点击传送,原因未知,修改之后识别和点击传送点基本都在zoomLevel=2的时候执行。 2024-12-11 04:20:55 +08:00
unknown 9180b58d94 修复部分已知问题,调快了鼠标移动速度,无需再担忧寻找传送点的苦恼。 2024-12-11 02:43:25 +08:00
辉鸭蛋 5b8caef75a one dragon : 0.37.4 2024-12-11 00:00:49 +08:00
辉鸭蛋 c22edcd39a pathing: dash behind press E, and don't press E when it's too close to the target point
疾跑放在开E后面,离目标点过近的时候不再开E
2024-12-10 23:58:49 +08:00
辉鸭蛋 7e88c9a57d Merge pull request #848 from physligl/main
修改了缩放的逻辑,以及因为缩放导致的bug
2024-12-10 22:05:53 +08:00
unknown 49fc8ed260 清理部分变量 2024-12-10 04:48:02 +08:00
unknown f37d1d34a6 修改了缩放的逻辑,并且缩放后更新鼠标移动的距离,避免因为缩放导致移动距离不够或者过多。 2024-12-10 04:38:02 +08:00
unknown 76dd2f3903 修改了缩放的逻辑,并且缩放后更新鼠标移动的距离,避免因为缩放导致移动距离不够或者过多。 2024-12-10 04:32:58 +08:00
辉鸭蛋 5e94037722 Merge pull request #847 from physligl/main
修改传送过程中移动到目标传送点的逻辑。
2024-12-10 01:20:41 +08:00
unknown 57610a3945 修改传送过程中移动到目标传送点的逻辑。 2024-12-10 01:13:31 +08:00
辉鸭蛋 11dda84592 pick drops 2024-12-09 00:57:17 +08:00
辉鸭蛋 b600d577c4 fix action params not valid 2024-12-08 15:29:06 +08:00
辉鸭蛋 dd19afaca5 update ui 2024-12-08 00:46:48 +08:00
辉鸭蛋 c2cd6dbe9c pathing: pre judgment of recovery
* 强制判断分辨率
* 切换队伍前判断是否需要复苏
2024-12-07 01:47:01 +08:00
辉鸭蛋 c059611edb update ui 2024-12-06 00:32:52 +08:00
辉鸭蛋 7ebbfda15d fix mail reward 2024-12-05 00:11:33 +08:00
辉鸭蛋 54887b90f6 fix daily reward collection judgment 2024-12-04 23:06:17 +08:00
辉鸭蛋 77cfcbe73f fix big map tp shielded area 2024-12-04 01:59:36 +08:00
辉鸭蛋 f3e16fbb77 fixed #837 2024-12-04 01:58:50 +08:00
辉鸭蛋 99c8cd450e add claim mail 2024-12-04 01:33:17 +08:00
辉鸭蛋 dffccd0740 fix auto domain camera bug 2024-12-02 23:40:54 +08:00
辉鸭蛋 6cfa4b27a6 Merge pull request #835 from babalae/feat/new-camera
new camera orientation algorithm
2024-12-02 22:55:21 +08:00
辉鸭蛋 e2a25e4492 new camera orientation algorithm by https://github.com/Limint 2024-12-02 22:53:40 +08:00
辉鸭蛋 b6220db756 update 2024-12-02 22:13:46 +08:00
辉鸭蛋 958703dcd7 V3 test 2024-12-01 23:52:34 +08:00
辉鸭蛋 c182ec13f9 init V3 2024-12-01 23:23:06 +08:00
辉鸭蛋 ff0533288a fix ClaimBattlePass 2024-12-01 22:56:41 +08:00
辉鸭蛋 2383761b5d more js methods to expose 2024-12-01 16:43:42 +08:00
辉鸭蛋 ebc6ed8e07 prevent shortcut key conflicts 2024-12-01 14:37:29 +08:00
辉鸭蛋 9ab518d593 v2 2024-11-30 18:10:26 +08:00
辉鸭蛋 df84cc9ef1 add auto claim Battle Pass rewards 2024-11-29 20:37:27 +08:00
辉鸭蛋 60bd96f1f4 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-11-29 01:42:23 +08:00
辉鸭蛋 d9faefd446 fix ArtifactSalvageTask 2024-11-29 01:37:41 +08:00
辉鸭蛋 19530e6c50 Merge pull request #821 from OPPO9008/patch-1
添加纳塔训练大师名字
2024-11-27 17:15:28 +08:00
OPPO9008 842f8506a5 添加纳塔训练大师名字 2024-11-27 11:46:09 +08:00
辉鸭蛋 2083caa9d7 one dragon: params opt 2024-11-26 23:47:40 +08:00
辉鸭蛋 67a418b984 one dragon: task series connection 2024-11-26 00:46:38 +08:00
辉鸭蛋 216c78d4d5 0.37.2 2024-11-25 22:50:45 +08:00
辉鸭蛋 fa1809a1f0 add PickAroundHandler action params 2024-11-25 22:37:19 +08:00
辉鸭蛋 fa9eacf4ac divide the path by tp point 2024-11-25 22:27:04 +08:00
辉鸭蛋 968048baa9 new PickAroundHandler @Limint 2024-11-25 22:04:02 +08:00
辉鸭蛋 436dfef2ee Merge remote-tracking branch 'origin/main' 2024-11-24 19:38:31 +08:00
辉鸭蛋 c2f81877dd Update bug.md 2024-11-24 19:38:12 +08:00
辉鸭蛋 0d6ab88c4a add ClaimEncounterPointsRewardsTask 2024-11-24 19:04:52 +08:00
辉鸭蛋 d7302b65c3 auto domain: tp & switch party & artifact salvage 2024-11-24 17:48:23 +08:00
辉鸭蛋 74acb4eb1c 0.37.1 2024-11-24 11:35:21 +08:00
辉鸭蛋 026dcd4488 auto domain: tp & switch party 2024-11-24 02:45:49 +08:00
辉鸭蛋 1cad8c3a00 pathing: config ui 2024-11-24 01:10:30 +08:00
辉鸭蛋 84629942bc pathing: use gadget #799 2024-11-24 00:49:49 +08:00
辉鸭蛋 a6f6ce55dd pathing: add OnlyInTeleportRecover config #779 2024-11-24 00:32:41 +08:00
辉鸭蛋 62a19c0052 auto pick: add black list #800 2024-11-24 00:01:32 +08:00
辉鸭蛋 3d63f18831 auto skip: background opt 2024-11-23 22:09:43 +08:00
辉鸭蛋 99c593cb7d 0.37.0 2024-11-23 19:44:00 +08:00
辉鸭蛋 93640f0b55 update: UI/UX 2024-11-23 14:03:25 +08:00
辉鸭蛋 2a2acb5b0d auto skip: background skip use key (5.2) 2024-11-23 00:49:11 +08:00
辉鸭蛋 382f31bbe7 auto domain: fix ocr region 2024-11-22 22:52:22 +08:00
辉鸭蛋 e3689cd21a ui opt 2024-11-22 22:36:32 +08:00
辉鸭蛋 258848edba new model 2024-11-22 22:18:02 +08:00
辉鸭蛋 0a5dc888a0 5.2 avatar + Yap model 2024-11-22 00:49:59 +08:00
辉鸭蛋 e27e22acaa 5.2 avatar 2024-11-22 00:29:54 +08:00
辉鸭蛋 a89af32560 pathing: fix bug, init mining 2024-11-22 00:23:21 +08:00
辉鸭蛋 d34d24cd5e fix auto domain skip 2024-11-21 23:41:32 +08:00
辉鸭蛋 175db6a792 Merge pull request #802 from babalae/feat/refine-ui
Refine Script Control Page
2024-11-21 17:25:03 +08:00
DismissedLight a8b105f7ee Refine Script Control Page 2024-11-21 17:11:04 +08:00
辉鸭蛋 142bf0a47f Merge pull request #801 from haokaiyang/main
auto tcg: update character card config to v5.2
2024-11-21 12:09:17 +08:00
haokaiyang 36c0fb0f13 auto tcg: update character card config to v5.2 2024-11-21 11:32:42 +08:00
辉鸭蛋 008f09cbe9 5.2 map 2024-11-20 22:49:35 +08:00
辉鸭蛋 7feb204789 fix stopfly not work 2024-11-18 23:07:25 +08:00
辉鸭蛋 d82859177f extend waiting time 2024-11-17 00:45:37 +08:00
辉鸭蛋 bbe1dc1968 0.36.4 2024-11-16 22:50:31 +08:00
辉鸭蛋 9580dd916a pathing: add action combat_script 2024-11-16 22:48:26 +08:00
辉鸭蛋 bb13aac0a9 fix rider error tips 2024-11-16 13:40:57 +08:00
辉鸭蛋 2c3352f1bc don't switch teams while online 2024-11-15 00:31:41 +08:00
辉鸭蛋 7a5efe208f pathing opt
在 `PathExecutor` 类中添加了 `EndAction` 和 `EndJudgment` 属性,用于判断路径追踪的结束条件,并在路径执行过程中调用 `ResolveAnomalies` 和 `EndJudgment` 方法处理异常和结束条件。处理 `NormalEndException` 异常并记录日志。检查游戏窗口分辨率,低于 1920x1080 记录错误日志。

更新 `冒险家协会_枫丹.json` 文件,将路径点类型从 `path` 修改为 `target`。

在 `GoToAdventurersGuildTask` 和 `GoToCraftingBenchTask` 类中,添加结束日志信息,移除交互代码,并添加 `EndAction` 属性判断任务结束条件。
2024-11-13 23:42:15 +08:00
辉鸭蛋 8941f6ce8c fix elemental collect avatar name
将“心海”更改为“珊瑚宫心海”。
将“万叶”更改为“枫原万叶”。
2024-11-13 23:00:26 +08:00
辉鸭蛋 b2db1e0b84 add GoToCraftingBenchTask
更新了 `BetterGenshinImpact.csproj` 文件中的程序集版本号,从 `0.36.2` 更新到 `0.36.3`。在 `ElementAssets.cs` 文件中,添加了 `CraftCondensedResin` 识别对象,并在 `ElementAssets` 类的构造函数中初始化了该对象。在 `ChooseTalkOptionTask.cs` 文件中,添加了 `BetterGenshinImpact.Core.Config` 的引用,并增加了在选项文本包含指定内容时保存截图的功能。修改了 `SelectLastOptionUntilEnd` 方法,增加了 `endAction` 参数和重试次数 `retry` 参数,并在循环中增加了对 `endAction` 的判断。修改了 `IsOrangeOption` 方法中的颜色阈值参数。在 `GoToAdventurersGuildTask.cs` 文件中,添加了 `Vanara.PInvoke` 的引用,并增加了等待对话界面的延迟时间和领取每日委托奖励后的点击操作。在 `HotKeyPageViewModel.cs` 文件中,修改了 `Test2Hotkey` 的回调函数,改为执行 `GoToCraftingBenchTask` 任务。

添加了多个命名空间引用,包括 `BetterGenshinImpact.Core.Config`、`BetterGenshinImpact.GameTask.AutoPathing`、`BetterGenshinImpact.GameTask.AutoPathing.Model`、`BetterGenshinImpact.GameTask.AutoSkip.Assets`、`BetterGenshinImpact.GameTask.AutoSkip`、`BetterGenshinImpact.GameTask.Common.BgiVision`、`Microsoft.Extensions.Logging`、`System`、`System.Threading`、`System.Threading.Tasks`、`BetterGenshinImpact.Core.Simulator`、`BetterGenshinImpact.GameTask.Common.Element.Assets` 和 `Vanara.PInvoke`。

新增了 `GoToCraftingBenchTask` 类,并定义了其命名空间 `BetterGenshinImpact.GameTask.Common.Job`。在 `GoToCraftingBenchTask` 类中,定义了 `Name` 属性,表示任务名称。定义了 `_retryTimes` 字段,表示重试次数。定义了 `_chooseTalkOptionTask` 字段,用于选择对话选项。新增了 `Start` 方法,接受 `country` 和 `CancellationToken` 参数,表示任务的开始。在 `Start` 方法中,添加了重试机制,调用 `DoOnce` 方法执行任务,并在异常情况下进行重试。新增了 `DoOnce` 方法,接受 `country` 和 `CancellationToken` 参数,表示单次任务的执行。在 `DoOnce` 方法中,定义了前往合成台、交互、等待合成界面、判断浓缩树脂是否存在等步骤。新增了 `GoToCraftingBench` 方法,接受 `country` 和 `CancellationToken` 参数,表示前往合成台的操作。在 `GoToCraftingBench` 方法中,使用 `PathingTask` 和 `PathExecutor` 执行路径任务。
2024-11-12 23:42:56 +08:00
辉鸭蛋 3c2739c5c5 add GoToAdventurersGuildTask
优化项目结构并新增任务和路径文件

主要更改:
- 在 `BetterGenshinImpact.csproj` 文件中,添加了对 `GameTask\Common\Element\Assets\Json\**` 目录的处理,并确保其内容始终复制到输出目录。
- 在 `RecognitionObject.cs` 文件中,新增了多个静态方法 `Ocr` 和一个静态实例 `OcrThis`。
- 在 `PathExecutor.cs` 文件中,优化了路径执行逻辑,新增 `GetPosition` 方法,并调整了超时判断。
- 在 `AutoPickAssets.cs` 文件中,添加了多个 `using` 语句,新增 `_logger` 和 `PickRo` 字段,并在构造函数中添加了自定义拾取按键的处理逻辑。
- 在 `AutoPickTrigger.cs` 文件中,移除了自定义拾取按键的初始化逻辑。
- 在 `OneKeyExpeditionTask.cs` 文件中,注释掉了 `Cv2.ImWrite` 方法的调用。
- 在 `TpTask.cs` 文件中,添加了点位很近时不切换的判断逻辑。
- 在 `BvSimpleOperation.cs` 文件中,新增了多个点击按钮的方法和 `FindF`、`FindFAndPress` 方法。
- 在 `BvStatus.cs` 文件中,新增了多个方法用于判断是否在对话界面并等待对话界面加载完成。
- 在 `GameTaskManager.cs` 文件中,添加了 `MapAssets.DestroyInstance` 方法的调用。
- 在 `HotKeyPageViewModel.cs` 文件中,注释掉了 `ElementalCollectHandler` 的测试代码,并添加了 `GoToAdventurersGuildTask` 的测试代码。
- 在 `TaskSettingsPageViewModel.cs` 文件中,更新了 `OnGoToAutoGeniusInvokationUrlAsync` 方法中的 URL。
- 添加了 `BetterGenshinImpact - Backup.csproj` 文件,配置了项目属性、资源文件和包引用。
- 添加了 `冒险家协会_枫丹.json`、`合成台_枫丹.json` 和 `合成台_璃月.json` 文件,定义了前往相应地点的路径和动作。
- 添加了 `ChooseTalkOptionTask.cs` 文件,实现了选择对话选项的任务。
- 添加了 `GoToAdventurersGuildTask.cs` 文件,实现了前往冒险家协会领取奖励的任务。
2024-11-10 22:49:55 +08:00
辉鸭蛋 648dfd3f41 ensure that the 'settings' object passed into JS is not empty 2024-11-10 13:22:56 +08:00
辉鸭蛋 ef20a5448b fixed the issue where the pathing cannot be used properly when the resolution is below 1920x1080 2024-11-10 13:13:10 +08:00
辉鸭蛋 23973bb679 auto task opt 2024-11-10 12:28:53 +08:00
辉鸭蛋 ebc2b7b42e edit fight end judge 2 2024-11-10 01:24:35 +08:00
辉鸭蛋 8d2ee35b7c edit fight end judge 2024-11-10 01:20:45 +08:00
辉鸭蛋 68d3061523 switch party: shorten the time for Hutao 2024-11-10 01:02:31 +08:00
辉鸭蛋 435d04b52d pathing: add more settings 2024-11-10 00:51:47 +08:00
辉鸭蛋 244ce1c27f pathing: add exception handling for entering conversations 2024-11-10 00:02:18 +08:00
辉鸭蛋 adcd08421a fix: incorrect host judgment methods #777 2024-11-09 17:49:42 +08:00
辉鸭蛋 19c7b10b01 fix repo update 2024-11-09 17:37:46 +08:00
辉鸭蛋 fe1d67bf16 add tool tip for js page 2024-11-09 09:42:50 +08:00
辉鸭蛋 9c7651702a add auto BlessingOfTheWelkinMoonTask 2024-11-09 00:38:57 +08:00
辉鸭蛋 b0b3768ee7 https://github.com/babalae/bettergi-scripts-list/pull/15 2024-11-08 23:17:02 +08:00
辉鸭蛋 462741d3fb 0.36.1 2024-11-05 22:50:58 +08:00
辉鸭蛋 32bec1656b default pathing condition config 2024-11-05 22:50:34 +08:00
辉鸭蛋 003939bb94 js: fix no path pathing task
更新 PathingConditionConfig 和 PathingTask 方法以支持空值

将 PathingConditionConfig 类中的 FilterPartyName 方法的 materialName 参数类型从 string 改为 string?,以允许传入空值。增加了对 materialName 是否为空的检查,只有在 materialName 不为空时才进行条件匹配。将 PathingTask 类中的 GetMaterialName 方法的返回类型从 string 改为 string?,以允许返回空值。增加了对 FullPath 是否为空的检查,如果为空则返回 null。
2024-11-05 22:26:41 +08:00
辉鸭蛋 9c9bd7d138 js: extend click time
修改了 `GlobalMethod` 类中的 `Click` 方法,现在调用 `LeftButtonClick` 方法而不是 `Simulation.SendInput.Mouse.LeftButtonClick`。
修改了 `GlobalMethod` 类中的 `LeftButtonClick` 方法,现在使用 `Simulation.SendInput.Mouse.LeftButtonDown().Sleep(60).LeftButtonUp()` 代替 `Simulation.SendInput.Mouse.LeftButtonClick`。
修改了 `GlobalMethod` 类中的 `RightButtonClick` 方法,现在使用 `Simulation.SendInput.Mouse.RightButtonDown().Sleep(60).RightButtonUp()` 代替 `Simulation.SendInput.Mouse.RightButtonClick`。
2024-11-05 22:00:16 +08:00
辉鸭蛋 5b054bf31b 0.36.0 2024-11-04 21:33:07 +08:00
ema a960f76920 feat: restore from another instance 2024-11-04 03:45:08 +08:00
辉鸭蛋 00447d3e78 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-11-03 22:30:24 +08:00
辉鸭蛋 c5de098865 new doc url 2024-11-03 22:26:14 +08:00
辉鸭蛋 4ce7d02e75 Merge pull request #763 from FannieMC/main
增加对多人联机下进入尘歌壶的支持
2024-11-03 21:33:20 +08:00
Fannie MC c7827d0fa3 增加对多人联机下进入尘歌壶的支持 2024-11-03 21:10:08 +08:00
辉鸭蛋 7513e75f74 remove 'textRegion' from the log record The > character of Text `
修改了日志记录的代码,将 `textRegion.Text` 中的 `>` 字符去掉后再记录日志。
2024-11-03 20:54:07 +08:00
辉鸭蛋 0923b0802c auto tp opt 2024-11-03 20:21:25 +08:00
辉鸭蛋 2c9c78f933 edit ui style 2024-11-03 19:01:06 +08:00
辉鸭蛋 c1ef7c141f + drag drop 2024-11-03 00:04:54 +08:00
辉鸭蛋 a98934fc9a fix bug 2024-11-02 22:56:35 +08:00
辉鸭蛋 2b8f38b758 finsh pathing config 2024-11-02 21:03:58 +08:00
辉鸭蛋 2545581807 new pathing config 2024-11-02 19:49:38 +08:00
辉鸭蛋 e595b67d33 msg more info 2024-11-02 13:05:48 +08:00
辉鸭蛋 dcd7831368 auto fix win11 bitblt 2024-11-02 12:57:58 +08:00
辉鸭蛋 4725af5491 impl js run task 2024-11-01 21:37:44 +08:00
辉鸭蛋 a1cdf15c7e fix bug 2024-11-01 19:19:47 +08:00
辉鸭蛋 c461938ddd add elemental collect handler
在 `DefaultAutoFightConfig.cs` 中,将 `JsonSerializer.Deserialize` 替换为 `Newtonsoft.Json.JsonConvert.DeserializeObject` 来反序列化 `combat_avatar.json` 文件。

在 `ActionFactory.cs` 中,添加了 `BetterGenshinImpact.GameTask.AutoGeniusInvokation.Model` 的引用,并在 `ActionFactory` 类中添加了新的元素采集处理器(`hydro_collect`、`electro_collect`、`anemo_collect`)。

在 `HotKeyPageViewModel.cs` 中,添加了 `BetterGenshinImpact.GameTask.AutoGeniusInvokation.Model` 的引用,并修改了 `Test1Hotkey` 的处理逻辑,使用 `ElementalCollectHandler` 进行元素采集。

新增了 `ElementalCollectHandler.cs` 文件,定义了 `ElementalCollectHandler` 类,用于处理元素采集逻辑。该类根据元素类型筛选角色,并执行相应的攻击或技能操作。同时定义了 `ElementalCollectAvatar` 和 `ElementalCollectAvatarConfigs` 类,用于配置和管理不同元素类型的角色。
2024-11-01 01:47:10 +08:00
辉鸭蛋 3d6546b528 time consuming of calculation script 2024-11-01 00:07:11 +08:00
辉鸭蛋 b0d4068eb2 pathing opt 2024-10-31 23:10:11 +08:00
辉鸭蛋 b0d8e1a274 add condition settings 2024-10-31 23:06:40 +08:00
辉鸭蛋 a39aefb44c retry when TpPointNotActivate 2024-10-31 12:36:21 +08:00
辉鸭蛋 adf824519b waiting for map movement to complete 2024-10-31 12:25:55 +08:00
辉鸭蛋 4cb5442161 add switch party task
在 `BetterGenshinImpact.csproj` 文件中,添加了两个新文件夹路径 `GameTask\OneDragon\` 和 `User\AutoPathing\`。

在 `BvStatus.cs` 文件中:
- 将 `WaitForMainUi` 方法的默认重试次数从 25 次减少到 10 次。
- 添加了 `IsInPartyViewUi` 和 `WaitForPartyViewUi` 方法。

在 `ElementAssets.cs` 文件中:
- 添加并初始化了 `PartyBtnChooseView` 和 `PartyBtnDelete` 两个新的识别对象。

在 `NewRetry.cs` 文件中:
- 添加了 `using System.Threading.Tasks;` 引用。
- 添加了 `WaitForAction` 方法。

在 `Region.cs` 文件中,添加了一个新的 `ClickTo` 方法,该方法接受 `double` 类型的参数。

在 `ReturnMainUiTask.cs` 文件中:
- 删除了旧的 `ReturnMainUiTask` 类。
- 添加了新的 `ReturnMainUiTask` 类,内容与旧的类似,但文件路径和命名空间有所变化。

在 `RunnerContext.cs` 文件中,移除了 `using BetterGenshinImpact.GameTask.OneDragon;` 引用,添加了 `using BetterGenshinImpact.GameTask.Common.Job;` 引用。

在 `HotKeyPageViewModel.cs` 文件中:
- 添加了多个 `using` 引用,包括 `using System.Threading.Tasks;` 和 `using BetterGenshinImpact.GameTask.Common.Job;`。
- 修改了多个方法的代码格式,使其更加简洁。
- 添加了多个新的快捷键设置。

添加了两个新的 PNG 图片文件 `party_btn_choose_view.png` 和 `party_btn_delete.png`。

在 `SwitchPartyTask.cs` 文件中,添加了新的 `SwitchPartyTask` 类,用于切换队伍。
2024-10-29 01:41:43 +08:00
辉鸭蛋 b74e09ac8b add continuous execution & add pathing ui right menu & real time updates of script repository
更新了 `BetterGenshinImpact.csproj` 文件中的 `WPF-UI.Violeta` 包版本,从 `3.0.5.21` 升级到 `3.0.5.23`。
在 `RepoWebBridge.cs` 文件中,注释掉了检查本地 `repo.json` 文件是否存在的代码,并直接调用 `ScriptRepoUpdater.Instance.UpdateCenterRepo()` 方法更新仓库。更新后的异常信息也进行了修改。
在 `MapPathingPage.xaml` 文件中,删除了 `ui:TreeListView` 控件的 `behavior:RightClickSelectBehavior.Enabled` 属性。
在 `ScriptControlPage.xaml` 文件中,添加了一个新的 `RowDefinition`,并在 `Grid` 中添加了一个新的 `ui:Button`,用于执行连续脚本组的命令。
在 `ScriptControlViewModel.cs` 文件中,添加了 `System.Windows.Media` 的引用。
在 `ScriptControlViewModel.cs` 文件中,添加了一个新的异步方法 `OnStartMultiScriptGroupAsync`,用于显示一个包含全选按钮和配置组复选框的对话框,并执行选中的脚本组。
2024-10-28 00:25:14 +08:00
辉鸭蛋 dd9433f565 update pathing ui 2024-10-27 23:47:26 +08:00
辉鸭蛋 a802ffa0e5 tp.json supplement 2024-10-27 23:05:15 +08:00
辉鸭蛋 fe12b59b5c Pathing has been stuck 3 times. Try the route again or abandon it!
将 `_retryTimes` 字段改为常量 `RetryTimes`,并将其值设为 2。添加了新的字段 `_inTrap`,用于记录陷入困境的次数。在 `Pathing` 方法中,将 `for` 循环中的 `_retryTimes` 替换为 `RetryTimes`。在路径执行过程中,增加了对陷入困境的检测逻辑。如果在 8 个位置内的移动距离小于 3,则认为可能陷入困境,并增加 `_inTrap` 计数器。如果 `_inTrap` 超过 2 次,则抛出 `RetryException` 异常,提示路线出现 3 次卡死,重试或放弃此路线。检测到疑似卡死时,记录警告日志,并调用 `TrapEscaper` 的方法尝试脱困。
2024-10-27 22:24:14 +08:00
辉鸭蛋 5f40e28332 修复后台自动剧情启用的情况下,自动领取探索奖励失效的问题 2024-10-27 22:18:32 +08:00
辉鸭蛋 44190a522b team identification support online
修复错误信息,改进联机状态处理

更新了 `BetterGenshinImpact.csproj` 文件中的程序集版本号,从 `0.35.2` 更新为 `0.35.4`。

修正了 `ScriptProject.cs` 文件中抛出 `FileNotFoundException` 异常时的错误信息,将 "manifest.json文件存在" 改为 "manifest.json文件不存在"。

在 `AutoFightAssets.cs` 文件中:
- 为 `AvatarSideIconRectList` 和 `AvatarIndexRectList` 添加了注释,解释其在非联机状态下的用途。
- 添加了多个新的属性和注释,用于处理联机状态下的角色头像和对应的白色块位置。
- 初始化了 `OnePRa` 和 `PRa` 两个识别对象,用于识别联机状态下的1P和P图标。

在 `Avatar.cs` 文件中:
- 修改了角色切换逻辑,使用 `CombatScenes.ExpectedTeamAvatarNum` 替代硬编码的数字。
- 在 `TrySwitch` 方法中添加了 `needLog` 参数,并在切换成功时记录日志。
- 移除了部分注释代码,并在日志中保存了角色切换和索引区域的截图。
- 添加了 `System.Diagnostics` 的引用。

在 `CombatScenes.cs` 文件中:
- 将 `Avatars` 初始化为空数组。
- 添加了 `ExpectedTeamAvatarNum` 属性,默认值为4。
- 在 `InitializeTeam` 方法中添加了联机状态的判断和处理逻辑。
- 修改了队伍识别逻辑,使用动态数组替代固定长度的数组。
- 修改了 `CheckTeamInitialized` 方法,使用 `ExpectedTeamAvatarNum` 替代硬编码的数字。
- 修改了 `BuildAvatars` 方法,添加了对联机状态下角色编号位置信息的处理。
- 修改了 `SelectAvatar` 方法,使用 `GetValueOrDefault` 替代 `TryGetValue`。

在 `ScriptControlViewModel.cs` 文件中,设置 `WindowStartupLocation` 为 `WindowStartupLocation.CenterOwner`。

添加了 `1p.png` 和 `p.png` 两个新图像文件,用于识别联机状态下的1P和P图标。
2024-10-27 17:15:55 +08:00
辉鸭蛋 98d2664c28 auto pathing: use group config & fix bug 2024-10-27 00:51:10 +08:00
辉鸭蛋 94418cbe56 auto pathing: add retry 2024-10-26 23:37:55 +08:00
辉鸭蛋 72c2e38f94 add pathing settings for script group 2024-10-26 21:11:59 +08:00
辉鸭蛋 be5c8ad6e3 update logo 2024-10-26 21:08:09 +08:00
辉鸭蛋 255f328b67 update logo 2024-10-26 20:24:17 +08:00
辉鸭蛋 1dbb9e3bf1 auto pathing: optimize avatar switch 2024-10-26 14:46:38 +08:00
辉鸭蛋 df7b55e47c support recognition of semi transparent avatars 2024-10-26 14:45:53 +08:00
辉鸭蛋 ed77d955ef add AvatarClassifyTransparentGen 2024-10-26 01:47:41 +08:00
辉鸭蛋 e4e7b37fd2 the whole team is defeated
在 `PathExecutor.cs` 中,`RecoverWhenLowHp` 方法进行了修改:
- 使用 `using` 语句来捕获区域。
- 如果当前角色血量过低,调用新的 `TpStatueOfTheSeven` 方法进行传送和恢复。
- 增加了一个新的分支,如果检测到复苏提示,点击复苏并等待主界面加载完成,然后再调用 `TpStatueOfTheSeven` 方法。
- 新增了 `TpStatueOfTheSeven` 方法,用于处理传送到七天神像并恢复血量的逻辑。

在 `BvStatus.cs` 中:
- 增加了 `System.Threading.Tasks` 和 `System.Threading` 的引用。
- 在 `Bv` 类中新增了 `WaitForMainUi` 方法,用于等待主界面加载完成。
- 在 `Bv` 类中新增了 `ClickIfInReviveModal` 方法,用于检测并点击复苏提示。
2024-10-26 00:21:51 +08:00
辉鸭蛋 9f728fdf30 new banner 2024-10-26 00:20:50 +08:00
辉鸭蛋 7c96adb591 improve low hp detection and resurrection logic
改进低血量检测和复活逻辑

在 `BetterGenshinImpact.csproj` 文件中,将 `<AssemblyVersion>` 从 `0.35.1` 更新为 `0.35.2`。

在 `AutoDomainTask.cs` 文件中:
- 添加了 `using BetterGenshinImpact.GameTask.Common.BgiVision;` 引用。
- 将 `IsLowHealth` 方法替换为 `Bv.CurrentAvatarIsLowHp(CaptureToRectArea())` 方法。
- 在 `catch` 语句中添加了异常日志记录 `Logger.LogDebug(e, "红血自动吃药检测时发生异常")`。
- 删除了 `IsLowHealth` 方法的实现。

在 `Avatar.cs` 文件中:
- 修改了 `using` 引用,添加了 `BetterGenshinImpact.Core.Recognition`。
- 在 `ThrowWhenDefeated` 方法中,将 `region.Find(AutoFightContext.Instance.FightAssets.ConfirmRa)` 替换为 `Bv.IsInRevivePrompt(region)` 方法,并添加了复活逻辑。

在 `PathExecutor.cs` 文件中:
- 在 `foreach` 循环中添加了 `await RecoverWhenLowHp();` 方法调用。
- 添加了 `RecoverWhenLowHp` 方法,用于检测并处理低血量恢复。

在 `TpTask.cs` 文件中:
- 添加了 `ReviveStatueOfTheSevenPointX` 和 `ReviveStatueOfTheSevenPointY` 静态变量,用于复活点的坐标。

在 `BvStatus.cs` 文件中:
- 添加了多个 `using` 引用。
- 在 `Bv` 类中添加了 `IsInRevivePrompt` 和 `CurrentAvatarIsLowHp` 方法,用于检测复苏提示和当前角色是否低血量。
2024-10-25 23:49:07 +08:00
辉鸭蛋 14a1d3be74 auto pathing: add settings ui 2024-10-25 01:17:00 +08:00
辉鸭蛋 94aae80046 auto pathing: optimize switch avatar
删除 `BetterGenshinImpact.csproj` 中的无用文件夹包含项。
将 `PathingConfig.cs` 中部分属性类型从 `int` 改为 `string`,并调整默认值。
在 `ScriptRepoUpdater.cs` 中用 `MessageBox` 替换 `ContentDialog`。
简化 `ElementalSkillHandler.cs` 和 `NormalAttackHandler.cs` 中的代码。
删除 `NahidaCollectHandler.cs` 中的切换角色代码。
在 `PathingTask.cs` 中添加 `HasAction` 方法。
在 `PathExecutor.cs` 中添加 `_actionAvatarIndexMap` 字典和多个新方法。
新增 `ReturnMainUiTask.cs` 任务类。
2024-10-24 23:05:52 +08:00
辉鸭蛋 404e7215fa add icon for pathing ui 2024-10-24 00:48:58 +08:00
辉鸭蛋 b3f6002846 add pathing config 2024-10-22 01:21:11 +08:00
辉鸭蛋 960cfea102 fix script repo web
重构:移出 localRepoJsonPath 赋值和 null 检查逻辑

将 localRepoJsonPath 的赋值和 null 检查逻辑移出 if (needUpdate) 代码块,以确保无论 needUpdate 的值如何,这段逻辑都会被执行。
2024-10-22 00:36:26 +08:00
辉鸭蛋 7cc4093079 refresh the ui after subscribing to the script
重构了多个类中的方法为异步方法,并增加了消息注册逻辑:
- `ScriptRepoUpdater.cs`:增加了检查并创建 `ReposPath` 目录的逻辑。
- `RepoWebBridge.cs`:引用新命名空间,重构 `GetRepoJson` 和 `ImportUri` 方法为异步方法,增加了检查和更新本地仓库的逻辑。
- `JsListViewModel.cs` 和 `MapPathingViewModel.cs`:引用新命名空间,增加消息注册逻辑,修正方法中的引用。
- `PathingTask.cs`:修正了日志记录中 `FileName` 的引用。
- `TaskSettingsPage.xaml`:更新了文本内容,增加了关于装备「王树瑞佑」的说明。
- 新增 `RefreshDataMessage.cs` 文件,定义了 `RefreshDataMessage` 类。
2024-10-21 01:32:36 +08:00
辉鸭蛋 d23ba65d51 fix #732 2024-10-20 20:38:38 +08:00
辉鸭蛋 6b41b52008 warning when script version number is too high
更新程序集版本号并添加版本号比较逻辑

更新了 `BetterGenshinImpact.csproj` 文件中的程序集版本号,从 `0.35.0` 更新到 `0.35.1`。

在 `Manifest.cs` 文件中,增加了对 `BetterGenshinImpact.GameTask.Common` 和 `Microsoft.Extensions.Logging` 的引用,并在 `Manifest` 类中增加了版本号比较的逻辑,如果脚本要求的版本号大于当前版本号,则记录错误日志。

在 `ScriptProject` 类的构造函数中,增加了对脚本文件夹是否存在的检查,如果不存在则抛出 `DirectoryNotFoundException` 异常。

在 `PathingTask.cs` 文件中,增加了对 `BetterGenshinImpact.Core.Config`、`BetterGenshinImpact.GameTask.Common` 和 `Microsoft.Extensions.Logging` 的引用,并在 `PathingTask` 类中增加了版本号比较的逻辑,如果路径追踪任务要求的版本号大于当前版本号,则记录错误日志。
2024-10-20 15:47:03 +08:00
辉鸭蛋 3cbbbff093 add UpDownGrabLeaf action 2024-10-20 11:20:25 +08:00
辉鸭蛋 81b754125a update ui 2024-10-20 10:51:41 +08:00
辉鸭蛋 29544507eb one dragon: fill
添加 OneDragon 相关 ViewModel 和页面,删除旧配置

在 `App.xaml.cs` 中添加了 `using BetterGenshinImpact.ViewModel.Pages.OneDragon` 语句,并在 `App` 类中添加了一系列 `OneDragon` 相关的 ViewModel 到服务集合中。
在 `OneDragonTaskItem.cs` 中调整了 `using` 语句的顺序,初始化了一些属性的默认值,并添加了两个构造函数。
删除了 `LoginConfigPage.xaml`、`LoginConfigPage.xaml.cs`、`MailConfigPage.xaml`、`MailConfigPage.xaml.cs`、`LoginConfigViewModel.cs` 和 `MailConfigViewModel.cs` 文件的内容。
在 `OneDragonFlowPage.xaml` 中更新了 `oneDragonView` 的命名空间,并添加了多个 `DataTemplate` 以支持新的 ViewModel。
在 `OneDragonFlowViewModel.cs` 中调整了 `using` 语句的顺序,并更新了 `_taskList` 的初始化内容。
添加了多个新的 ViewModel 文件,包括 `CraftViewModel.cs`、`DailyCommissionViewModel.cs`、`DailyRewardViewModel.cs`、`DomainViewModel.cs`、`ForgingViewModel.cs`、`LeyLineBlossomViewModel.cs`、`MailViewModel.cs`、`OneDragonBaseViewModel.cs`、`SereniteaPotViewModel.cs` 和 `TcgViewModel.cs`。
添加了多个新的页面文件,包括 `CraftPage.xaml`、`CraftPage.xaml.cs`、`DailyCommissionPage.xaml`、`DailyCommissionPage.xaml.cs`、`DailyRewardPage.xaml`、`DailyRewardPage.xaml.cs`、`DomainPage.xaml`、`DomainPage.xaml.cs`、`ForgingPage.xaml`、`ForgingPage.xaml.cs`、`LeyLineBlossomPage.xaml`、`LeyLineBlossomPage.xaml.cs`、`MailPage.xaml`、`MailPage.xaml.cs`、`SereniteaPotPage.xaml`、`SereniteaPotPage.xaml.cs` 和 `TcgPage.xaml`、`TcgPage.xaml.cs`。
2024-10-19 19:29:44 +08:00
辉鸭蛋 8471d5ef88 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-10-19 17:43:07 +08:00
辉鸭蛋 a4bc632ae7 ui test
新增任务类属性和配置页面,优化日志记录

在 `BetterGenshinImpact.csproj` 文件中,添加了两个新文件夹路径 `GameTask\OneDragon\` 和 `User\AutoPathing\`。

在多个任务类文件中(如 `AutoDomainTask.cs`、`AutoFightTask.cs`、`AutoGeniusInvokationTask.cs`、`AutoMusicGameTask.cs`、`AutoWoodTask.cs`),新增了 `Name` 属性。

在 `PickAroundHandler.cs` 文件中,优化了 `RunAsync` 方法的日志记录,并添加了超时检查。

在 `ISoloTask.cs` 文件中,新增了 `Name` 属性和 `Start` 方法的接口定义。

在 `OneDragonTaskItem.cs` 文件中,新增了 `ViewModel` 属性。

在 `OneDragonFlowPage.xaml` 文件中,右侧配置部分从 `StackPanel` 改为 `ContentControl`,并添加了 `DataTemplate` 以支持不同任务类型的配置页面。

在 `IViewModel.cs` 文件中,将 `IViewModel` 接口的访问修饰符从 `internal` 改为 `public`。

在 `OneDragonFlowViewModel.cs` 文件中,初始化了任务项的 `ViewModel` 属性。

在 `ScriptControlViewModel.cs` 文件中,移除了构造函数的 `HomePageViewModel` 参数。

新增了 `LoginConfigViewModel.cs` 和 `MailConfigViewModel.cs` 文件,定义了相应的 ViewModel 类。

新增了 `LoginConfigPage.xaml` 和 `MailConfigPage.xaml` 文件,定义了相应的 XAML 布局及其交互逻辑。
2024-10-19 17:42:58 +08:00
DismissedLight 1f2d3a40d9 Add HutaoInterop Pipe 2024-10-19 15:20:58 +08:00
辉鸭蛋 3a88da3c6e code cleanup 2024-10-19 14:34:30 +08:00
辉鸭蛋 790d42cee0 Merge pull request #726 from babalae/feat-cts
refactor: CancellationTokenSource -> CancellationToken
2024-10-19 13:10:38 +08:00
辉鸭蛋 c9f541362d Merge branch 'main' into feat-cts 2024-10-19 13:09:44 +08:00
辉鸭蛋 efd2808a2e Merge pull request #721 from jbcaaa/main_testing
添加PickAround实现(浅测试)
2024-10-19 13:08:43 +08:00
辉鸭蛋 11ec9bc45d refactor: CancellationTokenSource -> CancellationToken 2024-10-19 01:50:21 +08:00
jbcaaa 74645e8e93 修正错误 2024-10-18 22:43:20 +08:00
辉鸭蛋 af7209af48 dispather ui : fix the issue of multi-level directories not being displayed
在 `TpTask.cs` 文件中:
- 修改了异常处理的日志记录逻辑。
- 修复了一个多余的 `}`。

在 `ScriptControlViewModel.cs` 文件中:
- 添加了新的 `using` 语句。
- 修改了 `OnAddPathing` 方法,替换了 `LoadAllPathingScripts` 方法。
- 重构了 `CreatePathingScriptSelectionPanel` 方法,修改了参数类型。
- 添加了 `AddNodesToPanel` 方法,用于递归添加节点。
- 修改了 `SetChildCheckBoxesState` 方法,增加了对嵌套 `StackPanel` 的处理。
- 修改了 `AddSelectedPathingScripts` 方法,调整了 `FileInfo` 的创建方式。
- 添加了对 `item.Project` 的空值检查。
- 添加了 `item.Project.LoadSettingUi` 方法的调用。
- 添加了 `oldItem.Projects.CollectionChanged` 事件的取消订阅。
2024-10-18 21:52:11 +08:00
jbcaaa 7df31c66d2 缩小旋转角度转大圈 2024-10-18 21:31:40 +08:00
jbcaaa 0bb45c8390 Merge branch 'babalae:main' into main_testing 2024-10-18 21:24:22 +08:00
辉鸭蛋 07e682d488 auto pathing: code clean & opt 2024-10-18 20:59:58 +08:00
辉鸭蛋 a1508a7b05 Merge pull request #711 from jbcaaa/main
Support using both key-mouse-record and auto-pathing in js scripts
2024-10-18 20:14:12 +08:00
辉鸭蛋 57989fd8b9 update ui 2024-10-18 19:57:39 +08:00
jbcaaa c4031069c6 Merge branch 'babalae:main' into main_testing 2024-10-18 18:46:56 +08:00
jbcaaa ecaab5dc76 添加PickAround实现(未测试) 2024-10-18 17:57:13 +08:00
jbcaaa a220dd2377 修正某些默认方法的使用问题 2024-10-18 15:19:40 +08:00
jbcaaa e1149bc254 分离行走逻辑和避障逻辑 2024-10-18 14:45:23 +08:00
jbcaaa 6a53efce1e 增加注释,辅助理解 2024-10-18 10:51:19 +08:00
jbcaaa a67adc0070 修复许多问题,增加小脱困 2024-10-18 08:24:58 +08:00
jbcaaa 03f6b6331f 设置为非攀爬时进入攀爬,自动脱离 2024-10-18 07:41:43 +08:00
jbcaaa ee720f8dfd try again 2024-10-18 07:06:06 +08:00
jbcaaa b152486327 统一脱困跳跃方法 2024-10-18 06:57:57 +08:00
jbcaaa 70f1f69067 回退一个数值更改 2024-10-18 06:44:27 +08:00
jbcaaa f56465ebf3 fixed the problem causes autopathing cannot run correctly. 2024-10-18 06:41:24 +08:00
jbcaaa 3b8b1ef9db Update PathExecutor.cs 2024-10-18 00:48:57 +08:00
jbcaaa a4bb2eeca2 changed some value 2024-10-18 00:23:26 +08:00
jbcaaa f222431784 [testing] madly modified move actions in autopathing 2024-10-17 21:15:58 +08:00
辉鸭蛋 7c5958f8ad Update README.md 2024-10-17 21:01:05 +08:00
jbcaaa 561f1b8b72 Support using both key-mouse-record and auto-pathing in js scripts 2024-10-17 16:04:27 +08:00
辉鸭蛋 9ad1062020 update one-stop service ui 2024-10-17 03:25:25 +08:00
辉鸭蛋 2ed7a883b3 One-stop service init 2024-10-17 02:48:21 +08:00
辉鸭蛋 4859c4dc4a add log & pathing opt 2024-10-16 01:31:44 +08:00
辉鸭蛋 03f25ebcfb revert #697 2024-10-16 01:06:22 +08:00
辉鸭蛋 0580ec68e9 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-10-16 01:03:44 +08:00
辉鸭蛋 b4e6565443 normal attack & elemental_skill 2024-10-16 00:54:56 +08:00
辉鸭蛋 e74d6b6bd4 Merge pull request #697 from ccccccggggg/main
加入四个战斗脚本
2024-10-15 06:11:38 +08:00
鹤望兰 b8c9dc971f Add files via upload 2024-10-15 01:59:36 +08:00
辉鸭蛋 b51200c1f3 fix pick 声望 2024-10-14 23:47:39 +08:00
鹤望兰 943bd4fc4d Add files via upload 2024-10-14 21:58:11 +08:00
辉鸭蛋 3d2b1b376e 0.35.0 2024-10-14 00:24:11 +08:00
辉鸭蛋 73cd48f8b1 fix nahida collect 2024-10-13 23:49:04 +08:00
辉鸭蛋 c4a7823c83 fix js pathingScript 2024-10-13 22:58:42 +08:00
辉鸭蛋 50aac5cea0 auto pathing opt 2024-10-13 22:12:07 +08:00
辉鸭蛋 228d50bb5d Revert "feat: 优化autopath MoveTo逻辑"
This reverts commit 504f853893.
2024-10-13 21:09:41 +08:00
辉鸭蛋 5e16f48cf2 update pating ui 2024-10-13 20:51:02 +08:00
辉鸭蛋 6fb29ddfad Xilonen 5.1 2024-10-13 20:46:56 +08:00
辉鸭蛋 ac4dde6bf0 Merge pull request #685 from gqzcl/main_path
feat: 优化autopath MoveTo逻辑
2024-10-13 18:50:49 +08:00
辉鸭蛋 6c643b2419 删除一些默认用户配置 2024-10-13 18:27:03 +08:00
辉鸭蛋 2f44905c27 rm script 2024-10-13 18:24:06 +08:00
辉鸭蛋 b2cf62a21c add local script repo web
重构了 `AvatarClassifyGen.cs` 中的图像读取逻辑,现在只读取一个图像文件。`AllConfig.cs` 中添加了 `ScriptConfig` 类的配置,并监听其属性变化。`ScriptRepoUpdater.cs` 中引入了多个新命名空间,添加了 `_logger` 和 `_webWindow` 字段,新增了 `AutoUpdate` 方法,修改了 `UpdateCenterRepo` 方法,新增了 `FindCenterRepoPath`、`ImportScriptFromUri` 和 `OpenLocalRepoInWebView` 方法。`WebpagePanel.cs` 中添加了 `OnWebViewInitializedAction` 属性。`WebpageWindow.cs` 中注释掉了背景色设置。`MainWindow.xaml` 中修改了标题栏图标路径。`JsListPage.xaml`、`KeyMouseRecordPage.xaml` 和 `MapPathingPage.xaml` 中修改了按钮命令绑定。`MainWindowViewModel.cs` 中添加了 `AutoUpdate` 方法调用。`JsListViewModel.cs`、`KeyMouseRecordPageViewModel.cs` 和 `MapPathingViewModel.cs` 中添加了 `Config` 属性和 `OnOpenLocalScriptRepo` 命令。新增了 `ScriptConfig.cs` 和 `RepoWebBridge.cs` 文件,定义了 `ScriptConfig` 和 `RepoWebBridge` 类。
2024-10-13 18:13:28 +08:00
辉鸭蛋 245c05b208 1st logo #671 2024-10-13 15:42:49 +08:00
辉鸭蛋 333ad6f0b4 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-10-13 13:36:10 +08:00
辉鸭蛋 c75dbbc241 add script repo downloader 2024-10-13 13:36:06 +08:00
ema 421b11504f fix: titlebar accent color #442 2024-10-13 03:02:19 +08:00
辉鸭蛋 bb18350457 fix mouse move for js 2024-10-11 03:12:38 +08:00
辉鸭蛋 831f28b2aa WPF-UI.Violeta 3.0.5.18 https://github.com/emako/wpfui.violeta/issues/5 2024-10-10 22:00:30 +08:00
辉鸭蛋 475b9bbd00 update ui text & ProxySpeedTester
删除了 `ClickOffset` 类及其相关代码。
在 `MainWindow.xaml` 中,将导航菜单项的内容从“脚本”更改为“JS 脚本”。
在 `JsListPage.xaml` 和 `KeyMouseRecordPage.xaml` 中,更新了文本内容,并添加了指向相关教程的超链接。
在 `JsListViewModel.cs` 和 `KeyMouseRecordPageViewModel.cs` 中,分别添加了 `OnGoToJsScriptUrl` 和 `OnGoToKmScriptUrl` 方法,用于打开对应的教程 URL。
新增了 `ProxySpeedTester.cs` 文件,包含一个用于测试代理速度的类 `ProxySpeedTester`,提供了获取最快代理地址的方法。
2024-10-10 21:58:35 +08:00
辉鸭蛋 a963a8595a auto pick: add black list
新增黑名单条目至 pick_black_lists.json
2024-10-10 01:20:41 +08:00
辉鸭蛋 5c712c5a31 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-10-09 23:56:01 +08:00
辉鸭蛋 8651ec74a6 update ui 2024-10-09 23:53:55 +08:00
辉鸭蛋 6fadd528f1 Merge pull request #690 from haokaiyang/main
auto tcg: update character card config to v5.1
2024-10-09 13:32:26 +08:00
haokaiyang f20cf89d5f auto tcg: update character card config to v5.1 2024-10-09 11:25:59 +08:00
辉鸭蛋 c13db0a501 rename 2024-10-08 00:21:56 +08:00
辉鸭蛋 7b80867bd1 update ui 2024-10-06 21:05:42 +08:00
辉鸭蛋 a2f877c455 increase the minimum waiting time for the transmission panel delay to 300 milliseconds
增加传送面板延迟的最小等待时间至 300 毫秒

将 `time` 的最小值从 100 毫秒增加到 300 毫秒。这意味着在等待传送面板延迟时,最小等待时间从 100 毫秒变为 300 毫秒。
2024-10-06 14:50:53 +08:00
gqzcl 504f853893 feat: 优化autopath MoveTo逻辑 2024-10-05 14:04:20 +08:00
辉鸭蛋 b1f6c062fb auto tp: add blocked click area
主要变更:
- 在 `TpTask` 构造函数中添加了两个新的私有只读字段 `_captureRect` 和 `_zoomOutMax1080PRatio`。
- 在 `TpOnce` 方法中,使用新的私有字段 `_zoomOutMax1080PRatio` 替代局部变量 `s`。
- 将 `while` 循环条件改为调用新的私有方法 `IsPointInBigMapWindow`。
- 删除了原来计算点击坐标的代码,改为调用新的私有方法 `ConvertToGameRegionPosition`。
- 添加了新的私有方法 `IsPointInBigMapWindow` 和 `ConvertToGameRegionPosition`。
- 更新了子项目的提交版本。

这些更改通过引入新的私有方法和字段,减少了重复代码,并使逻辑更加清晰,代码变得更加模块化,便于后续的维护和扩展。
2024-10-04 19:57:18 +08:00
辉鸭蛋 876a833590 fix: js script bug 2024-10-04 19:04:32 +08:00
辉鸭蛋 160e45c75a fix JustTp 2024-10-04 14:24:42 +08:00
辉鸭蛋 66f15488e1 add bgi version 2024-10-03 20:14:04 +08:00
辉鸭蛋 389dac879b js: add CaptureGameRegion 2024-10-03 16:24:56 +08:00
辉鸭蛋 8b6351cbd6 update: simulator for js 2024-10-03 00:40:07 +08:00
辉鸭蛋 ca126e0d66 js: +func 2024-10-02 19:20:25 +08:00
辉鸭蛋 6c0b293328 js: add solo task 2024-10-01 21:34:33 +08:00
辉鸭蛋 aee54cc115 js config 2024-10-01 20:25:39 +08:00
辉鸭蛋 2817479d33 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-10-01 20:10:51 +08:00
辉鸭蛋 8de5bcf987 auto pick: ForceInteraction 2024-10-01 20:10:46 +08:00
辉鸭蛋 a25cc951c9 new banner 2024-10-01 20:10:23 +08:00
辉鸭蛋 50ee1d1a3e Merge pull request #679 from lwh9346/main
添加了一些可靠的路径追踪捡狗粮路线
2024-10-01 19:15:22 +08:00
lwh9346 7f39062f14 添加了一些可靠的路径追踪捡狗粮路线 2024-10-01 16:56:31 +08:00
ema 619cb667cd chore: doc about game cli #665 2024-10-01 14:16:13 +08:00
ema 4da6efd54e fix the all about scrollable 2024-10-01 13:50:59 +08:00
辉鸭蛋 5fe3db52bf fix hotkey bug 2024-10-01 13:36:53 +08:00
辉鸭蛋 d760f2411a Merge pull request #676 from babalae/feat/btn
add TwoStateButton
2024-10-01 12:42:31 +08:00
辉鸭蛋 1706312957 wpfui.violeta 3.0.5.16 2024-10-01 12:35:08 +08:00
辉鸭蛋 d686fdcb5a auto skip black list #677 2024-10-01 12:17:01 +08:00
辉鸭蛋 a93839e0be refactor: hotkey UI to a tree view 2024-10-01 01:58:00 +08:00
辉鸭蛋 6e00e3f91e collect fight screenshots 2024-10-01 01:56:53 +08:00
qhy040404 41c5f4c226 fix wrong state 2024-10-01 00:04:35 +08:00
qhy040404 95f7b76a03 add TwoStateButton 2024-09-30 23:17:10 +08:00
辉鸭蛋 c137daec40 fix ui 2024-09-30 22:04:01 +08:00
辉鸭蛋 c89e2d4e84 upgrade build ps1
在 `upload_1_build_dist.cmd` 文件中:
- 添加了切换到当前脚本目录的命令 `cd /d %~dp0`。
- 添加了删除 `dist` 目录及其子目录的命令 `if exist dist rd /s /q dist`。
- 添加了创建 `dist\BetterGI` 目录的命令 `mkdir dist\BetterGI`。
- 添加了准备编译器的命令,使用 `vswhere.exe` 查找最新的 Visual Studio 安装路径并设置环境变量。
- 添加了准备版本信息的命令,使用 PowerShell 从 `BetterGenshinImpact.csproj` 文件中提取 `AssemblyVersion`。
- 添加了设置临时文件夹和归档文件名的命令。
- 添加了使用 Visual Studio 2022 构建应用程序的命令。
- 添加了使用 7z 打包应用程序的命令。
- 添加了删除特定文件(如 `.lib` 和 `ffmpeg` DLL 文件)的命令。
- 添加了从特定路径复制文件到临时文件夹的命令。
- 添加了暂停命令 `@pause`。

在 `upload_2_zip_dist.ps1` 文件中:
- 添加了导入 `Microsoft.PowerShell.Archive` 模块的命令。
- 添加了设置目录路径、输出 JSON 路径和目标目录路径的命令。
- 添加了将相对路径转换为绝对路径的命令。
- 添加了初始化排除目录列表的命令。
- 添加了初始化一个空的哈希表来存储文件路径和哈希值的命令。
- 添加了获取目录中所有文件的命令。
- 添加了遍历文件列表并计算每个文件的 SHA256 哈希值的命令。
- 添加了将文件路径和哈希值添加到哈希表中的命令。
- 添加了压缩文件并替换原文件的命令。
- 添加了将哈希表转换为 JSON 格式并写入文件的命令。
- 添加了获取所有 `.zip` 文件并复制到目标目录的命令。
- 添加了删除原始目录的命令。
2024-09-30 22:03:55 +08:00
辉鸭蛋 1901246bab Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-09-30 14:02:45 +08:00
辉鸭蛋 c15cb33c2c rename variables and properties, refactor code, add new configuration options
重命名变量和属性,重构代码,添加新配置选项

主要更改:
* 将 `AutoFightConfig` 和 `AutoFightParam` 类中的字段和属性重命名,以提高名称的清晰度和一致性。
* 移除不必要的 `using` 语句,并调整顺序。
* 重构 `AutoFightTask` 和 `AutoFightHandler` 类中的条件判断和方法逻辑。
* 调整 `CameraRotateTask` 类中的参数值。
* 在 `PathExecutor` 类中添加 `_rotateTask` 字段,并修改相关方法调用。
* 在 `TaskSettingsPage.xaml` 中添加新的配置选项。
* 在 `HotKeyPageViewModel` 类中添加 `using` 语句,并修改热键回调逻辑。
* 修改 `TaskSettingsPageViewModel` 类中 `AutoFightParam` 的初始化。
2024-09-30 13:42:11 +08:00
ema 377de9e244 update: use embedded pdb 2024-09-30 10:29:19 +08:00
ema 335b053b32 change: moved image assets to new folder 2024-09-30 10:12:13 +08:00
辉鸭蛋 2516f9b248 fix tp task 2024-09-30 00:30:00 +08:00
辉鸭蛋 d9e5f2f1dd add rotate task
在 `BgiYoloV8Predictor.cs` 文件中,添加了 `System.Diagnostics`、`System.Drawing.Imaging` 和 `System.IO` 的引用,并在 YOLOv8 识别结果返回前,添加了调试输出,使用 `JsonSerializer` 序列化识别结果并输出到调试窗口。

在 `AutoFightTask.cs` 文件中,添加了 `System.Collections.Generic` 和 `BetterGenshinImpact.GameTask.AutoPathing` 的引用,修改了 `combatScenes.BeforeTask` 方法的调用,使用新的取消令牌 `cts2`。在战斗操作的 `Task.Run` 中添加了 `try-catch` 块,以捕获并忽略异常。修改了战斗结束检测线程,使用 `async` 和 `await` 关键字,并在检测战斗结束时添加了 `try-catch` 块。修改了 `CheckFightFinish` 方法,改为异步方法 `CheckFightFinish`,并在检测战斗结束时添加了旋转视角的逻辑。

在 `PathExecutor.cs` 文件中,添加了关于 DPI 和分辨率影响转动速度的注释。

在 `TaskSettingsPageViewModel.cs` 文件中,在获取战斗策略后,创建了 `AutoFightParam` 对象,并设置了 `EndDetect` 和 `AutoPickAfterFight` 参数。修改了 `RunSoloTaskAsync` 方法的调用,传入了新的 `AutoFightParam` 对象。

在 `CameraRotateTask.cs` 文件中,添加了新的 `CameraRotateTask` 类,用于处理相机视角的旋转,实现了 `RotateToApproach` 方法,用于将视角旋转到接近目标角度,实现了 `WaitUntilRotatedTo` 异步方法,用于等待视角旋转到目标角度。
2024-09-30 00:10:08 +08:00
辉鸭蛋 0549df75b6 auto fight: init end detect
在 `BetterGenshinImpact.csproj` 文件中,删除了 `Assets\Model\World\` 和 `Script\JustTp\` 文件夹的包含项。

在 `AutoFightConfig.cs` 文件中,`AutoFightConfig` 类新增了两个属性:`_endDetect` 和 `_autoPickAfterFight`,并且默认值分别为 `true`。

在 `AutoFightParam.cs` 文件中,`AutoFightParam` 类新增了两个属性:`EndDetect` 和 `AutoPickAfterFight`,并且默认值分别为 `false`。

在 `AutoFightTask.cs` 文件中:
  * 修改了 `using` 引用,添加了 `BetterGenshinImpact.Core.Config` 和 `BetterGenshinImpact.GameTask.Model.Area`,删除了 `BetterGenshinImpact.GameTask.AutoGeniusInvokation.Exception`。
  * 在 `AutoFightTask` 类中,新增了 `_predictor` 和 `_lastFightFlagTime` 字段。
  * 在 `AutoFightTask` 构造函数中,增加了对 `EndDetect` 和 `AutoPickAfterFight` 属性的检查,并在满足条件时初始化 `_predictor`。
  * 修改了 `Start` 方法,增加了战斗结束检测线程和自动拾取掉落物的功能。
  * 新增了 `CheckFightFinish` 和 `HasFightFlag` 方法,用于检测战斗是否结束。

在 `BetterGenshinImpact.Core.Recognition.ONNX` 命名空间下新增了 `BgiYoloV8Predictor` 类,并实现了 `IDisposable` 接口。
  * 添加了一个只读字段 `_predictor`,并通过 `YoloV8Builder` 创建了一个默认的 YoloV8 预测器。
  * 添加了一个 `Predictor` 属性,用于获取 `_predictor`。
  * 添加了一个 `Detect` 方法,该方法接受一个 `ImageRegion` 对象作为参数,并返回一个包含类别和矩形框的字典。
  * 添加了 `Dispose` 方法,用于释放 `_predictor` 的资源。
2024-09-29 23:01:29 +08:00
辉鸭蛋 35264bc855 auto tp: throwing an exception when the tp point is not activated
在 `TpTask.cs` 文件中,添加了 `using BetterGenshinImpact.GameTask.Common.Exceptions;` 引用,并在 `TpTask` 类中添加了对 `TpPointNotActivate` 异常的处理逻辑,当传送点未激活或不存在时,按下 ESC 键返回大地图界面,并抛出异常。同时在 `ClickTpPoint` 方法中,修改了判断逻辑,增加了对传送点未激活或不存在的异常处理。

在 `MapAssets.cs`、`NewRetry.cs`、`TaskControl.cs` 文件中,将 `Exception` 修改为 `System.Exception`。

在 `NormalEndException.cs` 和 `RetryException.cs` 文件中,删除了旧的异常类定义,并重新添加了新的异常类定义。

在 `TpPointNotActivate.cs` 文件中,添加了新的异常类 `TpPointNotActivate`。
2024-09-29 21:37:54 +08:00
辉鸭蛋 5167ce0ba8 Merge pull request #658 from iris10086/iris-dev
在路径追踪中添加了一个AutoFightAction实现
2024-09-25 10:58:16 +08:00
辉鸭蛋 7df330a9fb 低分辨率缩放 2024-09-24 01:18:26 +08:00
辉鸭蛋 24c2d2cbf0 直接调用重构后的自动战斗独立任务
移除了 `AutoFightHandler` 类中的 `_combatScriptBag` 相关代码,并替换为新的 `AutoFightTask` 任务。
添加了新的命名空间引用,包括 `BetterGenshinImpact.GameTask.AutoFight`、`BetterGenshinImpact.GameTask.Common.TaskControl`、`System.IO` 和 `Wpf.Ui.Violeta.Controls`。
在 `StartFight` 方法中,替换了原有的战斗操作逻辑,使用 `AutoFightTask` 类来处理战斗任务。
添加了新的 `GetFightStrategy` 方法,用于获取战斗策略文件路径。
修改了战斗结束检测逻辑,将 `checkFightFinish` 方法重命名为 `CheckFightFinish`,并调整了检测逻辑。
调整了任务取消的逻辑,使用新的 `CancellationTokenSource` 实例 `cts2` 来管理任务取消。
将原有的 `Task` 实例替换为 `Task.Run` 方法来启动任务。
调整了任务等待逻辑,使用 `Task.WhenAll` 方法等待战斗任务和结束检测任务的完成。
2024-09-23 22:24:58 +08:00
辉鸭蛋 d51139025b 便携营养袋 的判断进行前置,减少无意义的性能损耗 2024-09-23 22:21:12 +08:00
辉鸭蛋 e7148f827d Merge branch 'iris-dev' of https://github.com/iris10086/better-genshin-impact into pr/658 2024-09-23 21:59:59 +08:00
辉鸭蛋 3d5d918d24 Merge branch 'main' into pr/658 2024-09-23 21:59:16 +08:00
何杰泽 ff969abbc7 自动吃药 添加了是否携带食物的检测 2024-09-23 21:18:24 +08:00
iris10086 541e9331c0 Merge branch 'babalae:main' into iris-dev 2024-09-23 20:44:10 +08:00
辉鸭蛋 f182e345c2 Merge pull request #660 from babalae/feat-solo-task
refactor: solo task
2024-09-23 10:07:59 +08:00
辉鸭蛋 5a0f7226ed update ISoloTask
更新 Start 方法以接受 CancellationTokenSource 参数

这些更改主要是为了使 `Start` 方法能够接受 `CancellationTokenSource` 参数,从而更好地控制任务的取消操作。通过传递 `CancellationTokenSource`,可以在需要时取消正在运行的任务,提高了代码的灵活性和可控性。

具体更改包括:
- 将 `Start` 方法的签名从无参数更改为接受 `CancellationTokenSource` 参数。
- 在多个任务类(如 `AutoDomainTask.cs`、`AutoFightTask.cs`、`AutoGeniusInvokationTask.cs`、`AutoMusicGameTask.cs`、`AutoWoodTask.cs`)中,更新 `Start` 方法以接受并使用传入的 `CancellationTokenSource`。
- 在 `Duel.cs` 中,更新 `RunAsync` 和 `Run` 方法的参数以接受 `CancellationTokenSource`,并将 `Cts` 赋值为传入的 `cts`。
- 在 `ISoloTask.cs` 接口中,更新 `Start` 方法的签名以接受 `CancellationTokenSource` 参数。
- 在 `TaskRunner.cs` 中,调用 `soloTask.Start` 时传入 `CancellationContext.Instance.Cts` 作为参数。
2024-09-23 00:04:09 +08:00
辉鸭蛋 8bb1d728ff refactor: solo task 2024-09-22 23:56:39 +08:00
辉鸭蛋 38e05830a2 nahida collect opt
优化 NahidaCollectHandler 逻辑并更新 HotKeyPageViewModel

在 NahidaCollectHandler.cs 文件中,调整了 RunAsync 方法的多个参数和延迟时间,增加了条件判断以优化逻辑。在 HotKeyPageViewModel.cs 文件中,添加了新的引用,并修改了 Test1Hotkey 的回调函数以调用 NahidaCollectHandler 的 RunAsync 方法。
2024-09-22 00:27:49 +08:00
辉鸭蛋 89340c42b0 code cleanup 2024-09-22 00:01:10 +08:00
辉鸭蛋 8e44643a51 auto eat #649 2024-09-21 23:41:20 +08:00
辉鸭蛋 7afbbee3e1 add more interrupt operation
在 KeyMouseMacroPlayer 类中添加取消请求检查

在 `KeyMouseMacroPlayer` 类中添加了一个检查取消请求的功能。
在处理每个宏事件之前,增加了以下代码:
    if (ct.IsCancellationRequested)
    {
        return;
    }
这段代码用于在取消请求被触发时,立即终止宏事件的重放。
2024-09-21 18:11:47 +08:00
iris10086 6cf96c71f3 Merge branch 'babalae:main' into iris-dev 2024-09-21 16:02:40 +08:00
何杰泽 997059dd4b 添加fight action。战斗结束策略比较low。 2024-09-21 15:56:37 +08:00
辉鸭蛋 b445cbf42f Merge pull request #649 from iris10086/iris-dev
添加了一个自动吃药的实时触发。
2024-09-21 15:47:00 +08:00
何杰泽 19e7c9d02e Merge branches 'main' and 'main' of github.com:iris10086/better-genshin-impact into iris-dev 2024-09-19 08:30:26 +08:00
何杰泽 d3f0f89da1 添加autoEat功能。 2024-09-19 08:24:41 +08:00
辉鸭蛋 70b1ed88bb auto pathing: add nahida_collect action
新增 Action 处理机制及相关类和方法

删除了 `PickHandler` 类及其相关的 `Obsolete` 特性。
在 `ActionEnum` 类中新增了两个静态只读字段:`NahidaCollect` 和 `PickAround`。
在 `PathExecutor` 类中引入了 `BetterGenshinImpact.GameTask.AutoPathing.Handler` 命名空间。
在 `PathExecutor` 类的 `MoveTo` 方法中,添加了一个调用 `AfterMoveToTarget` 方法的步骤,用于在到达点位后执行特定的动作。
在 `PathExecutor` 类中,修改了疑似卡死时的延迟时间,从 500 毫秒增加到 1500 毫秒。
在 `PathExecutor` 类中新增了 `AfterMoveToTarget` 方法,用于根据 `waypoint.Action` 执行相应的处理逻辑。
新增了 `ActionFactory` 类,用于根据 `handlerType` 获取相应的 `IActionHandler` 实例。
新增了 `IActionHandler` 接口,定义了 `RunAsync` 方法。
新增了 `NahidaCollectHandler` 类,实现了 `IActionHandler` 接口,用于执行纳西妲的收集操作。
新增了 `PickAroundHandler` 类,实现了 `IActionHandler` 接口,暂时未实现具体的拾取操作逻辑。
2024-09-19 00:36:14 +08:00
辉鸭蛋 1a4682bf29 Update README.md 2024-09-18 21:37:23 +08:00
ema 19fbcc48ab chore: hint audio resource for #640 2024-09-18 17:08:50 +08:00
辉鸭蛋 c63ac6947a fix big map shrink 2024-09-18 00:56:34 +08:00
何杰泽 98da4e072c Merge remote-tracking branch 'origin/main' into iris-dev 2024-09-17 22:24:44 +08:00
何杰泽 a2adfe5b6f 修改自动秘境战斗策略,添加自动吃药任务。但是没进行判断。 2024-09-17 22:18:00 +08:00
辉鸭蛋 9cc91b4568 test new pic 2024-09-17 18:18:31 +08:00
辉鸭蛋 068cbd6e20 删除重复点位 2024-09-17 17:54:27 +08:00
辉鸭蛋 f713847df2 add missing tp points #630 #603 #586 2024-09-17 16:29:47 +08:00
辉鸭蛋 c39a882272 auto tp: shrink big map #604 2024-09-17 15:24:09 +08:00
辉鸭蛋 5f9ca6b399 auto pathing: add force tp for tp point 2024-09-17 15:06:32 +08:00
辉鸭蛋 bfe6b69edd fix build bat 2024-09-17 12:24:58 +08:00
辉鸭蛋 8dbdf0840c add map pos editor 2024-09-17 01:41:20 +08:00
辉鸭蛋 4cba618722 edit ui text 2024-09-16 22:13:11 +08:00
辉鸭蛋 4cc4aa27f0 fix path recorder 2024-09-16 21:31:40 +08:00
辉鸭蛋 3e69e6c3ac fix map pos not reset during feature match #619 2024-09-16 21:15:59 +08:00
辉鸭蛋 6414210095 add log #631 2024-09-16 20:27:52 +08:00
辉鸭蛋 83e6798439 add an entry to open the log folder #632 2024-09-16 20:12:58 +08:00
辉鸭蛋 779fbaad86 add refresh context menu #627
添加刷新命令菜单项及刷新方法

在 `JsListPage.xaml` 和 `MapPathingPage.xaml` 中,添加了新的菜单项 `<MenuItem>`,用于绑定 `RefreshCommand` 命令,并设置了相应的 `CommandParameter` 和 `Header` 属性。

在 `JsListViewModel.cs` 中,添加了 `using BetterGenshinImpact.GameTask.AutoPathing.Model;` 语句,并修改了 `OnOpenScriptProjectFolder` 方法,将 `item` 为 `null` 时的处理逻辑改为使用 `scriptPath`。

在 `JsListViewModel.cs` 和 `MapPathingViewModel.cs` 中,添加了 `OnRefresh` 方法,该方法通过调用 `InitScriptListViewData` 来刷新脚本列表视图数据。
2024-09-16 10:52:34 +08:00
辉鸭蛋 962d47722d tp with retry
将 `Tp` 方法重命名为 `TpOnce`,以便区分新的 `Tp` 方法。
新增了一个 `Tp` 方法,该方法会重试调用 `TpOnce` 方法最多三次,如果三次都失败则抛出异常。
修改了一个重试机制的时间间隔,从 500 毫秒重试 10 次改为 500 毫秒重试 5 次。
2024-09-15 19:44:44 +08:00
辉鸭蛋 89079f74d8 if the current map location recognition fails, the national location will be directly used for large-scale map positioning
重构大地图中心点位置获取逻辑

在 `TpTask.cs` 文件中,添加了一个新的方法 `GetPositionFromBigMapNullable`,该方法在调用 `GetBigMapCenterPoint` 时使用了 `try-catch` 结构来捕获异常,并在发生异常时返回 `null`。

修改了原有代码中获取大地图中心点位置的逻辑。原先直接调用 `GetPositionFromBigMap` 方法,现在改为调用新的 `GetPositionFromBigMapNullable` 方法,并在获取到非空值时计算距离和记录日志。

将计算 `minDistance` 的逻辑从直接计算改为在获取到有效的大地图中心点位置后再进行计算。
2024-09-15 19:37:11 +08:00
辉鸭蛋 8dc074e987 tile map 2024-09-15 19:34:59 +08:00
辉鸭蛋 12d4c60f7a fix absolute path for pathing in dispatcher 2024-09-15 19:34:40 +08:00
何杰泽 fae49c4c3b 添加自动吃药的功能。 2024-09-12 15:34:53 +08:00
ema a4e55ab164 change: WindowBackdropType 2024-09-12 00:08:59 +08:00
辉鸭蛋 dc8c1e063e update the naming format for saving path files #600
将保存路径文件的命名格式从“yyyy-MM-dd HH:mm:ss:ffff”更改为“yyyyMMdd_HHmmss”。
2024-09-11 22:35:27 +08:00
辉鸭蛋 1d9168d96e Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-09-11 22:31:27 +08:00
辉鸭蛋 2d4a6192f2 fix #606 2024-09-11 22:30:34 +08:00
ema 7b51c018a7 feat: ExceptionReport 2024-09-11 22:28:59 +08:00
辉鸭蛋 121bfbaa8e fix #608 2024-09-11 21:50:17 +08:00
辉鸭蛋 8d2b36d5fd refactor: script run 2024-09-10 23:27:04 +08:00
辉鸭蛋 c83d3e336f Update README.md 2024-09-10 16:17:42 +08:00
辉鸭蛋 5f76749be7 use System.Windows.Forms.MessageBox for unhandled exception 2024-09-10 00:32:12 +08:00
辉鸭蛋 57d2257283 fix map hotkey not save 2024-09-10 00:20:07 +08:00
辉鸭蛋 1657beb9a8 fix open map viewer 2024-09-10 00:01:04 +08:00
辉鸭蛋 1829498647 update ui
更新文本提示和超链接,修改热键名称

在 `JsListPage.xaml` 文件中,更新了文本内容,增加了“建议在调度器中使用!”的提示。
在 `MapPathingPage.xaml` 文件中,更新了文本内容,增加了“建议在调度器中使用!”的提示,并添加了一个超链接,指向地图追踪使用教程。
在 `HotKeyPageViewModel.cs` 文件中,将热键设置模型的名称从“添加记录点”更改为“添加路径点”。
在 `MapPathingViewModel.cs` 文件中,新增了一个 `OnGoToPathingUrl` 方法,该方法通过超链接打开地图追踪使用教程的网页。
2024-09-09 23:19:07 +08:00
辉鸭蛋 cb53c74c6c log opt 2024-09-09 22:55:52 +08:00
辉鸭蛋 4e6190ac7b fixed #598 2024-09-09 22:42:35 +08:00
辉鸭蛋 bb374ee491 update script 2024-09-09 22:00:34 +08:00
辉鸭蛋 a06f0fcdb2 auto pathing: fix not releasing the mouse and keyboard when stopping tasks
更新日志和黑名单

移除 `PathExecutor.cs` 中的无用引用,重构 `Pathing` 方法,添加 `InitializePathing` 和 `ConvertWaypoints` 方法,提取传送点处理逻辑到 `HandleTeleportWaypoint` 方法。修改 `TpTask.cs` 中的日志格式为浮点数格式。将 `TaskRunner.cs` 中的 `FireAndForgetAsync` 方法重命名为 `RunThreadAsync`,并在 `ScriptService.cs` 中相应替换调用。为 `DpiHelper.cs` 中的 `ScaleY` 属性添加注释。更新 `pick_black_lists.json`,添加新的黑名单项 `"摆放巧像"`。在 `MapPathingViewModel.cs` 中添加 `_mapViewer` 字段,并在 `OnOpenMapViewer` 方法中使用。
2024-09-09 21:57:48 +08:00
辉鸭蛋 1a2b63fff7 update submodule
更新子项目提交版本

更新了子项目的提交版本,从 `2a839bffb0a74d7289b0009de817a7aa523dab68` 变更为 `076ca948ca5d7888f3b42b5cc002363e13489e6b`。
2024-09-09 21:10:06 +08:00
辉鸭蛋 220d6a4f9b fix multi thread ui bug & rotate with dpi
优化 DPI 处理和异步任务执行

在 `PathExecutor.cs` 中,添加了对 `BetterGenshinImpact.Helpers` 的引用,并引入了 `DpiHelper` 来调整 `_dpi` 变量。
在 `PathExecutor` 类中,添加了 `_dpi` 变量,并在 `Pathing` 方法中初始化 `_dpi` 为 `DpiHelper.ScaleY`。
修改了 `RotateTo` 方法的 `controlRatio` 参数类型,从 `int` 改为 `double`,并在调用 `Simulation.SendInput.Mouse.MoveMouseBy` 时乘以 `_dpi` 进行 DPI 缩放。
在 `TaskRunner.cs` 中,添加了 `FireAndForgetAsync` 方法,用于异步执行任务。
在 `ScriptService.cs` 中,添加了对 `BetterGenshinImpact.Helpers` 的引用。
修改了 `ScriptService` 类中调用 `TaskRunner` 的方式,从 `RunAsync` 改为 `FireAndForgetAsync`。
在 `ScriptControlViewModel.cs` 中,简化了调用 `_scriptService.RunMulti` 的方式,去掉了多余的 `Task.Run` 包装。
2024-09-09 00:44:24 +08:00
辉鸭蛋 d6860d5294 0.34.0 2024-09-08 23:36:53 +08:00
辉鸭蛋 c37c43ce92 dispatcher supprot pathing script
调度器支持路径追踪功能及多项代码优化

在 `ScriptGroupProject.cs` 中:
- 添加对多个命名空间的引用。
- 修改构造函数,增加 `folder` 和 `type` 参数,删除 `kmName` 参数。
- 添加 `BuildKeyMouseProject` 和 `BuildPathingProject` 静态方法。
- 在 `Run` 方法中增加 `Pathing` 类型处理逻辑。
- 在 `ScriptGroupProjectExtensions` 中增加 `Pathing` 类型描述。

在 `PathingTask.cs` 中:
- 添加 `FileName` 属性,并在 `BuildFromFilePath` 方法中设置。

在 `Navigation.cs` 中:
- 将 `Navigation` 类改为 `public`。
- 添加 `_isWarmUp` 静态字段,防止重复加载地图特征点。
- 将 `GetPosition`、`GetTargetOrientation` 和 `GetDistance` 方法改为 `public`。

在 `GameTaskManager.cs` 中:
- 在 `AddTrigger` 方法中添加注释,指出清理 `TriggerDictionary` 的问题。

在 `ScriptService.cs` 中:
- 在 `RunMulti` 方法中增加 `hasTimer` 变量,并在处理 `Pathing` 类型时设置。
- 修改 `RunMulti` 方法逻辑,确保无定时操作时检查 JS 脚本。
- 在 `Run` 方法中增加 `Pathing` 类型处理逻辑。

在 `MapPathingPage.xaml` 中:
- 注释掉第四列定义和相关 `Grid` 元素。
- 修改 `ListView` 中 `GridViewColumn` 的 `DisplayMemberBinding`。

在 `ScriptControlPage.xaml` 中:
- 在 `ContextMenu` 中添加新的 `MenuItem`,用于添加路径追踪任务。

在 `PromptDialog.xaml.cs` 中:
- 添加新的 `Prompt` 方法,允许指定对话框大小。
- 修改 `ResponseText` 属性逻辑,增加默认返回值。

在 `MapPathingViewModel.cs` 中:
- 调整 `using` 语句顺序,删除重复引用。

在 `ScriptControlViewModel.cs` 中:
- 修改 `OnAddKmScript` 方法,使用 `BuildKeyMouseProject` 方法创建键鼠脚本项目。
- 添加 `OnAddPathing` 方法及其辅助方法,用于添加路径追踪任务。
- 在 `RunSelectedScriptGroup` 方法中,将脚本运行逻辑放入 `Task.Run` 中,避免阻塞 UI 线程。
2024-09-08 23:17:48 +08:00
辉鸭蛋 5984adf015 auto pathing: add pick timer
更新地图特征点路径和UI文本,地图追踪时添加自动拾取

在 `FeatureStorage.cs` 中,将 `rootPath` 的路径从 `Global.Absolute(@"User\Map\");` 修改为 `Global.Absolute(@"Assets\Map\");`。
在 `Navigation.cs` 中,更新了日志信息的内容,使其更加明确首次加载速度较慢。
在 `BigMap.cs` 中,将 `FeatureMatcher` 的初始化参数从 `MapAssets.Instance.MainMap256BlockMat.Value` 修改为 `new Size(4096, 3328)`。
在 `MapPathingPage.xaml` 中,更新了部分 UI 文本,使其更加准确和清晰。例如,将“查看地图”修改为“查看实时追踪地图”,并在功能描述中添加了“尝鲜”字样。
在 `MapPathingPage.xaml` 中,注释掉了一个 `GridViewColumn`,该列包含了一个操作按钮。
在 `MapPathingViewModel.cs` 中,添加了 `using BetterGenshinImpact.Core.Script.Dependence.Model;` 引用。
在 `MapPathingViewModel.cs` 中,修改了 `TaskRunner` 的初始化参数,并在执行路径任务前添加了一个触发器。
在 `PickHandler.cs` 中,添加了一个新的类 `PickHandler`,并标记为 `[Obsolete]`,表示该类暂时不需要。
2024-09-08 20:28:50 +08:00
辉鸭蛋 4276957837 tp opt & F11 can cancel script task
优化日志记录和任务取消逻辑

在 `PathExecutor.cs` 中添加了 `using System.Diagnostics;` 语句。
注释掉了 `PathExecutor` 类中的部分日志信息。
将 `MoveTo` 和 `MoveCloseTo` 方法中的日志记录改为使用 `Debug.WriteLine`。
修改了 `MoveTo` 和 `MoveCloseTo` 方法中的循环条件,改为 `while (!cts.IsCancellationRequested)`。
将 `MoveTo` 方法中的超时时间从 30 秒改为 60 秒。
在 `TpTask.cs` 中增加了对配置项的最小值检查。
在 `MapAssets.cs` 中添加了新的地图坐标 `{ "纳塔", [8973.5, -1879.1] }`。
在 `HomePageViewModel.cs` 中添加了 `using BetterGenshinImpact.Core.Script;` 语句。
在 `HomePageViewModel` 类的 `Stop` 方法中,添加了取消独立任务的逻辑。
2024-09-08 19:44:34 +08:00
辉鸭蛋 a0691f1c19 auto pathing: add mapper viewer 2024-09-08 19:08:46 +08:00
辉鸭蛋 ca6994a720 auto pathing : first version 2024-09-08 15:16:02 +08:00
辉鸭蛋 cb09a369c2 auto pathing: fix jump and fly 2024-09-08 12:33:58 +08:00
辉鸭蛋 535f6b4551 auto hangout: fix 诺艾尔第二幕 #581
更新诺艾尔第二幕结局对话内容

修改了多个结局的对话内容,删除了一些冗余语句,并新增了更简洁的表达:
- 结局1: 删除“换个地方,缓解一下紧张感吧”和“去港口吧,说不定能向千岩军请教”,新增“缓解一下紧张感吧”和“去港口吧”。
- 结局2: 删除“换个地方,缓解一下紧张感吧”和“去[三碗不过港]吧,然后再往前走走”,新增“缓解一下紧张感吧”和“三碗不过港”。
- 结局3: 删除“不要逃避,直面考试压力吧”,新增“直面考试压力吧”。
- 结局4: 删除“不要逃避,直面考试压力吧”,新增“直面考试压力吧”。
- 结局5: 删除“不要逃避,直面考试压力吧”和“可以成为琴那样的[代理团长]”,新增“直面考试压力吧”和“琴那样”。
- 结局6: 删除“不要逃避,直面考试压力吧”和“可以成为凯亚那样的[骑兵队长]”,新增“直面考试压力吧”和“凯亚那样”。
2024-09-08 12:33:30 +08:00
辉鸭蛋 1f798b9a3a auto hangout: fix 班尼特+重云 #581
更新班尼特和重云结局中的对话和标题

修改了“班尼特结局6:辛运的可能性”中的一行对话,从“怎么能让你承担危险呢”改为“承担危险”。
修改了“重云结局4”的标题,从“试菜员罗伊斯”改为“一无所获”。
2024-09-08 10:26:53 +08:00
辉鸭蛋 1fd5320df2 auto pathing: update
- 移除了不必要的 `using` 语句,添加了新的 `using` 语句。
- 将 `Waypoints` 属性重命名为 `Positions`。
- 更新了 `BuildFromFilePath` 方法中的 `JsonOptions` 引用。
- 将 `Waypoint` 类移到单独的文件中,并添加了相关属性和注释。
- 添加了 `SaveToFile` 方法,用于将 `PathingTask` 对象保存到文件。
- 更新了 `PathExecutor` 中的 `TaskControl` 引用,简化了代码。
- 更新了 `PathRecorder` 的属性和方法,使用私有字段 `_pathingTask`。
- 更新了 `MapPathingPage.xaml` 的命令绑定。
- 更新了 `HotKeyPageViewModel` 和 `MapPathingViewModel` 的逻辑。
- 添加了新的 `PathingTaskConfig` 类,用于配置路径任务。
2024-09-08 02:23:45 +08:00
辉鸭蛋 5818bcd7ed refactor the path task-related code, using the new enum class
在 `PathingTask.cs`、`PathExecutor.cs` 和 `PathRecorder.cs` 中,删除了 `WaypointType`、`MoveType`、`ActionType` 和 `PathingTaskType` 枚举,并将其替换为 `Enum` 命名空间中的类。更新了 `PathingTaskInfo` 类的属性默认值和新增属性。在 `PathExecutor.cs` 中,使用 `.Code` 属性进行比较,并优化了 `prevPositions` 列表的索引。在 `HotKeyPageViewModel.cs` 中,重命名了变量并更新了回调函数。在 `ActionEnum.cs`、`MoveStatusType.cs`、`PathingTaskType.cs` 和 `WaypointType.cs` 中,定义了新的枚举类及其静态实例和相关方法。
2024-09-07 14:53:25 +08:00
辉鸭蛋 93250f84cf update UI experience
在 `App.xaml` 中添加了 `BooleanToEnableTextConverter` 转换器。
在 `ScriptControlPage.xaml` 中:
  * 更新了文本描述,增加了对配置组排序的说明。
  * 添加了一个新的 `TextBlock` 和 `Button`,用于新增配置组。
  * 将“启用状态”列从简单的文本显示改为 `ToggleSwitch` 控件,并使用 `BooleanToEnableTextConverter` 进行绑定。
  * 将 `ListBox.ContextMenu` 更改为 `ListView.ContextMenu`。
  * 为“修改JS脚本自定义配置”菜单项添加了样式和触发器,以根据脚本类型动态显示或隐藏。
在 `ScriptControlViewModel.cs` 中:
  * 添加了 `System.ComponentModel` 的引用。
  * 注释掉了 `WriteScriptGroup` 的循环调用。
  * 修改了 `ShowEditWindow` 方法,将关闭按钮文本从“确定”改为“关闭”。
  * 在 `EditJsScriptSettings` 方法中,添加了对 `LoadSettingUi` 返回值的检查,并在未提供自定义配置时显示警告。
  * 在 `ScriptProjectsCollectionChanged` 方法中,添加了对项目属性变化的事件处理。
  * 添加了 `ScriptProjectsPChanged` 方法,用于处理项目属性变化事件。
  * 更新了 `OnGoToScriptGroupUrl` 方法中的 URL。
新增了 `BooleanToEnableTextConverter.cs` 文件,实现了 `BooleanToEnableTextConverter` 转换器,用于将布尔值与启用状态文本进行转换。
2024-09-07 12:31:07 +08:00
辉鸭蛋 010beebcb6 add open fight script command #569 2024-09-06 00:35:31 +08:00
辉鸭蛋 e6aa70a74c add pick black list 2024-09-06 00:06:25 +08:00
辉鸭蛋 f6801eeaab update ui text #583
原来的文本块内容是“在游戏内剧情‘自动’开启时,快速跳过文本、自动选择选项”,现在被修改为“快速跳过剧情文本、自动选择选项、自动提交物品等”。
2024-09-05 00:49:40 +08:00
辉鸭蛋 522d0517a6 update script 2024-09-03 01:20:09 +08:00
辉鸭蛋 c90fb15557 add 5.0 tp pos 2024-09-03 01:05:37 +08:00
辉鸭蛋 5726e73d40 更新传送点绘制逻辑及界面文本
在 `MainWindow.xaml` 中,修改了按钮文本,将“超大地图标点”改为“画传送点”,并调整了按钮属性顺序以符合 XAML 标准格式。

在 `MapTeleportPointDraw.cs` 中:
- 添加命名空间引用。
- 修改 `Draw` 方法中的文件路径和数据源,增加从 `MapAssets.Instance.TpPositions` 中加载传送点。
- 修改 `DrawTeleportPoint` 方法参数类型为 `List<GiWorldPosition>`,增加坐标转换和文字标注。
- 修改 `LoadTeleportPoint` 方法返回类型为 `List<GiWorldPosition>`。
- 修改 `Transform` 方法返回类型为 `GiWorldPosition`,简化坐标转换逻辑。

在 `ScaleTest.cs` 中:
- 修改 `ZoomOutTest` 方法加载的图像模式为彩色图。
- 修改缩小倍数为 4 倍,调整目标文件路径和图像尺寸。
2024-09-03 00:50:03 +08:00
辉鸭蛋 5d70782c49 auto pick: hard-coding #573 2024-09-02 23:25:24 +08:00
辉鸭蛋 3430e116e3 auto tp: retry after failed map recognition 2024-09-02 01:38:01 +08:00
辉鸭蛋 139b2089d5 fix _submitGoodsEnabled & _closePopupPagedEnabled not vaild 2024-09-01 20:48:45 +08:00
辉鸭蛋 0056dcfc11 #558 2024-09-01 20:46:34 +08:00
辉鸭蛋 c5d5ccab0e fix: trigger may not obtain the latest screenshot 2024-09-01 20:23:10 +08:00
辉鸭蛋 7c1febf307 add pathing ui 2024-09-01 20:15:47 +08:00
辉鸭蛋 5955f90c03 update pathing page 2024-09-01 02:10:13 +08:00
辉鸭蛋 8931a633f1 update pick_black_lists 2024-09-01 00:46:47 +08:00
辉鸭蛋 ae5dbab855 update pick_black_lists 2024-09-01 00:38:18 +08:00
辉鸭蛋 fe09e9c35f Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-09-01 00:35:20 +08:00
辉鸭蛋 023733d88f Merge pull request #573 from rong-xiaoli/main
[bug] Fix: AutoPick chose wrong option
2024-09-01 00:33:55 +08:00
辉鸭蛋 93944250e6 update avatar classify model to 5.0 2024-09-01 00:22:45 +08:00
辉鸭蛋 c9f7b3a14b auto wood: automatically disable logging function upon initial failure 2024-09-01 00:22:08 +08:00
容小狸 ae75e9007d Update pick_black_lists.json
Added:
  "我在「回声之子」的声望…";
  "我在「悬木人」的声望…";
  "我在「流泉之众」的声望…";
2024-08-31 21:31:59 +08:00
辉鸭蛋 181b486db7 update avatar to 5.0 2024-08-31 14:17:28 +08:00
辉鸭蛋 4e7349fac4 update Yap to 5.0 2024-08-31 13:29:00 +08:00
辉鸭蛋 36da78cb78 update map data to 5.0 2024-08-31 13:22:05 +08:00
辉鸭蛋 bfddb53fa0 update script repo 2024-08-31 01:24:21 +08:00
辉鸭蛋 185ce4d930 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-08-31 01:09:52 +08:00
辉鸭蛋 7d82b1af9f add scripts submodule 2024-08-31 01:09:19 +08:00
辉鸭蛋 cb47bf730b delete scripts 2024-08-31 01:07:54 +08:00
辉鸭蛋 b2fecf1155 Merge pull request #567 from haokaiyang/main
auto tcg: update character card config to v5.0
2024-08-30 11:40:40 +08:00
haokaiyang 201ac734cb auto tcg: update character card config to v5.0 2024-08-30 11:23:39 +08:00
辉鸭蛋 bb6aa9e121 auto skip: add pause text #552 2024-08-26 23:17:35 +08:00
辉鸭蛋 b68b0d85f6 Js -> JS 2024-08-24 02:28:31 +08:00
辉鸭蛋 7f03157c25 add GetBigMapPosHotkey 2024-08-24 02:22:52 +08:00
辉鸭蛋 461b0b00d1 add JS script dynamic settings 2024-08-24 02:13:46 +08:00
ema 24d798d6b2 UI/UX: use MessageBox from Violeta 2024-08-20 23:46:29 +08:00
辉鸭蛋 447fd103de support high dpi keyboard and mouse recording 2024-08-20 23:40:25 +08:00
辉鸭蛋 b7d492e5d2 I don't know why this error occurred, but I fixed it 2024-08-20 23:35:08 +08:00
辉鸭蛋 3b701735e6 fix kmscript dpi adapt 2024-08-20 23:22:40 +08:00
辉鸭蛋 928f9612c0 Update README.md 2024-08-20 01:17:31 +08:00
辉鸭蛋 a440729a67 Merge pull request #535 from lwh9346/main
继续完善自动寻路
2024-08-20 01:16:10 +08:00
辉鸭蛋 64c5ab78bc Merge branch 'main' into main 2024-08-20 01:15:55 +08:00
辉鸭蛋 c370410d53 add runner 2024-08-20 01:04:59 +08:00
辉鸭蛋 98b1376111 0.33.1 2024-08-19 23:14:55 +08:00
lwh9346 622a4d5fde allow adding target points 2024-08-19 11:25:55 +08:00
lwh9346 fb0c63f8a8 optimize fly mode and path recording 2024-08-19 11:14:37 +08:00
lwh9346 1610f1cd31 remove redundant screen capture 2024-08-18 22:47:23 +08:00
lwh9346 ab2d6c1de4 copy when transforming coordinate 2024-08-18 21:55:08 +08:00
辉鸭蛋 b62e4a7425 add script group editor 2024-08-18 21:41:12 +08:00
lwh9346 8f64c0ca4e remove unnecessary task run 2024-08-18 21:28:03 +08:00
lwh9346 57138a7be0 Merge branch 'main' of github.com:babalae/better-genshin-impact 2024-08-18 17:41:13 +08:00
辉鸭蛋 6aa02b94d9 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-08-18 14:49:00 +08:00
qhy040404 be89383add fix relative path 2024-08-18 09:06:58 +08:00
辉鸭蛋 0097bfa8c3 edit auto crystalfly script 2024-08-17 20:23:29 +08:00
lwh9346 9393b0cb24 test and make "move to" functional 2024-08-17 19:16:26 +08:00
辉鸭蛋 6812f30732 optimize script execution 2024-08-17 18:00:03 +08:00
辉鸭蛋 c6680ced12 add js script page 2024-08-17 16:02:54 +08:00
辉鸭蛋 b47ce6f529 modify menu hierarchy 2024-08-17 12:09:03 +08:00
NextKale d17a29890f Merge branch 'main' of github.com:atiasn/better-genshin-impact 2024-08-16 08:01:16 +08:00
ema 9b874d3747 small trial with using Toast instead of MessageBox 2024-08-16 00:43:32 +08:00
辉鸭蛋 2b6465be22 edit kmscript name 2024-08-16 00:38:41 +08:00
辉鸭蛋 d2574022fc Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-08-16 00:34:29 +08:00
ema 87ae5e437a update: PresentMonFps version 2024-08-16 00:26:50 +08:00
辉鸭蛋 c486b860d0 0.32.6 2024-08-16 00:11:53 +08:00
辉鸭蛋 4784551e10 expand the orange option recognition range 2024-08-16 00:11:20 +08:00
辉鸭蛋 030caec91f fix: auto skip ClosePopupPagedEnabled not effective 2024-08-16 00:02:20 +08:00
辉鸭蛋 8b0bdef670 edit script group name 2024-08-15 23:55:57 +08:00
辉鸭蛋 6651ec7d9f attempt to correct coordinates 2024-08-15 00:00:12 +08:00
辉鸭蛋 d4fe1f2ab0 add BfMatch instead of FlannMatch 2024-08-14 23:21:03 +08:00
辉鸭蛋 4e1a0673c9 fix GetMiniMapPositionByFeatureMatch = 0 2024-08-14 22:25:15 +08:00
辉鸭蛋 f904fe024b Merge remote-tracking branch 'origin/main' into pr/522 2024-08-14 21:57:11 +08:00
ema bb41bcb25e Merge pull request #525 from babalae/cleanup
code cleanup
2024-08-14 19:43:21 +08:00
qhy040404 c490d29aa1 code cleanup 2024-08-14 18:01:02 +08:00
lwh9346 743debb58b Merge branch 'babalae:main' into main 2024-08-14 16:20:32 +08:00
lwh9346 180fc2d228 Merge branch 'main' of github.com:lwh9346/better-genshin-impact 2024-08-14 16:20:16 +08:00
lwh9346 d148014b7f testing code 2024-08-14 16:11:13 +08:00
qhy040404 78ec9d31e8 check integration #468 2024-08-14 16:03:43 +08:00
lwh9346 9fa721d5e4 Merge branch 'babalae:main' into main 2024-08-14 15:10:41 +08:00
lwh9346 8a5d1d5f64 add path executor 2024-08-14 15:08:37 +08:00
lwh9346 cc245b0e8a change file structure 2024-08-14 14:01:21 +08:00
lwh9346 49bc6befb7 add script support 2024-08-14 14:00:56 +08:00
辉鸭蛋 b62e87f36f Merge pull request #524 from babalae/feat-random-opt
随便改改
2024-08-14 11:34:22 +08:00
DismissedLight 48115be84e 随便改改 2024-08-14 11:13:40 +08:00
lwh9346 f82e35382c add UNTESTED path executor 2024-08-14 10:17:16 +08:00
lwh9346 224fc9917a add walk and swim to "move to" function 2024-08-14 01:39:27 +08:00
lwh9346 eb0b681b9d Merge branch 'main' of github.com:lwh9346/better-genshin-impact 2024-08-14 00:37:46 +08:00
lwh9346 f61a7c32d4 add basic code for auto pathing 2024-08-14 00:36:57 +08:00
辉鸭蛋 bc6ef4fa49 add comment 2024-08-14 00:15:25 +08:00
辉鸭蛋 eef5ff32cb add CameraOrientation.ComputeMiniMap(mat) 2024-08-14 00:14:04 +08:00
辉鸭蛋 c9f3f11c8a make the ScriptControlPage visible 2024-08-13 23:29:51 +08:00
辉鸭蛋 4b4ef25ede 0.32.5 2024-08-13 23:09:14 +08:00
辉鸭蛋 644cdea7ee fix the accuracy issue of feature matching 2024-08-13 23:05:53 +08:00
辉鸭蛋 83911bb13d add new knn match 2024-08-13 21:37:00 +08:00
辉鸭蛋 bc3f356d46 add new knn match 2024-08-13 01:52:48 +08:00
辉鸭蛋 f016f6001c Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-08-13 01:07:59 +08:00
辉鸭蛋 e1097199c4 map feature clear up 2024-08-13 01:07:53 +08:00
辉鸭蛋 36639a0786 auto crystalfly more position 2024-08-12 23:49:35 +08:00
辉鸭蛋 be6c5646da Update README.md 2024-08-12 22:16:43 +08:00
ema 4626863f30 fix #446 2024-08-12 00:23:43 +08:00
辉鸭蛋 b07f2ec839 more crystalfly position 2024-08-11 23:21:55 +08:00
辉鸭蛋 b44ddd5625 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-08-11 20:15:23 +08:00
辉鸭蛋 ed9a47a3a1 fix dispather thread safe 2024-08-11 20:14:32 +08:00
ema 3c27c90828 update: GetParent before SetParent 2024-08-11 19:42:49 +08:00
辉鸭蛋 8fa071722e js : dispatcher.addTimer 2024-08-11 17:58:22 +08:00
辉鸭蛋 2c2e9c0303 supplement the mode of the runner 2024-08-11 10:41:01 +08:00
辉鸭蛋 a7153a47f6 auto crystalfly init 2024-08-11 02:32:00 +08:00
辉鸭蛋 26aa811e97 add script group runner 2024-08-11 00:09:25 +08:00
辉鸭蛋 00f822c49d switch to ground when big map in underground 2024-08-10 23:14:08 +08:00
辉鸭蛋 02b3d80056 record camera orientation config 2024-08-10 22:04:17 +08:00
辉鸭蛋 0edf6c13ef script group ui3 2024-08-10 21:18:48 +08:00
辉鸭蛋 ad288c60cc script group ui 2 2024-08-10 19:16:35 +08:00
辉鸭蛋 308d398036 script group ui 2024-08-10 13:37:29 +08:00
辉鸭蛋 dc09a0ac7b Merge pull request #514 from lwh9346/main
修复了相机视角记录频率不正确的问题
2024-08-10 08:51:57 +08:00
lwh9346 0a4e8e6403 Merge branch 'babalae:main' into main 2024-08-10 00:39:23 +08:00
lwh9346 b881ba313e bug fix 2024-08-10 00:37:52 +08:00
辉鸭蛋 7422454c56 Merge pull request #512 from lwh9346/main
通过在录制脚本时记录相机视角改善回放精度
2024-08-09 19:57:53 +08:00
ema 00ab7042c5 chrome://flags/#enable-force-dark 2024-08-09 17:04:25 +08:00
lwh9346 d69a7c428e capture camera orientation while recording mouse movement to improve replay accuracy 2024-08-09 15:58:40 +08:00
辉鸭蛋 c1072d0574 script: support running macros 2024-08-07 01:07:58 +08:00
辉鸭蛋 bd64181b7c Merge pull request #511 from lwh9346/main
改进键鼠脚本录制与回放精度
2024-08-06 23:57:16 +08:00
lwh9346 6bd9079b3b improve macro player 2024-08-06 23:43:48 +08:00
ema 44921dd3e0 create ISSUE_TEMPLATE\feature.md 2024-08-05 12:02:31 +08:00
辉鸭蛋 d5ac4c523e add crud helper 2024-08-04 23:47:54 +08:00
ema fe418e7bc4 update server b login pos #495 2024-08-04 15:21:51 +08:00
ema a1c5c25623 change server b identity 2024-08-04 15:15:34 +08:00
辉鸭蛋 4610c9e7ca add script engine 2024-08-03 19:41:48 +08:00
辉鸭蛋 abac18bc7e reduce the recognition rate requirements for Qin and costume characters 2024-08-02 22:38:47 +08:00
辉鸭蛋 352b45f07d use FileStorage save KeyPoints 2024-08-01 22:36:06 +08:00
辉鸭蛋 65f2aad4c2 add tp click & fix mask window display 2024-07-31 23:44:25 +08:00
辉鸭蛋 4e5629bc16 fix stop recorder hotkey #501 2024-07-30 00:26:52 +08:00
辉鸭蛋 917df88099 add cancel task hotkey #501 2024-07-30 00:12:18 +08:00
辉鸭蛋 96a56ac4b8 fix stop when recorder starting #501 2024-07-29 23:59:22 +08:00
辉鸭蛋 f9cada6ef9 revert mask window old style #503 2024-07-29 23:38:30 +08:00
辉鸭蛋 babe62ddfd 0.32 2024-07-28 14:05:39 +08:00
辉鸭蛋 3b8429d3c4 auto tcg: add Kaveh 2024-07-28 13:53:49 +08:00
辉鸭蛋 9980576083 edit ui 2024-07-28 12:34:25 +08:00
辉鸭蛋 3d2168874e fix some bug 2024-07-28 11:29:50 +08:00
辉鸭蛋 0f5247c844 keymouse script adaptation for multi-resolution 2024-07-28 11:07:00 +08:00
辉鸭蛋 2314a5eb0e fix #497 2024-07-28 10:37:25 +08:00
辉鸭蛋 14e0af74c0 Merge pull request #499 from babalae/feat-task-refactor
Feat task refactor
2024-07-27 20:25:07 +08:00
辉鸭蛋 9a7e4b5a01 move log info 2024-07-24 22:12:13 +08:00
辉鸭蛋 f9bc5ff426 fix build script 2024-07-23 21:35:40 +08:00
辉鸭蛋 e092f6df29 fix build script 2024-07-23 21:34:58 +08:00
辉鸭蛋 059e21775f unified capture image method 2024-07-21 20:38:06 +08:00
辉鸭蛋 076a7596a0 refactor some code 2024-07-21 19:21:01 +08:00
辉鸭蛋 5e3d50c74a edit auto pick settings 2024-07-21 15:34:29 +08:00
辉鸭蛋 4243972eeb script async test 2024-07-21 12:42:39 +08:00
辉鸭蛋 c3922107b5 init script 2024-07-21 10:13:41 +08:00
辉鸭蛋 3741c92c75 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-07-20 21:57:52 +08:00
辉鸭蛋 9a76e5ad22 add common task runner 2024-07-20 21:57:39 +08:00
ema 619865f6d9 fix filename #492 2024-07-20 19:32:35 +08:00
辉鸭蛋 937d4fb214 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-07-20 12:03:37 +08:00
ema 57444dfe95 adjust fps font size 2024-07-20 01:08:37 +08:00
辉鸭蛋 416b0ab0d9 4.8 avatar 2024-07-19 22:19:00 +08:00
辉鸭蛋 57391a3ad4 fix mask ui display 2024-07-19 21:43:16 +08:00
辉鸭蛋 114974f5c3 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-07-18 22:36:08 +08:00
辉鸭蛋 95d2155390 edit text 2024-07-18 22:36:05 +08:00
辉鸭蛋 6402da1841 Neuvillette _runaroundInterval = 10 2024-07-18 22:14:30 +08:00
ema 5bfc11c797 use digital font to show fps 2024-07-17 23:36:50 +08:00
辉鸭蛋 349469250f auto skip: use new new icon 2024-07-17 23:13:14 +08:00
辉鸭蛋 3173e5aeba update Yap model to 4.8 & add more black pick text 2024-07-17 22:39:47 +08:00
辉鸭蛋 6e968f62de fix: direction ui display font size 2024-07-17 22:33:06 +08:00
辉鸭蛋 b628ecc2a9 auto skip: use new playing icon 2024-07-17 22:23:10 +08:00
辉鸭蛋 31d1f579a7 Merge pull request #485 from haokaiyang/main
auto tcg: update character card config to v4.8
2024-07-17 12:41:22 +08:00
haokaiyang 56c46b1e46 auto tcg: update character card config to v4.8 2024-07-17 11:43:44 +08:00
辉鸭蛋 d56b5efaa0 background click blessing of the welkin moon 2024-07-15 23:20:04 +08:00
辉鸭蛋 b1534a612c new BaseTaskThread 2024-07-15 22:15:26 +08:00
辉鸭蛋 9878786dd7 init script page 2024-07-14 20:18:29 +08:00
辉鸭蛋 f7cce1bbbd stage new page 2024-07-13 21:57:41 +08:00
辉鸭蛋 bc6e9bc078 update key mouse marco ui 2024-07-13 17:03:05 +08:00
NextKale af86c1147c Merge branch 'main' of github.com:atiasn/better-genshin-impact 2024-07-13 15:37:15 +08:00
辉鸭蛋 35354ede17 multiple instances of mask windows #481 2024-07-13 10:17:07 +08:00
ema ed20c8bb1d fix #481 2024-07-13 02:42:58 +08:00
辉鸭蛋 98d7ebd217 add FPS displaying #476 2024-07-12 22:47:51 +08:00
辉鸭蛋 3c2d9ca851 smoother mask window #441 2024-07-12 22:21:23 +08:00
辉鸭蛋 c88644f7a6 macro ui 2024-07-07 21:57:33 +08:00
辉鸭蛋 5e607d98f1 Merge pull request #472 from babalae/dotnet8
update to .net8
2024-07-01 10:23:47 +08:00
辉鸭蛋 ba57eebc99 fix ui 2024-07-01 00:56:35 +08:00
辉鸭蛋 347e42bab9 update dependency library version 2024-07-01 00:51:28 +08:00
辉鸭蛋 7d498f2c35 update to .net8 2024-07-01 00:22:36 +08:00
辉鸭蛋 6c1314cc4d add listview for KeyMouseRecordPage 2024-07-01 00:13:18 +08:00
辉鸭蛋 2cd71ff4a1 improve the speed of matching bigmap 2024-06-30 17:12:50 +08:00
辉鸭蛋 cde2046202 fix markdown-body css 2024-06-27 00:39:14 +08:00
ema 1691c73770 update: vendored markdown html 2024-06-27 00:11:23 +08:00
ema 1cf134ab30 show release markdown 2024-06-27 00:08:37 +08:00
辉鸭蛋 083fdd435f integrated recording and playback 2024-06-27 00:00:49 +08:00
辉鸭蛋 84465d866f test direct input 2024-06-26 00:04:52 +08:00
辉鸭蛋 40c42e550b add calibration 2024-06-25 01:50:55 +08:00
辉鸭蛋 8153367903 fix macro play 2024-06-25 00:07:06 +08:00
辉鸭蛋 0d74e9701e add dinput test 2024-06-24 02:20:43 +08:00
辉鸭蛋 7ce829a3af code optimization 2024-06-24 01:20:38 +08:00
辉鸭蛋 da30d0b7a1 add key mouse recorder 2024-06-24 01:12:42 +08:00
辉鸭蛋 85a2e4a642 add record UI 2024-06-23 23:22:11 +08:00
辉鸭蛋 8469f6c37e test map track 2024-06-23 22:17:32 +08:00
辉鸭蛋 d77bb68066 auto domain: switch roles in advance #463 2024-06-23 15:58:48 +08:00
辉鸭蛋 36e0456061 auto skip: add more switch #464 2024-06-23 08:59:36 +08:00
辉鸭蛋 58bf183763 auto skip: random chat option click 2024-06-23 00:57:26 +08:00
辉鸭蛋 3e554d3bd8 auto skip: close popup page use post message 2024-06-23 00:07:03 +08:00
辉鸭蛋 7aeed2978c test to determine if the game is in input state 2024-06-22 23:48:51 +08:00
NextKale 1c5fe7ec64 wood 2024-06-19 08:57:35 +08:00
辉鸭蛋 1097cc3eb8 auto track: more controller 2024-06-16 23:28:29 +08:00
辉鸭蛋 1f0bf59ca7 opt track 2024-06-16 16:42:08 +08:00
辉鸭蛋 a0e241baee close auto wood ocr default #444 2024-06-16 08:43:21 +08:00
辉鸭蛋 a7eafb6f77 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-06-10 13:52:38 +08:00
辉鸭蛋 577abec2d2 simple auto tracking 2024-06-10 13:52:12 +08:00
辉鸭蛋 1ce02a9630 Update README.md 2024-06-08 20:53:10 +08:00
辉鸭蛋 a8d07823f2 DirectML need Windows 10 version 1903 or later 2024-06-08 18:46:07 +08:00
辉鸭蛋 94d4c32cf5 resource updates 2024-06-08 18:25:54 +08:00
ema 187c728ffe fix setup icon size not tradition 2024-06-08 18:07:11 +08:00
辉鸭蛋 6327fbc690 0.31.1 2024-06-08 17:55:48 +08:00
辉鸭蛋 75389d64f2 game loading in background 2024-06-08 17:53:23 +08:00
辉鸭蛋 581f66f16a Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-06-08 16:06:04 +08:00
辉鸭蛋 a2efc18431 setup.exe icon resource replacement 2024-06-08 16:05:58 +08:00
辉鸭蛋 c025d94c69 Update README.md 2024-06-08 10:09:08 +08:00
辉鸭蛋 e5b9639dec 0.31.0 2024-06-08 09:49:17 +08:00
辉鸭蛋 414e4dd026 add build script for appveyor 2024-06-08 02:09:14 +08:00
辉鸭蛋 809f974cbb auto hangout: auto press skip #335 2024-06-08 00:59:28 +08:00
辉鸭蛋 8cb7e2565f simplify .csproj config 2024-06-08 00:34:17 +08:00
辉鸭蛋 8aec2b18d9 auto hangout: add choose option sleep delay #440 2024-06-08 00:20:27 +08:00
辉鸭蛋 ffe5452f91 auto wood: fix repeated add 2024-06-07 23:41:36 +08:00
辉鸭蛋 4eb9a6ae10 update 4.7 avatar model 2024-06-06 01:52:35 +08:00
辉鸭蛋 47e2473041 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-06-06 01:24:06 +08:00
辉鸭蛋 3f5b984b55 update 4.7 avatar json 2024-06-06 00:56:09 +08:00
辉鸭蛋 fc5d37670c auto map test 2024-06-06 00:44:52 +08:00
辉鸭蛋 a9f9e69f77 Merge pull request #436 from haokaiyang/main
auto tcg: update character card config to v4.7
2024-06-05 13:39:06 +08:00
haokaiyang b0f3cb9abb auto tcg: update character card config to v4.7 2024-06-05 13:28:59 +08:00
辉鸭蛋 fe426e4e24 Merge pull request #433 from Vinkle-hzt/main
fix pick bug
2024-06-03 14:02:27 +08:00
Vinkle-hzt 8f3adc62c1 fix pick bug 2024-06-03 13:58:35 +08:00
辉鸭蛋 a141bf459c auto skip: backgroud fix 2024-06-02 17:07:01 +08:00
辉鸭蛋 d016e59eb4 add map country switch 2024-06-02 01:57:38 +08:00
辉鸭蛋 19f2956633 add map tp 2024-06-02 01:09:57 +08:00
辉鸭蛋 6b7e51a78e edit UI title 2024-06-01 18:21:08 +08:00
辉鸭蛋 283cdfbd1d fix merge hangout.json 2024-06-01 18:20:46 +08:00
辉鸭蛋 cfe963dcae auto skip: backgroud click 2024-06-01 18:09:34 +08:00
辉鸭蛋 b75420cd0b Merge pull request #427 from wy3057/main
托马邀约
2024-06-01 18:08:43 +08:00
禹仔二号 d7e3fb01d8 Update hangout.json
托马邀约
2024-06-01 16:23:39 +08:00
辉鸭蛋 5c26287e51 #425 2024-06-01 12:55:41 +08:00
辉鸭蛋 7730b9b1de do not add click delay when claiming rewards #425 2024-06-01 10:07:48 +08:00
辉鸭蛋 36cde37fea switch to combobox config 2024-05-31 22:26:44 +08:00
辉鸭蛋 f6ad165d60 Merge pull request #424 from Vinkle-hzt/main
支持拾取键更改为E键
2024-05-31 21:42:23 +08:00
Vinkle-hzt 563812dfe2 support E to pick 2024-05-30 14:38:21 +08:00
辉鸭蛋 4a30881a4e add hotkey for #366 2024-05-28 23:29:19 +08:00
辉鸭蛋 e470d684ae auto skip: optimize chat option choose #422 2024-05-28 23:01:08 +08:00
辉鸭蛋 f3c17f7443 opt orange option OCR #409 2024-05-28 22:42:05 +08:00
辉鸭蛋 0baf176daa fix AutoGetDailyRewardsEnabled & AutoReExploreEnabled not working #417 2024-05-28 22:31:33 +08:00
辉鸭蛋 ce8b8687f4 keyboard monitor hotkey support space #416 2024-05-28 22:23:04 +08:00
辉鸭蛋 2749af78a5 Merge pull request #421 from babalae/feat-directml
支持使用DirectML进行GPU推理
2024-05-28 19:14:05 +08:00
辉鸭蛋 03a336967e add classify yolov8 2024-05-28 19:11:43 +08:00
辉鸭蛋 94c8c6a842 modify device name 2024-05-28 19:08:28 +08:00
辉鸭蛋 889955389b use DML 2024-05-28 11:42:54 +08:00
辉鸭蛋 08fbd6e2a2 +main 2024-05-28 10:28:16 +08:00
辉鸭蛋 e1f3b01eb1 add icon in mask window 2024-05-28 01:20:59 +08:00
辉鸭蛋 0973ca0887 use new icon 2024-05-28 01:08:42 +08:00
ema be4039a77a Update TriggerSettingsPage.xaml 2024-05-27 23:33:28 +08:00
ema 684fac7d29 fix style about CardExpander 2024-05-27 23:04:55 +08:00
辉鸭蛋 5c6a96957e add new icon font 2024-05-27 22:28:32 +08:00
ema 56477f3490 use font in mask window 2024-05-26 21:23:22 +08:00
辉鸭蛋 95757a5ed6 test PostMessage 2024-05-26 19:14:44 +08:00
ema c4eae50716 fix: hide mask window from Alt+Tab 2024-05-26 19:10:10 +08:00
ema 6da76f4ef7 Update README.md 2024-05-26 18:09:40 +08:00
辉鸭蛋 443f79bde3 Update README.md 2024-05-26 09:29:33 +08:00
辉鸭蛋 57e24c8e33 update readme 2024-05-25 20:10:02 +08:00
辉鸭蛋 edff49c9cb fix #394 2024-05-25 11:15:36 +08:00
辉鸭蛋 594b517936 0.30.2 2024-05-25 11:00:56 +08:00
辉鸭蛋 5f35d483c2 remove system version judgment #394 2024-05-25 11:00:30 +08:00
辉鸭蛋 b8e5c179fc fix the performance of mask windows at different resolutions - 0.30.1 2024-05-24 12:13:51 +08:00
辉鸭蛋 c5d9930a3d 0.30.0 2024-05-23 17:51:36 +08:00
辉鸭蛋 a84c94c5ce add auto cook #266 2024-05-23 00:27:13 +08:00
辉鸭蛋 a801bb2c4f modify home page text 2024-05-22 23:32:12 +08:00
辉鸭蛋 cb106db75f use 2048 block map 2024-05-22 15:38:13 +08:00
辉鸭蛋 772ab1b7e6 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-05-21 00:18:53 +08:00
辉鸭蛋 92be667328 big map tp 2024-05-21 00:18:44 +08:00
ema cb75cf8338 update: OSVERSIONINFOEX 2024-05-20 21:20:46 +08:00
辉鸭蛋 4bf5001a2c WindowsGraphicsCapture only support Windows 10 version 1903 or later #394 2024-05-20 11:56:04 +08:00
辉鸭蛋 6ffe7a670c prevent computer screen shutdown during auto wood #387 2024-05-19 21:28:49 +08:00
辉鸭蛋 54b669de90 press two esc to close tips #235 2024-05-19 21:18:04 +08:00
辉鸭蛋 65acb852f3 add enable switch for #398 2024-05-19 20:59:54 +08:00
辉鸭蛋 c014284b84 add auto fight strategy 2024-05-19 20:21:23 +08:00
辉鸭蛋 cf16969ea0 Merge pull request #398 from atiasn/wood-count 2024-05-18 23:03:38 +08:00
辉鸭蛋 89e505f4a5 fix capture mod for one key marco #396 2024-05-18 22:28:54 +08:00
辉鸭蛋 c686c4a4a6 fix automatic fishing bait selection error for multiple bait fishing points #396 2024-05-18 22:16:09 +08:00
辉鸭蛋 3cc313c204 fix incorrect auto tcg file names 2024-05-18 22:03:18 +08:00
atiasn 9e3d16c819 check wood 2024-05-17 21:57:53 +08:00
atiasn 8513c9ed4f return ocr 2024-05-16 19:40:27 +08:00
Atiasn bb3941d9f5 get best ocr 2024-05-16 18:12:59 +08:00
atiasn 66d1791218 Merge branch 'main' into wood-count 2024-05-16 01:00:04 +08:00
atiasn 27e6de0fbf delete indexOf 2024-05-16 00:59:17 +08:00
ema cb9dc4ca2e UI/UX: use MiSans-Regular as TextThemeFontFamily 2024-05-15 20:26:55 +08:00
NextKale cc16a60896 delete 2024-05-15 00:36:33 +08:00
atiasn 3792a5f0bf sleep 2024-05-15 00:19:07 +08:00
atiasn fec0e8ec39 wood counts 2024-05-15 00:06:09 +08:00
Atiasn bd4223ddaa wood class 2024-05-14 18:15:20 +08:00
Atiasn 3a35d537b6 woods 2024-05-14 17:06:21 +08:00
atiasn 87a39c95eb 只对首次进行OCR识别 2024-05-14 01:46:27 +08:00
Atiasn fb1eeed107 wood count 2024-05-13 16:40:04 +08:00
atiasn cfe9fc6389 伐木计数 2024-05-13 00:49:29 +08:00
ema 9378a134bd remove: package H.InputSimulator #154 2024-05-12 05:16:27 +08:00
辉鸭蛋 c27b5176e7 16:10 high dpi #373 2024-05-12 00:28:37 +08:00
辉鸭蛋 85e0c827ca fix task not work in 16:10 #373 2024-05-11 23:41:07 +08:00
辉鸭蛋 790c30183b edit ui 2024-05-10 21:07:30 +08:00
辉鸭蛋 6f67bea46c auto music: fix low resolution not work 2024-05-10 20:11:29 +08:00
辉鸭蛋 f8ad1bd8e3 0.29.3 2024-05-09 23:39:09 +08:00
辉鸭蛋 8fe59842c6 update music game 2024-05-09 21:56:56 +08:00
辉鸭蛋 ee154da3c3 music game: Gdi32.GetPixel 2024-05-09 02:46:33 +08:00
辉鸭蛋 9886e7eeff test new method 2024-05-08 02:52:52 +08:00
辉鸭蛋 5797c716dc auto music game 2024-05-08 01:59:30 +08:00
辉鸭蛋 dabdfa51f4 fix boundary overflow after switching game resolution 2024-05-05 22:51:11 +08:00
辉鸭蛋 9ab884512a test params 2024-05-05 20:41:30 +08:00
辉鸭蛋 24590d125e Merge pull request #385 from wy3057/main 2024-05-05 19:55:11 +08:00
辉鸭蛋 118307c562 Merge branch 'main' into main 2024-05-05 19:53:23 +08:00
禹仔二号 7096b9ed9e Update hangout.json 2024-05-05 19:46:32 +08:00
辉鸭蛋 85932c1040 auto hangout: fix 鹿野院平藏 2024-05-05 19:44:16 +08:00
禹仔二号 d90376461c Update hangout.json 2024-05-05 19:40:41 +08:00
辉鸭蛋 c544c18b07 test map tp 2024-05-05 19:12:01 +08:00
辉鸭蛋 a7fcce36b6 Merge pull request #384 from wy3057/main 2024-05-05 19:08:30 +08:00
禹仔二号 e7ef9dcd2f Update hangout.json
根据群友及issue修改了部分邀约文本,其他有可能存在问题
珐露珊结局1:过去的故事
五郎结局1:下,下次一定~
凝光结局1:趁着光景正好
重云结局5:告别    issue#377
重云结局6:小小的遗憾
鹿野院平藏结局1:不蒸发的回忆 issue#375
2024-05-05 18:55:01 +08:00
辉鸭蛋 80b6e36d9a test way point recorder 2024-05-04 23:31:26 +08:00
辉鸭蛋 e6c7abb074 add macro 2024-05-04 23:31:02 +08:00
辉鸭蛋 bcec9cfc6b add new auto pick ocr engine 2024-05-04 19:31:47 +08:00
辉鸭蛋 bea434a3bb Revert "update Yap model to 4.6"
This reverts commit 0e6e94c1e9.
2024-05-04 18:53:37 +08:00
辉鸭蛋 e250498c57 quick tp : eliminate interference from place names on the map 2024-05-04 15:55:00 +08:00
辉鸭蛋 0e6e94c1e9 update Yap model to 4.6 2024-05-04 14:43:52 +08:00
辉鸭蛋 87345e6225 Merge pull request #379 from babalae/feat/resolution 2024-05-04 14:21:30 +08:00
辉鸭蛋 992d1a2e9e edit text 2024-05-04 13:55:52 +08:00
辉鸭蛋 87cb044947 fix bug & edit tip 2024-05-04 13:30:03 +08:00
辉鸭蛋 667043594c refactor: remove ClickOffset 2024-05-04 12:33:27 +08:00
辉鸭蛋 1f6d4a3346 refactor: QuickBuyTask 2024-05-04 11:57:58 +08:00
辉鸭蛋 b1e33a6339 refactor: QuickSereniteaPotTask 2024-05-04 11:49:22 +08:00
辉鸭蛋 7953a76b3d refactor: auto domain 2024-05-03 22:22:42 +08:00
辉鸭蛋 f1c82f83b0 add middle button click. Test passed #154 2024-05-03 22:22:06 +08:00
辉鸭蛋 98b744f33f auto tcg opt 2024-05-03 21:24:17 +08:00
辉鸭蛋 9e01dbd88c #354 2024-05-03 21:21:48 +08:00
辉鸭蛋 be99fb3605 refactor: auto fish 2024-05-03 20:10:43 +08:00
辉鸭蛋 6bf73adce2 fix ra bug 2024-05-03 19:43:22 +08:00
辉鸭蛋 6b98424603 refactor: auto wood & fix game loading trigger 2024-05-03 13:33:56 +08:00
辉鸭蛋 d3f934b1fa Merge branch 'main' into feat/resolution 2024-05-03 12:02:15 +08:00
辉鸭蛋 31db69b20b fix: the official name 阿蕾奇诺 not supported 2024-05-03 12:01:45 +08:00
辉鸭蛋 8acf23e9ce refactor: quick tp & add: ra.ocr 2024-05-03 12:00:34 +08:00
辉鸭蛋 191786962a Merge branch 'main' into feat/resolution 2024-05-03 00:37:03 +08:00
辉鸭蛋 cf8ab82043 0.28.0 2024-05-03 00:17:02 +08:00
辉鸭蛋 a553dc2402 edit text 2024-05-03 00:16:34 +08:00
辉鸭蛋 8bf6a39177 hide test functions 2024-05-02 22:47:26 +08:00
辉鸭蛋 06f77a2d5f delete useless variables 2024-05-02 22:40:49 +08:00
辉鸭蛋 7dadf9b9f9 auto restart when switching capture mode 2024-05-02 22:39:26 +08:00
辉鸭蛋 25ed398524 refactor: submit goods 2024-05-02 21:47:39 +08:00
辉鸭蛋 912d86ac33 refactor: auto hangout 2024-05-02 21:05:10 +08:00
辉鸭蛋 4fa718c6e0 refactor: auto skip 2024-05-02 19:06:10 +08:00
辉鸭蛋 c2d3e132e8 refactor: RectArea -> Region compilation passed 2024-05-02 14:45:07 +08:00
辉鸭蛋 f0bfdde4b8 初始化新的坐标系工具类 2024-05-02 12:16:36 +08:00
辉鸭蛋 10d09afb98 add pick blacklist item 2024-05-01 12:58:09 +08:00
辉鸭蛋 6761b7d72f add 4.6 avatar 2024-05-01 12:37:05 +08:00
辉鸭蛋 239ab3384c 4.6 map puzzle 2024-04-30 22:33:56 +08:00
辉鸭蛋 e8a781f040 edit click param 2024-04-29 22:57:27 +08:00
辉鸭蛋 b60784b8df execute macro even if not successfully recognized 2024-04-28 00:14:43 +08:00
辉鸭蛋 18c1e9f978 automatically restart the dispatcher when the game window size changes 2024-04-28 00:01:04 +08:00
辉鸭蛋 45b5653b13 fix hangout bug 2024-04-27 16:45:56 +08:00
辉鸭蛋 c561da1892 narrowing down the recognition range of auto skip #354 2024-04-27 16:17:50 +08:00
辉鸭蛋 4e7da7156e reduce the frequency of black screen clicks 2024-04-27 16:06:22 +08:00
辉鸭蛋 e7e238e099 add hangout branches 2024-04-27 15:46:45 +08:00
辉鸭蛋 59b5656719 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-04-27 11:50:56 +08:00
辉鸭蛋 fe03913020 add 4.5、4.6 avatar 2024-04-27 11:48:48 +08:00
辉鸭蛋 a45b34378c Merge pull request #363 from haokaiyang/main 2024-04-24 11:46:44 +08:00
郝凯阳 c27150d4d3 Merge branch 'babalae:main' into main 2024-04-24 10:55:40 +08:00
haokaiyang e0ea024631 auto tcg: update character card config to v4.6 2024-04-24 10:52:46 +08:00
辉鸭蛋 7dda27c59b benchmark for #358 2024-04-23 00:45:17 +08:00
辉鸭蛋 8513d31f13 Merge pull request #358 from babalae/span-copy 2024-04-22 23:34:52 +08:00
辉鸭蛋 6dc81e181c fix AutoHangoutEventEnabled switch log display #360 2024-04-22 22:17:50 +08:00
DismissedLight df01527d98 Update KeyPointFeatureBlockHelper.cs 2024-04-22 10:43:13 +08:00
Lightczx fcdf1c4873 Update KeyPointFeatureBlockHelper.cs 2024-04-22 10:41:17 +08:00
辉鸭蛋 116a4c8790 init way record 2024-04-21 23:03:40 +08:00
辉鸭蛋 f64e2f37c9 add feature matcher 2024-04-21 17:18:03 +08:00
辉鸭蛋 25e640bff1 block based feature matching 2024-04-21 13:49:25 +08:00
辉鸭蛋 d917720c9e delete boundary overflow judgment 2024-04-20 17:13:09 +08:00
辉鸭蛋 7756c3af9c reload macro when edited 2024-04-20 15:49:00 +08:00
辉鸭蛋 643a5b0262 fix json editor save 2024-04-20 14:56:56 +08:00
辉鸭蛋 4354ca5900 0.27.0 2024-04-20 12:34:06 +08:00
辉鸭蛋 27ff3e649b quick click genshin online yes or no button #170 2024-04-20 12:24:15 +08:00
辉鸭蛋 e151229eff auto skip: add no click option #350 2024-04-20 11:43:27 +08:00
辉鸭蛋 f10694a476 code style 2024-04-20 00:25:15 +08:00
辉鸭蛋 a458b86fab one key fight 2024-04-20 00:14:27 +08:00
Lightczx 820cd8949d refactor singleton 2024-04-19 17:05:22 +08:00
辉鸭蛋 a983ed45ce Merge pull request #351 from babalae/feat/optimization 2024-04-19 16:31:03 +08:00
辉鸭蛋 f2908509a4 edit tips 2024-04-17 22:49:54 +08:00
辉鸭蛋 dc389f95b9 edit UI 2024-04-17 22:46:13 +08:00
辉鸭蛋 19c441b8c6 finish one click fight macro 2024-04-16 01:02:42 +08:00
辉鸭蛋 a0f94babe8 init one key fight task 2024-04-14 21:54:43 +08:00
辉鸭蛋 f1ac26155a auto select strategy based on team avatars 2024-04-14 01:31:59 +08:00
辉鸭蛋 df2926fe95 auto skip: add hold keyword #350
thanks @snouker
2024-04-13 19:26:01 +08:00
辉鸭蛋 cbca6cfcfe don't interrupt when recognition fails 2024-04-13 19:03:33 +08:00
辉鸭蛋 aa0fedf808 new avatar rec in auto fight 2024-04-13 18:46:18 +08:00
辉鸭蛋 f8f4332abd surf opt 2024-04-13 16:35:54 +08:00
辉鸭蛋 ad606dd29c finsh gen avatar datasets 2024-04-13 16:31:44 +08:00
辉鸭蛋 55aa735c3b avatar classify dataset 2024-04-13 14:26:27 +08:00
Lightczx 4819849902 code style 2024-04-12 10:38:50 +08:00
辉鸭蛋 b8f812c551 auto track opt 2024-04-08 23:23:37 +08:00
辉鸭蛋 1060b819ff draw map teleport point 2024-04-07 22:05:36 +08:00
辉鸭蛋 c3ea13715a add black cancel btn #170 2024-04-06 18:43:12 +08:00
辉鸭蛋 d070f45a0a more match template support 2024-04-06 18:42:23 +08:00
辉鸭蛋 d0405d0800 quick click genshin confirm or cancel button #170 2024-04-06 13:11:24 +08:00
辉鸭蛋 36dcbebdfa add GPU title flag 2024-04-06 12:00:14 +08:00
辉鸭蛋 ed63a68ee5 add switch inference device UI 2024-04-06 11:57:19 +08:00
辉鸭蛋 f14d4a4d10 Merge branch 'main' into feat-gpu 2024-04-06 11:25:04 +08:00
辉鸭蛋 edbc860a3d fix Release error 2024-04-06 11:24:41 +08:00
辉鸭蛋 d69242f7c2 edit onnx version 2024-04-06 11:23:14 +08:00
辉鸭蛋 034d695bf8 all use gpu 2024-04-06 02:43:43 +08:00
辉鸭蛋 4b41fdcecc test gpu 2024-04-06 00:26:55 +08:00
辉鸭蛋 0453355b8a optimize multiple item submissions 2024-04-05 22:16:37 +08:00
辉鸭蛋 e408750d09 auto track mission 2024-04-05 19:54:37 +08:00
辉鸭蛋 8affeff26f optimization 2024-04-04 22:35:36 +08:00
辉鸭蛋 3b6d5f936f resolve conflicts 2024-04-04 20:40:15 +08:00
辉鸭蛋 9c5bc866f8 resolve conflicts 2024-04-04 20:40:04 +08:00
辉鸭蛋 e744aba880 add more recognition capabilities for RectArea 2024-04-04 20:35:42 +08:00
辉鸭蛋 962d00e90d Merge pull request #343 from babalae/feat-asset-singleton 2024-04-04 14:48:26 +08:00
辉鸭蛋 94a049e066 fix compilation error 2024-04-04 14:48:01 +08:00
辉鸭蛋 bdc99e9e06 all assets to singleton 2024-04-04 14:38:04 +08:00
辉鸭蛋 f41cbcdab4 pick assets 2024-04-04 14:10:15 +08:00
辉鸭蛋 7300d32756 simplify View&ViewModel Registration 2024-04-04 13:27:51 +08:00
辉鸭蛋 531ca76cfd Merge pull request #334 from babalae/feat/view-registraion 2024-04-04 13:25:00 +08:00
辉鸭蛋 3df5904d2c Merge branch 'main' into feat/view-registraion 2024-04-04 13:24:48 +08:00
辉鸭蛋 85b253036c Merge pull request #333 from Mr-Quin/notification 2024-04-04 13:18:42 +08:00
辉鸭蛋 2b455ad2fc add universal singleton 2024-04-04 12:15:52 +08:00
辉鸭蛋 5187001b31 unified template matching threshold 2024-04-03 22:47:30 +08:00
辉鸭蛋 314d5b6e9e Merge branch 'pr/342' 2024-04-02 22:25:56 +08:00
辉鸭蛋 f87500245d Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-04-02 22:25:10 +08:00
辉鸭蛋 45f2b9b459 Merge pull request #342 from Mr-Quin/quick-serenitea-pot 2024-04-02 22:22:49 +08:00
辉鸭蛋 09e23cab57 Update QuickSereniteaPotTask.cs
add delay
2024-04-02 22:20:25 +08:00
辉鸭蛋 24713a47e1 mini map test 2024-04-02 22:03:53 +08:00
Mr-Quin a890fa1aca Change label wording 2024-04-01 08:53:55 -07:00
Mr-Quin 32a6507027 Add hotkey to enter Serenitea Pot 2024-04-01 08:37:14 -07:00
Mr-Quin 3f471c68da Fix code style issues 2024-03-31 23:14:24 -07:00
ema 3d4ae6cb06 changed hide button CornerRadius to default 0 2024-04-01 06:59:29 +08:00
辉鸭蛋 0bfaa0daf2 edit assets path 2024-03-31 15:02:40 +08:00
辉鸭蛋 a9ff321daf big map surf test 2024-03-31 14:49:03 +08:00
Mr-Quin 97f2dc4550 Small refactor to NotificationHelper 2024-03-30 15:23:53 -07:00
Mr-Quin 63bec641af Simplify notification creation 2024-03-30 13:57:03 -07:00
Mr-Quin 04ce508efd Slightly simplify call to NotifyAllNotifiersAsync 2024-03-30 13:57:03 -07:00
Mr-Quin 7e5b7eb1d4 Improve error handling 2024-03-30 13:57:03 -07:00
Mr-Quin 4f9424ff3d Register NotificationService as HostedService so it instantiates early 2024-03-30 13:57:03 -07:00
Mr-Quin 8c025feaba Remove taskParams fom serialization 2024-03-30 13:57:03 -07:00
Mr-Quin 083766320d Add error handling to NotifierManager 2024-03-30 13:57:03 -07:00
Mr-Quin a11d31bd62 Update Notification model 2024-03-30 13:57:03 -07:00
Mr-Quin 7781ca1271 Fix ImageConverter 2024-03-30 13:57:03 -07:00
Mr-Quin 4864d32f8c Add screenshot property to TaskNotificationData 2024-03-30 13:57:03 -07:00
Mr-Quin 911ee49083 Refactor notification 2024-03-30 13:57:02 -07:00
Mr-Quin 4755213ccc Fix notification page layout 2024-03-30 13:57:02 -07:00
Mr-Quin e62516c9ce Add notification to task 2024-03-30 13:57:02 -07:00
Mr-Quin 3973a132b4 Add notification 2024-03-30 13:57:02 -07:00
辉鸭蛋 992e1ac3eb key point map test & refactor test window 2024-03-30 22:38:10 +08:00
辉鸭蛋 94da864852 Merge pull request #338 from Mr-Quin/retry-to-new-retry 2024-03-30 11:32:10 +08:00
Mr-Quin 675d3cdb50 Change all references of Retry to NewRetry 2024-03-29 20:26:22 -07:00
辉鸭蛋 417dafa456 auto submit goods support multiple (have some problems) 2024-03-28 23:53:06 +08:00
Lightczx 1c97b425f4 refine 2024-03-28 14:00:29 +08:00
辉鸭蛋 fdd48f4f62 Update README.md 2024-03-27 18:50:21 +08:00
辉鸭蛋 282b7358a0 Merge pull request #327 from Mr-Quin/exit-to-tray 2024-03-27 00:31:46 +08:00
辉鸭蛋 2a7f5265a3 Merge pull request #328 from Mr-Quin/activate 2024-03-26 16:47:42 +08:00
Mr-Quin 43766c6d93 Bring window to foreground on startup 2024-03-25 22:53:51 -07:00
Mr-Quin 087956b161 Add option to minimize to tray when existing 2024-03-25 22:45:12 -07:00
辉鸭蛋 fa9157880f edit display text 2024-03-25 23:05:39 +08:00
辉鸭蛋 c1fce8a3eb Merge pull request #322 from Mr-Quin/status 2024-03-25 22:57:32 +08:00
辉鸭蛋 19e37a35bc city map test 2024-03-25 22:51:54 +08:00
辉鸭蛋 3385692de3 fixed #323 2024-03-25 22:51:16 +08:00
Mr-Quin 30ec2a55ad Add status display in mask window 2024-03-24 11:22:05 -07:00
辉鸭蛋 2448b5b6b0 map match test param opt 2024-03-23 23:55:53 +08:00
辉鸭蛋 f6e2694204 map match test & add map viewer 2024-03-23 20:31:38 +08:00
辉鸭蛋 a36c283784 fix genshin start WorkingDirectory 2024-03-22 22:58:02 +08:00
辉鸭蛋 741deafd3f new map combine 2024-03-22 00:34:23 +08:00
辉鸭蛋 39e552d9fe update Yap model 4.5 2024-03-21 23:28:31 +08:00
辉鸭蛋 919d4c5083 add map puzzle 2024-03-19 02:10:01 +08:00
辉鸭蛋 1d645b1565 catch exception get game path 2024-03-17 21:55:15 +08:00
辉鸭蛋 0d6ad22a22 fix Monitor.Exit() throw exception when use "async" worker functions 2024-03-17 00:15:26 +08:00
辉鸭蛋 29e679d1fd GC for #311 2024-03-16 21:13:59 +08:00
辉鸭蛋 037d4dadff add lock for independent task 2024-03-16 15:20:01 +08:00
辉鸭蛋 62492b3f95 auto hangout hotkey 2024-03-16 14:45:44 +08:00
辉鸭蛋 11c13c6fdd some opt 2024-03-14 23:24:30 +08:00
辉鸭蛋 6ba56fe6e2 add using keyword #311 2024-03-14 00:32:43 +08:00
辉鸭蛋 eb0a886784 replace message box #245 2024-03-14 00:09:02 +08:00
辉鸭蛋 016c94e06c rename editor #245 2024-03-13 23:41:52 +08:00
辉鸭蛋 8a450d9edd single simple JSON editor #245 2024-03-13 23:35:30 +08:00
辉鸭蛋 bb0ea6622b move namespace 2024-03-13 23:11:31 +08:00
郝凯阳 ede7751ebf auto tcg: update character card config to v4.5 (#310) 2024-03-13 11:30:47 +08:00
haokaiyang 7b721ee13c auto tcg: update character card config to v4.5 2024-03-13 10:37:40 +08:00
辉鸭蛋 c9851552e4 update logo (#309) 2024-03-13 00:53:06 +08:00
辉鸭蛋 e74422a219 new README.md (#306) 2024-03-12 13:52:53 +08:00
ema 77496332bf update: edit auto pick black/white list files #245 2024-03-12 04:16:49 +08:00
辉鸭蛋 c7df940f13 Update README.md 2024-03-11 22:39:52 +08:00
辉鸭蛋 ecaa8c15fb attempting to upgrade dependencies 2024-03-10 20:00:06 +08:00
辉鸭蛋 3b4c993aab auto skip hangout: remove all enter 2024-03-10 14:16:20 +08:00
辉鸭蛋 b98097e8e6 auto skip hangout ui 2024-03-10 13:48:00 +08:00
辉鸭蛋 22ea2c2576 clean up code by ReSharper and CodeMaid [\Core] 2024-03-10 12:55:11 +08:00
ema 5b1fe0e2d0 update: formatter 2024-03-10 03:03:14 +08:00
ema ce89e41b60 fix: process can't be exited by X button
#298
2024-03-10 02:58:30 +08:00
ema 24c4a021cb restruct: add mvvm with NotifyIcon 2024-03-10 02:40:40 +08:00
辉鸭蛋 8415daa740 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-03-10 00:50:00 +08:00
辉鸭蛋 ffac1859dc add auto skip hangout 2024-03-10 00:49:53 +08:00
ema ca418ba7b1 fix: change logo.ico file to inner resource 2024-03-10 00:48:45 +08:00
ema a1475732af Merge pull request #298 from Mr-Quin/notifyicon
添加最小化到托盘的按钮
2024-03-10 00:40:53 +08:00
辉鸭蛋 006c7a71cc 0.26.0 2024-03-09 16:36:05 +08:00
辉鸭蛋 5df1eac561 opencv mask test 2024-03-09 16:20:44 +08:00
Mr-Quin 8f7cd481f2 Implement NotifyIcon using WPF-UI.Tray 2024-03-08 12:08:15 -08:00
Mr-Quin c664eca7da Add button to send app to tray 2024-03-07 20:15:09 -08:00
qhy040404 4554769f38 real time mask settings 2024-03-07 23:36:19 +08:00
辉鸭蛋 3133478fca fix mask window config 2024-03-07 22:47:24 +08:00
辉鸭蛋 89b85e0bfd Merge pull request #295 from Mr-Quin/temp 2024-03-07 21:33:54 +08:00
Mr-Quin 961e73880b Change method to private 2024-03-07 00:24:35 -08:00
辉鸭蛋 920ea6333b Merge pull request #297 from qhy040404/feat/converter 2024-03-07 16:14:29 +08:00
qhy040404 fb8ee063bc Use converter to optimize binding
impl #296
2024-03-07 14:59:17 +08:00
Mr-Quin 60117666a7 Change object type to string 2024-03-06 19:51:47 -08:00
Mr-Quin fd47761f7f Fix event handler missed #294 2024-03-06 18:27:48 -08:00
辉鸭蛋 7d69c2ca7f Merge pull request #294 from Mr-Quin/load-dropdown 2024-03-07 10:15:03 +08:00
辉鸭蛋 007efdbf1a Merge pull request #293 from Mr-Quin/path 2024-03-07 10:11:32 +08:00
Mr-Quin 31d7e4c94b Load strategy files when dropdown opens 2024-03-06 13:08:32 -08:00
Mr-Quin 7590f6a273 Normalize detected game executable path 2024-03-06 13:06:50 -08:00
辉鸭蛋 ccadc11b2b Merge pull request #292 from Mr-Quin/Impl2 2024-03-06 22:15:06 +08:00
辉鸭蛋 c150e6a280 code simplify & consider the scenario of WGC 2024-03-06 22:12:58 +08:00
huiyadanli 4e92f7f2c6 auto domain: opt 2024-03-06 21:20:17 +08:00
Mr-Quin c0f34b6c87 Stop task when game exits and update UI 2024-03-06 00:16:02 -08:00
huiyadanli 6b4de6da19 auto enter game: use postmessage instead of sendinput 2024-03-04 22:49:03 +08:00
辉鸭蛋 b63f95b9c0 Merge pull request #288 from qiuyue0/main 2024-03-04 21:35:16 +08:00
秋月 7fcfdbd3bf fix 修复特定情况下关闭自动钓鱼程序未停止的错误
现在特定情况下关闭自动钓鱼后不会继续寻找鱼饵落点
2024-03-04 00:33:21 +08:00
秋月 6f8cfbee4f fix 修复关闭自动钓鱼后意外输出的日志
关闭自动钓鱼后停止输出相关日志
2024-03-04 00:31:13 +08:00
辉鸭蛋 fd79acaee6 Merge pull request #287 from babalae/feat-hutao-fisher 2024-03-03 18:16:33 +08:00
huiyadanli fecc95230f using a new model & new Pole Throwing Algorithm 2024-03-03 18:11:18 +08:00
huiyadanli cc181ebd16 fix: macro ui 2024-03-02 23:25:03 +08:00
huiyadanli 9c1c283576 add more auto fight strategy 2024-03-02 20:14:31 +08:00
huiyadanli 373b2fe61c feat: adjustable parameters 2024-03-01 19:55:16 +08:00
ema da353a9472 update: version comparison method 2024-02-29 17:33:16 +08:00
ema c5f81dd447 restruct: Retry methods 2024-02-29 10:29:29 +08:00
huiyadanli 591007eff6 fix: no longer display warnings that appear when minimizing and restoring #145 2024-02-27 22:41:58 +08:00
辉鸭蛋 ef8f51d8e1 Update README.md 2024-02-27 21:03:27 +08:00
huiyadanli cc37788495 auto enter game: timely close trigger 2024-02-26 20:45:42 +08:00
huiyadanli 9c29156584 add auto enter game trigger 2024-02-25 20:55:32 +08:00
huiyadanli ca00c3dfd7 update auto fish model 2024-02-25 18:15:34 +08:00
huiyadanli dd4d8ae2c2 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-02-23 23:07:18 +08:00
huiyadanli f9e9be6d9d add WindowsGraphicsCapture cache option 2024-02-23 22:55:31 +08:00
huiyadanli fbc5a3ced9 auto skip: update log output logic 2024-02-23 22:06:16 +08:00
ema cb395deef9 clean Fischless.WindowsInput codes 2024-02-19 12:15:56 +08:00
huiyadanli 36aa0270f6 fix: filter empty ocr result in auto skip #261 2024-02-17 23:17:48 +08:00
huiyadanli e3546e9b80 add RunaroundMouseXInterval 2024-02-16 14:32:05 +08:00
huiyadanli bd366503cf auto fish: support Sumeru and Fontaine fish 2024-02-14 19:07:17 +08:00
huiyadanli 9d6d621b75 revert wgc 2024-02-14 15:46:48 +08:00
huiyadanli eac6957185 hokey active when game active 2 2024-02-12 21:35:08 +08:00
huiyadanli 0ec20aa86c hokey active when game active 2024-02-12 21:31:28 +08:00
huiyadanli be291d4093 auto skip: black screen click threshold 2024-02-11 22:46:10 +08:00
huiyadanli 0b2541ac3a version 0.24.1 2024-02-10 22:36:27 +08:00
huiyadanli fe9b028bb2 monitor mode: combination keys not supported 2024-02-10 22:34:56 +08:00
huiyadanli aa9f1cb8d9 fix: switch hotKey type not unregister all hotkey #260 2024-02-10 18:23:19 +08:00
huiyadanli 06a46533d0 version 0.24 2024-02-10 15:39:19 +08:00
huiyadanli 9cc647196c add submit one goods in auto skip 2024-02-10 15:16:02 +08:00
huiyadanli b9ea59cc04 fix new auto skip 2024-02-10 00:21:35 +08:00
huiyadanli cb52ddc78b new auto skip 2024-02-09 23:27:49 +08:00
huiyadanli aedcb3dde5 optimize 2024-02-09 13:05:14 +08:00
huiyadanli 7660e58452 add require administartor tips #255 2024-02-09 11:41:17 +08:00
huiyadanli 2d6b399a07 more user-friendly parsing of error messages 2024-02-08 19:56:10 +08:00
huiyadanli a2255f8250 add quick tp hotkey #127 2024-02-08 18:59:57 +08:00
huiyadanli 15a4dbd624 add black list #175 2024-02-08 15:57:36 +08:00
huiyadanli 3fc3935519 add start param #152 2024-02-08 15:44:50 +08:00
huiyadanli 1c345eae16 add take screenshot 2024-02-08 14:47:26 +08:00
huiyadanli c1018bf3fd add manually pick window hwnd 2024-02-07 22:29:20 +08:00
huiyadanli d67e5e5635 optimize Windows.Graphics.Capture 2024-02-07 22:10:43 +08:00
huiyadanli 16a256dbe0 more accurate auto tp & slower judgment time 2024-02-06 21:18:33 +08:00
huiyadanli ad6d70f75e delete default hotkey 2024-02-06 18:56:47 +08:00
huiyadanli 6bb49eb243 optimizations 2024-02-06 18:25:51 +08:00
huiyadanli a9a02c7e9c update avatar json to 4.4 2024-02-06 13:58:11 +08:00
huiyadanli 92c30bec11 update Yap to 4.4 2024-02-06 13:54:09 +08:00
huiyadanli 8e700d271e Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2024-02-06 13:23:45 +08:00
huiyadanli a4d4aef130 support key mouse monitor hotkey 2024-02-06 13:23:36 +08:00
huiyadanli 78364c5fa7 more stringent fishing box rectangle 2024-02-05 23:54:13 +08:00
辉鸭蛋 3628bd1904 Update README.md 2024-02-04 14:24:45 +08:00
huiyadanli 54ee6e2ad1 add keyboard monitor hotkey 2024-02-03 23:04:14 +08:00
huiyadanli 7ac890e43f view model for #245 @Lightczx 2024-02-03 14:00:55 +08:00
huiyadanli 82ce255617 add YOLOv8 qq group 2024-02-03 12:34:49 +08:00
辉鸭蛋 4dc286c8e9 Merge pull request #249 from haokaiyang/main
auto tcg: update character card config to v4.4
2024-01-31 17:53:40 +08:00
haokaiyang 9162e5970c auto tcg: update character card config to v4.4 2024-01-31 16:23:37 +08:00
辉鸭蛋 2f96f7b312 Merge pull request #248 from Womsxd/main
fix 惊喜牌组 order
2024-01-31 14:11:22 +08:00
Womsxd 0846949823 fix 惊喜牌组 order 2024-01-31 11:11:37 +08:00
huiyadanli 9bab2a0c0c auto domain: add walk option 2024-01-28 15:39:02 +08:00
辉鸭蛋 afdb8e488d Merge pull request #244 from Womsxd/main
加入新的惊喜牌组
2024-01-27 18:06:16 +08:00
Womsxd 387711c413 Add new 惊喜牌组 2024-01-27 13:24:46 +08:00
huiyadanli ae4eb6a7f4 fix inoperative short move & add auto domain config 2024-01-24 23:40:04 +08:00
huiyadanli c714c73975 auto domain: handling situations where items are full 2024-01-24 22:24:27 +08:00
huiyadanli 2789b2edb2 quick teleport: more precise 2024-01-22 23:18:57 +08:00
huiyadanli c32508f0a9 extend waiting time 2024-01-22 22:57:15 +08:00
huiyadanli 215bd3e81f version 0.23 2024-01-21 23:00:41 +08:00
huiyadanli 149f964350 auto tcg: edit log skill name #217 2024-01-21 21:56:56 +08:00
huiyadanli 85f87b02aa auto tcg: default character card config #217 2024-01-21 21:39:11 +08:00
huiyadanli 47eb6ae392 print dpi scale 2024-01-20 19:27:13 +08:00
huiyadanli 4f578e293b 自动领取『每日委托』奖励后关闭奖励结果界面 #230 2024-01-20 19:16:22 +08:00
huiyadanli 954dc1968d use condensed resin double click #224 2024-01-17 23:47:05 +08:00
huiyadanli 1a04986d6e extend close popup page judgment time #223 2024-01-17 23:42:19 +08:00
huiyadanli 288c2856ca fix: auto get daily rewards not work #225 2024-01-17 23:31:33 +08:00
huiyadanli ee2f9f9368 fix: avatar switch bug #213 2024-01-17 00:48:23 +08:00
huiyadanli 511051eae6 fix: enter domain keydown F -> keypress F 2024-01-16 23:54:08 +08:00
huiyadanli 61e72330c6 auto fight: continuous operations will no longer be cancelled 2024-01-15 22:52:07 +08:00
huiyadanli b0d2be2808 auto domain: extend the time to obtain rewards 2024-01-15 22:12:54 +08:00
huiyadanli 6130852d4b version 0.22 2024-01-15 21:50:57 +08:00
huiyadanli d888a5f119 fix some script bug 2024-01-14 22:21:36 +08:00
huiyadanli 4b5b8f9b88 more combat script 2024-01-14 21:30:54 +08:00
huiyadanli 9a0fa23451 add alias support 2024-01-14 00:08:59 +08:00
huiyadanli d2dc2afcf5 add avatar alias 2024-01-14 00:05:25 +08:00
huiyadanli 374de87833 fix: OCR cannot accurately recognize "纳西妲" 2024-01-13 23:13:12 +08:00
huiyadanli 6977b07fad extend retry count and time when taking screenshots #207 2024-01-13 22:57:16 +08:00
huiyadanli 7883cc2d29 auto genius invokation: optimize dice count OCR & dice recognition is sorted by character element priority #165 2024-01-13 22:49:14 +08:00
huiyadanli 179d64dc64 auto domain when configuring rounds, do not recognize resin num 2024-01-13 21:07:28 +08:00
huiyadanli 5e5fcb4b82 optimize the success rate of condensed resin OCR 2024-01-13 21:00:43 +08:00
huiyadanli da87ee0b71 revert auto skip daily reward press esc 2024-01-13 17:20:30 +08:00
huiyadanli 3f1da9e995 optimize domain end recognition 2024-01-13 16:49:16 +08:00
huiyadanli 954fea6bbe optimize domain tree pathfinding #203 2024-01-13 16:24:13 +08:00
huiyadanli 02c6436a8b fix: combat script parse #203 2024-01-11 23:15:51 +08:00
huiyadanli 69fb7f95af fix drawable content not clear 2024-01-11 22:19:33 +08:00
huiyadanli 0d9cf01800 fix auto fight bug when all triggers close #203 2024-01-11 21:56:32 +08:00
huiyadanli d8935138fa revert e q 2024-01-10 22:49:19 +08:00
huiyadanli 1bf156449e new auto fight strategy 2024-01-10 22:44:54 +08:00
辉鸭蛋 4fdd4e90b8 Update question.md 2024-01-10 22:22:53 +08:00
ema 0921ceff85 add ISSUE_TEMPLATE 2024-01-10 12:03:23 +08:00
huiyadanli b7aaeed3d3 edit auto fight strategy (delete q) 2024-01-09 23:47:17 +08:00
huiyadanli 2f29ab7fae using debug log level to print StackTrace 2024-01-09 23:42:00 +08:00
huiyadanli c0171f7874 the log level for writing files is different (debug) 2024-01-09 23:30:28 +08:00
huiyadanli f709c4e019 task delay 2024-01-09 23:21:35 +08:00
huiyadanli 5ba5687178 auto domain add fight end delay 2024-01-09 23:21:19 +08:00
辉鸭蛋 df1191e348 Update README.md 2024-01-07 22:55:25 +08:00
huiyadanli cc8115710f fix log & use resin with retry 2024-01-07 22:36:29 +08:00
辉鸭蛋 96529e8cae Update README.md 2024-01-07 22:34:32 +08:00
辉鸭蛋 3f66de47b7 Update README.md 2024-01-07 20:25:05 +08:00
huiyadanli ed1fe39360 fix 惊喜牌组 order 2024-01-07 20:02:17 +08:00
huiyadanli f4ac8da670 add auto fight hotkey 2024-01-07 16:48:04 +08:00
huiyadanli 87df7297e1 support Neuvillette charge and more command 2024-01-07 16:46:16 +08:00
huiyadanli 92a084cde8 support Nahida long e 2024-01-07 15:56:06 +08:00
huiyadanli 819587d2bd mandatory assignment of team avatars 2024-01-07 14:56:58 +08:00
huiyadanli 7a50f8b994 fix wanderer recognition 2024-01-07 13:12:15 +08:00
huiyadanli 64bee42794 add auto fight task 2024-01-07 11:18:15 +08:00
huiyadanli f992b87acb add combat strategy ui and test it 2024-01-06 23:44:13 +08:00
huiyadanli 66cd73dbf3 universal combat strategy 2024-01-06 22:59:23 +08:00
huiyadanli b5a4806c64 add resin recognition and defeated recognition 2024-01-06 16:20:08 +08:00
huiyadanli 2ea4139a9f fix avatar avtive status detection 2024-01-06 14:58:51 +08:00
huiyadanli aebe605130 optimize auto fishing 2024-01-06 10:53:41 +08:00
huiyadanli d09f6dfee5 press esc after get daily reward 2024-01-05 21:08:58 +08:00
huiyadanli 4b41c2fb86 adjustable parameters 2024-01-04 23:36:25 +08:00
huiyadanli 433475d6c0 circulate domain 2024-01-02 23:40:13 +08:00
huiyadanli 279f7eb3b5 add enter domain 2024-01-01 22:22:46 +08:00
辉鸭蛋 8bfa560a0f Update README.md 2024-01-01 17:43:02 +08:00
辉鸭蛋 fe34e0f4d4 Merge pull request #192 from babalae/autoDomain
first version for auto domain
2024-01-01 16:03:50 +08:00
huiyadanli be08871440 go to domain tree 2024-01-01 15:06:16 +08:00
huiyadanli 2362b01742 init minimap 2024-01-01 00:15:11 +08:00
huiyadanli 922118a3a1 optimize "播放中" ocr result 2023-12-31 19:40:19 +08:00
huiyadanli 3f76d8dbc9 optimization task termination and team identification 2023-12-31 19:06:31 +08:00
辉鸭蛋 475d127ae5 Merge pull request #191 from babalae/autoDomain
auto fight
2023-12-31 17:40:36 +08:00
huiyadanli 1c4c884096 finsh auto combat 2023-12-31 17:39:42 +08:00
huiyadanli e1a66099ad use e, q and cd 2023-12-31 14:52:45 +08:00
huiyadanli e2360ca2bd switch avatar 2023-12-31 14:37:44 +08:00
huiyadanli 427ed0045f team identification 2023-12-30 13:53:07 +08:00
huiyadanli 0c52e3b85b init team avatars 2023-12-30 00:11:59 +08:00
huiyadanli d0321e9d73 add only capture mode 2023-12-28 23:18:36 +08:00
huiyadanli 7965dd15e5 walk to start domain 2023-12-27 00:05:33 +08:00
huiyadanli 877c16c605 Merge branch 'main' into autoDomain 2023-12-26 21:54:13 +08:00
huiyadanli 185e897e4f optimize expedition task 2023-12-26 21:53:12 +08:00
huiyadanli 02480ed060 fix LinkedStartEnabled not working 2023-12-26 21:33:45 +08:00
huiyadanli 76989a6487 update ui text 2023-12-26 21:31:19 +08:00
huiyadanli cddf66bd95 revert quick enhance artifact 2023-12-26 21:27:40 +08:00
huiyadanli f06bddffef init auto domain 2023-12-26 21:04:44 +08:00
huiyadanli da40679559 last felling don't exit game 2023-12-24 19:57:50 +08:00
huiyadanli c6d28874df auto genius invokation: dice OCR determination 2->4 2023-12-24 19:51:33 +08:00
huiyadanli 167c9f6973 0.20.0 2023-12-24 15:59:43 +08:00
辉鸭蛋 67d1c610b3 Merge pull request #182 from babalae/autoDomain
auto fight init
2023-12-24 15:52:16 +08:00
huiyadanli 18b0b03bc8 auto fight init 2023-12-24 15:51:27 +08:00
huiyadanli d38b1f6648 update Yap model to 4.3 2023-12-24 13:10:42 +08:00
huiyadanli 6a7eab49ed new auto expedition task 2023-12-23 18:30:55 +08:00
huiyadanli 0885faf8b8 remove quick enhance artifact 2023-12-23 17:50:51 +08:00
huiyadanli 8a940ae644 team identification test 2023-12-22 22:53:45 +08:00
huiyadanli 13e6d1651a finsh CameraOrientationTest 2023-12-20 00:46:10 +08:00
ema dff7d58873 NumEnter key support was added to the Fischless.WindowsInput 2023-12-19 00:03:20 +08:00
ema 5c557ae684 fix: hot key like binding name error
merge from Fischless.KeyboardCapture
2023-12-18 23:53:16 +08:00
ema c3b5829a2c use wScan got from User32.MapVirtualKey 2023-12-18 23:33:02 +08:00
huiyadanli 29f6351924 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-12-18 01:49:10 +08:00
huiyadanli ca51662b5c camera orientation test 2 2023-12-18 01:49:03 +08:00
辉鸭蛋 7465b5be7b Merge pull request #171 from babalae/ui-fix
fixup UI
2023-12-17 22:42:49 +08:00
DismissedLight 340952d074 fixup UI 2023-12-17 20:10:16 +08:00
ema efd6d1ea41 initial script control but debug only 2023-12-17 17:36:36 +08:00
ema ddfca0340e resolve the consolidate with setup 2023-12-17 15:47:17 +08:00
ema 3b9bd5d267 use IsRefreshExplorer for setup 2023-12-17 14:57:31 +08:00
huiyadanli 848fe90180 init camera orientation test 2023-12-16 23:45:24 +08:00
huiyadanli 978cd45fd8 finsh character orientation test 2023-12-14 01:20:35 +08:00
huiyadanli 24fe650ac9 revert find genshin handle #157 & delay after obtaining handle when BetterGI start genshin #153 2023-12-13 19:58:02 +08:00
huiyadanli 57fd22c4cd Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-12-13 12:10:31 +08:00
辉鸭蛋 553055ddfb Merge pull request #160 from goldenapple1/main
修改引号
2023-12-13 12:08:08 +08:00
huiyadanli a3dcda8261 QuickTeleport: The OCR result is a single character not clicked 2023-12-13 11:33:40 +08:00
_9EE199 0aaf13294b 修改引号 2023-12-12 22:33:05 -05:00
辉鸭蛋 4814c42f6c Merge pull request #159 from goldenapple1/main
增加针对NPC的错误OCR词语的屏蔽
2023-12-13 10:52:56 +08:00
_9EE199 d0544c1f1e 增加针对NPC的错误OCR词语的屏蔽 2023-12-12 15:56:02 -05:00
huiyadanli 62edd9c73a genshin registry opt todo #150 2023-12-13 01:50:24 +08:00
huiyadanli 401e484f4e CharacterOrientationTest 2023-12-13 00:15:52 +08:00
huiyadanli e7542bde79 add orientation display settings 2023-12-13 00:15:26 +08:00
huiyadanli 3d20a4357d unrestricted the name of the genshin startup program #158 2023-12-13 00:04:58 +08:00
huiyadanli 6433cbf456 add orientation display on mask window - ui #156 2023-12-13 00:03:37 +08:00
huiyadanli febbf2d064 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-12-13 00:02:09 +08:00
huiyadanli b44fe7ec19 add orientation display on mask window #156 2023-12-13 00:01:57 +08:00
ema 033b87c267 support more server's settings registry 2023-12-12 11:42:11 +08:00
ema c9b890536f fix override controller settings for auto wood #98 2023-12-11 05:07:16 +08:00
ema d58745a6a7 new input simulator from Fischless.WindowsInput 2023-12-11 05:00:00 +08:00
huiyadanli 5ce8740f17 character orientation test 2023-12-11 02:27:39 +08:00
huiyadanli e77f8322fc 0.18.0 2023-12-10 15:28:16 +08:00
huiyadanli 71095d5724 new linked game start #126 #139 2023-12-10 15:22:38 +08:00
huiyadanli 4bf302b013 auto wood custom buttons #98 2023-12-10 13:51:52 +08:00
huiyadanli 399ad7eb89 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-12-10 13:28:27 +08:00
huiyadanli 703e27662c auto genius invokation optimize #136 2023-12-10 13:25:42 +08:00
ema 5da8c225c0 the methods of the override controller settings #98 2023-12-09 13:36:00 +08:00
huiyadanli 3b7acdcaf0 fix quick buy bug 2023-12-09 12:22:32 +08:00
huiyadanli a56f0c33c9 edit text 2023-12-09 12:10:26 +08:00
huiyadanli 0def54599b add quick buy #138 2023-12-09 12:05:47 +08:00
huiyadanli a911036868 SettingsContainer opt 2023-12-08 00:54:34 +08:00
huiyadanli bc9c0a2e33 fix black screen click 2023-12-08 00:50:52 +08:00
huiyadanli 01999c15fe print logs when registry read fails 2023-12-07 23:49:59 +08:00
huiyadanli 261abf3255 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-12-07 23:36:55 +08:00
辉鸭蛋 c890a200d2 Merge pull request #143 from babalae/RegistryFix
try fix Registry search issue
2023-12-07 23:35:54 +08:00
DismissedLight 981a6c4c05 try fix Registry search issue 2023-12-07 21:05:08 +08:00
huiyadanli b45bbf9030 auto genius invokation: retry multi when capture failed 2023-12-06 23:06:51 +08:00
huiyadanli cce7d1a9f0 add manual GC #131 2023-12-06 22:26:33 +08:00
huiyadanli 8d25e6dcad auto wood support #125 2023-12-06 00:28:39 +08:00
huiyadanli df1174fd9b restore start genshin code 2023-12-05 23:52:26 +08:00
huiyadanli fbf00105c1 throw inner exception #132 #48 2023-12-05 23:50:35 +08:00
huiyadanli 265425eaf2 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-12-05 22:42:45 +08:00
huiyadanli b9200695be fixed: #135 use FindWindow instead of MainWindowHandle 2023-12-05 22:42:13 +08:00
ema f3b1d3ee10 fix: setup don't creat auto run 2023-12-05 20:00:52 +08:00
huiyadanli 6d485dca94 auto genius invokation for keqing #130 2023-12-05 01:59:23 +08:00
ema b58be043f5 syntax: C# 12.0 2023-12-05 00:40:38 +08:00
ema d155c285c3 fix setup some lost files 2023-12-04 15:57:31 +08:00
ema dc68f63d86 one more try login for auto wood bilibili 2023-12-04 02:32:35 +08:00
ema a6891e29dc create a setup builder impl from MicaSetup 2023-12-04 02:29:01 +08:00
huiyadanli edc597a19a 0.17.1 2023-12-03 16:38:32 +08:00
huiyadanli 19ad1f3891 fix auto teleport with high error rates 2023-12-03 16:38:08 +08:00
huiyadanli 1c314f419e fix version compare 2023-12-03 15:27:20 +08:00
huiyadanli 94260d73b4 0.17.0 2023-12-03 14:34:36 +08:00
huiyadanli 0702dc5824 There are certain issues and the release has been postponed 2023-12-03 14:02:21 +08:00
huiyadanli 56473d79a4 detailed error logs switch 2023-12-03 13:44:31 +08:00
huiyadanli a989db29e7 quick teleport ui & performance optimization 2023-12-03 12:55:11 +08:00
huiyadanli 46fd989ba5 auto teleport optimize 2023-12-03 00:25:08 +08:00
huiyadanli d7963fb0c9 quick teleport init 2023-12-02 23:23:08 +08:00
huiyadanli d56bd20b13 add auto wood hotkey 2023-12-02 18:51:37 +08:00
huiyadanli 2e5b62cc8e auto skip add after choose option delay config 2023-12-02 18:49:01 +08:00
huiyadanli e2fddc436d auto wood z delay config 2023-12-02 18:35:00 +08:00
huiyadanli a2addefbbf package scripts 2023-12-02 14:49:00 +08:00
huiyadanli 3990ad9a77 copywriting optimization 2023-12-01 23:38:03 +08:00
辉鸭蛋 5cb04cb05b Merge pull request #116 from Mr-Quin/main
修复七圣召唤启动报错
2023-12-01 10:37:44 +08:00
Mr-Quin 32f1f6a694 Fix OpenCv file name error 2023-11-30 09:31:00 -08:00
huiyadanli 2a48054472 fix auto wood not work in other resolutions #113 2023-11-30 23:20:45 +08:00
huiyadanli e3fdbe8990 fixed: GetNewestInfoの呼び出しが再びクラッシュ #114 2023-11-30 22:56:43 +08:00
ema 35d6f514cb internal beta version 0.16.4 2023-11-30 22:48:02 +08:00
ema dc7cf8f036 enable detect auto wood Z item 2023-11-30 22:44:57 +08:00
ema a293e9c420 support auto wood when bilibili 2023-11-30 22:43:10 +08:00
ema c6a7ff060a wait launching Task.Delay instead of Thread.Sleep 2023-11-30 21:52:12 +08:00
huiyadanli 6ff9f57c50 special not pick 尚需生长时间 #103 2023-11-30 12:57:47 +08:00
ema 50922a2a0a confirm the default backdrop type
1. The acrylic not recommended as default.
2. Mica first than Tabbed.
2023-11-30 10:07:57 +08:00
huiyadanli e33a0da3fa update yap model 2023-11-30 02:03:03 +08:00
huiyadanli 32ca6fdbd0 fix git lfs & update yap model 2023-11-30 02:00:36 +08:00
辉鸭蛋 0402b4d620 Merge pull request #108 from babalae/fluent-design
Bring Fluent Design to Better GI
2023-11-30 01:55:43 +08:00
huiyadanli c53ecb413f revert wpfui style 2023-11-30 01:43:36 +08:00
DismissedLight 115436d871 main window & home page 2023-11-29 22:08:07 +08:00
辉鸭蛋 3a49e82bf7 Merge pull request #105 from wwbweibo/main
支持从注册表中读取安装目录
2023-11-29 10:32:16 +08:00
ema 2d1fe16a65 Revert "fix game launching stuck"
This reverts commit 12be380f44.
2023-11-29 10:21:08 +08:00
ema 12be380f44 fix game launching stuck 2023-11-29 00:53:01 +08:00
wangweibo f5ed61c78e Merge branch 'babalae:main' into main 2023-11-29 00:29:40 +08:00
wwbweibo dd3fe0670b 优先从配置文件中读取游戏可执行文件 2023-11-29 00:15:59 +08:00
huiyadanli e7d49a7b51 auto wood: replace judgment esc menu image 2023-11-29 00:04:42 +08:00
huiyadanli efccde8765 attempted multiple times when capture failed #90 2023-11-28 22:41:05 +08:00
辉鸭蛋 237bf7141a Merge pull request #97 from wwbweibo/main
添加本地安装路径配置,直接启动原神
2023-11-28 12:14:17 +08:00
wwbweibo e16f24ce2a 添加游戏加载完成界面触发器, 直接进入游戏 2023-11-27 22:19:53 +08:00
wwbweibo a6b6772618 可以总本地路径直接启动原神 2023-11-27 22:13:12 +08:00
辉鸭蛋 8fb59738db Update README.md 2023-11-27 11:44:15 +08:00
huiyadanli 3298caa009 remove git lfs 2023-11-27 00:11:08 +08:00
辉鸭蛋 a1fdef7015 Merge pull request #77 from GengGode/main
feat:点击模拟添加是否启用随机参数
2023-11-26 09:12:18 +08:00
ema fc74e127c1 try support bilibili auto wood
Now wait for an account to test it
2023-11-26 07:21:57 +08:00
ema e2f37cae39 notify auto wood unsupported with bilibili 2023-11-26 05:56:33 +08:00
Yu SuiXian 0da4df1afa Merge branch 'babalae:main' into main 2023-11-26 02:32:38 +08:00
ema e06e7c878c simplify OnStartup method 2023-11-26 02:13:30 +08:00
Yu SuiXian c5aeb197c9 feat:点击模拟添加是否启用随机参数,默认不随机 2023-11-26 02:05:06 +08:00
ema ecfaba7252 feat: BetterGI single instance 2023-11-26 02:01:13 +08:00
huiyadanli c2ac8dff77 0.16.1 2023-11-26 00:08:17 +08:00
huiyadanli f8f8414909 AutoGeniusInvokation: fix last card burning 2 2023-11-26 00:07:50 +08:00
huiyadanli 944c61b867 0.16 2023-11-25 23:49:46 +08:00
huiyadanli 4a255ac1bd upgrade prompt to add options that will no longer be prompted 2023-11-25 23:47:39 +08:00
huiyadanli 775619b811 AutoGeniusInvokation: add strategy 2023-11-25 23:30:11 +08:00
huiyadanli 408e372481 auto wood 2023-11-25 22:30:18 +08:00
huiyadanli 5068f4a7f7 fix black screen click 2023-11-25 19:38:47 +08:00
huiyadanli d314b92d67 add switch bgi trigger enable hotkey 2023-11-25 17:16:54 +08:00
huiyadanli cef6f6a9e0 use new hotkey module 2023-11-25 17:04:36 +08:00
huiyadanli 9fe2a75db2 auto genius invokation: fix PredictionDiceType, switching characters does not require specific dice 2023-11-25 16:51:33 +08:00
huiyadanli 8af8b444c2 ui copywriting changes 2023-11-25 14:23:52 +08:00
huiyadanli 7c3e193ca7 fix the last card burn #29 2023-11-25 12:59:17 +08:00
huiyadanli ede9019649 double speed ! #54 2023-11-25 12:29:29 +08:00
huiyadanli f4fb5a24aa more friendly prompts #23 2023-11-25 04:21:18 +08:00
huiyadanli 15480e8de0 add locker for PaddleOcr 2023-11-25 03:42:38 +08:00
huiyadanli d8cbdba33b try catch #47 & print exception logs #48 2023-11-25 03:35:30 +08:00
huiyadanli 92df6d8bb4 add 3-channel template match & can quickly exit during automatic pole throwing 2023-11-25 03:24:35 +08:00
huiyadanli d679ef64f9 improve dice recognition rate #29 2023-11-25 02:46:28 +08:00
huiyadanli 55748bc549 fix rect 2023-11-25 02:21:03 +08:00
huiyadanli 8d4019010a RectConfig -> Rect test pass 2023-11-25 01:13:12 +08:00
Lightczx 5874ad285c OpenCvRectJsonConverter 2023-11-24 10:24:44 +08:00
ema f1208d8cfd Create FolderProfile.pubxml 2023-11-24 05:02:31 +08:00
ema 9b193e56ea feat: now you can launch through bettergi:// 2023-11-24 04:56:40 +08:00
ema df2acc4198 apply WindowBackdropType.Mica for MainWindow 2023-11-24 04:15:13 +08:00
ema b9bc7748d9 add a settings button to support win11 BitBlt 2023-11-24 03:41:46 +08:00
ema 48d94f8729 force platforms to x64 without testing 2023-11-24 03:28:39 +08:00
ema ce428fe9e7 fix mask window to an actual transparent mouse 2023-11-24 03:24:29 +08:00
辉鸭蛋 f4588ede42 Merge pull request #44 from qhy040404/main
Set btn text after exiting duel
2023-11-23 11:06:45 +08:00
huiyadanli 28899ee9d6 add update notice 2023-11-23 01:13:20 +08:00
qhy040404 920e0fb4df Set btn text after exiting duel 2023-11-22 18:58:13 +08:00
huiyadanli 34725b5122 fix OpenCvSharp.Rect can't deserialize 2023-11-22 00:30:06 +08:00
huiyadanli 70c13393fe fix trigger point 2023-11-21 00:24:16 +08:00
huiyadanli 6a7123ff72 enhance artifact: move the mouse back to the origin 2023-11-20 00:12:32 +08:00
huiyadanli a97a67d028 fix auto skip 2023-11-20 00:09:22 +08:00
huiyadanli f41129a6ad beautify the home page 2023-11-19 02:09:32 +08:00
huiyadanli 83c77745ef add genshin settings #23 2023-11-19 00:18:06 +08:00
huiyadanli 289b510c97 fix auto pick white list & log box hittest false 2023-11-18 19:49:39 +08:00
huiyadanli f20926d0e0 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-11-18 13:48:14 +08:00
huiyadanli 4e2bd0372e update Yap model and black list & update icon and urls 2023-11-18 13:44:57 +08:00
辉鸭蛋 59dd9761d2 use new home url 2023-11-18 03:14:17 +08:00
辉鸭蛋 c676ec720c Update README.md 2023-11-18 03:12:50 +08:00
huiyadanli d6d2f15d0e Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-11-18 01:07:01 +08:00
huiyadanli 4ba6a4540e adjust expedition waiting time 2023-11-18 00:42:21 +08:00
辉鸭蛋 167673f3d9 Update README.md 2023-11-17 21:01:07 +08:00
辉鸭蛋 c0e930c4d6 Update README.md 2023-11-17 20:44:26 +08:00
辉鸭蛋 6e88d1ebb3 Update README.md 2023-11-17 00:15:22 +08:00
huiyadanli 29d5ecf77d fix the TP interface was mistakenly closed by auto skip 2023-11-15 23:51:56 +08:00
huiyadanli 30f161eba7 fix expedition character idle judge 2023-11-13 23:31:07 +08:00
huiyadanli 82a6c229e3 some optimizations 2 2023-11-13 02:02:07 +08:00
huiyadanli b8ed185e2b some optimizations 2023-11-13 02:01:57 +08:00
huiyadanli 1356f5208c fix auto genius invokation 2023-11-13 01:27:38 +08:00
huiyadanli 117fc39dd2 set dice count by ocr #14 2023-11-13 00:17:58 +08:00
huiyadanli 95f4bff66e extend the wait time of the last card #14 2023-11-13 00:02:43 +08:00
huiyadanli 0743717f77 use hp ocr recognize which character active #14 2023-11-13 00:01:11 +08:00
huiyadanli e2143429c0 add PromptDialog & add explore config 2023-11-12 22:51:03 +08:00
huiyadanli 36463a4b75 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-11-12 17:52:43 +08:00
huiyadanli 4b01709e2e add task trigger interval settings 2023-11-12 17:52:29 +08:00
辉鸭蛋 cf2406aa9a Update README.md 2023-11-12 16:54:25 +08:00
辉鸭蛋 29d651f2ce Update README.md 2023-11-12 11:27:10 +08:00
huiyadanli 7f1dc84ec5 update yap model 2023-11-11 21:44:57 +08:00
huiyadanli cfa1aced7b auto skip: fix black screen click & add auto close page 2023-11-11 21:38:16 +08:00
huiyadanli 71eaecab0d add OCR within 3s of auto skip button recognition failure 2023-11-11 20:26:29 +08:00
huiyadanli 4feb7b489f update auto expedition 2023-11-09 22:53:33 +08:00
huiyadanli 77b4e9ab57 update Yap model for 4.2 2023-11-08 22:28:00 +08:00
huiyadanli dbec380c69 fix: auto expedition skip 2023-11-08 21:50:07 +08:00
huiyadanli 75788845ef fix: blinking window when selecting logs 2023-11-08 21:34:13 +08:00
huiyadanli 9ac4d12896 fixed: error app name #21 2023-11-07 22:58:01 +08:00
huiyadanli 3974fbb351 auto expedition: delay switch area time 2023-11-07 00:52:35 +08:00
辉鸭蛋 6e6277e531 Merge pull request #20 from babalae/async-startup-fix
Fix async void startup
2023-11-06 14:09:56 +08:00
Lightczx 9e1080c9ec Update App.xaml.cs 2023-11-06 14:05:08 +08:00
辉鸭蛋 c834b5376e Update README.md 2023-11-05 21:43:57 +08:00
huiyadanli dbadaa265c auto expedition: ui 2023-11-05 21:23:31 +08:00
huiyadanli fcc76de886 add enhance wait delay time config #9 2023-11-05 14:32:37 +08:00
huiyadanli d43a5a27db auto expedition: init 2023-11-05 00:33:17 +08:00
huiyadanli 35b994bdb9 auto pick: fast mode [deprecated] 2023-11-04 13:05:44 +08:00
huiyadanli b770f6ed9f remove Media.Ocr 2023-11-03 22:49:35 +08:00
huiyadanli 333d692237 refactor: add model in preject 2023-11-03 00:44:14 +08:00
huiyadanli a5d8758a97 update logo 2023-11-02 22:56:56 +08:00
ema 0a9a63841a fix: the lost logo in MainWindow 2023-11-02 00:29:08 +08:00
ema bb9e02f313 fix: deburring the logo 2023-11-01 20:32:37 +08:00
huiyadanli b5713ed0bb add SpeedTimer record debug time consumed 2023-10-31 23:48:24 +08:00
huiyadanli fd4e498898 auto picker: optimize performance 2023-10-31 23:04:42 +08:00
huiyadanli edb9a2ec67 add PaddleOcr 2023-10-31 22:29:42 +08:00
huiyadanli 4b9722aa25 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-10-30 00:09:50 +08:00
huiyadanli a2dcad54c8 auto get daily rewards 2023-10-30 00:09:39 +08:00
huiyadanli 5d87c7543b use gray-style by Yap 2023-10-29 20:44:50 +08:00
辉鸭蛋 45dbc27b2d Update README.md 2023-10-28 21:51:31 +08:00
辉鸭蛋 4b68d8d5f4 Update README.md 2023-10-28 21:50:59 +08:00
huiyadanli d57e67c159 update version and add logo 2023-10-28 21:03:05 +08:00
huiyadanli 8ca4baa377 fix typo 2023-10-28 20:26:44 +08:00
huiyadanli 5c6f93972f update ui 2023-10-28 20:25:24 +08:00
huiyadanli c12e9a28ad fully automatic fishing by YOLOv8 2023-10-28 20:20:35 +08:00
huiyadanli a27f66669f Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-10-28 02:23:05 +08:00
huiyadanli 9a78634628 preliminary completion of auto throwing rod 2023-10-28 02:22:53 +08:00
辉鸭蛋 9e98fa1a96 Update README.md 2023-10-25 14:53:12 +08:00
辉鸭蛋 46c59cf7c1 Update README.md 2023-10-25 14:51:58 +08:00
huiyadanli 480581b02b add fish bait assets 2023-10-25 00:41:51 +08:00
huiyadanli 2cdc3035a3 add YOLOv8 test trigger 2023-10-24 00:46:52 +08:00
辉鸭蛋 3b52db645e Update README.md 2023-10-22 16:09:33 +08:00
huiyadanli 5dd048fdea add url jump 2023-10-22 16:08:43 +08:00
huiyadanli 4f5619cf31 AutoGeniusInvokation: add sleep delay settings 2023-10-22 15:40:05 +08:00
huiyadanli bfca926c07 AutoGeniusInvokation: add hotkey 2023-10-22 15:28:38 +08:00
huiyadanli 6256a80c01 fix some Genius Invokation bug 2023-10-22 14:17:41 +08:00
huiyadanli 63dbc54095 finsh Genius Invokation 2023-10-22 02:12:13 +08:00
huiyadanli bda00ad054 AutoGeniusInvokation: add entry 2023-10-21 18:48:36 +08:00
huiyadanli feb09bb6bc AutoGeniusInvokation: migrate code 2023-10-21 14:08:16 +08:00
huiyadanli a65ab0adbd Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-10-21 00:20:31 +08:00
huiyadanli 65cb2aff64 Fix the incorrect recognition of point positions after window movement 2023-10-21 00:19:48 +08:00
辉鸭蛋 c5cff89f07 Create LICENSE 2023-10-16 18:20:02 +08:00
huiyadanli 50cf9aa8b2 fix the configuration QuicklySkipConversationsEnabled not work 2023-10-15 18:47:54 +08:00
huiyadanli 967f5ca1a7 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-10-15 18:25:53 +08:00
huiyadanli 9abf1a98c5 add log of function switches 2023-10-15 18:25:28 +08:00
辉鸭蛋 2b99c4338a Update README.md 2023-10-15 13:09:43 +08:00
DismissedLight 3b5220dcf6 introducing high dpi awareness controller 2023-10-15 13:00:07 +08:00
huiyadanli e4cb3e78e9 fix mask window display errors at high dpi 2023-10-15 12:57:13 +08:00
huiyadanli df80bd1dcb Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-10-15 12:42:51 +08:00
huiyadanli 5e3fefb731 add tasks to the task page (not Implemented) 2023-10-15 12:37:36 +08:00
辉鸭蛋 9035ef4a6f Update README.md 2023-10-15 11:05:54 +08:00
辉鸭蛋 33aa70b3ff Update README.md 2023-10-15 03:01:14 +08:00
辉鸭蛋 661a0af9e7 Update README.md 2023-10-15 02:04:22 +08:00
辉鸭蛋 9316662ed1 Update README.md 2023-10-15 02:03:34 +08:00
辉鸭蛋 59a372a91b Update README.md 2023-10-15 01:54:32 +08:00
辉鸭蛋 c0e24087ee Update README.md 2023-10-15 01:37:09 +08:00
辉鸭蛋 b0c17969f2 Update README.md 2023-10-15 01:36:03 +08:00
huiyadanli ca5db4ca68 fix hotkey config‘s value is "< None >" 2023-10-15 01:32:47 +08:00
辉鸭蛋 7571d8a8b9 Merge pull request #5 from hllshiro/issue-4
修复删除已配置的快捷键为None,重新启动软件时的异常
2023-10-15 01:17:22 +08:00
辉鸭蛋 bc3972fa34 Update README.md 2023-10-15 01:14:58 +08:00
hllshiro f3dc400c60 修复删除已配置的快捷键为None,重新启动软件时的异常 2023-10-15 01:12:17 +08:00
huiyadanli c154879491 fix TurnAroundMacro 2023-10-14 23:14:16 +08:00
huiyadanli dec39c1874 delete random num for Space and F fire 2023-10-14 22:50:20 +08:00
huiyadanli 298524fe8e Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-10-14 22:34:17 +08:00
huiyadanli 45fb8badb3 fix auto pick enabled invalidity 2023-10-14 22:33:14 +08:00
huiyadanli 347db368bc fix auto pick didn't pick up anything when everything was full 2023-10-14 22:21:15 +08:00
huiyadanli d671f70bda update dependeny 2023-10-14 22:20:26 +08:00
辉鸭蛋 138b181d93 Update README.md 2023-10-14 20:19:21 +08:00
辉鸭蛋 f5c753b41c Update README.md 2023-10-14 20:08:44 +08:00
辉鸭蛋 ee9efb0bae Update README.md 2023-10-14 19:39:26 +08:00
huiyadanli 271ce50df7 some optimizations 2023-10-14 18:55:21 +08:00
huiyadanli 030851ba3d add TurnAroundMacro and QuickEnhanceArtifactMacro 2023-10-14 18:11:40 +08:00
huiyadanli 380e9d79c1 add hotkey bind 2023-10-14 16:10:02 +08:00
huiyadanli 30eca35efc add simple hotkey 2023-10-14 01:17:55 +08:00
huiyadanli 50ef3d2e22 delete useless code 2023-10-13 23:33:31 +08:00
huiyadanli b4d1942b99 optimize GC 2023-10-13 23:26:59 +08:00
huiyadanli 044d153591 Merge branch 'main' of https://github.com/babalae/better-genshin-impact 2023-10-12 23:54:33 +08:00
huiyadanli 470e90ac37 add hotkey page 2023-10-12 23:52:42 +08:00
Lightczx a2025264b4 simplify GraphicsCaptureItem creation 2023-10-12 13:12:29 +08:00
huiyadanli cfd03833ab add task page 2023-10-12 00:15:36 +08:00
huiyadanli f43a7d7bdf add common settings 2023-10-11 01:22:37 +08:00
huiyadanli 540871912d auto pick: exclude settings icon 2023-10-10 22:34:55 +08:00
huiyadanli c2e46dc32b fix wgc not work in early win10 version 2023-10-10 22:33:58 +08:00
huiyadanli 44fe024985 using a simpler way to identify whether to enter fishing 2023-10-09 23:07:44 +08:00
huiyadanli 04437364da add mask settings page 2023-10-09 22:10:41 +08:00
huiyadanli 6ee0a3a7cf optimized log output 2023-10-09 20:42:16 +08:00
huiyadanli 2f80872c1c clean up comment code 2023-10-09 00:37:28 +08:00
huiyadanli 729c891a98 AutoSkipTrigger: optimize 2023-10-09 00:36:54 +08:00
huiyadanli c27ea845eb interface modification and logic optimization 2023-10-08 23:56:41 +08:00
huiyadanli 88a606cf9f fix mouse click position 2023-10-08 22:18:36 +08:00
huiyadanli 6c40372f26 AutoPicker: exclude chat icon (not in white list) 2023-10-08 21:49:38 +08:00
huiyadanli ab533030c3 compatible with full screen 2023-10-08 00:22:01 +08:00
huiyadanli 1fc0301551 refactor Fischless.WindowCapture & add DwmSharedSurface capture 2023-10-07 23:26:56 +08:00
huiyadanli a8fa869842 make the game area as capture area 2023-10-07 19:29:24 +08:00
Lightczx 629b254f67 unsafe value convert 2023-10-07 17:02:08 +08:00
huiyadanli 5794164546 some test code 2023-10-07 16:01:10 +08:00
Lightczx 9c4b795d42 fix CreateD3D11Texture2D RCW 2023-10-07 14:16:59 +08:00
huiyadanli 9d8c07a2a9 Add capture test 2023-10-07 11:26:26 +08:00
huiyadanli 088360fe8d optimize 2023-10-07 11:25:59 +08:00
huiyadanli 45414606ce optimize log output 2023-10-07 10:15:13 +08:00
huiyadanli 3e246a19d0 Global exception catch 2023-10-06 21:52:55 +08:00
huiyadanli 30e81d1d04 finsh auto pick 2023-10-06 20:59:51 +08:00
huiyadanli ed6df959fa refactor: rename enum name 2023-10-06 18:24:39 +08:00
huiyadanli 2b11eb3a91 ONNX test case passed 2023-10-06 18:17:49 +08:00
huiyadanli 4bad84970a Add run as administrator 2023-10-06 10:45:09 +08:00
huiyadanli 9cca103c8c Fixed a stupid bug 2023-10-06 00:55:03 +08:00
huiyadanli f48b55d88f MouseKeyMonitor config read 2023-10-06 00:19:58 +08:00
huiyadanli fa770efcca Clear draw content when triggers disabled 2023-10-06 00:11:52 +08:00
huiyadanli 81a5819019 Tasks and triggers can read config 2023-10-05 23:56:57 +08:00
huiyadanli 6bde44ea39 Remove ITaskConfig 2023-10-05 22:18:04 +08:00
huiyadanli f1b26f4d70 Load and save config 2023-10-05 22:13:48 +08:00
huiyadanli 21d7a30023 Adjusting the Log Level 2023-10-05 18:40:20 +08:00
huiyadanli 2fe46f46a8 Modify drag icon 2023-10-05 18:40:07 +08:00
huiyadanli 548e136d11 Menu navigation & DI 2023-10-05 17:56:57 +08:00
huiyadanli 95bbb55eff Init main window UI 2023-10-05 00:47:03 +08:00
huiyadanli c3f0c85f43 Add script 2023-10-04 18:01:58 +08:00
huiyadanli cdc62d5520 auto fishing optimize 2023-10-04 14:29:43 +08:00
huiyadanli 4402383fa8 Imperfect throw rod 2023-10-04 14:02:16 +08:00
huiyadanli 57648a8151 Some UI changes 2023-10-04 01:21:44 +08:00
huiyadanli 3a208b6ca2 Add new test trigger & remake mask window 2023-10-03 22:08:06 +08:00
huiyadanli de51fbfd0d mask window mvvm 2023-10-03 01:51:18 +08:00
huiyadanli 5088be2f44 refactor: fix tiggers 2023-10-02 22:11:51 +08:00
huiyadanli 28da64cba5 refactor: Convert all Assets files 2023-10-02 19:23:19 +08:00
huiyadanli 6ed54db1eb refactor: Debugging successful 2023-10-02 18:41:14 +08:00
huiyadanli bbd8ed5067 refactor: use Fischless 2023-10-02 18:00:14 +08:00
huiyadanli 45e86a7a34 refactor: New recognition methods and task schedulers 2023-10-02 17:18:38 +08:00
huiyadanli cbaf1afdfc refactor: Identification Method Replacement and Packaging 2023-10-02 15:07:28 +08:00
huiyadanli 24b3f2b030 Add RecognitionObject 2023-10-01 01:27:17 +08:00
huiyadanli 8bc4237b32 refactor: Add RectArea 2023-10-01 00:27:43 +08:00
huiyadanli d42b763e5f Remove Vision.Recognition 2023-09-30 01:20:15 +08:00
1917 changed files with 213249 additions and 4171 deletions

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
main:
# 自定义按钮可触发的事件
web_trigger_one:
- docker:
image: python:3.11
imports:
- https://cnb.cool/bettergi/secret/-/blob/main/env.yml
stages:
- name: 下载构建物并上传
script: |
cd .github/workflows
pip install -r requirements.txt
python github_download_and_cnb_upload.py --cnb-token $CNB_TOKEN --github-token $GITHUB_TOKEN
echo done!
api_trigger_one:
- docker:
image: python:3.11
imports:
- https://cnb.cool/bettergi/secret/-/blob/main/env.yml
stages:
- name: API触发上传
script: |
echo run id: $RUN_ID
cd .github/workflows
pip install -r requirements.txt
python github_download_and_cnb_upload.py --cnb-token $CNB_TOKEN --github-token $GITHUB_TOKEN --run-id $RUN_ID
echo api done!
+5
View File
@@ -0,0 +1,5 @@
branch:
- buttons:
- name: 触发上传
description: 上传测试版或者正式版
event: web_trigger_one
+74
View File
@@ -0,0 +1,74 @@
name: Bug report / 错误报告
description: 提交可复现的问题,帮助我们定位错误 / Report a reproducible problem
title: "[bug] "
labels:
- BUG
body:
- type: checkboxes
id: checks
attributes:
label: 提交确认 / Checklist
description: Checklist before submitting
options:
- label: 我已经搜索过现有 issue,确认这不是重复问题 / I have searched existing issues and confirmed this is not a duplicate
required: true
- label: "我已阅读过[文档](https://www.bettergi.com/doc.html),确认文档的内容无法解决我的问题 / I have read the [documentation](https://www.bettergi.com/doc.html) and confirmed it does not solve my problem"
required: true
- label: 我愿意为了解决这个问题尽自己所能 / I am willing to do my part to help resolve this issue
- type: textarea
id: environment
attributes:
label: 系统环境
description: System environment,例如操作系统版本、运行时版本、显卡驱动版本
placeholder: Windows 11 24H2 (26100.3775) / .NET Desktop Runtime 8.0.15 / NVIDIA 572.83
validations:
required: true
- type: input
id: version
attributes:
label: BetterGI 版本号
description: BetterGI Version
placeholder: e.g. 0.58.0
validations:
required: true
- type: textarea
id: description
attributes:
label: 问题描述
description: Describe the actual behavior and impact
placeholder: 请描述实际出现的问题,以及这个问题对使用造成了什么影响 / Describe the actual behavior and impact
validations:
required: true
- type: textarea
id: expected
attributes:
label: 期望结果
description: Expected behavior
placeholder: 请描述你期望出现的正确行为或结果 / Describe the expected behavior or result
validations:
required: true
- type: textarea
id: steps
attributes:
label: 复现步骤
description: Reproduction steps
placeholder: |-
1. 打开…… / Open ...
2. 点击…… / Click ...
3. 出现…… / Observe ...
validations:
required: true
- type: textarea
id: logs
attributes:
label: 日志与附件
description: Logs and attachments,可直接拖拽上传日志文件、压缩包、截图或视频
placeholder: |-
可在这里补充日志和附件说明 / Add logs and attachment notes here:
- 可直接粘贴关键日志片段 / Paste key log snippets directly
- 可拖拽上传日志文件或压缩包 / Drag and drop log files or archives
- 可拖拽上传截图、录屏或演示视频 / Drag and drop screenshots or videos
- 若附件较多,请说明对应的时间点、任务名称或异常现象 / If there are many files, explain the relevant timestamps or symptoms
- 提交前请注意移除账号、路径等隐私信息 / Remove private information before submitting
validations:
required: false
+9
View File
@@ -0,0 +1,9 @@
blank_issues_enabled: false
contact_links:
- name: 官方文档 / Document
url: https://www.bettergi.com/doc.html
about: 请在提出问题前阅读文档 / Read the document before submit the issue
- name: 常见问题 / FAQ
url: https://www.bettergi.com/faq.html
about: 常见的用户提出的问题 / Common questions asked by users
+52
View File
@@ -0,0 +1,52 @@
name: I have feature requesting / 我有功能需求
description: 提出新的功能想法 / Share a feature request
title: "[feature] "
labels:
- 功能建议
body:
- type: checkboxes
id: checks
attributes:
label: 提交确认 / Checklist
description: Please confirm the following before submitting
options:
- label: 我已经搜索过现有 issue,确认这不是重复建议 / I have searched existing issues and confirmed this is not a duplicate request
required: true
- label: 我已确认当前版本中尚未提供该功能,或至少没有等价实现 / I have confirmed this feature, or an equivalent one, is not already available in the current version
required: true
- label: 我认为这个需求能为更多用户带来明确收益,而不仅仅是个人偏好 / I believe this request provides clear value to a broader group of users, not just my personal preference
required: true
- label: 我理解这个需求可能因实现成本、维护成本或项目方向而暂不采纳 / I understand this request may not be accepted due to implementation cost, maintenance cost, or project direction
required: true
- type: textarea
id: request
attributes:
label: 功能请求
description: Feature Request
placeholder: 请简要说明你希望新增什么能力 / Briefly describe the capability you want to add
validations:
required: true
- type: textarea
id: scenario
attributes:
label: 使用场景
description: Use Case
placeholder: 这个功能要解决什么问题?在哪些场景下使用? / What problem does this feature solve, and when would it be used?
validations:
required: true
- type: textarea
id: impact
attributes:
label: 潜在影响
description: Potential Impact
placeholder: 请说明这个功能是否可能带来新的问题、维护成本、使用门槛或兼容性影响;如果没有,请填写“无” / Describe any potential downsides such as new issues, maintenance cost, usability barriers, or compatibility impact. Write "None" if there are no obvious downsides.
validations:
required: true
- type: textarea
id: extra
attributes:
label: 补充信息
description: Optional
placeholder: "可选,补充示意图、交互草图、参考链接或相关背景信息 / Optional: add mockups, interaction sketches, reference links, or other background information"
validations:
required: false
+22
View File
@@ -0,0 +1,22 @@
name: Feel free to express / 自由描述
description: 记录你想反馈的内容 / Share general feedback
title: "[feedback] "
body:
- type: checkboxes
id: checks
attributes:
label: 提交确认 / Checklist
description: Please confirm the following before submitting
options:
- label: 我已经搜索过现有 issue,确认这不是重复反馈 / I have searched existing issues and confirmed this is not duplicate feedback
required: true
- label: "我已阅读过[文档](https://www.bettergi.com/doc.html),确认文档的内容无法解决我的问题或覆盖我的反馈 / I have read the [documentation](https://www.bettergi.com/doc.html) and confirmed it does not solve my problem or cover my feedback"
required: true
- type: textarea
id: description
attributes:
label: 描述
description: Description
placeholder: 请描述你想反馈的内容 / Describe what you want to share
validations:
required: true
+32
View File
@@ -0,0 +1,32 @@
name: I have a question / 我有疑问
description: 提交你的问题,我们会尽量帮助你解决 / Ask a question
title: "[question] "
labels:
- 问题咨询
body:
- type: checkboxes
id: checks
attributes:
label: 提交确认 / Checklist
description: Please confirm the following before submitting
options:
- label: 我已经搜索过现有 issue,确认这不是重复问题 / I have searched existing issues and confirmed this is not a duplicate question
required: true
- label: "我已阅读过[文档](https://www.bettergi.com/doc.html),确认文档的内容无法解决我的问题 / I have read the [documentation](https://www.bettergi.com/doc.html) and confirmed it does not solve my problem"
required: true
- type: textarea
id: question
attributes:
label: 问题描述
description: Problem Description
placeholder: 请清楚描述你的问题 / Clearly describe your question
validations:
required: true
- type: textarea
id: tried
attributes:
label: 已尝试内容
description: Screenshots / logs / what you already tried
placeholder: 可附上截图、日志,以及你已经尝试过的排查过程 / Add screenshots, logs, and what you have already tried
validations:
required: true
+32
View File
@@ -0,0 +1,32 @@
name: I have suggestions / 我有建议
description: 分享对项目的改进建议 / Share an improvement suggestion
title: "[suggestion] "
labels:
- 功能建议
body:
- type: checkboxes
id: checks
attributes:
label: 提交确认 / Checklist
description: Please confirm the following before submitting
options:
- label: 我已经搜索过现有 issue,确认这不是重复建议 / I have searched existing issues and confirmed this is not a duplicate suggestion
required: true
- label: "我已阅读过[文档](https://www.bettergi.com/doc.html),确认文档的内容无法解决我的问题或覆盖我的建议 / I have read the [documentation](https://www.bettergi.com/doc.html) and confirmed it does not solve my problem or cover my suggestion"
required: true
- type: textarea
id: suggestion
attributes:
label: 建议内容
description: Suggestion
placeholder: 请描述你的建议内容 / Describe your suggestion
validations:
required: true
- type: textarea
id: benefit
attributes:
label: 预期收益
description: Expected Benefit
placeholder: 这个建议会给用户或项目带来什么帮助? / What benefits would this suggestion bring to users or the project?
validations:
required: true
+229
View File
@@ -0,0 +1,229 @@
runtime:
languageMode: auto
dryRun: false
providers:
openAiCompatible:
enabled: true
baseUrl: https://api.openai.com/v1
model: gpt-5.4
apiStyle: responses
timeoutMs: 30000
issues:
autoProcessing:
skipCreatedBefore: auto
validation:
enabled: true
fallbackTemplateKey: normal
commentAnchor: issue-bot:validation
templates:
- key: bug
detect:
markers:
- bug
titlePrefixes:
- "[bug]"
requiredSections:
- id: environment
aliases:
- 系统环境
- System Environment
- id: version
aliases:
- BetterGI 版本号
- BetterGI Version
- id: description
aliases:
- 问题描述
- Description of the issue
- id: steps
aliases:
- 复现步骤
- Reproduction steps
labels:
whenValid:
- BUG
whenInvalid:
- 需要更多信息
- key: feature
detect:
markers:
- feature
titlePrefixes:
- "[feature]"
requiredSections:
- id: request
aliases:
- 功能请求
- Feature Request
- id: scenario
aliases:
- 使用场景
- Use Case
labels:
whenValid:
- 功能建议
whenInvalid:
- 需要更多信息
- key: suggestion
detect:
markers:
- suggestion
titlePrefixes:
- "[suggestion]"
requiredSections:
- id: suggestion
aliases:
- 建议内容
- Suggestion
- id: benefit
aliases:
- 预期收益
- Expected Benefit
labels:
whenValid:
- 功能建议
whenInvalid:
- 需要更多信息
- key: question
detect:
markers:
- question
titlePrefixes:
- "[question]"
requiredSections:
- id: question
aliases:
- 问题描述
- Problem Description
- id: tried
aliases:
- 已尝试内容
- What I Tried
labels:
whenValid:
- 问题咨询
whenInvalid:
- 需要更多信息
- key: normal
detect:
markers:
- normal
titlePrefixes:
- "[feedback]"
- "[normal]"
requiredSections:
- id: description
aliases:
- 描述
- Description
labels:
whenValid: []
whenInvalid:
- 需要更多信息
duplicateDetection:
enabled: true
bypassLabels:
- 跳过重复检测
duplicateLabel: 重复
searchResultLimit: 50
candidateLimit: 20
aiReviewMaxCandidates: 3
thresholds:
exact: 0.995
highConfidence: 0.93
reviewMin: 0.82
similarityComment:
enabled: false
commentAnchor: issue-bot:similar-issues
minScore: 0.3
maxCandidates: 3
labeling:
enabled: true
autoCreateMissing: true
managed:
- BUG
- 功能建议
- 问题咨询
- 需要更多信息
- 重复
definitions:
BUG:
color: d73a4a
description: 程序存在缺陷或异常行为。
功能建议:
color: a2eeef
description: 新功能建议或现有功能改进。
问题咨询:
color: d876e3
description: 使用问题、求助或咨询。
# 需要更多信息:
# color: fbca04
# description: 当前 Issue 缺少必要信息。
重复:
color: cfd3d7
description: 已存在相同或高度相似的问题。
keywordRules: []
aiClassification:
enabled: false
maxLabels: 3
minConfidence: 0.65
include: []
exclude:
- BUG
- 功能请求
- 重复
- 不会修复
- 使用问题
- 需要帮助
- 已完成
- 未解决
- 待确认
- P0
- P1
- 需要文档
- 优化点
- 急急急
prompt: 优先给 BetterGI Issue 选择能反映具体功能模块、子系统或使用场景的标签,例如一条龙、调度器、脚本、设置项、地图追踪;避免只选择宽泛的流程或状态标签。
sourceRepository:
owner: babalae
repo: better-genshin-impact
aiHelp:
enabled: true
triggerLabels: []
commentAnchor: issue-bot:ai
projectContext:
enabled: true
includeRepositoryMetadata: true
includeReadme: true
readmeMaxChars: 3000
profile:
name: BetterGI
aliases:
- BGI
- Better Genshin Impact
summary: BetterGI is a desktop automation assistant for Genshin Impact.
techStack:
- C#
- WPF
- .NET
commands:
enabled: true
mentions:
- "@bot"
- "@bettergi-repo-bot"
access: collaborators
fix:
enabled: true
commentAnchor: issue-bot:fix
refresh:
enabled: true
pullRequests:
review:
enabled: false
labeling:
enabled: false
summary:
enabled: false
+452
View File
@@ -0,0 +1,452 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
CNB Release Uploader
依赖:
- requests
- tqdm
安装依赖:
pip install requests tqdm
"""
import os
import json
import requests
import time
import sys
import argparse
from typing import List, Dict, Optional
from pathlib import Path
from tqdm import tqdm
class CNBReleaseUploader:
def __init__(self, token: str, base_url: str = "https://api.cnb.cool"):
"""
初始化CNB Release上传器
Args:
token: 认证token
base_url: API基础URL
"""
self.token = token
self.base_url = base_url
self.headers = {
'Accept': 'application/json',
'Authorization': f'Bearer {token}',
'Content-Type': 'application/json',
'User-Agent': 'CNB-Release-Uploader/1.0.0',
'Host': 'api.cnb.cool',
'Connection': 'keep-alive'
}
def create_release(self, project_path: str, release_data: Dict) -> Optional[Dict]:
"""
创建一个新的release
Args:
project_path: 项目路径 (例如: "bettergi/better-genshin-impact")
release_data: release数据
Returns:
创建的release信息或None
"""
url = f"{self.base_url}/{project_path}/-/releases"
# 打印请求信息
print("\n📋 请求头 (Headers):")
for key, value in self.headers.items():
print(f" {key}: {value}")
try:
response = requests.post(url, headers=self.headers, json=release_data)
response.raise_for_status()
release_info = response.json()
print(f"✅ Release创建成功: {release_info.get('name', 'N/A')}")
print(f" Release ID: {release_info.get('id', 'N/A')}")
print(f" Tag Name: {release_info.get('tag_name', 'N/A')}")
print(f" Created At: {release_info.get('created_at', 'N/A')}")
print(f" Is Latest: {release_info.get('is_latest', False)}")
return release_info
except requests.exceptions.RequestException as e:
print(f"❌ 创建release失败: {e}")
if hasattr(e, 'response') and e.response is not None:
print(f" 状态码: {e.response.status_code}")
print(f" 响应内容: {e.response.text}")
return None
def get_asset_upload_url(self, project_path: str, release_id: str, asset_name: str,
file_size: int, overwrite: bool = True) -> Optional[Dict]:
"""
获取asset上传URL
Args:
project_path: 项目路径
release_id: release ID
asset_name: asset名称
file_size: 文件大小
overwrite: 是否覆盖现有文件
Returns:
包含upload_url等信息的字典或None
"""
url = f"{self.base_url}/{project_path}/-/releases/{release_id}/asset-upload-url"
data = {
"asset_name": asset_name,
"overwrite": overwrite,
"size": file_size
}
try:
response = requests.post(url, headers=self.headers, json=data)
response.raise_for_status()
upload_info = response.json()
print(f"✅ 获取上传URL成功")
return upload_info
except requests.exceptions.RequestException as e:
print(f"❌ 获取上传URL失败 ({asset_name}): {e}")
if hasattr(e, 'response') and e.response is not None:
print(f" 状态码: {e.response.status_code}")
print(f" 响应内容: {e.response.text}")
return None
def upload_asset(self, upload_url: str, file_path: str, show_progress: bool = True) -> bool:
"""
上传asset文件
Args:
upload_url: 上传URL
file_path: 本地文件路径
show_progress: 是否显示上传进度条
Returns:
是否上传成功
"""
if not os.path.exists(file_path):
print(f"❌ 文件不存在: {file_path}")
return False
upload_headers = {
'Accept': 'application/json',
'Authorization': f'Bearer {self.token}',
}
file_size = os.path.getsize(file_path)
file_name = os.path.basename(file_path)
try:
with open(file_path, 'rb') as file:
if show_progress and file_size > 0:
# 创建进度条
progress_bar = tqdm(
total=file_size,
unit='B',
unit_scale=True,
unit_divisor=1024,
desc=f"📤 上传 {file_name}",
ncols=80,
bar_format='{desc}: {percentage:3.0f}%|{bar}| {n_fmt}/{total_fmt} [{elapsed}<{remaining}, {rate_fmt}]'
)
# 创建一个包装器来更新进度条
class ProgressFileWrapper:
def __init__(self, file_obj, progress_bar):
self.file_obj = file_obj
self.progress_bar = progress_bar
def read(self, size=-1):
data = self.file_obj.read(size)
if data:
self.progress_bar.update(len(data))
return data
def __getattr__(self, name):
return getattr(self.file_obj, name)
wrapped_file = ProgressFileWrapper(file, progress_bar)
response = requests.put(upload_url, headers=upload_headers, data=wrapped_file)
progress_bar.close()
else:
response = requests.put(upload_url, headers=upload_headers, data=file)
response.raise_for_status()
print(f"📤 上传到 {upload_url} 返回结果: {response.status_code}")
try:
response_data = response.json()
print(f" 响应内容 (JSON): {json.dumps(response_data, indent=2, ensure_ascii=False)}")
except (json.JSONDecodeError, ValueError):
print(f" 响应内容 (文本): {response.text}")
return True
except requests.exceptions.RequestException as e:
print(f"❌ 文件上传失败 ({os.path.basename(file_path)}): {e}")
if hasattr(e, 'response') and e.response is not None:
print(f" 响应状态码: {e.response.status_code}")
print(f" 响应内容: {e.response.text}")
return False
def verify_upload(self, verify_url: str) -> bool:
"""
验证上传是否成功
Args:
verify_url: 验证URL
Returns:
是否验证成功
"""
try:
response = requests.post(verify_url, headers=self.headers)
response.raise_for_status()
print(f"🔍 验证请求返回状态: {response.status_code}")
try:
response_data = response.json()
print(f" 响应内容 (JSON): {json.dumps(response_data, indent=2, ensure_ascii=False)}")
except (json.JSONDecodeError, ValueError):
print(f" 响应内容 (文本): {response.text}")
return True
except requests.exceptions.RequestException as e:
print(f"❌ 验证上传失败: {e}")
if hasattr(e, 'response') and e.response is not None:
print(f" 验证状态码: {e.response.status_code}")
print(f" 验证响应内容: {e.response.text}")
return False
def upload_multiple_assets(self, project_path: str, release_id: str,
asset_files: List[str], overwrite: bool = True, show_progress: bool = True) -> List[bool]:
"""
上传多个assets
Args:
project_path: 项目路径
release_id: release ID
asset_files: asset文件路径列表
overwrite: 是否覆盖现有文件
show_progress: 是否显示进度条
Returns:
每个文件的上传结果列表
"""
results = []
print(f"\n📦 开始上传 {len(asset_files)} 个文件到release {release_id}...")
# 计算总文件大小用于整体进度显示
total_size = 0
valid_files = []
for file_path in asset_files:
if os.path.exists(file_path):
total_size += os.path.getsize(file_path)
valid_files.append(file_path)
if show_progress and valid_files:
print(f"📊 总计 {len(valid_files)} 个有效文件,总大小: {total_size / 1024 / 1024:.2f} MB")
print("" + "=" * 60)
for i, file_path in enumerate(asset_files, 1):
if not os.path.exists(file_path):
print(f"❌ [{i}/{len(asset_files)}] 跳过不存在的文件: {file_path}")
results.append(False)
continue
file_size = os.path.getsize(file_path)
asset_name = os.path.basename(file_path)
print(f"\n📁 [{i}/{len(asset_files)}] 处理文件: {asset_name}")
print(f" 文件大小: {file_size:,} bytes ({file_size / 1024 / 1024:.2f} MB)")
# 1. 获取上传URL
upload_info = self.get_asset_upload_url(
project_path, release_id, asset_name, file_size, overwrite
)
if not upload_info:
results.append(False)
continue
# 2. 上传文件
upload_success = self.upload_asset(upload_info['upload_url'], file_path, show_progress)
time.sleep(1)
# 3. 验证上传(如果有验证URL)
final_success = upload_success
if upload_success and 'verify_url' in upload_info:
verify_success = self.verify_upload(upload_info['verify_url'])
final_success = verify_success
if verify_success:
print(f"✅ 文件 {asset_name} 上传并验证成功")
else:
print(f"❌ 文件 {asset_name} 上传成功但验证失败")
elif upload_success:
print(f"✅ 文件 {asset_name} 上传成功(无需验证)")
results.append(final_success)
# 避免请求过快
if i < len(asset_files):
time.sleep(1)
return results
def load_config_from_json(json_input: str) -> Dict:
"""
从JSON字符串或文件路径加载配置
Args:
json_input: JSON字符串或JSON文件路径
Returns:
配置字典
"""
try:
# 首先尝试作为JSON字符串解析
config = json.loads(json_input)
print("✅ 从JSON字符串加载配置成功")
return config
except json.JSONDecodeError:
# 如果失败,尝试作为文件路径
try:
if os.path.exists(json_input):
with open(json_input, 'r', encoding='utf-8') as f:
config = json.load(f)
print(f"✅ 从文件 {json_input} 加载配置成功")
return config
else:
raise FileNotFoundError(f"配置文件不存在: {json_input}")
except Exception as e:
raise ValueError(f"无法解析JSON配置: {e}")
def validate_config(config: Dict) -> None:
"""
验证配置的必需字段
Args:
config: 配置字典
Raises:
ValueError: 如果配置无效
"""
required_fields = ['token', 'project_path', 'release_data']
for field in required_fields:
if field not in config:
raise ValueError(f"缺少必需字段: {field}")
# 验证release_data必需字段
release_required = ['tag_name', 'name']
for field in release_required:
if field not in config['release_data']:
raise ValueError(f"release_data缺少必需字段: {field}")
# 验证asset_files
if 'asset_files' in config and not isinstance(config['asset_files'], list):
raise ValueError("asset_files必须是数组")
def main():
parser = argparse.ArgumentParser(description='CNB Release Uploader - JSON配置版本')
parser.add_argument('config', help='JSON配置字符串或JSON配置文件路径')
parser.add_argument('--dry-run', action='store_true', help='只验证配置,不执行上传')
parser.add_argument('--no-progress', action='store_true', help='禁用上传进度条显示')
args = parser.parse_args()
try:
# 加载配置
print("🔧 加载配置...")
config = load_config_from_json(args.config)
# 验证配置
print("🔍 验证配置...")
validate_config(config)
# 打印配置信息
print("\n📋 配置信息:")
print(f" Token: {'*' * 20}")
print(f" 项目路径: {config['project_path']}")
print(f" Release名称: {config['release_data']['name']}")
print(f" Tag名称: {config['release_data']['tag_name']}")
print(f" Asset文件数量: {len(config.get('asset_files', []))}")
if args.dry_run:
print("\n🧪 Dry-run模式,配置验证通过,退出程序")
return 0
# 创建上传器实例
uploader = CNBReleaseUploader(
token=config['token'],
base_url=config.get('base_url', 'https://api.cnb.cool')
)
# 1. 创建release
print("\n🚀 开始创建release...")
release_info = uploader.create_release(config['project_path'], config['release_data'])
if not release_info:
print("❌ 创建release失败,退出程序")
return 1
release_id = release_info.get('id')
if not release_id:
print("❌ 无法获取release ID,退出程序")
return 1
# 2. 上传assets(如果有)
asset_files = config.get('asset_files', [])
if asset_files:
overwrite = config.get('overwrite', True)
show_progress = not args.no_progress # 默认显示进度条,除非指定 --no-progress
results = uploader.upload_multiple_assets(
config['project_path'], release_id, asset_files, overwrite, show_progress
)
# 3. 显示结果
print("\n" + "=" * 50)
print("📊 上传结果汇总:")
print("=" * 50)
success_count = sum(results)
total_count = len(results)
for i, (file_path, success) in enumerate(zip(asset_files, results)):
status = "✅ 成功" if success else "❌ 失败"
print(f" [{i + 1}] {status} - {os.path.basename(file_path)}")
print(f"\n🎉 完成! 成功上传 {success_count}/{total_count} 个文件")
if success_count == total_count:
print("🎊 所有文件都上传成功!")
return 0
elif success_count > 0:
print("⚠️ 部分文件上传成功,请检查失败的文件")
return 2
else:
print("💥 所有文件上传失败,请检查配置和网络")
return 1
else:
print("\n📦 没有指定asset文件,只创建了release")
return 0
except Exception as e:
print(f"❌ 程序执行失败: {e}")
return 1
if __name__ == "__main__":
exit_code = main()
sys.exit(exit_code)
+94
View File
@@ -0,0 +1,94 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Better Genshin Impact Build Trigger Script
用于触发CNB构建的Python脚本
"""
import requests
import json
import sys
import argparse
def trigger_build(token, branch="main", event="api_trigger_one", runid=None):
"""
触发构建请求
Args:
token (str): 授权token
branch (str): 分支名称,默认为main
event (str): 事件类型,默认为api_trigger_one
runid (str): 运行ID,可选参数
Returns:
dict: API响应结果
"""
url = "https://api.cnb.cool/bettergi/better-genshin-impact/-/build/start"
headers = {
"Accept": "application/json",
"Authorization": f"Bearer {token}",
"Content-Type": "application/json",
"Host": "api.cnb.cool",
"Connection": "keep-alive"
}
data = {
"branch": branch,
"event": event
}
# 如果提供了runid,则添加到env中
if runid:
data["env"] = {
"RUN_ID": runid
}
try:
print(f"正在发起构建请求...")
print(f"URL: {url}")
print(f"请求体: {json.dumps(data, indent=2, ensure_ascii=False)}")
response = requests.post(url, headers=headers, json=data)
print(f"响应状态码: {response.status_code}")
if response.status_code == 200:
result = response.json()
print("构建触发成功!")
print(f"响应内容: {json.dumps(result, indent=2, ensure_ascii=False)}")
return result
else:
print(f"请求失败: {response.status_code}")
print(f"错误信息: {response.text}")
return None
except requests.exceptions.RequestException as e:
print(f"请求异常: {e}")
return None
except json.JSONDecodeError as e:
print(f"JSON解析错误: {e}")
print(f"响应内容: {response.text}")
return None
def main():
parser = argparse.ArgumentParser(description="触发Better Genshin Impact构建")
parser.add_argument("token", help="授权token")
parser.add_argument("--branch", default="main", help="分支名称 (默认: main)")
parser.add_argument("--event", default="api_trigger_one", help="事件类型 (默认: api_trigger_one)")
parser.add_argument("--runid", help="运行ID (可选)")
args = parser.parse_args()
if not args.token:
print("错误: 必须提供token参数")
sys.exit(1)
result = trigger_build(args.token, args.branch, args.event, args.runid)
if result is None:
sys.exit(1)
if __name__ == "__main__":
main()
@@ -0,0 +1,507 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
GitHub Actions 构建物下载和上传脚本
该脚本用于:
1. 从 GitHub Actions 下载最新的构建物 (BetterGI_7z 和 BetterGI_Install)
2. 解压构建物到本地
3. 调用 cnb_release.py 上传文件到 CNB
使用方法:
python github_download_and_cnb_upload.py --cnb-token YOUR_CNB_TOKEN [--github-token YOUR_GITHUB_TOKEN] [--run-id RUN_ID]
参数说明:
--cnb-token: CNB API Token (必需)
--github-token: GitHub Personal Access Token (可选,用于提高API限制)
--run-id: 指定 GitHub Actions 运行 ID (可选,默认获取最新运行)
依赖:
- requests: HTTP 请求库
- tqdm: 进度条显示库
安装依赖:pip install -r requirements.txt
"""
import os
import sys
import json
import requests
import zipfile
import tempfile
import shutil
import re
from pathlib import Path
from typing import List, Dict, Optional
from tqdm import tqdm
# 导入 CNBReleaseUploader
from cnb_release import CNBReleaseUploader
class GitHubActionsDownloader:
def __init__(self, token: Optional[str] = None):
"""
初始化 GitHub Actions 下载器
Args:
token: GitHub Personal Access Token (可选,用于提高API限制)
"""
self.token = token
self.headers = {
'Accept': 'application/vnd.github.v3+json',
'User-Agent': 'BetterGI-Downloader/1.0.0'
}
if token:
self.headers['Authorization'] = f'token {token}'
def get_latest_workflow_run(self, owner: str, repo: str, workflow_file: str) -> Optional[Dict]:
"""
获取最新的工作流运行
Args:
owner: 仓库所有者
repo: 仓库名称
workflow_file: 工作流文件名
Returns:
最新的工作流运行信息或None
"""
url = f'https://api.github.com/repos/{owner}/{repo}/actions/workflows/{workflow_file}/runs'
params = {
'status': 'completed',
'conclusion': 'success',
'per_page': 1
}
try:
response = requests.get(url, headers=self.headers, params=params)
response.raise_for_status()
data = response.json()
runs = data.get('workflow_runs', [])
if not runs:
print("❌ 没有找到成功完成的工作流运行")
return None
latest_run = runs[0]
print(f"✅ 找到最新的工作流运行:")
print(f" Run ID: {latest_run['id']}")
print(f" 创建时间: {latest_run['created_at']}")
print(f" 状态: {latest_run['status']} / {latest_run['conclusion']}")
print(f" 分支: {latest_run['head_branch']}")
return latest_run
except requests.exceptions.RequestException as e:
print(f"❌ 获取工作流运行失败: {e}")
return None
def get_artifacts(self, owner: str, repo: str, run_id: int) -> List[Dict]:
"""
获取指定运行的构建物列表
Args:
owner: 仓库所有者
repo: 仓库名称
run_id: 运行ID
Returns:
构建物列表
"""
url = f'https://api.github.com/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts'
try:
response = requests.get(url, headers=self.headers)
response.raise_for_status()
data = response.json()
artifacts = data.get('artifacts', [])
print(f"📦 找到 {len(artifacts)} 个构建物:")
for artifact in artifacts:
print(f" - {artifact['name']} ({artifact['size_in_bytes']:,} bytes)")
return artifacts
except requests.exceptions.RequestException as e:
print(f"❌ 获取构建物列表失败: {e}")
return []
def download_artifact(self, owner: str, repo: str, artifact_id: int,
artifact_name: str, download_dir: str) -> Optional[str]:
"""
下载指定的构建物
Args:
owner: 仓库所有者
repo: 仓库名称
artifact_id: 构建物ID
artifact_name: 构建物名称
download_dir: 下载目录
Returns:
下载的文件路径或None
"""
url = f'https://api.github.com/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/zip'
try:
print(f"📥 开始下载构建物: {artifact_name}")
response = requests.get(url, headers=self.headers, stream=True)
response.raise_for_status()
# 获取文件总大小
total_size = int(response.headers.get('content-length', 0))
# 保存到临时文件
zip_path = os.path.join(download_dir, f"{artifact_name}.zip")
# 使用 tqdm 创建进度条
chunk_size = 8192
with open(zip_path, 'wb') as f:
with tqdm(
total=total_size,
unit='B',
unit_scale=True,
unit_divisor=1024,
desc=f"下载 {artifact_name}",
ncols=80,
bar_format='{desc}: {percentage:3.0f}%|{bar}| {n_fmt}/{total_fmt} [{elapsed}<{remaining}, {rate_fmt}]'
) as pbar:
for chunk in response.iter_content(chunk_size=chunk_size):
if chunk:
f.write(chunk)
pbar.update(len(chunk))
print(f"✅ 下载完成: {zip_path}")
return zip_path
except requests.exceptions.RequestException as e:
print(f"❌ 下载构建物失败 ({artifact_name}): {e}")
return None
def extract_artifact(self, zip_path: str, extract_dir: str) -> List[str]:
"""
解压构建物
Args:
zip_path: ZIP文件路径
extract_dir: 解压目录
Returns:
解压出的文件列表
"""
extracted_files = []
try:
print(f"📂 解压构建物: {os.path.basename(zip_path)}")
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
zip_ref.extractall(extract_dir)
extracted_files = [os.path.join(extract_dir, name) for name in zip_ref.namelist()]
print(f"✅ 解压完成,共 {len(extracted_files)} 个文件")
for file_path in extracted_files:
if os.path.isfile(file_path):
size = os.path.getsize(file_path)
print(f" - {os.path.basename(file_path)} ({size:,} bytes)")
return extracted_files
except Exception as e:
print(f"❌ 解压失败: {e}")
return []
def extract_version_from_filename(filename: str) -> Optional[str]:
"""
从文件名中提取版本号
Args:
filename: 文件名
Returns:
版本号或None
"""
# 去除扩展名
import os
filename_without_ext = os.path.splitext(filename)[0]
# 匹配版本号模式,如 v1.2.3, 1.2.3-alpha.1 等
patterns = [
r'v?([0-9]+\.[0-9]+\.[0-9]+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?)',
r'_v?([0-9]+\.[0-9]+\.[0-9]+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?)',
]
for pattern in patterns:
match = re.search(pattern, filename_without_ext)
if match:
return match.group(1)
return None
def create_cnb_config(files: List[str], version: str, token: str) -> Dict:
"""
创建CNB上传配置
Args:
files: 要上传的文件列表
version: 版本号
token: CNB token
Returns:
CNB配置字典
"""
# 判断是否为预发布版本
is_prerelease = '-' in version
make_latest = "false" if is_prerelease else "true"
config = {
"token": token,
"project_path": "bettergi/better-genshin-impact",
"base_url": "https://api.cnb.cool",
"overwrite": True,
"release_data": {
"tag_name": f"v{version}",
"name": f"BetterGI v{version}",
"body": f"BetterGI v{version} 自动发布",
"draft": False,
"prerelease": is_prerelease,
"target_commitish": "main",
"make_latest": make_latest
},
"asset_files": files
}
return config
def main():
import argparse
# 解析命令行参数
parser = argparse.ArgumentParser(description='BetterGI 构建物下载和上传工具')
parser.add_argument('--run-id', type=str, help='指定 GitHub Actions 运行 ID,如果提供则不会获取最新运行')
parser.add_argument('--github-token', type=str, help='GitHub Personal Access Token')
parser.add_argument('--cnb-token', type=str, required=True, help='CNB API Token (必需)')
args = parser.parse_args()
print("🚀 BetterGI 构建物下载和上传工具")
print("=" * 50)
# 获取 token,优先使用命令行参数,其次使用环境变量
github_token = args.github_token or os.getenv('GITHUB_TOKEN')
cnb_token = args.cnb_token or os.getenv('CNB_TOKEN')
if not cnb_token:
print("❌ 错误: 请设置 CNB_TOKEN 环境变量")
return 1
if not github_token:
print("⚠️ 警告: 未设置 GITHUB_TOKEN,可能会遇到API限制")
# 确定运行 ID
if args.run_id:
print(f"\n🎯 使用指定的运行 ID: {args.run_id}")
run_id = args.run_id
else:
# 创建下载器来获取最新运行 ID
downloader = GitHubActionsDownloader(github_token)
print("\n🔍 查找最新的工作流运行...")
latest_run = downloader.get_latest_workflow_run('babalae', 'better-genshin-impact', 'publish.yml')
if not latest_run:
return 1
run_id = str(latest_run['id'])
# 使用当前目录下的固定目录,以action运行ID命名
work_dir = os.path.join(os.getcwd(), 'github_actions_cache', run_id)
download_dir = os.path.join(work_dir, 'downloads')
extract_dir = os.path.join(work_dir, 'extracted')
print(f"\n📁 使用工作目录: {work_dir}")
# 检查是否已存在解压后的文件
all_files = []
version = None
# 检查解压目录是否已存在且包含文件
if os.path.exists(extract_dir):
print("🔍 检查已存在的构建物...")
existing_files = []
# 预期的构建物名称
expected_artifacts = ['BetterGI_7z', 'BetterGI_Install']
for artifact_name in expected_artifacts:
artifact_extract_dir = os.path.join(extract_dir, artifact_name)
if os.path.exists(artifact_extract_dir):
for root, dirs, files in os.walk(artifact_extract_dir):
for file in files:
file_path = os.path.join(root, file)
existing_files.append(file_path)
# 尝试从文件名提取版本号
if not version:
filename = os.path.basename(file_path)
extracted_version = extract_version_from_filename(filename)
if extracted_version:
version = extracted_version
if existing_files and version:
print(f"✅ 发现已存在的构建物 ({len(existing_files)} 个文件),跳过下载")
print(f"📋 检测到版本号: {version}")
all_files = existing_files
else:
print("⚠️ 已存在目录但未找到有效文件,将重新下载")
# 如果没有找到已存在的文件,则进行下载和解压
if not all_files:
print("📥 需要下载构建物,正在获取构建物信息...")
# 如果还没有创建下载器,现在创建
if 'downloader' not in locals():
downloader = GitHubActionsDownloader(github_token)
# 获取构建物列表
print("\n📦 获取构建物列表...")
artifacts = downloader.get_artifacts('babalae', 'better-genshin-impact', int(run_id))
if not artifacts:
return 1
# 筛选需要的构建物
target_artifacts = []
for artifact in artifacts:
if artifact['name'] in ['BetterGI_7z', 'BetterGI_Install']:
target_artifacts.append(artifact)
if len(target_artifacts) != 2:
print(f"❌ 错误: 期望找到2个构建物,实际找到 {len(target_artifacts)} 个")
return 1
print("📥 开始下载和解压构建物...")
os.makedirs(download_dir, exist_ok=True)
os.makedirs(extract_dir, exist_ok=True)
for artifact in target_artifacts:
# 下载
zip_path = downloader.download_artifact(
'babalae', 'better-genshin-impact',
artifact['id'], artifact['name'], download_dir
)
if not zip_path:
continue
# 解压
artifact_extract_dir = os.path.join(extract_dir, artifact['name'])
os.makedirs(artifact_extract_dir, exist_ok=True)
extracted_files = downloader.extract_artifact(zip_path, artifact_extract_dir)
# 收集文件并提取版本号
for file_path in extracted_files:
if os.path.isfile(file_path):
all_files.append(file_path)
# 尝试从文件名提取版本号
if not version:
filename = os.path.basename(file_path)
extracted_version = extract_version_from_filename(filename)
if extracted_version:
version = extracted_version
print(f"📋 检测到版本号: {version}")
if not all_files:
print("❌ 错误: 没有找到可上传的文件")
return 1
if not version:
print("❌ 错误: 无法从文件名中提取版本号")
return 1
print(f"\n📋 准备上传 {len(all_files)} 个文件:")
for file_path in all_files:
size = os.path.getsize(file_path)
print(f" - {os.path.basename(file_path)} ({size:,} bytes)")
# 创建CNB配置
print("\n⚙️ 创建CNB配置...")
cnb_config = create_cnb_config(all_files, version, cnb_token)
# 保存配置文件
config_path = os.path.join(work_dir, 'cnb_config.json')
with open(config_path, 'w', encoding='utf-8') as f:
json.dump(cnb_config, f, indent=2, ensure_ascii=False)
print(f"✅ 配置文件已保存: {config_path}")
# 直接调用 CNBReleaseUploader
print("\n🚀 开始上传到CNB...")
try:
# 创建 CNBReleaseUploader 实例
uploader = CNBReleaseUploader(
token=cnb_config['token'],
base_url=cnb_config.get('base_url', 'https://api.cnb.cool')
)
# 创建 release
print(f"📝 创建 release: {cnb_config['release_data']['name']}")
release_result = uploader.create_release(
project_path=cnb_config['project_path'],
release_data=cnb_config['release_data']
)
if not release_result:
print("❌ 创建 release 失败")
return 1
print(f"✅ Release 创建成功: {release_result['name']}")
# 上传文件
print(f"📤 开始上传 {len(cnb_config['asset_files'])} 个文件...")
upload_results = uploader.upload_multiple_assets(
project_path=cnb_config['project_path'],
release_id=release_result['id'],
asset_files=cnb_config['asset_files'],
overwrite=cnb_config.get('overwrite', True)
)
# 检查上传结果
success_count = sum(1 for result in upload_results if result)
total_count = len(upload_results)
print(f"\n📊 上传结果汇总:")
print(f" ✅ 成功: {success_count}/{total_count}")
if success_count < total_count:
print(f" ❌ 失败: {total_count - success_count}/{total_count}")
for i, result in enumerate(upload_results):
if not result:
file_name = os.path.basename(cnb_config['asset_files'][i])
print(f" - {file_name}: 上传失败")
if success_count == total_count:
print("\n🎉 所有文件上传完成!")
return 0
else:
print("\n❌ 部分文件上传失败")
return 1
except Exception as e:
print(f"❌ CNB上传失败: {e}")
return 1
if __name__ == '__main__':
try:
exit_code = main()
sys.exit(exit_code)
except KeyboardInterrupt:
print("\n⚠️ 用户中断操作")
sys.exit(1)
except Exception as e:
print(f"\n💥 程序异常: {e}")
sys.exit(1)
@@ -0,0 +1,20 @@
name: mirrorchyan_release_note
on:
workflow_dispatch:
release:
types: [edited, released]
jobs:
mirrorchyan_release_note:
if: github.repository_owner == 'babalae'
runs-on: macos-latest
steps:
- id: uploading
uses: MirrorChyan/release-note-action@v1
with:
mirrorchyan_rid: BGI
upload_token: ${{ secrets.MirrorChyanUploadToken }}
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,89 @@
name: mirrorchyan_uploading
on:
workflow_dispatch:
release:
types: [released]
jobs:
mirrorchyan:
if: github.repository_owner == 'babalae'
runs-on: windows-latest
steps:
- name: 📥 Download release
uses: robinraju/[email protected]
with:
latest: true
fileName: "*"
- name: 📥 Download kachina-builder release
uses: robinraju/[email protected]
with:
repository: "YuehaiTeam/kachina-installer"
latest: true
fileName: "kachina-builder.exe"
- name: Embed Dotnet and VCRedist
shell: bash
run: |
# dotnet
VERSION_URL="https://builds.dotnet.microsoft.com/dotnet/WindowsDesktop/8.0/latest.version"
VERSION=$(curl -fsSL "$VERSION_URL" | tr -d '\r\n')
if [ -z "$VERSION" ]; then
echo "Cannot get the latest version from $VERSION_URL"
exit 1
fi
INSTALLER_URL="https://builds.dotnet.microsoft.com/dotnet/WindowsDesktop/${VERSION}/windowsdesktop-runtime-${VERSION}-win-x64.exe"
OUTPUT="windowsdesktop-runtime-${VERSION}-win-x64.exe"
echo "Downloading Windows Desktop Runtime version $VERSION from $INSTALLER_URL"
curl -fSL -o "$OUTPUT" "$INSTALLER_URL"
# vcredist
echo "Downloading VCRedist"
curl -fSL -o "vc_redist.x64.exe" "https://aka.ms/vs/17/release/vc_redist.x64.exe"
# embed
echo "Embedding runtimes"
./kachina-builder.exe append -o ./BetterGI.Install.*.exe -f "$OUTPUT" -n "Microsoft.DotNet.DesktopRuntime.8" -f "vc_redist.x64.exe" -n "Microsoft.VCRedist.2015+.x64"
./kachina-builder.exe extract -i ./BetterGI.Install.*.exe -f ./metadata.json -n "\0META"
- name: Extract 7z and create zip
shell: bash
run: |
7z a -tzip BetterGI.Install.zip ./BetterGI.Install.*.exe -mx=1 -r -y
choco install wget --no-progress
7z x BetterGI_v*.7z -oun7z
mv ./metadata.json ./un7z/BetterGI/.metadata.json
cd un7z
7z a -tzip ../BetterGI.zip ./BetterGI -mx=5 -r -y
- name: Determine version number
id: get-version
shell: bash
run: |
if [ "${{ github.event_name }}" = "release" ]; then
echo "version=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
else
LATEST_TAG=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/releases/latest \
| jq -r '.tag_name')
echo "version=$LATEST_TAG" >> $GITHUB_OUTPUT
fi
- name: Upload Zip
uses: MirrorChyan/uploading-action@v1
with:
filetype: local
mirrorchyan_rid: BGI
filename: "BetterGI.zip"
version_name: ${{ steps.get-version.outputs.version }}
upload_token: ${{ secrets.MirrorChyanUploadToken }}
os: win
arch: x64
- name: Upload Exe
uses: MirrorChyan/uploading-action@v1
with:
filetype: local
mirrorchyan_rid: BGI
filename: "BetterGI.Install.zip"
version_name: ${{ steps.get-version.outputs.version }}
upload_token: ${{ secrets.MirrorChyanUploadToken }}
+596
View File
@@ -0,0 +1,596 @@
name: BetterGI Publish
run-name: "BetterGI ${{ inputs.version }}"
on:
workflow_dispatch:
inputs:
version:
description: 'BetterGI Version (eg: 0.35.1, 0.36.5-alpha.1)'
required: true
type: string
kachina-channel:
type: choice
description: 'Kachina Installer Channel'
required: true
default: 'release'
options:
- release
- dev
create-release:
type: boolean
description: '创建 GitHub Release 草稿'
required: true
default: false
upload-to-steambird:
type: boolean
description: '上传到 Steambird'
required: true
default: false
jobs:
# Add validation job to check version format
validate:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.set-version.outputs.version }}
steps:
- name: Set version from input or tag
id: set-version
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
# Validate manual input version format
if ! [[ "${{ github.event.inputs.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$ ]]; then
echo "❌ 错误:版本格式必须符合语义化版本规范 (例如: 1.2.3, 1.2.3-alpha, 1.2.3+build.123)"
exit 1
fi
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
echo "✨ 手动触发构建,版本号:${{ github.event.inputs.version }}"
else
# Extract version from tag name (remove 'v' prefix)
VERSION=${GITHUB_REF#refs/tags/v}
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "🏷️ 从 tag 触发构建,版本号:${VERSION}"
fi
build_web_map_editor:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: huiyadanli/bettergi-map
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm install
- run: npm run build:single
- uses: actions/upload-artifact@v4
with:
name: web_map_editor
path: dist/
build_web_scripts_list:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: zaodonganqi/bettergi-script-web
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm install
- run: npm run build:single
- uses: actions/upload-artifact@v4
with:
name: web_scripts_list
path: dist/
build_dist:
runs-on: windows-latest
needs: [validate, build_web_map_editor, build_web_scripts_list]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: 更新 csproj 文件版本号
run: |
$version = '${{ needs.validate.outputs.version }}'
(Get-Content BetterGenshinImpact/BetterGenshinImpact.csproj) -replace '<Version>.*</Version>', "<Version>$version</Version>" | Set-Content BetterGenshinImpact/BetterGenshinImpact.csproj
- name: 自动提交更改
if: github.repository_owner == 'babalae'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update version to ${{ needs.validate.outputs.version }}"
branch: main
file_pattern: BetterGenshinImpact/BetterGenshinImpact.csproj
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/BetterGenshinImpact.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: 🛠️ Build application
run: dotnet publish BetterGenshinImpact/BetterGenshinImpact.csproj -c Release -p:PublishProfile=FolderProfile -p:Version=${{ needs.validate.outputs.version }}
continue-on-error: true
- name: 🧹 Clear & Move Files
run: |
$sourceDir = ".\BetterGenshinImpact\bin\x64\Release\net8.0-windows10.0.22621.0\publish\win-x64"
Get-ChildItem -Path $sourceDir -Recurse -Filter "*.lib" | Remove-Item -Force
Get-ChildItem -Path $sourceDir -Recurse -Filter "*ffmpeg*.dll" | Remove-Item -Force
Get-ChildItem -Path $sourceDir -Recurse -Filter "*.pdb" | Remove-Item -Force
New-Item -Path "dist/BetterGI" -ItemType Directory
xcopy "$sourceDir\*" ".\dist\BetterGI\" /E /H /I /Y
# 下载前面构建好的web内容
- uses: actions/download-artifact@v4
with:
name: web_map_editor
path: dist/BetterGI/Assets/Map/Editor
- uses: actions/download-artifact@v4
with:
name: web_scripts_list
path: dist/BetterGI/Assets/Web/ScriptRepo
# 下载构建 repo 的内容补充数据
- uses: actions/checkout@v4
with:
repository: babalae/bettergi-publish
path: publish
# - name: 🗜️ Extract Map
# run: |
# cd publish
# # Extract zst files
# Get-ChildItem -Filter *.zst | ForEach-Object {
# if ($_.PSIsContainer -eq $false) {
# $file = $_.Name
# $output_file = "..\dist\BetterGI\Assets\Map\$($file -replace '.zst$', '')"
# & zstd -d $file -o $output_file
# Write-Host "$file -> $output_file"
# }
# }
# # Extract zip files
# Get-ChildItem -Filter *.zip | ForEach-Object {
# if ($_.PSIsContainer -eq $false) {
# $file = $_.FullName
# $destination = "..\dist\BetterGI\Assets\Map"
# Expand-Archive -Path $file -DestinationPath $destination -Force
# Write-Host "$file -> $destination"
# }
# }
# 生成更新器
- name: 📥 Download kachina-builder release
if: ${{ github.event.inputs.kachina-channel == 'release' }}
uses: robinraju/[email protected]
with:
repository: "YuehaiTeam/kachina-installer"
latest: true
fileName: "kachina-builder.exe"
- name: 📥 Download kachina-builder dev
if: ${{ github.event.inputs.kachina-channel == 'dev' }}
uses: dawidd6/action-download-artifact@v8
with:
github_token: ${{secrets.GITHUB_TOKEN}}
repo: "YuehaiTeam/kachina-installer"
workflow: "build.yml"
name: artifact
branch: main
event: push
workflow_conclusion: success
- name: 📦 Gen Updater by kachina-builder
run: |
cd dist
..\kachina-builder.exe pack -c ..\Build\kachina.config.json -o BetterGI/BetterGI.update.exe
# 打包上传
- name: 📦 Generate archive
run: |
cd dist
7z a "BetterGI_v${{ needs.validate.outputs.version }}.7z" BetterGI -t7z -mx=5 -mf=BCJ2 -r -y
- uses: actions/upload-artifact@v4
with:
name: BetterGI_7z
path: dist/BetterGI_*.7z
build_installer:
runs-on: windows-latest
needs: [validate, build_dist]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: BetterGI_7z
path: dist
- name: Unpack BetterGI_*.7z
run: |
cd dist
7z x "BetterGI_v${{ needs.validate.outputs.version }}.7z"
- name: 📥 Download kachina-builder release
if: ${{ github.event.inputs.kachina-channel == 'release' }}
uses: robinraju/[email protected]
with:
repository: "YuehaiTeam/kachina-installer"
latest: true
fileName: "kachina-builder.exe"
- name: 📥 Download kachina-builder dev
if: ${{ github.event.inputs.kachina-channel == 'dev' }}
uses: dawidd6/action-download-artifact@v8
with:
github_token: ${{secrets.GITHUB_TOKEN}}
repo: "YuehaiTeam/kachina-installer"
workflow: "build.yml"
name: artifact
branch: main
event: push
workflow_conclusion: success
- name: 📥 Download last release
uses: robinraju/[email protected]
with:
repository: "babalae/better-genshin-impact"
latest: true
fileName: "BetterGI_v*.7z"
out-file-path: 'last'
- name: 📥 Get 2nd and 3rd release
id: release_tags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$releasesUrl = "https://api.github.com/repos/babalae/better-genshin-impact/releases"
$headers = @{
"Authorization" = "Bearer $env:GITHUB_TOKEN"
"Accept" = "application/vnd.github.v3+json"
}
$releases = Invoke-RestMethod -Uri $releasesUrl -Headers $headers -Method Get
$validReleases = $releases |
Where-Object { -not $_.draft -and -not $_.prerelease } |
Sort-Object { [DateTime]$_.published_at } -Descending
if ($validReleases.Count -lt 3) {
Write-Error "至少需要 3 个正式 Release(当前找到 $($validReleases.Count) 个)"
exit 1
}
"second_release_tag=$($validReleases[1].tag_name)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
"third_release_tag=$($validReleases[2].tag_name)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
- name: 📥 Download 2nd last release
uses: robinraju/[email protected]
with:
repository: "babalae/better-genshin-impact"
tag: ${{ steps.release_tags.outputs.second_release_tag }}
fileName: "BetterGI_v*.7z"
out-file-path: '2nd'
- name: 📥 Download 3rd last release
uses: robinraju/[email protected]
with:
repository: "babalae/better-genshin-impact"
tag: ${{ steps.release_tags.outputs.third_release_tag }}
fileName: "BetterGI_v*.7z"
out-file-path: '3rd'
- name: Unpack releases
run: |
cd last
7z x "BetterGI*.7z" -otemp
if (Test-Path -Path ".\temp\BetterGI" -PathType Container) {
Move-Item -Path ".\temp\BetterGI" -Destination ".\BetterGI"
} else {
Rename-Item -Path ".\temp" -NewName ".\BetterGI"
}
cd ..
cd 2nd
7z x "BetterGI*.7z" -otemp
if (Test-Path -Path ".\temp\BetterGI" -PathType Container) {
Move-Item -Path ".\temp\BetterGI" -Destination ".\BetterGI"
} else {
Rename-Item -Path ".\temp" -NewName ".\BetterGI"
}
cd ..
cd 3rd
7z x "BetterGI*.7z" -otemp
if (Test-Path -Path ".\temp\BetterGI" -PathType Container) {
Move-Item -Path ".\temp\BetterGI" -Destination ".\BetterGI"
} else {
Rename-Item -Path ".\temp" -NewName ".\BetterGI"
}
cd ..
ls .\last
ls .\2nd
ls .\3rd
- name: 📦 Pack kachina-builder
run: |
cd dist
..\kachina-builder.exe gen -j 6 -i BetterGI -m metadata.json -o hashed -r babalae/bettergi -t ${{ needs.validate.outputs.version }} --diff-vers ..\last\BetterGI --diff-vers ..\2nd\BetterGI --diff-vers ..\3rd\BetterGI --diff-ignore *[.txt,.onnx] -u .\BetterGI\BetterGI.update.exe
..\kachina-builder.exe pack -c ../Build/kachina.config.json -m metadata.json -d hashed -o BetterGI.Install.${{ needs.validate.outputs.version }}.exe
- uses: actions/upload-artifact@v4
with:
name: BetterGI_Install
path: dist/BetterGI.Install.*.exe
- uses: actions/upload-artifact@v4
with:
name: BetterGI_OnlineInst
path: dist/BetterGI/BetterGI.update.exe
build_setup:
runs-on: windows-latest
needs: [validate, build_dist]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: BetterGI_7z
path: dist
- name: Unpack BetterGI_*.7z & Repack
run: |
cd dist
7z x "BetterGI_v${{ needs.validate.outputs.version }}.7z"
cd BetterGI
7z a -t7z "..\..\publish.7z" *
- name: 📥 Download MicaSetup
uses: robinraju/[email protected]
with:
repository: "lemutec/MicaSetup"
latest: true
fileName: "MicaSetup_v*.7z"
- name: 📦 Pack MicaSetup
run: |
$archiveFiles = Get-ChildItem -Path . -Filter "MicaSetup_v*.7z"
foreach ($archive in $archiveFiles) {
& 7z x $archive.FullName
}
Copy-Item -Path "Build\micasetup.json" -Destination "."
Copy-Item -Path "Build\micasetup" -Destination "." -Recurse -Force
.\makemica.exe micasetup.json
ren BetterGI_Setup.exe BetterGI_Setup_v${{ needs.validate.outputs.version }}.exe
- uses: actions/upload-artifact@v4
with:
name: BetterGI_Setup
path: BetterGI_Setup*.exe
# 创建 GitHub Release
create_release:
if: github.event.inputs.create-release == 'true'
needs: [validate, build_dist, build_installer]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.validate.outputs.version }}
name: BetterGI v${{ needs.validate.outputs.version }}
draft: true
prerelease: ${{ contains(needs.validate.outputs.version, '-') }}
fail_on_unmatched_files: true
files: |
artifacts/BetterGI_7z/*.7z
artifacts/BetterGI_Install/*.exe
mirrorchyan_uploading:
if: github.repository_owner == 'babalae' && contains(needs.validate.outputs.version, '-')
needs: [validate, build_dist, build_installer]
runs-on: windows-latest
steps:
- uses: actions/download-artifact@v4
with:
path: downloads
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: 📥 Download kachina-builder release
if: ${{ github.event.inputs.kachina-channel == 'release' }}
uses: robinraju/[email protected]
with:
repository: "YuehaiTeam/kachina-installer"
latest: true
fileName: "kachina-builder.exe"
- name: 📥 Download kachina-builder dev
if: ${{ github.event.inputs.kachina-channel == 'dev' }}
uses: dawidd6/action-download-artifact@v8
with:
github_token: ${{secrets.GITHUB_TOKEN}}
repo: "YuehaiTeam/kachina-installer"
workflow: "build.yml"
name: artifact
branch: main
event: push
workflow_conclusion: success
- name: Embed Dotnet and VCRedist
shell: bash
run: |
# dotnet
VERSION_URL="https://builds.dotnet.microsoft.com/dotnet/WindowsDesktop/8.0/latest.version"
VERSION=$(curl -fsSL "$VERSION_URL" | tr -d '\r\n')
if [ -z "$VERSION" ]; then
echo "Cannot get the latest version from $VERSION_URL"
exit 1
fi
INSTALLER_URL="https://builds.dotnet.microsoft.com/dotnet/WindowsDesktop/${VERSION}/windowsdesktop-runtime-${VERSION}-win-x64.exe"
OUTPUT="windowsdesktop-runtime-${VERSION}-win-x64.exe"
echo "Downloading Windows Desktop Runtime version $VERSION from $INSTALLER_URL"
curl -fSL -o "$OUTPUT" "$INSTALLER_URL"
# vcredist
echo "Downloading VCRedist"
curl -fSL -o "vc_redist.x64.exe" "https://aka.ms/vs/17/release/vc_redist.x64.exe"
# embed
echo "Embedding runtimes"
./kachina-builder.exe append -o ./downloads/BetterGI_Install/BetterGI.Install.*.exe -f "$OUTPUT" -n "Microsoft.DotNet.DesktopRuntime.8" -f "vc_redist.x64.exe" -n "Microsoft.VCRedist.2015+.x64"
./kachina-builder.exe extract -i ./downloads/BetterGI_Install/BetterGI.Install.*.exe -f ./metadata.json -n "\0META"
- name: Extract 7z and create zip
shell: bash
run: |
choco install wget --no-progress
7z a -tzip BetterGI.Install.${{ needs.validate.outputs.version }}.zip ./downloads/BetterGI_Install/BetterGI.Install.${{ needs.validate.outputs.version }}.exe -mx=1 -r -y
cd downloads/BetterGI_7z
7z x BetterGI_v*.7z -oun7z
mv ../../metadata.json ./un7z/BetterGI/.metadata.json
cd un7z
7z a -tzip ../BetterGI.zip ./BetterGI -mx=5 -r -y
- name: Upload Zip
uses: MirrorChyan/uploading-action@v1
with:
filetype: local
mirrorchyan_rid: BGI
filename: "downloads/BetterGI_7z/BetterGI.zip"
version_name: ${{ needs.validate.outputs.version }}
upload_token: ${{ secrets.MirrorChyanUploadToken }}
os: win
arch: x64
- name: Upload Install.exe
uses: MirrorChyan/uploading-action@v1
with:
filetype: local
mirrorchyan_rid: BGI
filename: "BetterGI.Install.${{ needs.validate.outputs.version }}.zip"
version_name: ${{ needs.validate.outputs.version }}
upload_token: ${{ secrets.MirrorChyanUploadToken }}
cnb_uploading:
if: github.repository_owner == 'babalae' && false
needs: [validate, build_dist, build_installer]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r .github/workflows/requirements.txt
- uses: actions/download-artifact@v4
with:
path: artifacts
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare files for upload
run: |
mkdir -p upload_files
# 只复制 7z 文件和 Install.exe 文件
find artifacts -name "*.7z" -exec cp {} upload_files/ \;
find artifacts -name "BetterGI.Install.*.exe" -exec cp {} upload_files/ \;
echo "📦 准备上传的文件:"
ls -la upload_files/
- name: Copy CNB uploader script
run: |
# 复制 CNB 上传脚本到当前目录
cp .github/workflows/cnb_release.py ./cnb_release.py
- name: Upload to CNB
env:
CNB_TOKEN: ${{ secrets.CNB_TOKEN }}
VERSION: ${{ needs.validate.outputs.version }}
run: |
# 生成文件列表数组
FILE_LIST=""
for file in upload_files/*; do
if [ -f "$file" ]; then
if [ -n "$FILE_LIST" ]; then
FILE_LIST="$FILE_LIST,"
fi
FILE_LIST="$FILE_LIST\"$file\""
fi
done
# 判断是否为预发布版本
if [[ "$VERSION" == *"-"* ]]; then
IS_PRERELEASE="true"
MAKE_LATEST="false"
else
IS_PRERELEASE="false"
MAKE_LATEST="true"
fi
# 创建 JSON 配置
cat > cnb_config.json << EOF
{
"token": "$CNB_TOKEN",
"project_path": "bettergi/better-genshin-impact",
"base_url": "https://api.cnb.cool",
"overwrite": true,
"release_data": {
"tag_name": "v$VERSION",
"name": "BetterGI v$VERSION",
"body": "BetterGI v$VERSION 自动发布",
"draft": false,
"prerelease": $IS_PRERELEASE,
"target_commitish": "main",
"make_latest": "$MAKE_LATEST"
},
"asset_files": [
$FILE_LIST
]
}
EOF
# 检查配置文件内容
echo "📋 CNB 配置内容:"
cat cnb_config.json
# 验证 JSON 格式
python -c "import json; print('✅ JSON 格式验证通过'); json.load(open('cnb_config.json'))"
# 执行上传
python cnb_release.py cnb_config.json
cnb_trigger:
if: github.repository_owner == 'babalae'
needs: [validate, build_dist, build_installer]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r .github/workflows/requirements.txt
- name: Trigger CNB Build
env:
CNB_TOKEN: ${{ secrets.CNB_TOKEN }}
run: |
python .github/workflows/cnb_trigger.py "$CNB_TOKEN" --runid ${{ github.run_id }}
upload_to_steambird:
if: ${{ inputs.upload-to-steambird && github.repository_owner == 'babalae' }}
needs: [validate, build_dist, build_installer]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: artifacts
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare files for upload
run: |
mkdir -p upload_files
# 只复制 7z 文件和 Install.exe 文件
find artifacts -name "*.7z" -exec cp {} upload_files/ \;
find artifacts -name "BetterGI.Install.*.exe" -exec cp {} upload_files/ \;
echo "📦 准备上传的文件:"
ls -la upload_files/
- name: Upload to Steambird
env:
TUS_USER: "bgi"
TUS_PASS: ${{ secrets.TUS_PASS }}
run: |
wget https://uploads.steambird.pub/upload.sh
chmod +x upload.sh
./upload.sh https://uploads.steambird.pub/dav/bgi/ upload_files/BetterGI.Install.*.exe
+55
View File
@@ -0,0 +1,55 @@
name: Repo Bot
on:
issues:
types:
- opened
- edited
- reopened
- labeled
issue_comment:
types:
- created
- edited
jobs:
repo-bot:
runs-on: ubuntu-latest
permissions:
issues: write
contents: read
steps:
- name: Detect GitHub App configuration
id: auth-mode
shell: bash
env:
REPO_BOT_GITHUB_APP_ID: ${{ vars.REPO_BOT_GITHUB_APP_ID }}
REPO_BOT_GITHUB_APP_PRIVATE_KEY: ${{ secrets.REPO_BOT_GITHUB_APP_PRIVATE_KEY }}
run: |
if [ -n "$REPO_BOT_GITHUB_APP_ID" ] && [ -n "$REPO_BOT_GITHUB_APP_PRIVATE_KEY" ]; then
echo "use_app=true" >> "$GITHUB_OUTPUT"
else
echo "use_app=false" >> "$GITHUB_OUTPUT"
fi
- name: Checkout repository
uses: actions/checkout@v4
- name: Create GitHub App token
if: ${{ steps.auth-mode.outputs.use_app == 'true' }}
id: app-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ vars.REPO_BOT_GITHUB_APP_ID }}
private-key: ${{ secrets.REPO_BOT_GITHUB_APP_PRIVATE_KEY }}
- name: Run Repo Bot
uses: ddaodan/bettergi-github-bot@v1
env:
GITHUB_TOKEN: ${{ github.token }}
REPO_BOT_GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
REPO_BOT_AI_API_KEY: ${{ secrets.REPO_BOT_AI_API_KEY }}
REPO_BOT_AI_BASE_URL: ${{ vars.REPO_BOT_AI_BASE_URL }}
with:
config-path: .github/repo-bot.yml
config-overrides-json: ${{ vars.REPO_BOT_CONFIG_OVERRIDES_JSON }}
+3
View File
@@ -0,0 +1,3 @@
# CNB Release Uploader 依赖
requests>=2.25.0
tqdm>=4.60.0
+21 -1
View File
@@ -23,4 +23,24 @@ bld/
# Mine
Tmp/
/packages/
node_modules/
node_modules/
github_actions_cache/
*.zip
# Rider
.idea
.claude
CLAUDE.md
AGENTS.md
__pycache__/
# Trae
.trae/*
!.trae/rules/
!.trae/rules/**
!.trae/skills/
!.trae/skills/**
+3
View File
@@ -0,0 +1,3 @@
[submodule "Test/BetterGenshinImpact.UnitTest/Assets"]
path = Test/BetterGenshinImpact.UnitTest/Assets
url = https://github.com/huiyadanli/BetterGI.UnitTest.Assets.git
+80
View File
@@ -0,0 +1,80 @@
本项目使用了 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 规范的交互事件触发方式。
### 其他框架使用要求
请优先使用 Newtonsoft.Json 作为json序列化工具,但是如果这个模型已经被System.Text.Json序列化过了,那么就直接使用System.Text.Json反序列化。
## 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>();
```
最后,程序能够编译就认为成功,无需实际运行程序。
+62
View File
@@ -0,0 +1,62 @@
---
name: "github-issue-triage"
description: "Reads GitHub issues, extracts reporter details and <=10MB attachments/images, then decides discuss/research vs direct fix vs implementation plan. Invoke when user shares an issue URL."
---
# GitHub Issue Triage
用于处理 GitHub issue 链接,并在结合当前仓库代码后给出执行路径。
## 触发时机
- 用户提供 GitHub issue URL,并希望你分析内容后继续行动
- 需要先读取 issue 创建者信息、附件或图片,再决定如何推进
- 需要判断是先讨论研究、直接修复,还是先制定方案
## 输入
- 必填:GitHub issue URL,例如 `https://github.com/<owner>/<repo>/issues/<id>`
- 可选:用户额外上下文(复现步骤、期望行为、优先级)
## 执行流程
1. 读取 issue 内容
- 获取标题、正文、标签、状态、创建者、创建时间
- 提取创建者在 issue 中提供的关键信息(正文 + 创建者本人评论)
- 区分“创建者信息”与“其他参与者讨论”
2. 收集附件与图片(限制 10MB)
- 从 issue 正文和创建者评论中提取附件/图片链接
- 对每个链接获取文件大小与类型,只有 `<= 10MB` 才下载
- 优先下载图片(png/jpg/jpeg/webp/gif)与问题复现相关附件
- 记录已下载与跳过原因(超限、类型不符、不可访问)
3. 结合代码库研判
- 先做高层语义检索定位相关模块,再做符号/关键字精查
- 找到与 issue 直接相关的代码路径、入口点、可能影响范围
- 判断是否已有类似问题处理逻辑、开关、兜底或已知限制
4. 路径决策
- 讨论研究问题:信息不足、无法稳定复现、需求存在歧义、外部依赖阻塞
- 直接修复问题:根因清晰、改动范围可控、验收标准明确
- 计划方案:涉及跨模块改造、兼容性权衡、需要分阶段实施
5. 执行动作
- 若“直接修复问题”:直接修改代码并完成必要验证
- 若“计划方案”:输出分步计划、影响面、风险与验证策略
- 若“讨论研究问题”:给出需要补充的信息与建议实验步骤
## 输出格式
- Issue 摘要:标题、创建者、关键诉求、复现线索
- 创建者信息提炼:仅保留创建者提供的有效信息
- 附件处理结果:下载清单(<=10MB)与跳过清单(含原因)
- 代码关联分析:相关模块、关键函数、潜在根因
- 决策结论:讨论研究 / 直接修复 / 计划方案
- 下一步:立即执行项
## 质量要求
- 必须优先依据创建者提供的信息,不被无关评论干扰
- 必须在代码层面给出证据,不做纯主观结论
- 决策应可执行,并且与当前仓库结构一致
@@ -0,0 +1,142 @@
---
name: "release-note-generator"
description: "Generates release notes from git commits/diffs and outputs one Chinese MD file. Invoke when user asks for release notes bounded by previous non-alpha version."
---
# Release Note Generator
用于基于当前仓库的 git 历史自动生成发布说明,确保不遗漏提交,并为每条变更记录追加提交人的 GitHub ID(`@id`)。默认输出一个 Markdown 文件到 `.trae/documents` 目录:变更内容。
## 触发时机
- 用户要求生成 Release Note / 更新日志
- 用户要求基于最近提交和实际代码变更做汇总
- 用户要求以“上一个非 alpha 版本”为边界统计变更
## 输入约定
- 默认分支当前 `HEAD`
- 版本边界规则:从最新提交向后遍历,遇到“提交信息包含版本号且不含 alpha”的最近一个提交作为边界
- 若用户指定分支、Tag 或版本正则,优先使用用户指定
- 未指定时,默认输出文档路径为:`.trae/documents/release_notes-<version>.md`
## 实战经验(本项目)
- 不直接依赖终端长输出:大量 `git log` 在终端中容易被截断,导致误判“提交缺失”
- 不用 `|` 等普通分隔符解析:提交标题可能包含分隔符,必须使用 NUL 分隔(`\x00`)保证可解析
- 统一 UTF-8:PowerShell 下中文提交信息可能乱码,调用 git 时需显式设置输出编码
- 避免在 `RunCommand` 的内联脚本中直接硬编码中文常量(标题、分类名、文件名):在 Windows/PowerShell 链路中可能被替换为 `?`
- 发布文件名使用 ASCII:不要在文件名中使用中文(如 `ReleaseNotes-变更内容-<version>.md`),否则编码异常时会变成非法字符 `?` 导致写文件失败
- 中文文案仅放在 Markdown 内容里,并在写入后做一次乱码校验:若出现 `???`、`### ??` 等占位符,必须重新生成
- 明确分支范围:优先使用 `HEAD` 可达历史,必要时用 `--first-parent` 辅助核对发布主线
- 先计数再明细:先取 `rev-list --count`,再逐条采集,最后做数量一致性校验
- 版本边界要可回退:目标版本不存在时,自动回退到最近可识别的“上一非 alpha 版本”并在结果中声明
## 日志采集方式(强制)
- 必须使用 Python 脚本拉取 commit 与 diff,不直接用终端拼接命令产出最终结果
- Python 内通过 `subprocess.run([...], check=True, capture_output=True, text=True, encoding="utf-8", errors="replace")` 调 git
- git 命令需附加编码参数:`-c i18n.logOutputEncoding=utf8 -c core.quotepath=false`
- 提交元数据推荐格式:`--pretty=format:%H%x00%h%x00%an%x00%ae%x00%ad%x00%s%x00`,按 `\x00` 解析
- diff 证据至少包含:
- 区间总览:`git diff --shortstat <base>..<head>`
- 文件变更:`git diff --name-status <base>..<head>`
- 行级统计:`git diff --numstat <base>..<head>`
- 必要时单提交详情:`git show --name-status --numstat --format= <sha>`
- Python 脚本需输出结构化数据(JSON/对象)后再生成 release note 文本
- 若通过终端执行 Python,优先将中文文案写成 `\\uXXXX` 形式或由程序运行期拼接,避免命令传输阶段损坏字符
## 执行流程
1. 获取提交序列(防遗漏)
- 从 `HEAD` 向后扫描提交,定位边界提交 `boundary_commit`
- 使用可识别 SemVer 的正则提取版本号(例如 `v1.2.3`、`1.2.3`)
- 判断“非 alpha”时使用大小写不敏感匹配:提交信息不包含 `alpha`
- 生成统计区间:`(boundary_commit, HEAD]`,边界提交本身不计入变更列表
- 使用 Python 执行 git 并解析 NUL 分隔结果,禁止依赖终端显示内容做解析
2. 完整性校验(必须)
- 先取区间提交总数 `N`
- 再逐条收集区间内每个 commit 的详情
- 输出前校验“已收集条数 == N”,不一致则重新拉取,直到一致
- 若存在 merge,额外给出 `--first-parent` 视角的校验结果,避免发布主线理解偏差
3. 采集每条提交的证据
- 提交元数据:hash、标题、作者、时间
- 实际改动:由 Python 采集 `--name-status`、`--numstat`、`--shortstat` 与必要 diff 片段
- 将提交按功能模块归类(如 UI、任务、配置、脚本、基础设施等)
4. 提炼发布内容
- 先按用户指定分类规则归类;若未指定,使用更接近 GitHub Releases 页面的默认分类顺序:
1) 新功能
2) 地图遮罩
3) 独立任务
4) JS相关
5) 其他
- 分类名尽量贴近业务语义:例如“地图追踪”“自动剧情”“七圣召唤”等可作为二级小节并入对应一级分类
- 无法稳定归类的小变更统一放入“其他”
- 每条摘要都要可追溯到至少一个 commit
- 识别“变更最大点”并在首屏摘要中突出展示
- 主体正文只展示可读的变更描述,不在分类正文中堆叠 hash
- 完整提交清单放在文末,避免正文可读性下降
- 输出文案需去掉 Conventional Commits 前缀:至少移除 `feat:`、`fix:`(区分大小写不敏感),再写入分类正文与完整提交清单
5. 生成提交人 GitHub ID(逐条记录追加 `@id`)
- 必须以“当前方式”解析:对区间内每个 commit 逐条调用 GitHub 提交接口,禁止仅依赖本地 `author name`:
- 接口:`https://api.github.com/repos/<owner>/<repo>/commits/<sha>`
- 请求头至少包含:`Accept: application/vnd.github+json`、`User-Agent: <custom>`
- 解析顺序固定:优先 `author.login`,为空时取 `committer.login`
- 必须保证覆盖全量区间提交:
- 对每个 SHA 单独请求并记录结果
- 输出前校验“已解析 login 数 == 区间提交数”,不一致则进入回退链
- 回退链(仅当 API 某条未命中时):
- 先用“同区间内已解析结果”做映射回填(同 author email / 同 author name)
- 再解析 GitHub noreply 邮箱:
- `[email protected]` -> `@login`
- `[email protected]` -> `@login`
- 再回退 `.atom`:`https://github.com/<owner>/<repo>/commits/<branch>.atom` 按 SHA 匹配 `<entry>` 获取 `<author><name>`
- 最后才允许作者名标准化兜底,并明确标记为推断
- 为每条变更记录绑定对应作者的 `@id`
- 若一条汇总涉及多个 commit,按去重后多作者格式追加:`@id1 @id2`
## 输出格式(强制,需贴近 GitHub Releases 风格)
必须产出 1 个文件:
1. 变更内容文件(全中文)
- 文件路径:`.trae/documents/ReleaseNotes-<version>.md`(文件名必须 ASCII)
- 内容结构(推荐模板):
- 一级标题:`## <version> <版本主题>`(示例:`## 0.58 月之五适配`)
- 开场一句话:版本背景或问候语(可选,1~2 句)
- 分类正文:按以下顺序输出存在内容的分类:
- `新功能`
- `地图遮罩`
- `独立任务`
- `JS相关`
- `其他`(必须保留,即使只有 1 条)
- 分类内每条为单行 bullet,格式:
- `<变更描述> (#PR号可选) @githubId`
- 若某条由多人提交,使用:`@id1 @id2`
- 文末追加“完整提交清单”(倒序,不能缺项,每条带 `@id`)
- 在标题下方补充统计信息:`边界提交 / 区间 / 提交数 / shortstat`
补充要求:
- 变更内容文件必须全中文
- 仅内容全中文;文件名必须为 ASCII,避免 Windows 下出现 `?` 非法路径
- 风格贴近 GitHub Releases:简洁分段、先讲用户可感知变化,再给完整清单
- 正文优先使用自然语言,不直接复制 commit 原文
- 分类不允许缺失“其他”
- 内容中不保留 `feat:`、`fix:` 前缀
- 生成后必须执行乱码检查:若命中 `\\?{2,}` 或 `### \\?+`,视为失败并重生成
## 质量门槛
- 不允许遗漏区间内任意 commit
- 不允许仅基于 commit 标题,必须结合实际代码改动
- 每条变更记录必须带作者 `@id`,不允许只在末尾集中列出
- 必须通过 Python 脚本获取日志与 diff,禁止直接依赖终端长输出结果
- 解析 `@id` 时必须逐条调用 GitHub Commit API(`/repos/<owner>/<repo>/commits/<sha>`),不得以本地昵称直接替代
- 未找到边界版本时,必须明确说明并给出当前采用的兜底范围
- 分类默认遵循“新功能 / 地图遮罩 / 独立任务 / JS相关 / 其他”,其中“其他”必须出现
- Markdown 文件必须实际落盘到仓库中的 `.trae/documents` 目录
- 不允许输出出现乱码占位符(如 `???`、`??` 分类名);发现即判定为不合格
@@ -1,20 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<None Remove="NativeMethods.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.46-beta">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
@@ -1,10 +0,0 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/CsWin32/main/src/Microsoft.Windows.CsWin32/settings.schema.json",
"allowMarshaling": true,
"useSafeHandles": false,
"emitSingleFile": true,
"public": true,
"comInterop": {
"useIntPtrForComOutPointers": true
}
}
@@ -1,34 +0,0 @@
// D3D11
CreateDirect3D11DeviceFromDXGIDevice
CreateDirect3D11SurfaceFromDXGISurface
// GDI32
BitBlt
CreateCompatibleBitmap
CreateCompatibleDC
DeleteDC
GetDeviceCaps
SelectObject
// User32
GetClientRect
GetDC
GetForegroundWindow
GetSystemMetrics
GetWindowDC
GetWindowRect
GetWindowThreadProcessId
mouse_event
PostMessage
ReleaseDC
// COM & WinRT
D3D11CreateDevice
ID3D11Device3
IDirect3DDxgiInterfaceAccess
IGraphicsCaptureItemInterop
// Constants
D3D11_SDK_VERSION
WM_LBUTTONDOWN
WM_LBUTTONUP
+63 -19
View File
@@ -5,38 +5,82 @@ VisualStudioVersion = 17.6.33815.320
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BetterGenshinImpact", "BetterGenshinImpact\BetterGenshinImpact.csproj", "{75EC89E2-413D-4725-BCEA-AFAC57708F07}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vision.WindowCapture", "Vision.WindowCapture\Vision.WindowCapture.csproj", "{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fischless.GameCapture", "Fischless.GameCapture\Fischless.GameCapture.csproj", "{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vision.Recognition", "Vision.Recognition\Vision.Recognition.csproj", "{97A12A37-613B-4BE3-B01B-BF3411503711}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fischless.HotkeyCapture", "Fischless.HotkeyCapture\Fischless.HotkeyCapture.csproj", "{08152E44-2564-46C5-B5B2-54DD43C01A79}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BetterGenshinImpact.Win32", "BetterGenshinImpact.Win32\BetterGenshinImpact.Win32.csproj", "{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BetterGenshinImpact.Test", "Test\BetterGenshinImpact.Test\BetterGenshinImpact.Test.csproj", "{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fischless.WindowsInput", "Fischless.WindowsInput\Fischless.WindowsInput.csproj", "{9D00BC7A-9280-4AC9-8951-4502EDB71B76}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{02CEA57F-C24B-40F9-AF31-F1D4F3BDB4BF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BetterGenshinImpact.UnitTest", "Test\BetterGenshinImpact.UnitTest\BetterGenshinImpact.UnitTest.csproj", "{7DA575C0-8D1E-4BD2-AEDB-5471D8906B98}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Release|Any CPU.Build.0 = Release|Any CPU
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Release|Any CPU.Build.0 = Release|Any CPU
{97A12A37-613B-4BE3-B01B-BF3411503711}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{97A12A37-613B-4BE3-B01B-BF3411503711}.Debug|Any CPU.Build.0 = Debug|Any CPU
{97A12A37-613B-4BE3-B01B-BF3411503711}.Release|Any CPU.ActiveCfg = Release|Any CPU
{97A12A37-613B-4BE3-B01B-BF3411503711}.Release|Any CPU.Build.0 = Release|Any CPU
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Release|Any CPU.Build.0 = Release|Any CPU
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Debug|Any CPU.ActiveCfg = Debug|x64
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Debug|Any CPU.Build.0 = Debug|x64
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Debug|x64.ActiveCfg = Debug|x64
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Debug|x64.Build.0 = Debug|x64
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Release|Any CPU.ActiveCfg = Release|x64
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Release|Any CPU.Build.0 = Release|x64
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Release|x64.ActiveCfg = Release|x64
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Release|x64.Build.0 = Release|x64
{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}.Debug|Any CPU.ActiveCfg = Debug|x64
{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}.Debug|Any CPU.Build.0 = Debug|x64
{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}.Debug|x64.ActiveCfg = Debug|x64
{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}.Debug|x64.Build.0 = Debug|x64
{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}.Release|Any CPU.ActiveCfg = Release|x64
{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}.Release|Any CPU.Build.0 = Release|x64
{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}.Release|x64.ActiveCfg = Release|x64
{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}.Release|x64.Build.0 = Release|x64
{08152E44-2564-46C5-B5B2-54DD43C01A79}.Debug|Any CPU.ActiveCfg = Debug|x64
{08152E44-2564-46C5-B5B2-54DD43C01A79}.Debug|Any CPU.Build.0 = Debug|x64
{08152E44-2564-46C5-B5B2-54DD43C01A79}.Debug|x64.ActiveCfg = Debug|x64
{08152E44-2564-46C5-B5B2-54DD43C01A79}.Debug|x64.Build.0 = Debug|x64
{08152E44-2564-46C5-B5B2-54DD43C01A79}.Release|Any CPU.ActiveCfg = Release|x64
{08152E44-2564-46C5-B5B2-54DD43C01A79}.Release|Any CPU.Build.0 = Release|x64
{08152E44-2564-46C5-B5B2-54DD43C01A79}.Release|x64.ActiveCfg = Release|x64
{08152E44-2564-46C5-B5B2-54DD43C01A79}.Release|x64.Build.0 = Release|x64
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Debug|x64.ActiveCfg = Debug|x64
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Debug|x64.Build.0 = Debug|x64
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Release|Any CPU.ActiveCfg = Release|x64
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Release|Any CPU.Build.0 = Release|x64
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Release|x64.ActiveCfg = Release|x64
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Release|x64.Build.0 = Release|x64
{9D00BC7A-9280-4AC9-8951-4502EDB71B76}.Debug|Any CPU.ActiveCfg = Debug|x64
{9D00BC7A-9280-4AC9-8951-4502EDB71B76}.Debug|Any CPU.Build.0 = Debug|x64
{9D00BC7A-9280-4AC9-8951-4502EDB71B76}.Debug|x64.ActiveCfg = Debug|x64
{9D00BC7A-9280-4AC9-8951-4502EDB71B76}.Debug|x64.Build.0 = Debug|x64
{9D00BC7A-9280-4AC9-8951-4502EDB71B76}.Release|Any CPU.ActiveCfg = Release|x64
{9D00BC7A-9280-4AC9-8951-4502EDB71B76}.Release|Any CPU.Build.0 = Release|x64
{9D00BC7A-9280-4AC9-8951-4502EDB71B76}.Release|x64.ActiveCfg = Release|x64
{9D00BC7A-9280-4AC9-8951-4502EDB71B76}.Release|x64.Build.0 = Release|x64
{7DA575C0-8D1E-4BD2-AEDB-5471D8906B98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7DA575C0-8D1E-4BD2-AEDB-5471D8906B98}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7DA575C0-8D1E-4BD2-AEDB-5471D8906B98}.Debug|x64.ActiveCfg = Debug|x64
{7DA575C0-8D1E-4BD2-AEDB-5471D8906B98}.Debug|x64.Build.0 = Debug|x64
{7DA575C0-8D1E-4BD2-AEDB-5471D8906B98}.Release|Any CPU.ActiveCfg = Release|x64
{7DA575C0-8D1E-4BD2-AEDB-5471D8906B98}.Release|Any CPU.Build.0 = Release|x64
{7DA575C0-8D1E-4BD2-AEDB-5471D8906B98}.Release|x64.ActiveCfg = Release|x64
{7DA575C0-8D1E-4BD2-AEDB-5471D8906B98}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE} = {02CEA57F-C24B-40F9-AF31-F1D4F3BDB4BF}
{7DA575C0-8D1E-4BD2-AEDB-5471D8906B98} = {02CEA57F-C24B-40F9-AF31-F1D4F3BDB4BF}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {352D8B78-9DE3-4E58-985F-FADD22594DB4}
EndGlobalSection
+10
View File
@@ -0,0 +1,10 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=chyan/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=enkanomiya/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Kongying/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=mirrorchan/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=onslaugh/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=retcode/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=serenitea/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=steambird/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Teyvat/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
+1
View File
@@ -0,0 +1 @@
/Assets/Strings/*.html linguist-vendored
+33 -3
View File
@@ -1,9 +1,39 @@
<Application x:Class="BetterGenshinImpact.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:BetterGenshinImpact"
StartupUri="/View/MainWindow.xaml">
xmlns:behavior="clr-namespace:BetterGenshinImpact.View.Behavior"
xmlns:bgivc="clr-namespace:BetterGenshinImpact.View.Converters"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:vio="http://schemas.lepo.co/wpfui/2022/xaml/violeta">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ThemesDictionary Theme="Dark" />
<ui:ControlsDictionary />
<vio:ControlsDictionary />
<ResourceDictionary Source="/View/Controls/WpfUi/FaFontIconStyle.xaml" />
<ResourceDictionary Source="/View/Controls/Drawer/DrawerStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
<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" />
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<bgivc:BooleanToVisibilityRevertConverter x:Key="BooleanToVisibilityRevertConverter" />
<bgivc:BooleanToEnableTextConverter x:Key="BooleanToEnableTextConverter" />
<bgivc:InverseBooleanConverter x:Key="InverseBooleanConverter" />
<bgivc:NotNullConverter x:Key="NotNullConverter" />
<bgivc:EnumToKVPConverter x:Key="EnumToKVPConverter" />
<bgivc:CultureInfoNameToKVPConverter x:Key="CultureInfoNameToKVPConverter" />
<bgivc:StringToColorConverter x:Key="StringToColorConverter" />
<bgivc:TrConverter x:Key="TrConverter" />
<bgivc:AdaptiveUniformGridColumnsConverter x:Key="AdaptiveUniformGridColumnsConverter" />
<Style BasedOn="{StaticResource DefaultTextBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="behavior:ClipboardInterceptor.EnableSafeClipboard" Value="True" />
</Style>
<Style BasedOn="{StaticResource DefaultTextBoxStyle}" TargetType="{x:Type ui:TextBox}">
<Setter Property="behavior:ClipboardInterceptor.EnableSafeClipboard" Value="True" />
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>
+371 -50
View File
@@ -1,63 +1,384 @@
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
using BetterGenshinImpact.Core.Recognition.OCR;
using BetterGenshinImpact.Core.Recognition.ONNX;
using BetterGenshinImpact.GameTask;
using BetterGenshinImpact.Helpers;
using BetterGenshinImpact.Helpers.Extensions;
using BetterGenshinImpact.Helpers.Win32;
using BetterGenshinImpact.Hutao;
using BetterGenshinImpact.Service;
using BetterGenshinImpact.Service.Interface;
using BetterGenshinImpact.Service.Notification;
using BetterGenshinImpact.Service.Notifier;
using BetterGenshinImpact.View;
using BetterGenshinImpact.View.Pages;
using BetterGenshinImpact.ViewModel;
using BetterGenshinImpact.ViewModel.Pages;
using BetterGenshinImpact.ViewModel.Pages.View;
using LazyCache;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Serilog;
using System;
using System.IO;
using System.Windows;
using Vision.Recognition;
using WinRT;
using Serilog.Events;
using Serilog.Sinks.RichTextBox.Abstraction;
using Wpf.Ui;
using Wpf.Ui.DependencyInjection;
using Wpf.Ui.Violeta.Appearance;
using Wpf.Ui.Violeta.Controls;
namespace BetterGenshinImpact
// Wine 平台适配
using BetterGenshinImpact.Platform.Wine;
using BetterGenshinImpact.Service.Tavern;
namespace BetterGenshinImpact;
public partial class App : Application
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
// The.NET Generic Host provides dependency injection, configuration, logging, and other services.
// https://docs.microsoft.com/dotnet/core/extensions/generic-host
// https://docs.microsoft.com/dotnet/core/extensions/dependency-injection
// https://docs.microsoft.com/dotnet/core/extensions/configuration
// https://docs.microsoft.com/dotnet/core/extensions/logging
private static readonly IHost _host = Host.CreateDefaultBuilder()
.CheckIntegration()
.UseElevated()
.UseSingleInstance("BetterGI")
.ConfigureLogging(builder => { builder.ClearProviders(); })
.ConfigureServices((context, services) =>
{
// 提前初始化配置
var configService = new ConfigService();
services.AddSingleton<IConfigService>(sp => configService);
var all = configService.Get();
var logFolder = Path.Combine(AppContext.BaseDirectory, "log");
Directory.CreateDirectory(logFolder);
var logFile = Path.Combine(logFolder, "better-genshin-impact.log");
var richTextBox = new RichTextBoxImpl();
services.AddSingleton<IRichTextBox>(richTextBox);
var loggerConfiguration = new LoggerConfiguration()
.WriteTo.File(logFile,
outputTemplate:
"[{Timestamp:HH:mm:ss.fff}] [{Level:u3}] {SourceContext}{NewLine}{Message}{NewLine}{Exception}{NewLine}",
rollingInterval: RollingInterval.Day,
retainedFileCountLimit: 31,
retainedFileTimeLimit: TimeSpan.FromDays(21))
.WriteTo.Console(outputTemplate:
"[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}")
.MinimumLevel.Debug()
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
.MinimumLevel.Override("Microsoft.Hosting.Lifetime", LogEventLevel.Warning);
if (all.MaskWindowConfig.MaskEnabled)
{
loggerConfiguration.WriteTo.RichTextBox(richTextBox, LogEventLevel.Information,
"[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}");
}
Log.Logger = loggerConfiguration.CreateLogger();
services.AddSingleton<IMissingTranslationReporter, SupabaseMissingTranslationReporter>();
services.AddSingleton<ITranslationService, JsonTranslationService>();
services.AddLogging(c => c.AddSerilog());
// if ("zh-Hans".Equals(all.OtherConfig.UiCultureInfoName, StringComparison.OrdinalIgnoreCase))
// {
// services.AddLogging(c => c.AddSerilog());
// }
// else
// {
// services.AddLogging(logging =>
// {
// logging.ClearProviders();
// logging.SetMinimumLevel(LogLevel.Debug);
// logging.AddFilter("Microsoft", LogLevel.Warning);
// logging.AddFilter("Microsoft.Hosting.Lifetime", LogLevel.Warning);
// logging.Services.AddSingleton<ILoggerProvider, TranslatingSerilogLoggerProvider>();
// });
// }
services.AddLocalization();
services.AddNavigationViewPageProvider();
// App Host
services.AddHostedService<ApplicationHostService>();
// Page resolver service
services.AddSingleton<INavigationService, NavigationService>();
services.AddSingleton<IUpdateService, UpdateService>();
// Service containing navigation, same as INavigationWindow... but without window
services.AddSingleton<INavigationService, NavigationService>();
services.AddSingleton<ISnackbarService, SnackbarService>();
// Main window with navigation
services.AddView<INavigationWindow, MainWindow, MainWindowViewModel>();
services.AddSingleton<NotifyIconViewModel>();
// Views
services.AddView<HomePage, HomePageViewModel>();
services.AddView<ScriptControlPage, ScriptControlViewModel>();
services.AddView<TriggerSettingsPage, TriggerSettingsPageViewModel>();
services.AddView<MacroSettingsPage, MacroSettingsPageViewModel>();
services.AddView<CommonSettingsPage, CommonSettingsPageViewModel>();
services.AddView<TaskSettingsPage, TaskSettingsPageViewModel>();
services.AddView<HotKeyPage, HotKeyPageViewModel>();
services.AddView<NotificationSettingsPage, NotificationSettingsPageViewModel>();
services.AddView<KeyMouseRecordPage, KeyMouseRecordPageViewModel>();
services.AddView<JsListPage, JsListViewModel>();
services.AddView<MapPathingPage, MapPathingViewModel>();
services.AddView<OneDragonFlowPage, OneDragonFlowViewModel>();
services.AddSingleton<PathingConfigViewModel>();
// services.AddView<PathingConfigView, PathingConfigViewModel>();
services.AddView<KeyBindingsSettingsPage, KeyBindingsSettingsPageViewModel>();
// 一条龙 ViewModels
// services.AddSingleton<CraftViewModel>();
// services.AddSingleton<DailyCommissionViewModel>();
// services.AddSingleton<DailyRewardViewModel>();
// services.AddSingleton<DomainViewModel>();
// services.AddSingleton<ForgingViewModel>();
// services.AddSingleton<LeyLineBlossomViewModel>();
// services.AddSingleton<MailViewModel>();
// services.AddSingleton<SereniteaPotViewModel>();
// services.AddSingleton<TcgViewModel>();
// My Services
services.AddSingleton<TaskTriggerDispatcher>();
services.AddSingleton<NotificationService>();
services.AddHostedService(sp => sp.GetRequiredService<NotificationService>());
services.AddSingleton<NotifierManager>();
services.AddSingleton<IScriptService, ScriptService>();
services.AddSingleton<HutaoNamedPipe>();
services.AddSingleton<BgiOnnxFactory>();
services.AddSingleton<OcrFactory>();
services.AddMemoryCache();
services.AddSingleton<IAppCache, CachingService>();
services.AddSingleton<MemoryFileCache>();
services.AddSingleton<IMihoyoMapApiService, MihoyoMapApiService>();
services.AddSingleton<IKongyingTavernApiService, KongyingTavernApiService>();
services.AddSingleton<IHoYoLabMapApiService, HoYoLabMapApiService>();
services.AddSingleton<IMaskMapPointService, MaskMapPointService>();
services.AddSingleton(TimeProvider.System);
services.AddSingleton<IServerTimeProvider, ServerTimeProvider>();
// Configuration
//services.Configure<AppConfig>(context.Configuration.GetSection(nameof(AppConfig)));
I18N.Culture = new CultureInfo("zh-Hans"); // #1846
}
)
.Build();
public static IServiceProvider ServiceProvider => _host.Services;
public static ILogger<T> GetLogger<T>()
{
public App()
{
Services = ConfigureServices();
return _host.Services.GetService<ILogger<T>>()!;
}
this.InitializeComponent();
/// <summary>
/// Gets registered service.
/// </summary>
/// <typeparam name="T">Type of the service to get.</typeparam>
/// <returns>Instance of the service or <see langword="null"/>.</returns>
public static T? GetService<T>() where T : class
{
return _host.Services.GetService(typeof(T)) as T;
}
/// <summary>
/// Gets registered service.
/// </summary>
/// <returns>Instance of the service or <see langword="null"/>.</returns>
/// <returns></returns>
public static object? GetService(Type type)
{
return _host.Services.GetService(type);
}
/// <summary>
/// Occurs when the application is loading.
/// </summary>
protected override async void OnStartup(StartupEventArgs e)
{
// Wine 平台适配
WinePlatformAddon.ApplyApplicationConfig();
base.OnStartup(e);
try
{
// 分配控制台窗口以支持控制台输出
ConsoleHelper.AllocateConsole("BetterGI Console");
RegisterEvents();
await _host.StartAsync();
ServerTimeHelper.Initialize(_host.Services.GetRequiredService<IServerTimeProvider>());
await UrlProtocolHelper.RegisterAsync();
}
/// <summary>
/// Gets the current <see cref="App"/> instance in use
/// </summary>
public new static App Current => (App)Application.Current;
/// <summary>
/// Gets the <see cref="IServiceProvider"/> instance to resolve application services.
/// </summary>
public IServiceProvider Services { get; }
/// <summary>
/// Configures the services for the application.W
/// </summary>
private static IServiceProvider ConfigureServices()
catch (Exception ex)
{
var services = new ServiceCollection();
Debug.WriteLine(ex);
ConsoleHelper.WriteError($"应用程序启动失败: {ex.Message}");
try
{
HandleException(ex);
}
catch (Exception ex2)
{
Debug.WriteLine(ex2);
ConsoleHelper.WriteError($"应用程序启动失败打印日志时又失败了: {ex2.Message}");
}
var logFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"log");
Directory.CreateDirectory(logFolder);
var logFile = Path.Combine(logFolder, $"better-genshin-impact.log");
Log.Logger = new LoggerConfiguration()
.WriteTo.File(path: logFile, outputTemplate: "[{Timestamp:HH:mm:ss.fff}] [{Level:u3}] {SourceContext}{NewLine}{Message}{NewLine}{Exception}{NewLine}", rollingInterval: RollingInterval.Day)
.WriteTo.RichTextBox(MaskWindow.Instance().LogBox, outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}")
.CreateLogger();
services.AddLogging(c => c.AddSerilog());
//services.AddSingleton<ISettingsService, SettingsService>();
return services.BuildServiceProvider();
}
public static ILogger<T> GetLogger<T>()
{
return Current.Services.GetService<ILogger<T>>()!;
if (Debugger.IsAttached)
{
Debugger.Break();
}
}
}
/// <summary>
/// Occurs when the application is closing.
/// </summary>
protected override async void OnExit(ExitEventArgs e)
{
base.OnExit(e);
ConsoleHelper.WriteLine("BetterGI 应用程序正在关闭...");
TempManager.CleanUp();
await _host.StopAsync();
_host.Dispose();
// 释放控制台窗口
ConsoleHelper.FreeConsoleWindow();
}
/// <summary>
/// 注册事件
/// </summary>
private void RegisterEvents()
{
//Task线程内未捕获异常处理事件
TaskScheduler.UnobservedTaskException += TaskSchedulerUnobservedTaskException;
//UI线程未捕获异常处理事件(UI主线程)
this.DispatcherUnhandledException += AppDispatcherUnhandledException;
//非UI线程未捕获异常处理事件(例如自己创建的一个子线程)
AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException;
}
private static void TaskSchedulerUnobservedTaskException(object? sender, UnobservedTaskExceptionEventArgs e)
{
try
{
// 忽略V8引擎释放后pending的Task回调抛出的异常
if (IsV8EngineReleasedException(e.Exception))
{
return;
}
HandleException(e.Exception);
}
catch (Exception ex)
{
HandleException(ex);
}
finally
{
e.SetObserved();
}
}
private static bool IsV8EngineReleasedException(Exception? ex)
{
while (ex != null)
{
if (ex.Message?.Contains("V8 object has been released") == true)
{
return true;
}
ex = ex.InnerException;
}
return false;
}
//非UI线程未捕获异常处理事件(例如自己创建的一个子线程)
private static void CurrentDomainUnhandledException(object sender, UnhandledExceptionEventArgs e)
{
try
{
if (e.ExceptionObject is Exception exception)
{
HandleException(exception);
}
}
catch (Exception ex)
{
HandleException(ex);
}
finally
{
//ignore
}
}
//UI线程未捕获异常处理事件(UI主线程)
private static void AppDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
try
{
HandleException(e.Exception);
}
catch (Exception ex)
{
HandleException(ex);
}
finally
{
//处理完后,我们需要将Handler=true表示已此异常已处理过
e.Handled = true;
}
}
private static void HandleException(Exception e)
{
if (e.InnerException != null)
{
e = e.InnerException;
}
try
{
ExceptionReport.Show(e);
}
catch
{
// Fallback.
System.Windows.Forms.MessageBox.Show(
$"""
程序异常:{e.Source}
--
{e.StackTrace}
--
{e.Message}
"""
);
}
// log
GetLogger<App>().LogDebug(e, "UnHandle Exception");
}
}
+3 -8
View File
@@ -1,10 +1,5 @@
using System.Windows;
using System.Windows.Media;
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
[assembly: DisableDpiAwareness]
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
+239 -46
View File
@@ -1,53 +1,246 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows10.0.22000.0</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
</PropertyGroup>
<PropertyGroup>
<AssemblyName>BetterGI</AssemblyName>
<Version>0.60.2-alpha.3</Version>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<LangVersion>12.0</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ApplicationIcon>Resources\Images\logo.ico</ApplicationIcon>
<Platforms>x64</Platforms>
<DebugType>embedded</DebugType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
<PackageReference Include="Config.Net" Version="5.1.5" />
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.46-beta">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.39" />
<PackageReference Include="MouseKeyHook" Version="5.7.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.RichTextBox.Wpf" Version="1.1.0" />
</ItemGroup>
<!-- <ItemGroup>
<None Remove="Assets\Images\*.jpg" />
<None Remove="Assets\Images\*" />
<None Remove="Assets\Images\*.png" />
<None Remove="Assets\Images\*.ico" />
<None Remove="Assets\Fonts\*.ttf" />
<None Remove="Assets\Highlighting\*.xshd" />
<None Remove="Assets\Strings\*.html" />
<None Remove="Assets\Strings\*.md" />
<None Remove="Assets\Audios\*.mp3" />
<None Update="Assets\Config\*"/>
</ItemGroup>-->
<ItemGroup>
<ProjectReference Include="..\Vision.Recognition\Vision.Recognition.csproj" />
<ProjectReference Include="..\Vision.WindowCapture\Vision.WindowCapture.csproj" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Images\*.jpg" />
<Resource Include="Resources\Images\Anniversary\*" />
<Resource Include="Resources\Images\*.png" />
<Resource Include="Resources\Images\*.ico" />
<Resource Include="Resources\Fonts\*.ttf" />
</ItemGroup>
<ItemGroup>
<Folder Include="GameTask\AutoGeniusInvokation\" />
<Folder Include="GameTask\UseActiveCode\" />
<Folder Include="Service\Interface\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AvalonEdit" Version="6.3.1.120" />
<PackageReference Include="BehaviourTree" Version="1.0.73" />
<ItemGroup>
<None Update="GameTask\AutoFishing\Assets\1920x1080\Space.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoPick\Assets\1920x1080\F.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoSkip\Assets\1920x1080\menu.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoSkip\Assets\1920x1080\option.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoSkip\Assets\1920x1080\stop_auto.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<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="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="DeviceId" Version="6.9.0" />
<PackageReference Include="DeviceId.Windows" Version="6.9.0" />
<PackageReference Include="DeviceId.Windows.Wmi" Version="6.9.0" />
<PackageReference Include="Emoji.Wpf" Version="0.3.4" />
<PackageReference Include="LibGit2Sharp" Version="0.31.0" />
<PackageReference Include="LazyCache" Version="2.4.0" />
<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" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.4" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.4" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="9.0.4" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.4" />
<PackageReference Include="Microsoft.ML.OnnxRuntime.DirectML" Version="1.21.0" />
<!--排除掉cpu的runtime dll-->
<PackageReference Include="Microsoft.ML.OnnxRuntime" Version="1.21.0" IncludeAssets="none" />
<PackageReference Include="Microsoft.ML.OnnxRuntime.Managed" Version="1.21.0" />
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.3" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2592.51" />
<PackageReference Include="MimeKit" Version="4.15.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Ookii.Dialogs.Wpf" Version="5.0.1" />
<PackageReference Include="OpenCvSharp4.WpfExtensions" Version="4.11.0.20250507" />
<PackageReference Include="OpenCvSharp4.Extensions" Version="4.11.0.20250507" />
<PackageReference Include="OpenCvSharp4.Windows" Version="4.11.0.20250507" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.122" />
<PackageReference Include="Microsoft.ClearScript.V8" Version="7.4.5" />
<PackageReference Include="Microsoft.ClearScript.V8.Native.win-x64" Version="7.4.5" />
<PackageReference Include="MouseKeyHook" Version="5.7.1" />
<PackageReference Include="PresentMonFps" Version="2.0.5" />
<PackageReference Include="Sdl.MultiSelectComboBox" Version="1.0.103" />
<PackageReference Include="Semver" Version="3.0.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<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.IO.Hashing" Version="9.0.4" />
<PackageReference Include="TorchSharp" Version="0.105.0" />
<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="gong-wpf-dragdrop" Version="3.2.1" />
<PackageReference Include="YamlDotNet" Version="16.3.0" />
<PackageReference Include="YoloSharp" Version="6.0.3" />
</ItemGroup>
<ItemGroup Condition=" '$(Configuration)' == 'Debug'">
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Fischless.GameCapture\Fischless.GameCapture.csproj" />
<ProjectReference Include="..\Fischless.HotkeyCapture\Fischless.HotkeyCapture.csproj" />
<ProjectReference Include="..\Fischless.WindowsInput\Fischless.WindowsInput.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="Assets\Map\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Assets\Model\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Assets\Config\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoFight\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoFight\Assets\combat_avatar.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoFishing\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoLeyLineOutcrop\Assets\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\LogParse\Assets\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoGeniusInvokation\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoGeniusInvokation\Assets\tcg_character_card.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoPick\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoSkip\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoSkip\Assets\hangout.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoTrackPath\Assets\tp.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\Common\Element\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\Common\Element\Assets\Json\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoWood\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoMusicGame\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\GameLoading\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\QuickTeleport\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\QuickSereniteaPot\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoEat\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\QuickBuy\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\UseRedeemCode\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="User\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\LogParse\Assets\log.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\LogParse\Assets\log.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\GameLoading\Assets\1920x1080\enter_game.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\Common\Element\Assets\1920x1080\in_domain.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="GameTask\AutoDomain\Assets\1920x1080\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="User\I18n\en.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="GameTask\OneDragon\" />
<Folder Include="GameTask\UseRedeemCode\Assets\1920x1080\" />
<Folder Include="Resources\" />
<Folder Include="Service\Notification\Builder\" />
<Folder Include="User\AutoPathing\" />
</ItemGroup>
<ItemGroup>
<Page Update="View\Windows\WelcomeDialog.xaml">
<Generator>MSBuild:Compile</Generator>
<XamlRuntime>Wpf</XamlRuntime>
<SubType>Designer</SubType>
</Page>
<Page Update="View\Windows\MapPathingDevWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<XamlRuntime>Wpf</XamlRuntime>
<SubType>Designer</SubType>
</Page>
<Page Update="View\Pages\View\HardwareAccelerationView.xaml">
<Generator>MSBuild:Compile</Generator>
<XamlRuntime>Wpf</XamlRuntime>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Update="View\Windows\WelcomeDialog.xaml.cs">
<SubType>Code</SubType>
<DependentUpon>WelcomeDialog.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<_DeploymentManifestIconFile Remove="Resources\Images\logo.ico" />
</ItemGroup>
</Project>
@@ -0,0 +1,31 @@
using BetterGenshinImpact.Core.Recognition;
using BetterGenshinImpact.GameTask;
using OpenCvSharp;
namespace BetterGenshinImpact.Core.BgiVision;
public class BvImage
{
public RecognitionObject RecognitionObject { get; }
public BvImage(string templateAssert, Rect roi = default, double threshold = 0.8)
{
var args = templateAssert.Split(':');
var featureName = args[0];
var assertName = args[1];
RecognitionObject = new RecognitionObject
{
Name = templateAssert,
RecognitionType = RecognitionTypes.TemplateMatch,
TemplateImageMat = GameTaskManager.LoadAssetImage(featureName, assertName),
RegionOfInterest = roi,
Threshold = threshold
}.InitTemplate();
}
public RecognitionObject ToRecognitionObject()
{
return RecognitionObject;
}
}
@@ -0,0 +1,211 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using BetterGenshinImpact.Core.Recognition;
using BetterGenshinImpact.GameTask;
using BetterGenshinImpact.GameTask.Common;
using BetterGenshinImpact.GameTask.Model.Area;
using Microsoft.Extensions.Logging;
using OpenCvSharp;
using static BetterGenshinImpact.GameTask.Common.TaskControl;
namespace BetterGenshinImpact.Core.BgiVision;
/// <summary>
/// 针对 Region 体系的包装
/// </summary>
public class BvLocator
{
private static readonly ILogger Logger = App.GetLogger<BvLocator>();
private readonly CancellationToken _cancellationToken;
public RecognitionObject RecognitionObject { get; }
public Action<List<Region>>? RetryAction { get; set; }
public static int DefaultTimeout { get; set; } = 10000;
public static int DefaultRetryInterval { get; set; } = 250;
public BvLocator(RecognitionObject recognitionObject, CancellationToken cancellationToken)
{
RecognitionObject = recognitionObject.Clone();
_cancellationToken = cancellationToken;
}
/// <summary>
/// 根据传入的位置信息定位元素
/// 不建议外部调用使用
/// </summary>
/// <returns></returns>
/// <exception cref="NotSupportedException"></exception>
public List<Region> FindAll()
{
using var screen = CaptureToRectArea();
if (RecognitionObject.RecognitionType == RecognitionTypes.TemplateMatch)
{
var region = screen.Find(RecognitionObject);
if (region.IsExist())
{
return [region];
}
return [];
}
else if (RecognitionObject.RecognitionType == RecognitionTypes.Ocr)
{
var results = screen.FindMulti(RecognitionObject);
if (!string.IsNullOrEmpty(RecognitionObject.Text))
{
return results.FindAll(r => r.Text.Contains(RecognitionObject.Text));
}
return results;
}
else
{
throw new NotSupportedException($"不被 Locator 支持的识别类型: {RecognitionObject.RecognitionType}");
}
}
public bool IsExist()
{
return FindAll().Count > 0;
}
public async Task<Region> Click(int? timeout = null)
{
return (await WaitFor(timeout)).First().Click();
}
public async Task<Region> ClickUntilDisappears(int? timeout = null)
{
var region = (await WaitFor(timeout)).First().Click();
await new BvLocator(RecognitionObject, _cancellationToken)
.WithRetryAction(resList => { resList.First().Click(); }).WaitForDisappear();
return region;
}
public async Task<Region> DoubleClick(int? timeout = null)
{
var list = await WaitFor(timeout);
return list.First().DoubleClick();
}
public async Task<List<Region>> WaitFor(int? timeout = null)
{
var actualTimeout = timeout ?? DefaultTimeout;
var retryCount = actualTimeout / DefaultRetryInterval;
List<Region> results = [];
var retryRes = await NewRetry.WaitForAction(() =>
{
results = FindAll();
var b = results.Count > 0;
RetryAction?.Invoke(results);
return b;
}, _cancellationToken, retryCount, DefaultRetryInterval);
if (retryRes)
{
return results;
}
else
{
throw BuildTimeoutException(actualTimeout);
}
}
private TimeoutException BuildTimeoutException(int actualTimeout)
{
if (RecognitionObject.RecognitionType == RecognitionTypes.Ocr)
{
return new TimeoutException($"识别文字[{RecognitionObject.Text}]在 {actualTimeout}ms 后超时未出现!");
}
else if (RecognitionObject.RecognitionType == RecognitionTypes.TemplateMatch)
{
return new TimeoutException($"识别图像[{RecognitionObject.Name}]在 {actualTimeout}ms 后超时未出现!");
}
else
{
return new TimeoutException($"识别元素在 {actualTimeout}ms 后超时未出现!");
}
}
public async Task<List<Region>> TryWaitFor(int? timeout = null)
{
try
{
return await WaitFor(timeout);
}
catch
{
return [];
}
}
public async Task WaitForDisappear(int? timeout = null)
{
var actualTimeout = timeout ?? DefaultTimeout;
var retryCount = actualTimeout / DefaultRetryInterval;
var retryRes = await NewRetry.WaitForAction(() =>
{
var results = FindAll();
var b = results.Count == 0;
if (!b)
{
RetryAction?.Invoke(results);
}
return b;
}, _cancellationToken, retryCount, DefaultRetryInterval);
if (!retryRes)
{
throw new TimeoutException($"识别元素在 {actualTimeout}ms 后超时未消失!");
}
}
public async Task TryWaitForDisappear(int? timeout = null)
{
try
{
await WaitForDisappear(timeout);
}
catch
{
// ignored
}
}
/// <summary>
/// 方便优雅的设置感兴趣区域 (ROI)
/// 该方法会覆盖 RecognitionObject.RegionOfInterest 的值。
/// </summary>
/// <param name="rect"></param>
/// <returns></returns>
public BvLocator WithRoi(Rect rect)
{
RecognitionObject.RegionOfInterest = rect;
return this;
}
public BvLocator WithRoi(Func<Rect, Rect> deltaFunc)
{
var captureAreaRect = TaskContext.Instance().SystemInfo.ScaleMax1080PCaptureRect;
var rect = deltaFunc(captureAreaRect);
RecognitionObject.RegionOfInterest = rect;
return this;
}
public BvLocator WithRetryAction(Action<List<Region>>? action)
{
RetryAction = action;
return this;
}
}
@@ -0,0 +1,121 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using BetterGenshinImpact.Core.Recognition;
using BetterGenshinImpact.Core.Simulator;
using BetterGenshinImpact.GameTask.Common;
using BetterGenshinImpact.GameTask.Model.Area;
using Fischless.WindowsInput;
using Microsoft.Extensions.Logging;
using OpenCvSharp;
namespace BetterGenshinImpact.Core.BgiVision;
public class BvPage
{
private static readonly ILogger Logger = App.GetLogger<BvPage>();
private readonly CancellationToken _cancellationToken;
public IKeyboardSimulator Keyboard => Simulation.SendInput.Keyboard;
public IMouseSimulator Mouse => Simulation.SendInput.Mouse;
/// <summary>
/// Default timeout for operations in milliseconds
/// </summary>
public int DefaultTimeout { get; set; } = 10000;
/// <summary>
/// Default retry interval in milliseconds
/// </summary>
public int DefaultRetryInterval { get; set; } = 1000;
public BvPage(CancellationToken cancellationToken = default)
{
_cancellationToken = cancellationToken;
}
/// <summary>
/// 截图
/// </summary>
/// <returns></returns>
public ImageRegion Screenshot()
{
return TaskControl.CaptureToRectArea();
}
/// <summary>
/// 等待
/// </summary>
/// <param name="milliseconds"></param>
/// <returns></returns>
public async Task<BvPage> Wait(int milliseconds)
{
await TaskControl.Delay(milliseconds, _cancellationToken);
return this;
}
/// <summary>
/// 定位图片位置
/// </summary>
/// <param name="image"></param>
/// <returns></returns>
public BvLocator Locator(BvImage image)
{
return new BvLocator(image.ToRecognitionObject(), _cancellationToken);
}
/// <summary>
/// 定位文本位置
/// </summary>
/// <param name="text"></param>
/// <param name="rect"></param>
/// <returns></returns>
public BvLocator Locator(string text, Rect rect = default)
{
return Locator(new RecognitionObject
{
RecognitionType = RecognitionTypes.Ocr,
RegionOfInterest = rect,
Text = text
});
}
/// <summary>
/// 定位 RecognitionObject 代表的位置
/// </summary>
/// <param name="ro"></param>
/// <returns></returns>
public BvLocator Locator(RecognitionObject ro)
{
return new BvLocator(ro, _cancellationToken);
}
public BvLocator GetByText(string text = "", Rect rect = default)
{
return Locator(text, rect);
}
public BvLocator GetByImage(BvImage image)
{
return Locator(image);
}
public List<Region> Ocr(Rect rect = default)
{
return Locator(string.Empty, rect).FindAll();
}
/// <summary>
/// 1080P 分辨率下点击坐标
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
public void Click(double x, double y)
{
GameCaptureRegion.GameRegion1080PPosClick(x, y);
}
}
@@ -0,0 +1,300 @@
using BetterGenshinImpact.GameTask;
using BetterGenshinImpact.GameTask.AutoDomain;
using BetterGenshinImpact.GameTask.AutoFight;
using BetterGenshinImpact.GameTask.AutoFishing;
using BetterGenshinImpact.GameTask.AutoGeniusInvokation;
using BetterGenshinImpact.GameTask.AutoPick;
using BetterGenshinImpact.GameTask.AutoSkip;
using BetterGenshinImpact.GameTask.AutoWood;
using BetterGenshinImpact.GameTask.AutoMusicGame;
using BetterGenshinImpact.GameTask.QuickTeleport;
using BetterGenshinImpact.Service.Notification;
using CommunityToolkit.Mvvm.ComponentModel;
using Fischless.GameCapture;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using BetterGenshinImpact.GameTask.AutoTrackPath;
using BetterGenshinImpact.GameTask.AutoArtifactSalvage;
using BetterGenshinImpact.GameTask.AutoStygianOnslaught;
using BetterGenshinImpact.GameTask.GetGridIcons;
using BetterGenshinImpact.GameTask.AutoEat;
using BetterGenshinImpact.GameTask.AutoLeyLineOutcrop;
using BetterGenshinImpact.GameTask.AutoCook;
using BetterGenshinImpact.GameTask.MapMask;
using BetterGenshinImpact.GameTask.SkillCd;
using BetterGenshinImpact.GameTask.UseRedeemCode;
namespace BetterGenshinImpact.Core.Config;
/// <summary>
/// 更好的原神配置
/// </summary>
[Serializable]
public partial class AllConfig : ObservableObject
{
/// <summary>
/// 窗口捕获的方式
/// </summary>
[ObservableProperty]
private string _captureMode = CaptureModes.BitBlt.ToString();
/// <summary>
/// 详细的错误日志
/// </summary>
[ObservableProperty]
private bool _detailedErrorLogs;
/// <summary>
/// 不展示新版本提示的最新版本
/// </summary>
[ObservableProperty]
private string _notShowNewVersionNoticeEndVersion = "";
/// <summary>
/// 触发器触发频率(ms)
/// </summary>
[ObservableProperty]
private int _triggerInterval = 50;
// /// <summary>
// /// WGC使用位图缓存
// /// 高帧率情况下,可能会导致卡顿
// /// 云原神可能会出现黑屏
// /// </summary>
// [ObservableProperty]
// private bool _wgcUseBitmapCache = true;
/// <summary>
/// 自动修复Win11下BitBlt截图方式不可用的问题
/// </summary>
[ObservableProperty]
private bool _autoFixWin11BitBlt = true;
// /// <summary>
// /// 推理使用的设备
// /// </summary>
// [ObservableProperty]
// private string _inferenceDevice = "CPU";
[ObservableProperty]
private List<ValueTuple<string, int, string, string>> _nextScheduledTask = [];
/// <summary>
/// 连续执行任务时,从此任务开始执行
/// </summary>
[JsonIgnore]
public string NextScriptGroupName { get; set; }= string.Empty;
/// <summary>
/// 一条龙选中使用的配置
/// </summary>
[ObservableProperty]
private string _selectedOneDragonFlowConfigName = string.Empty;
/// <summary>
/// 遮罩窗口配置
/// </summary>
public MaskWindowConfig MaskWindowConfig { get; set; } = new();
/// <summary>
/// 通用配置
/// </summary>
public CommonConfig CommonConfig { get; set; } = new();
/// <summary>
/// 原神启动配置
/// </summary>
public GenshinStartConfig GenshinStartConfig { get; set; } = new();
/// <summary>
/// 自动拾取配置
/// </summary>
public AutoPickConfig AutoPickConfig { get; set; } = new();
/// <summary>
/// 自动剧情配置
/// </summary>
public AutoSkipConfig AutoSkipConfig { get; set; } = new();
/// <summary>
/// 自动钓鱼配置
/// </summary>
public AutoFishingConfig AutoFishingConfig { get; set; } = new();
/// <summary>
/// 快速传送配置
/// </summary>
public QuickTeleportConfig QuickTeleportConfig { get; set; } = new();
/// <summary>
/// 自动打牌配置
/// </summary>
public AutoGeniusInvokationConfig AutoGeniusInvokationConfig { get; set; } = new();
/// <summary>
/// 自动伐木配置
/// </summary>
public AutoWoodConfig AutoWoodConfig { get; set; } = new();
/// <summary>
/// 自动战斗配置
/// </summary>
public AutoFightConfig AutoFightConfig { get; set; } = new();
/// <summary>
/// 自动乐曲配置 - 千音雅集
/// </summary>
public AutoMusicGameConfig AutoMusicGameConfig { get; set; } = new();
/// <summary>
/// 自动秘境配置
/// </summary>
public AutoDomainConfig AutoDomainConfig { get; set; } = new();
/// <summary>
/// 自动秘境配置
/// </summary>
public AutoStygianOnslaughtConfig AutoStygianOnslaughtConfig { get; set; } = new();
/// <summary>
/// 自动分解圣遗物配置
/// </summary>
public AutoArtifactSalvageConfig AutoArtifactSalvageConfig { get; set; } = new();
/// <summary>
/// 自动吃药配置
/// </summary>
public AutoEatConfig AutoEatConfig { get; set; } = new();
/// <summary>
/// 自动地脉花配置
/// </summary>
public AutoLeyLineOutcropConfig AutoLeyLineOutcropConfig { get; set; } = new();
public AutoCookConfig AutoCookConfig { get; set; } = new();
/// <summary>
/// 地图遮罩
/// </summary>
public MapMaskConfig MapMaskConfig { get; set; } = new();
/// <summary>
/// 技能 CD 提示
/// </summary>
public SkillCdConfig SkillCdConfig { get; set; } = new();
/// <summary>
/// 自动使用
/// </summary>
public AutoRedeemCodeConfig AutoRedeemCodeConfig { get; set; } = new();
/// <summary>
/// 截取物品图标配置
/// </summary>
public GetGridIconsConfig GetGridIconsConfig { get; set; } = new();
/// <summary>
/// 宏配置
/// </summary>
public MacroConfig MacroConfig { get; set; } = new();
public RecordConfig RecordConfig { get; set; } = new();
/// <summary>
/// 脚本配置
/// </summary>
public ScriptConfig ScriptConfig { get; set; } = new();
/// <summary>
/// 地图追踪配置
/// </summary>
public PathingConditionConfig PathingConditionConfig { get; set; } = PathingConditionConfig.Default;
/// <summary>
/// 快捷键配置
/// </summary>
public HotKeyConfig HotKeyConfig { get; set; } = new();
/// <summary>
/// 通知配置
/// </summary>
public NotificationConfig NotificationConfig { get; set; } = new();
/// <summary>
/// 原神按键绑定配置
/// </summary>
public KeyBindingsConfig KeyBindingsConfig { get; set; } = new();
/// <summary>
/// 其他配置
/// </summary>
public OtherConfig OtherConfig { get; set; } = new();
/// <summary>
/// 传送相关配置
/// </summary>
public TpConfig TpConfig { get; set; } = new();
/// <summary>
/// 开发者配置
/// </summary>
public DevConfig DevConfig { get; set; } = new();
/// <summary>
/// 硬件加速设置
/// </summary>
public HardwareAccelerationConfig HardwareAccelerationConfig { get; set; } = new();
[JsonIgnore]
public Action? OnAnyChangedAction { get; set; }
public void InitEvent()
{
PropertyChanged += OnAnyPropertyChanged;
MaskWindowConfig.PropertyChanged += OnAnyPropertyChanged;
CommonConfig.PropertyChanged += OnAnyPropertyChanged;
GenshinStartConfig.PropertyChanged += OnAnyPropertyChanged;
NotificationConfig.PropertyChanged += OnAnyPropertyChanged;
NotificationConfig.PropertyChanged += OnNotificationPropertyChanged;
KeyBindingsConfig.PropertyChanged += OnAnyPropertyChanged;
AutoPickConfig.PropertyChanged += OnAnyPropertyChanged;
AutoSkipConfig.PropertyChanged += OnAnyPropertyChanged;
AutoFishingConfig.PropertyChanged += OnAnyPropertyChanged;
QuickTeleportConfig.PropertyChanged += OnAnyPropertyChanged;
MacroConfig.PropertyChanged += OnAnyPropertyChanged;
HotKeyConfig.PropertyChanged += OnAnyPropertyChanged;
AutoWoodConfig.PropertyChanged += OnAnyPropertyChanged;
AutoFightConfig.PropertyChanged += OnAnyPropertyChanged;
AutoDomainConfig.PropertyChanged += OnAnyPropertyChanged;
AutoStygianOnslaughtConfig.PropertyChanged += OnAnyPropertyChanged;
AutoArtifactSalvageConfig.PropertyChanged += OnAnyPropertyChanged;
AutoRedeemCodeConfig.PropertyChanged += OnAnyPropertyChanged;
AutoEatConfig.PropertyChanged += OnAnyPropertyChanged;
AutoLeyLineOutcropConfig.PropertyChanged += OnAnyPropertyChanged;
AutoCookConfig.PropertyChanged += OnAnyPropertyChanged;
MapMaskConfig.PropertyChanged += OnAnyPropertyChanged;
AutoMusicGameConfig.PropertyChanged += OnAnyPropertyChanged;
TpConfig.PropertyChanged += OnAnyPropertyChanged;
ScriptConfig.PropertyChanged += OnAnyPropertyChanged;
PathingConditionConfig.PropertyChanged += OnAnyPropertyChanged;
DevConfig.PropertyChanged += OnAnyPropertyChanged;
HardwareAccelerationConfig.PropertyChanged += OnAnyPropertyChanged;
SkillCdConfig.PropertyChanged += OnAnyPropertyChanged;
}
public void OnAnyPropertyChanged(object? sender, EventArgs args)
{
GameTaskManager.RefreshTriggerConfigs();
OnAnyChangedAction?.Invoke();
}
public void OnNotificationPropertyChanged(object? sender, PropertyChangedEventArgs args)
{
NotificationService.Instance().RefreshNotifiers();
}
}
@@ -0,0 +1,83 @@
using BetterGenshinImpact.Helpers;
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using Wpf.Ui.Controls;
namespace BetterGenshinImpact.Core.Config;
/// <summary>
/// 主题类型配置
/// </summary>
public enum ThemeType
{
DarkNone,
DarkMica,
DarkAcrylic,
LightNone,
LightMica,
LightAcrylic,
}
/// <summary>
/// 遮罩窗口配置
/// </summary>
[Serializable]
public partial class CommonConfig : ObservableObject
{
/// <summary>
/// 是否启用遮罩窗口
/// </summary>
[ObservableProperty]
private bool _screenshotEnabled;
/// <summary>
/// UID遮盖是否启用
/// </summary>
[ObservableProperty]
private bool _screenshotUidCoverEnabled = true;
/// <summary>
/// 退出时最小化至托盘
/// </summary>
[ObservableProperty]
private bool _exitToTray;
/// <summary>
/// 当前主题类型(新版主题)
/// </summary>
[ObservableProperty]
private ThemeType _currentThemeType = OsVersionHelper.IsWindows11_22523_OrGreater ? ThemeType.DarkMica : ThemeType.DarkNone;
/// <summary>
/// 主题(旧版主题,兼容性保留)
/// </summary>
[ObservableProperty]
private WindowBackdropType _currentBackdropType = WindowBackdropType.Mica;
/// <summary>
/// 是否是第一次运行
/// </summary>
[ObservableProperty]
private bool _isFirstRun = true;
/// <summary>
/// 这个版本是否运行过
/// </summary>
[ObservableProperty]
private string _runForVersion = string.Empty;
/// <summary>
/// 一个设备只运行一次的已运行设备ID列表
/// </summary>
[ObservableProperty]
private List<string> _onceHadRunDeviceIdList = new();
/// <summary>
/// 当前看过的兑换码推送版本
/// </summary>
[ObservableProperty]
private string _redeemCodeFeedsUpdateVersion = "20251013";
}
@@ -0,0 +1,16 @@
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using BetterGenshinImpact.GameTask.Common.Map.Maps.Base;
namespace BetterGenshinImpact.Core.Config;
/// <summary>
/// 脚本配置
/// </summary>
[Serializable]
public partial class DevConfig : ObservableObject
{
// 录制地图名称
[ObservableProperty]
private string _recordMapName = MapTypes.Teyvat.ToString();
}
@@ -0,0 +1,56 @@
using CommunityToolkit.Mvvm.ComponentModel;
using System;
namespace BetterGenshinImpact.Core.Config;
/// <summary>
/// 原神启动配置
/// </summary>
[Serializable]
public partial class GenshinStartConfig : ObservableObject
{
// /// <summary>
// /// 自动点击月卡
// /// </summary>
// [ObservableProperty]
// private bool _autoClickBlessingOfTheWelkinMoonEnabled;
/// <summary>
/// 自动进入游戏(开门)
/// </summary>
[ObservableProperty]
private bool _autoEnterGameEnabled = true;
/// <summary>
/// 原神启动参数
/// </summary>
[ObservableProperty]
private string _genshinStartArgs = "";
/// <summary>
/// 原神安装路径
/// </summary>
[ObservableProperty]
private string _installPath = "";
/// <summary>
/// 联动启动原神本体
/// </summary>
[ObservableProperty]
private bool _linkedStartEnabled = true;
/// <summary>
/// 使用Starward同步记录时间
/// </summary>
[ObservableProperty]
private bool _recordGameTimeEnabled = false;
[ObservableProperty]
private bool _startGameWithCmd = false;
/// <summary>
/// 启动前自动关闭原神 HDR(删除原神 HDR 对应注册表键)
/// </summary>
[ObservableProperty]
private bool _autoDisableGenshinHdrEnabled = true;
}
+77 -10
View File
@@ -1,19 +1,86 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
using System.Text.Json;
using System.Text.Json.Serialization;
using Semver;
namespace BetterGenshinImpact.Core.Config
namespace BetterGenshinImpact.Core.Config;
public class Global
{
public class Global
{
public static string StartUpPath { get; private set; } = AppDomain.CurrentDomain.BaseDirectory;
public static string Version { get; } = Assembly.GetEntryAssembly()?.
GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.
InformationalVersion!;
public static string Absolute(string relativePath)
public static string StartUpPath { get; set; } = AppContext.BaseDirectory;
public static readonly JsonSerializerOptions ManifestJsonOptions = new()
{
NumberHandling = JsonNumberHandling.AllowNamedFloatingPointLiterals,
Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower,
WriteIndented = true,
AllowTrailingCommas = true,
ReadCommentHandling = JsonCommentHandling.Skip,
};
public static string Absolute(string relativePath)
{
return Path.Combine(StartUpPath, relativePath);
}
public static string ScriptPath()
{
return Absolute("User\\JsScript");
}
public static string? ReadAllTextIfExist(string relativePath)
{
var path = Absolute(relativePath);
if (File.Exists(path)) return File.ReadAllText(path);
return null;
}
/// <summary>
/// 新获取到的版本号与当前版本号比较,判断是否为新版本
/// </summary>
/// <param name="currentVersion">新获取到的版本</param>
/// <returns></returns>
public static bool IsNewVersion(string currentVersion)
{
return IsNewVersion(Version, currentVersion);
}
/// <summary>
/// 新获取到的版本号与当前版本号比较,判断是否为新版本
/// </summary>
/// <param name="oldVersion">老版本</param>
/// <param name="currentVersion">新获取到的版本</param>
/// <returns>是否需要更新</returns>
public static bool IsNewVersion(string oldVersion, string currentVersion)
{
try
{
return Path.Combine(StartUpPath, relativePath);
var oldVersionX = SemVersion.Parse(oldVersion);
var currentVersionX = SemVersion.Parse(currentVersion);
if (currentVersionX.CompareSortOrderTo(oldVersionX) > 0)
// 需要更新
return true;
}
catch
{
///
}
// 不需要更新
return false;
}
public static void WriteAllText(string relativePath, string blackListJson)
{
var path = Absolute(relativePath);
File.WriteAllText(path, blackListJson);
}
}
@@ -0,0 +1,90 @@
using System;
using BetterGenshinImpact.Core.Recognition.ONNX;
using CommunityToolkit.Mvvm.ComponentModel;
namespace BetterGenshinImpact.Core.Config;
[Serializable]
public partial class HardwareAccelerationConfig : ObservableObject
{
/// <summary>
/// 推理使用的设备。默认CPU
/// </summary>
[ObservableProperty]
private InferenceDeviceType _inferenceDevice = InferenceDeviceType.Cpu;
/// <summary>
/// 是否强制OCR使用CPU推理。在某些环境上使用GPU进行OCR推理会导致性能下降(比如很多使用DirectML推理的情况下)。默认开启。
/// </summary>
[ObservableProperty]
private bool _cpuOcr = true;
#region 一般GPU加速设置
/// <summary>
/// 强制指定gpu设备,默认为0(使用默认设备)
/// </summary>
[ObservableProperty]
private int _gpuDevice = 0;
/// <summary>
/// 附加path,用;分割。默认为空。
/// </summary>
[ObservableProperty]
private string _additionalPath = "";
/// <summary>
/// 是否输出优化后的模型文件到缓存。注意:在不支持的执行器上使用会导致异常。默认关闭。
/// </summary>
[ObservableProperty]
private bool _optimizedModel = false;
#endregion
#region cuda设置
/// <summary>
/// 强制指定cuda设备,默认为0(使用默认设备)
/// </summary>
[ObservableProperty]
private int _cudaDevice = 0;
/// <summary>
/// 自动附加cuda的path。一般情况下用这个就足够了。默认关闭。
/// </summary>
[ObservableProperty]
private bool _autoAppendCudaPath = false;
#endregion
#region TensorRT缓存设置
/// <summary>
/// 启用TensorRT缓存。默认开启。不开的话使用TensorRT每次加载模型会卡爆。
/// </summary>
[ObservableProperty]
private bool _enableTensorRtCache = true;
/// <summary>
/// 嵌入式引擎缓存。将引擎缓存嵌入到模型中。默认开启。关闭它可能会提高性能(如果不爆炸的话)。
/// </summary>
[ObservableProperty]
private bool _embedTensorRtCache = true;
#endregion
#region OpenVINO设置
/// <summary>
/// OpenVino 设备参数。
/// </summary>
[ObservableProperty]
private string _openVinoDevice = "AUTO:GPU,CPU";
/// <summary>
/// 启用 OpenVINO 缓存。默认关闭。
/// </summary>
[ObservableProperty]
private bool _enableOpenVinoCache = false;
#endregion
}
@@ -0,0 +1,261 @@
using BetterGenshinImpact.Model;
using CommunityToolkit.Mvvm.ComponentModel;
using System;
namespace BetterGenshinImpact.Core.Config;
/// <summary>
/// 格式必须是 快捷键 与 快捷键Type
/// </summary>
[Serializable]
public partial class HotKeyConfig : ObservableObject
{
[ObservableProperty]
private string _autoTrackHotkey = "";
[ObservableProperty]
private string _autoTrackHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
[ObservableProperty]
private string _autoDomainHotkey = "";
[ObservableProperty]
private string _autoDomainHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
[ObservableProperty]
private string _autoFightHotkey = "";
[ObservableProperty]
private string _autoFightHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
[ObservableProperty]
private string _autoFishingEnabledHotkey = "";
[ObservableProperty]
private string _autoFishingEnabledHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
[ObservableProperty]
private string _autoGeniusInvokationHotkey = "";
[ObservableProperty]
private string _autoGeniusInvokationHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
[ObservableProperty]
private string _autoPickEnabledHotkey = "";
[ObservableProperty]
private string _autoPickEnabledHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
[ObservableProperty]
private string _autoSkipEnabledHotkey = "";
[ObservableProperty]
private string _autoSkipEnabledHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
[ObservableProperty]
private string _autoSkipHangoutEnabledHotkey = "";
[ObservableProperty]
private string _autoSkipHangoutEnabledHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
[ObservableProperty]
private string _autoWoodHotkey = "";
[ObservableProperty]
private string _autoWoodHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
[ObservableProperty]
private string _bgiEnabledHotkey = "F11";
[ObservableProperty]
private string _bgiEnabledHotkeyType = HotKeyTypeEnum.GlobalRegister.ToString();
[ObservableProperty]
private string _enhanceArtifactHotkey = "";
[ObservableProperty]
private string _enhanceArtifactHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
[ObservableProperty]
private string _quickBuyHotkey = "";
[ObservableProperty]
private string _quickBuyHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
[ObservableProperty]
private string _quickSereniteaPotHotkey = "";
[ObservableProperty]
private string _quickSereniteaPotHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
[ObservableProperty]
private string _quickTeleportEnabledHotkey = "";
[ObservableProperty]
private string _quickTeleportEnabledHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 快捷传送触发
[ObservableProperty]
private string _quickTeleportTickHotkey = "";
[ObservableProperty]
private string _quickTeleportTickHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 技能CD提示开关
[ObservableProperty]
private string _skillCdEnabledHotkey = "";
[ObservableProperty]
private string _skillCdEnabledHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 截图
[ObservableProperty]
private string _takeScreenshotHotkey = "";
[ObservableProperty]
private string _takeScreenshotHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
[ObservableProperty]
private string _turnAroundHotkey = "";
[ObservableProperty]
private string _turnAroundHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 点击确认按钮
[ObservableProperty]
private string _clickGenshinConfirmButtonHotkey = "";
[ObservableProperty]
private string _clickGenshinConfirmButtonHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 点击取消按钮
[ObservableProperty]
private string _clickGenshinCancelButtonHotkey = "";
[ObservableProperty]
private string _clickGenshinCancelButtonHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 一键战斗宏
[ObservableProperty]
private string _oneKeyFightHotkey = "";
[ObservableProperty]
private string _oneKeyFightHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 地图路线录制开始/停止
[ObservableProperty]
private string _mapPosRecordHotkey = "";
[ObservableProperty]
private string _mapPosRecordHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 活动音游开始/停止
[ObservableProperty]
private string _autoMusicGameHotkey = "";
[ObservableProperty]
private string _autoMusicGameHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 活动音游开始/停止
[ObservableProperty]
private string _autoFishingGameHotkey = "";
[ObservableProperty]
private string _autoFishingGameHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 自动烹饪开始/停止
[ObservableProperty]
private string _autoCookGameHotkey = "";
[ObservableProperty]
private string _autoCookGameHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 自动寻路
[ObservableProperty]
private string _autoTrackPathHotkey = "";
[ObservableProperty]
private string _autoTrackPathHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 测试
[ObservableProperty]
private string _test1Hotkey = "";
[ObservableProperty]
private string _test1HotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 测试2
[ObservableProperty]
private string _test2Hotkey = "";
[ObservableProperty]
private string _test2HotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 路径记录开始
[ObservableProperty]
private string _recBigMapPosHotkey = "";
[ObservableProperty]
private string _recBigMapPosHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 路径记录开始
[ObservableProperty]
private string _pathRecorderHotkey = "";
[ObservableProperty]
private string _pathRecorderHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 添加路径记录点
[ObservableProperty]
private string _addWaypointHotkey = "";
[ObservableProperty]
private string _addWaypointHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 路径执行
[ObservableProperty]
private string _executePathHotkey = "";
[ObservableProperty]
private string _executePathHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 日志与状态窗口展示
[ObservableProperty]
private string _logBoxDisplayHotkey = "";
[ObservableProperty]
private string _logBoxDisplayHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 键鼠录制/停止
[ObservableProperty]
private string _keyMouseMacroRecordHotkey = "";
[ObservableProperty]
private string _keyMouseMacroRecordHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 暂停
[ObservableProperty]
private string _suspendHotkey = "";
[ObservableProperty]
private string _suspendHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 停止任意独立任务
[ObservableProperty]
private string _cancelTaskHotkey = "";
[ObservableProperty]
private string _cancelTaskHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 停止任意独立任务
[ObservableProperty]
private string _onedragonHotkey = "";
[ObservableProperty]
private string _onedragonHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
// 地图遮罩开关
[ObservableProperty]
private string _mapMaskEnabledHotkey = "";
[ObservableProperty]
private string _mapMaskEnabledHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
}
@@ -0,0 +1,970 @@
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Windows.Forms;
using System.Windows.Input;
using Windows.Networking.PushNotifications;
using static Vanara.PInvoke.User32;
namespace BetterGenshinImpact.Core.Config;
/// <summary>
/// 原神按键绑定配置
/// </summary>
[Serializable]
public partial class KeyBindingsConfig:ObservableObject
{
/// <summary>
/// 是否启用全局按键映射
/// </summary>
[ObservableProperty]
private bool _globalKeyMappingEnabled = false;
#region Actions(操作)
/// <summary>
/// 向前移动
/// </summary>
[ObservableProperty]
private KeyId _moveForward = KeyId.W;
/// <summary>
/// 向后移动
/// </summary>
[ObservableProperty]
private KeyId _moveBackward = KeyId.S;
/// <summary>
/// 向左移动
/// </summary>
[ObservableProperty]
private KeyId _moveLeft = KeyId.A;
/// <summary>
/// 向右移动
/// </summary>
[ObservableProperty]
private KeyId _moveRight = KeyId.D;
/// <summary>
/// 切换走/跑;特定操作模式下向下移动
/// </summary>
[ObservableProperty]
private KeyId _switchToWalkOrRun = KeyId.LeftCtrl;
/// <summary>
/// 普通攻击
/// </summary>
[ObservableProperty]
private KeyId _normalAttack = KeyId.MouseLeftButton;
/// <summary>
/// 元素战技
/// </summary>
[ObservableProperty]
private KeyId _elementalSkill = KeyId.E;
/// <summary>
/// 元素爆发
/// </summary>
[ObservableProperty]
private KeyId _elementalBurst = KeyId.Q;
/// <summary>
/// 冲刺(键盘)
/// </summary>
[ObservableProperty]
private KeyId _sprintKeyboard = KeyId.LeftShift;
/// <summary>
/// 冲刺(鼠标)
/// </summary>
[ObservableProperty]
private KeyId _sprintMouse = KeyId.MouseRightButton;
/// <summary>
/// 切换瞄准模式
/// </summary>
[ObservableProperty]
private KeyId _switchAimingMode = KeyId.R;
/// <summary>
/// 跳跃;特定操作模式下向上移动
/// </summary>
[ObservableProperty]
private KeyId _jump = KeyId.Space;
/// <summary>
/// 落下
/// </summary>
[ObservableProperty]
private KeyId _drop = KeyId.X;
/// <summary>
/// 拾取/交互(自动拾取由AutoPick模块管理)
/// </summary>
[ObservableProperty]
private KeyId _pickUpOrInteract = KeyId.F;
/// <summary>
/// 快捷使用小道具
/// </summary>
[ObservableProperty]
private KeyId _quickUseGadget = KeyId.Z;
/// <summary>
/// 特定玩法内交互操作
/// </summary>
[ObservableProperty]
private KeyId _interactionInSomeMode = KeyId.T;
/// <summary>
/// 开启任务追踪
/// </summary>
[ObservableProperty]
private KeyId _questNavigation = KeyId.V;
/// <summary>
/// 中断挑战
/// </summary>
[ObservableProperty]
private KeyId _abandonChallenge = KeyId.P;
/// <summary>
/// 切换小队角色1
/// </summary>
[ObservableProperty]
private KeyId _switchMember1 = KeyId.D1;
/// <summary>
/// 切换小队角色2
/// </summary>
[ObservableProperty]
private KeyId _switchMember2 = KeyId.D2;
/// <summary>
/// 切换小队角色3
/// </summary>
[ObservableProperty]
private KeyId _switchMember3 = KeyId.D3;
/// <summary>
/// 切换小队角色4
/// </summary>
[ObservableProperty]
private KeyId _switchMember4 = KeyId.D4;
/// <summary>
/// 切换小队角色5
/// </summary>
[ObservableProperty]
private KeyId _switchMember5 = KeyId.D5;
/// <summary>
/// 呼出快捷轮盘
/// </summary>
[ObservableProperty]
private KeyId _shortcutWheel = KeyId.Tab;
#endregion
#region Menus(菜单)
/// <summary>
/// 打开背包
/// </summary>
[ObservableProperty]
private KeyId _openInventory = KeyId.B;
/// <summary>
/// 打开角色界面
/// </summary>
[ObservableProperty]
private KeyId _openCharacterScreen = KeyId.C;
/// <summary>
/// 打开地图
/// </summary>
[ObservableProperty]
private KeyId _openMap = KeyId.M;
/// <summary>
/// 打开派蒙界面
/// </summary>
[ObservableProperty]
private KeyId _openPaimonMenu = KeyId.Escape;
/// <summary>
/// 打开冒险之证界面
/// </summary>
[ObservableProperty]
private KeyId _openAdventurerHandbook = KeyId.F1;
/// <summary>
/// 打开多人游戏界面
/// </summary>
[ObservableProperty]
private KeyId _openCoOpScreen = KeyId.F2;
/// <summary>
/// 打开祈愿界面
/// </summary>
[ObservableProperty]
private KeyId _openWishScreen = KeyId.F3;
/// <summary>
/// 打开纪行界面
/// </summary>
[ObservableProperty]
private KeyId _openBattlePassScreen = KeyId.F4;
/// <summary>
/// 打开活动面板
/// </summary>
[ObservableProperty]
private KeyId _openTheEventsMenu = KeyId.F5;
/// <summary>
/// 打开玩法系统界面(尘歌壶内猫尾酒馆内)
/// </summary>
[ObservableProperty]
private KeyId _openTheSettingsMenu = KeyId.F6;
/// <summary>
/// 打开摆设界面(尘歌壶内)
/// </summary>
[ObservableProperty]
private KeyId _openTheFurnishingScreen = KeyId.F7;
/// <summary>
/// 打开星之归还(条件符合期间生效)
/// </summary>
[ObservableProperty]
private KeyId _openStellarReunion = KeyId.F8;
/// <summary>
/// 开关任务菜单
/// </summary>
[ObservableProperty]
private KeyId _openQuestMenu = KeyId.J;
/// <summary>
/// 打开通知详情
/// </summary>
[ObservableProperty]
private KeyId _openNotificationDetails = KeyId.Y;
/// <summary>
/// 打开聊天界面
/// </summary>
[ObservableProperty]
private KeyId _openChatScreen = KeyId.Enter;
/// <summary>
/// 打开特殊环境说明
/// </summary>
[ObservableProperty]
private KeyId _openSpecialEnvironmentInformation = KeyId.U;
/// <summary>
/// 查看教程详情
/// </summary>
[ObservableProperty]
private KeyId _checkTutorialDetails = KeyId.G;
/// <summary>
/// 长按打开元素视野
/// </summary>
[ObservableProperty]
private KeyId _elementalSight = KeyId.MouseMiddleButton;
/// <summary>
/// 呼出鼠标
/// </summary>
[ObservableProperty]
private KeyId _showCursor = KeyId.LeftAlt;
/// <summary>
/// 打开队伍配置界面
/// </summary>
[ObservableProperty]
private KeyId _openPartySetupScreen = KeyId.L;
/// <summary>
/// 打开好友界面
/// </summary>
[ObservableProperty]
private KeyId _openFriendsScreen = KeyId.O;
/// <summary>
/// 隐藏主界面
/// </summary>
[ObservableProperty]
private KeyId _hideUI = KeyId.Slash;
#endregion
}
public static class KeyIdConverter
{
/// <summary>
/// 将KeyId转换为字符串(可在后续支持多语言),按键名称的显示尽量与原神UI一致
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static string ToName(this KeyId value)
{
return ToChineseName(value);
}
private static string ToChineseName(KeyId value)
{
return value switch
{
// 需要单独翻译的按键
KeyId.None => "<未指定>",
KeyId.Unknown => "<未知>",
KeyId.MouseLeftButton => "鼠标左键",
KeyId.MouseRightButton => "鼠标右键",
KeyId.MouseMiddleButton => "鼠标中键",
KeyId.MouseSideButton1 => "鼠标侧键1",
KeyId.MouseSideButton2 => "鼠标侧键2",
KeyId.Apps => "菜单键",
// 无需单独翻译的部分
_ => EnglishKeyNameToChinese(value),
};
}
private static string EnglishKeyNameToChinese(KeyId value)
{
var engName = ToEnglishName(value);
if (engName.StartsWith("Left ") || engName.StartsWith("Right "))
{
return engName.Replace("Left ", "左").Replace("Right ", "右");
}
return engName;
}
private static string ToEnglishName(KeyId value)
{
return value switch
{
// 需要转换的部分
KeyId.None => "<None>",
KeyId.Unknown => "<Unknown>",
KeyId.MouseLeftButton => "Mouse LButton",
KeyId.MouseRightButton => "Mouse RButton",
KeyId.MouseMiddleButton => "Mouse MButton",
KeyId.MouseSideButton1 => "Mouse XButton1",
KeyId.MouseSideButton2 => "Mouse XButton2",
KeyId.Escape => "Esc",
KeyId.PageUp => "Page Up",
KeyId.PageDown => "Page Down",
KeyId.CapsLock => "Caps Lock",
KeyId.ScrollLock => "Scroll Lock",
KeyId.LeftShift => "Left Shift",
KeyId.RightShift => "Right Shift",
KeyId.LeftCtrl => "Left Ctrl",
KeyId.RightCtrl => "Right Ctrl",
KeyId.LeftAlt => "Left Alt",
KeyId.RightAlt => "Right Alt",
KeyId.LeftWin => "Left Win",
KeyId.RightWin => "Right Win",
KeyId.Apps => "Menu",
KeyId.Left => "←",
KeyId.Up => "↑",
KeyId.Right => "→",
KeyId.Down => "↓",
KeyId.D0 => "0",
KeyId.D1 => "1",
KeyId.D2 => "2",
KeyId.D3 => "3",
KeyId.D4 => "4",
KeyId.D5 => "5",
KeyId.D6 => "6",
KeyId.D7 => "7",
KeyId.D8 => "8",
KeyId.D9 => "9",
KeyId.Apostrophe => "'",
KeyId.Comma => ",",
KeyId.Minus => "-",
KeyId.Equal => "=",
KeyId.Period => ".",
KeyId.Slash => "/",
KeyId.Backslash => @"\",
KeyId.Semicolon => ";",
KeyId.LeftSquareBracket => "[",
KeyId.RightSquareBracket => "]",
KeyId.Tilde => "`",
KeyId.NumLock => "Num Lock",
KeyId.NumPad0 => "Num 0",
KeyId.NumPad1 => "Num 1",
KeyId.NumPad2 => "Num 2",
KeyId.NumPad3 => "Num 3",
KeyId.NumPad4 => "Num 4",
KeyId.NumPad5 => "Num 5",
KeyId.NumPad6 => "Num 6",
KeyId.NumPad7 => "Num 7",
KeyId.NumPad8 => "Num 8",
KeyId.NumPad9 => "Num 9",
KeyId.Decimal => "Num .",
KeyId.Divide => "Num /",
KeyId.Multiply => "Num *",
KeyId.Subtract => "Num -",
KeyId.Add => "Num +",
KeyId.NumEnter => "Num Enter",
// 默认使用枚举名
_ => value.ToString(),
};
}
/// <summary>
/// 将KeyId转换为VK
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static VK ToVK(this KeyId value)
{
return value switch
{
// 这两个值在VK中没有,抛异常
KeyId.None => throw new ArgumentOutOfRangeException(nameof(value), "未指定按键,无法转换为VK。"),
KeyId.Unknown => throw new ArgumentOutOfRangeException(nameof(value), "未知按键,无法转换为VK。"),
// 剩下的值相同,直接转
_ => (VK)value,
};
}
/// <summary>
/// 将KeyId转换为System.Windows.Input.Key
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static Key ToInputKey(this KeyId value)
{
// 部分按键名称相同,使用名称转换
try
{
return Enum.Parse<Key>(value.ToString());
}
catch
{
// 其他键使用查表法转换
return value switch
{
KeyId.LeftWin => Key.LWin,
KeyId.RightWin => Key.RWin,
KeyId.Apostrophe => Key.Oem7,
KeyId.Comma => Key.OemComma,
KeyId.Minus => Key.OemMinus,
KeyId.Equal => Key.OemPlus,
KeyId.Period => Key.OemPeriod,
KeyId.Slash => Key.Oem2,
KeyId.Semicolon => Key.Oem1,
KeyId.LeftSquareBracket => Key.Oem4,
KeyId.Backslash => Key.Oem5,
KeyId.RightSquareBracket => Key.Oem6,
KeyId.Tilde => Key.Oem3,
KeyId.Enter => Key.Enter,
KeyId.ScrollLock => Key.Scroll,
KeyId.PageUp => Key.Prior,
KeyId.PageDown => Key.Next,
KeyId.Backspace => Key.Back,
KeyId.CapsLock => Key.Capital,
// None、Unknown和鼠标按键抛异常
_ => throw new ArgumentOutOfRangeException(nameof(value)),
};
}
}
/// <summary>
/// 将KeyId转换为MouseButton
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
/// <exception cref="ArgumentOutOfRangeException"></exception>
public static MouseButton ToMouseButton(this KeyId value)
{
return value switch
{
KeyId.MouseLeftButton => MouseButton.Left,
KeyId.MouseRightButton => MouseButton.Right,
KeyId.MouseMiddleButton => MouseButton.Middle,
KeyId.MouseSideButton1 => MouseButton.XButton1,
KeyId.MouseSideButton2 => MouseButton.XButton2,
_ => throw new ArgumentOutOfRangeException(nameof(value), "键盘按键请使用ToInputKey方法"),
};
}
/// <summary>
/// [实验] 将KeyId转换为WinForm中的Keys(用于兼容按键连发功能)
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static Keys ToWinFormKeys(this KeyId value)
{
try
{
return Enum.Parse<Keys>(value.ToInputKey().ToString());
}
catch
{
return default;
}
}
/// <summary>
/// 将VK转换为KeyId
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static KeyId FromVK(VK value)
{
// 尝试通过VK的值获取KeyId的枚举名。若成功,表示对应的VK在KeyId支持的范围内,直接转换;否则返回Unknown
return string.IsNullOrEmpty(Enum.GetName(typeof(KeyId), value)) ? KeyId.Unknown : (KeyId)value;
}
/// <summary>
/// 将System.Windows.Input.Key转换为KeyId
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static KeyId FromInputKey(Key value)
{
// 部分按键名称相同,使用名称转换
try
{
return Enum.Parse<KeyId>(value.ToString());
}
catch
{
// 其他键使用查表法转换
return value switch
{
Key.LWin => KeyId.LeftWin,
Key.RWin => KeyId.RightWin,
Key.Oem7 => KeyId.Apostrophe,
Key.OemComma => KeyId.Comma,
Key.OemMinus => KeyId.Minus,
Key.OemPlus => KeyId.Equal,
Key.OemPeriod => KeyId.Period,
Key.Oem2 => KeyId.Slash,
Key.Oem1 => KeyId.Semicolon,
Key.Oem4 => KeyId.LeftSquareBracket,
Key.Oem5 => KeyId.Backslash,
Key.Oem6 => KeyId.RightSquareBracket,
Key.Oem3 => KeyId.Tilde,
Key.Enter => KeyId.Enter,
Key.Scroll => KeyId.ScrollLock,
Key.Prior => KeyId.PageUp,
Key.Next => KeyId.PageDown,
Key.Back => KeyId.Backspace,
Key.Capital => KeyId.CapsLock,
// 支持列表外的值返回Unknown
_ => KeyId.Unknown,
};
}
}
/// <summary>
/// 将MouseButton转换为KeyId
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static KeyId FromMouseButton(MouseButton value)
{
return value switch
{
MouseButton.Left => KeyId.MouseLeftButton,
MouseButton.Right => KeyId.MouseRightButton,
MouseButton.Middle => KeyId.MouseMiddleButton,
MouseButton.XButton1 => KeyId.MouseSideButton1,
MouseButton.XButton2 => KeyId.MouseSideButton2,
_ => KeyId.Unknown,
};
}
}
/// <summary>
/// 用于与VK/Windows.Input.Key解耦,值与VK对应,但是仅包含美式键盘(104键,不包括媒体控制等)和鼠标中的按键
/// </summary>
public enum KeyId
{
/// <summary>无</summary>
None = 0x00,
/// <summary>未知按键</summary>
Unknown = 0xFF,
#region 鼠标按键
/// <summary>鼠标左键</summary>
MouseLeftButton = 0x01,
/// <summary>鼠标右键</summary>
MouseRightButton = 0x02,
/// <summary>鼠标中键(滚轮)</summary>
MouseMiddleButton = 0x04,
/// <summary>鼠标侧键1(后退)</summary>
MouseSideButton1 = 0x05,
/// <summary>鼠标侧键2(前进)</summary>
MouseSideButton2 = 0x06,
#endregion
#region F键区
/// <summary>F1</summary>
F1 = 0x70,
/// <summary>F2</summary>
F2 = 0x71,
/// <summary>F3</summary>
F3 = 0x72,
/// <summary>F4</summary>
F4 = 0x73,
/// <summary>F5</summary>
F5 = 0x74,
/// <summary>F6</summary>
F6 = 0x75,
/// <summary>F7</summary>
F7 = 0x76,
/// <summary>F8</summary>
F8 = 0x77,
/// <summary>F9</summary>
F9 = 0x78,
/// <summary>F10</summary>
F10 = 0x79,
/// <summary>F11</summary>
F11 = 0x7A,
/// <summary>F12</summary>
F12 = 0x7B,
#endregion
#region 控制&功能键
/// <summary>Esc</summary>
Escape = 0x1B,
/// <summary>PrintScreen</summary>
PrintScreen = 0x2C,
/// <summary>ScrollLock</summary>
ScrollLock = 0x91,
/// <summary>Pause</summary>
Pause = 0x13,
/// <summary>Insert</summary>
Insert = 0x2D,
/// <summary>Delete</summary>
Delete = 0x2E,
/// <summary>Home</summary>
Home = 0x24,
/// <summary>End</summary>
End = 0x23,
/// <summary>Page Up</summary>
PageUp = 0x21,
/// <summary>Page Down</summary>
PageDown = 0x22,
/// <summary>Backspace退格</summary>
Backspace = 0x08,
/// <summary>Tab</summary>
Tab = 0x09,
/// <summary>Caps Lock大写锁定</summary>
CapsLock = 0x14,
/// <summary>Enter回车</summary>
Enter = 0x0D,
///// <summary>Shift</summary>
//Shift = 0x10,
/// <summary>左Shift</summary>
LeftShift = 0xA0,
/// <summary>右Shift</summary>
RightShift = 0xA1,
///// <summary>Ctrl</summary>
//Ctrl = 0x11,
/// <summary>左Ctrl</summary>
LeftCtrl = 0xA2,
/// <summary>右Ctrl</summary>
RightCtrl = 0xA3,
///// <summary>Alt</summary>
//Alt = 0x12,
/// <summary>左Alt</summary>
LeftAlt = 0xA4,
/// <summary>右Alt</summary>
RightAlt = 0xA5,
/// <summary>左Win键 (Microsoft Natural Keyboard)</summary>
LeftWin = 0x5B,
/// <summary>右Win键 (Microsoft Natural Keyboard)</summary>
RightWin = 0x5C,
/// <summary>菜单键 (Microsoft Natural Keyboard)</summary>
Apps = 0x5D,
/// <summary>Space空格键</summary>
Space = 0x20,
#endregion
#region 方向键
/// <summary>方向键 ←</summary>
Left = 0x25,
/// <summary>方向键 ↑</summary>
Up = 0x26,
/// <summary>方向键 →</summary>
Right = 0x27,
/// <summary>方向键 ↓</summary>
Down = 0x28,
#endregion
#region 字母区 - 字母
/// <summary>A</summary>
A = 0x41,
/// <summary>B</summary>
B = 0x42,
/// <summary>C</summary>
C = 0x43,
/// <summary>D</summary>
D = 0x44,
/// <summary>E</summary>
E = 0x45,
/// <summary>F</summary>
F = 0x46,
/// <summary>G</summary>
G = 0x47,
/// <summary>H</summary>
H = 0x48,
/// <summary>I</summary>
I = 0x49,
/// <summary>J</summary>
J = 0x4A,
/// <summary>K</summary>
K = 0x4B,
/// <summary>L</summary>
L = 0x4C,
/// <summary>M</summary>
M = 0x4D,
/// <summary>N</summary>
N = 0x4E,
/// <summary>O</summary>
O = 0x4F,
/// <summary>P</summary>
P = 0x50,
/// <summary>Q</summary>
Q = 0x51,
/// <summary>R</summary>
R = 0x52,
/// <summary>S</summary>
S = 0x53,
/// <summary>T</summary>
T = 0x54,
/// <summary>U</summary>
U = 0x55,
/// <summary>V</summary>
V = 0x56,
/// <summary>W</summary>
W = 0x57,
/// <summary>X</summary>
X = 0x58,
/// <summary>Y</summary>
Y = 0x59,
/// <summary>Z</summary>
Z = 0x5A,
#endregion
#region 字母区 - 数字
/// <summary>0</summary>
D0 = 0x30,
/// <summary>1</summary>
D1 = 0x31,
/// <summary>2</summary>
D2 = 0x32,
/// <summary>3</summary>
D3 = 0x33,
/// <summary>4</summary>
D4 = 0x34,
/// <summary>5</summary>
D5 = 0x35,
/// <summary>6</summary>
D6 = 0x36,
/// <summary>7</summary>
D7 = 0x37,
/// <summary>8</summary>
D8 = 0x38,
/// <summary>9</summary>
D9 = 0x39,
#endregion
#region 字母区 - 符号
/// <summary>引号 '</summary>
Apostrophe = 0xDE,
/// <summary>逗号 ,</summary>
Comma = 0xBC,
/// <summary>连接符 -</summary>
Minus = 0xBD,
/// <summary>等于号 =</summary>
Equal = 0xBB,
/// <summary>句号 .</summary>
Period = 0xBE,
/// <summary>斜杠 /</summary>
Slash = 0xBF,
/// <summary>反斜杠 \</summary>
Backslash = 0xE2,
/// <summary>分号 ;</summary>
Semicolon = 0xBA,
/// <summary>左方括号 [</summary>
LeftSquareBracket = 0xDB,
/// <summary>右方括号 ]</summary>
RightSquareBracket = 0xDD,
/// <summary>波浪号 `</summary>
Tilde = 0xC0,
#endregion
#region 小键盘区
/// <summary>Num Lock</summary>
NumLock = 0x90,
/// <summary>Num 0</summary>
NumPad0 = 0x60,
/// <summary>Num 1</summary>
NumPad1 = 0x61,
/// <summary>Num 2</summary>
NumPad2 = 0x62,
/// <summary>Num 3</summary>
NumPad3 = 0x63,
/// <summary>Num 4</summary>
NumPad4 = 0x64,
/// <summary>Num 5</summary>
NumPad5 = 0x65,
/// <summary>Num 6</summary>
NumPad6 = 0x66,
/// <summary>Num 7</summary>
NumPad7 = 0x67,
/// <summary>Num 8</summary>
NumPad8 = 0x68,
/// <summary>Num 9</summary>
NumPad9 = 0x69,
/// <summary>Num .</summary>
Decimal = 0x6E,
/// <summary>Num /</summary>
Divide = 0x6F,
/// <summary>Num *</summary>
Multiply = 0x6A,
/// <summary>Num -</summary>
Subtract = 0x6D,
/// <summary>Num +</summary>
Add = 0x6B,
/// <summary>Num Enter</summary>
NumEnter = 0x0E,
#endregion
}
@@ -0,0 +1,70 @@
using BetterGenshinImpact.GameTask.AutoFight;
using CommunityToolkit.Mvvm.ComponentModel;
using System;
namespace BetterGenshinImpact.Core.Config;
[Serializable]
public partial class MacroConfig : ObservableObject
{
/// <summary>
/// 高延迟下强化的额外等待时间
/// https://github.com/babalae/better-genshin-impact/issues/9
/// </summary>
[ObservableProperty]
private int _enhanceWaitDelay;
/// <summary>
/// F连发时间间隔
/// </summary>
[ObservableProperty]
private int _fFireInterval = 100;
/// <summary>
/// 长按F变F连发
/// </summary>
[ObservableProperty]
private bool _fPressHoldToContinuationEnabled;
/// <summary>
/// 转圈圈时间间隔
/// </summary>
[ObservableProperty]
private int _runaroundInterval = 10;
/// <summary>
/// 转圈圈鼠标右移长度
/// </summary>
[ObservableProperty]
private int _runaroundMouseXInterval = 500;
/// <summary>
/// 空格连发时间间隔
/// </summary>
[ObservableProperty]
private int _spaceFireInterval = 100;
/// <summary>
/// 长按空格变空格连发
/// </summary>
[ObservableProperty]
private bool _spacePressHoldToContinuationEnabled;
/// <summary>
/// 一键战斗宏启用状态
/// </summary>
[ObservableProperty]
private bool _combatMacroEnabled;
/// <summary>
/// 一键战斗宏快捷键模式
/// </summary>
[ObservableProperty]
private string _combatMacroHotkeyMode = OneKeyFightTask.HoldOnMode;
/// <summary>
/// 一键战斗宏优先级
/// </summary>
[ObservableProperty]
private int _combatMacroPriority = 1;
}
@@ -0,0 +1,98 @@
using CommunityToolkit.Mvvm.ComponentModel;
using OpenCvSharp;
using System;
namespace BetterGenshinImpact.Core.Config;
/// <summary>
/// 遮罩窗口配置
/// </summary>
[Serializable]
public partial class MaskWindowConfig : ObservableObject
{
/// <summary>
/// 方位提示是否启用
/// </summary>
[ObservableProperty]
private bool _directionsEnabled;
/// <summary>
/// 是否在遮罩窗口上显示识别结果
/// </summary>
[ObservableProperty]
private bool _displayRecognitionResultsOnMask = true;
/// <summary>
/// 是否启用遮罩窗口
/// </summary>
[ObservableProperty]
private bool _maskEnabled = true;
///// <summary>
///// 显示遮罩窗口边框
///// </summary>
//[ObservableProperty] private bool _showMaskBorder = false;
/// <summary>
/// 显示日志窗口
/// </summary>
[ObservableProperty]
private bool _showLogBox = true;
/// <summary>
/// 显示状态指示
/// </summary>
[ObservableProperty]
private bool _showStatus = true;
/// <summary>
/// UID遮盖是否启用
/// </summary>
[ObservableProperty]
private bool _uidCoverEnabled;
/// <summary>
/// 1080p下UID遮盖的位置与大小
/// </summary>
[NonSerialized]
public static readonly Rect UidCoverRightBottomRect = new(1920 - 1685, 1080 - 1053, 178, 22);
/// <summary>
/// 显示FPS
/// </summary>
[ObservableProperty]
private bool _showFps = false;
/// <summary>
/// 遮罩文本透明度 (0.0-1.0)
/// </summary>
[ObservableProperty]
private double _textOpacity = 1.0;
[ObservableProperty]
private bool _overlayLayoutEditEnabled = false;
[ObservableProperty]
private double _logTextBoxLeftRatio = 20.0 / 1920;
[ObservableProperty]
private double _logTextBoxTopRatio = 822.0 / 1080;
[ObservableProperty]
private double _logTextBoxWidthRatio = 480.0 / 1920;
[ObservableProperty]
private double _logTextBoxHeightRatio = 188.0 / 1080;
[ObservableProperty]
private double _statusListLeftRatio = 20.0 / 1920;
[ObservableProperty]
private double _statusListTopRatio = 790.0 / 1080;
[ObservableProperty]
private double _statusListWidthRatio = 480.0 / 1920;
[ObservableProperty]
private double _statusListHeightRatio = 24.0 / 1080;
}
@@ -0,0 +1,285 @@
using System;
using System.Collections.Generic;
using BetterGenshinImpact.GameTask;
using BetterGenshinImpact.GameTask.AutoLeyLineOutcrop;
using BetterGenshinImpact.Helpers;
using CommunityToolkit.Mvvm.ComponentModel;
namespace BetterGenshinImpact.Core.Config;
[Serializable]
public partial class OneDragonFlowConfig : ObservableObject
{
// 配置名
[ObservableProperty]
private string _name = string.Empty;
/// <summary>
/// 所有任务的开关状态
/// </summary>
public Dictionary<string, bool> TaskEnabledList { get; set; } = new();
// 合成树脂的国家
[ObservableProperty]
private string _craftingBenchCountry = "枫丹";
// 冒险者协会的国家
[ObservableProperty]
private string _adventurersGuildCountry = "枫丹";
// 自动战斗配置的队伍名称
[ObservableProperty]
private string _partyName = string.Empty;
// 自动战斗配置的策略名称
[ObservableProperty]
private string _domainName = string.Empty;
[ObservableProperty]
private bool _weeklyDomainEnabled = false;
// 领取每日奖励的好感队伍名称
[ObservableProperty]
private string _dailyRewardPartyName = string.Empty;
// 合成浓缩后保留原粹树脂的数量
[ObservableProperty]
private int _minResinToKeep = 0;
// 领取每日奖励的好感数量
[ObservableProperty]
private string _sundayEverySelectedValue = "0";
// 领取每日奖励的好感数量
[ObservableProperty]
private string _sundaySelectedValue = "0";
// 尘歌壶传送方式,1. 地图传送 2. 尘歌壶道具
[ObservableProperty]
private string _sereniteaPotTpType = "地图传送";
// 尘歌壶洞天购买商品
[ObservableProperty]
private List<string> _secretTreasureObjects = new();
// 地脉花一条龙模式(跳过部分准备流程)
[ObservableProperty]
private bool _leyLineOneDragonMode = false;
// 地脉花运行日期设置
[ObservableProperty]
private bool _leyLineRunMonday = true;
[ObservableProperty]
private bool _leyLineRunTuesday = true;
[ObservableProperty]
private bool _leyLineRunWednesday = true;
[ObservableProperty]
private bool _leyLineRunThursday = true;
[ObservableProperty]
private bool _leyLineRunFriday = true;
[ObservableProperty]
private bool _leyLineRunSaturday = true;
[ObservableProperty]
private bool _leyLineRunSunday = true;
// 地脉花每日类型与国家配置(为空则使用独立任务配置)
[ObservableProperty]
private string _leyLineMondayType = string.Empty;
[ObservableProperty]
private string _leyLineMondayCountry = string.Empty;
[ObservableProperty]
private string _leyLineTuesdayType = string.Empty;
[ObservableProperty]
private string _leyLineTuesdayCountry = string.Empty;
[ObservableProperty]
private string _leyLineWednesdayType = string.Empty;
[ObservableProperty]
private string _leyLineWednesdayCountry = string.Empty;
[ObservableProperty]
private string _leyLineThursdayType = string.Empty;
[ObservableProperty]
private string _leyLineThursdayCountry = string.Empty;
[ObservableProperty]
private string _leyLineFridayType = string.Empty;
[ObservableProperty]
private string _leyLineFridayCountry = string.Empty;
[ObservableProperty]
private string _leyLineSaturdayType = string.Empty;
[ObservableProperty]
private string _leyLineSaturdayCountry = string.Empty;
[ObservableProperty]
private string _leyLineSundayType = string.Empty;
[ObservableProperty]
private string _leyLineSundayCountry = string.Empty;
// 地脉花刷取次数(0 表示使用独立任务配置)
[ObservableProperty]
private int _leyLineRunCount = 0;
// 地脉花树脂耗尽模式
[ObservableProperty]
private bool _leyLineResinExhaustionMode = false;
// 地脉花刷取次数取小值(仅耗尽模式生效)
[ObservableProperty]
private bool _leyLineOpenModeCountMin = false;
#region 每周秘境配置
//周一
[ObservableProperty]
private string _mondayPartyName = string.Empty;
[ObservableProperty]
private string _mondayDomainName = string.Empty;
//周二
[ObservableProperty]
private string _tuesdayPartyName = string.Empty;
[ObservableProperty]
private string _tuesdayDomainName = string.Empty;
//周三
[ObservableProperty]
private string _wednesdayPartyName = string.Empty;
[ObservableProperty]
private string _wednesdayDomainName = string.Empty;
//周四
[ObservableProperty]
private string _thursdayPartyName = string.Empty;
[ObservableProperty]
private string _thursdayDomainName = string.Empty;
//周五
[ObservableProperty]
private string _fridayPartyName = string.Empty;
[ObservableProperty]
private string _fridayDomainName = string.Empty;
//周六
[ObservableProperty]
private string _saturdayPartyName = string.Empty;
[ObservableProperty]
private string _saturdayDomainName = string.Empty;
//周日
[ObservableProperty]
private string _sundayPartyName = string.Empty;
[ObservableProperty]
private string _sundayDomainName = string.Empty;
// 完成后操作
[ObservableProperty]
private string _completionAction = string.Empty;
// 通过当天(4点起始)是哪一天来返回配置
public (string partyName, string domainName, string sundaySelectedValue) GetDomainConfig()
{
if (WeeklyDomainEnabled)
{
var serverTime = ServerTimeHelper.GetServerTimeNow();
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)
};
}
else
{
return (PartyName, DomainName,SundayEverySelectedValue);
}
}
public bool ShouldRunLeyLineToday()
{
if (!LeyLineRunMonday
&& !LeyLineRunTuesday
&& !LeyLineRunWednesday
&& !LeyLineRunThursday
&& !LeyLineRunFriday
&& !LeyLineRunSaturday
&& !LeyLineRunSunday)
{
return true;
}
var serverTime = ServerTimeHelper.GetServerTimeNow();
var dayOfWeek = (serverTime.Hour >= 4 ? serverTime : serverTime.AddDays(-1)).DayOfWeek;
return dayOfWeek switch
{
DayOfWeek.Monday => LeyLineRunMonday,
DayOfWeek.Tuesday => LeyLineRunTuesday,
DayOfWeek.Wednesday => LeyLineRunWednesday,
DayOfWeek.Thursday => LeyLineRunThursday,
DayOfWeek.Friday => LeyLineRunFriday,
DayOfWeek.Saturday => LeyLineRunSaturday,
DayOfWeek.Sunday => LeyLineRunSunday,
_ => true
};
}
public (string type, string country) GetLeyLineConfigForToday(AutoLeyLineOutcropConfig fallback)
{
var serverTime = ServerTimeHelper.GetServerTimeNow();
var dayOfWeek = (serverTime.Hour >= 4 ? serverTime : serverTime.AddDays(-1)).DayOfWeek;
var (type, country) = dayOfWeek switch
{
DayOfWeek.Monday => (LeyLineMondayType, LeyLineMondayCountry),
DayOfWeek.Tuesday => (LeyLineTuesdayType, LeyLineTuesdayCountry),
DayOfWeek.Wednesday => (LeyLineWednesdayType, LeyLineWednesdayCountry),
DayOfWeek.Thursday => (LeyLineThursdayType, LeyLineThursdayCountry),
DayOfWeek.Friday => (LeyLineFridayType, LeyLineFridayCountry),
DayOfWeek.Saturday => (LeyLineSaturdayType, LeyLineSaturdayCountry),
DayOfWeek.Sunday => (LeyLineSundayType, LeyLineSundayCountry),
_ => (string.Empty, string.Empty)
};
if (string.IsNullOrWhiteSpace(type))
{
type = fallback.LeyLineOutcropType;
}
if (string.IsNullOrWhiteSpace(country))
{
country = fallback.Country;
}
return (type, country);
}
#endregion
}
@@ -0,0 +1,124 @@
using System;
using BetterGenshinImpact.Core.Recognition;
using BetterGenshinImpact.Model;
using CommunityToolkit.Mvvm.ComponentModel;
namespace BetterGenshinImpact.Core.Config;
[Serializable]
public partial class OtherConfig : ObservableObject
{
//调度器任务和部分独立任务,失去焦点,自动激活游戏窗口
[ObservableProperty]
private bool _restoreFocusOnLostEnabled = false;
//自动领取派遣任务城市
[ObservableProperty]
private string _autoFetchDispatchAdventurersGuildCountry = "无";
//服务器时区偏移量
[ObservableProperty]
private TimeSpan _serverTimeZoneOffset = TimeSpan.FromHours(8);
[ObservableProperty]
private AutoRestart _autoRestartConfig = new();
//锄地规划
[ObservableProperty]
private FarmingPlan _farmingPlanConfig = new();
[ObservableProperty]
private Miyoushe _miyousheConfig = new();
//OCR配置
[ObservableProperty]
private Ocr _ocrConfig = new();
public partial class AutoRestart : ObservableObject
{
[ObservableProperty]
private bool _enabled = false;
//调度器任务连续异常退出几次任务自动重启
[ObservableProperty]
private int _failureCount = 5;
//是否同时重启游戏,需开启首页启动配置:同时启动原神、自动进入游戏,此配置才会生效
[ObservableProperty]
private bool _restartGameTogether = false;
//锄地脚本,如果打架次数不一致,则判定任务失败。
[ObservableProperty]
private bool _isFightFailureExceptional = false;
//任何追踪任务,未走完全路径结束,视为失败。
[ObservableProperty]
private bool _isPathingFailureExceptional = false;
}
public partial class Miyoushe : ObservableObject
{
//cookie
[ObservableProperty]
private string _cookie = "";
//与调度器日志处相互同步cookie
[ObservableProperty]
private bool _logSyncCookie = true;
}
public partial class MiyousheDataSupport : ObservableObject
{
[ObservableProperty]
private bool _enabled = false;
//日精英上限
[ObservableProperty]
private int _dailyEliteCap = 400;
//日小怪上限
[ObservableProperty]
private int _dailyMobCap = 2000;
}
public partial class FarmingPlan : ObservableObject
{
[ObservableProperty]
private MiyousheDataSupport _miyousheDataConfig = new();
[ObservableProperty]
private bool _enabled = false;
//日精英上限
[ObservableProperty]
private int _dailyEliteCap = 400;
//日小怪上限
[ObservableProperty]
private int _dailyMobCap = 2000;
}
public partial class Ocr : ObservableObject
{
/// <summary>
/// PaddleOCR模型配置
/// </summary>
[ObservableProperty]
private PaddleOcrModelConfig _paddleOcrModelConfig = PaddleOcrModelConfig.V4Auto;
}
//public partial class OtherConfig : ObservableObject
/// <summary>
/// 游戏语言名称
/// </summary>
[ObservableProperty]
private string _gameCultureInfoName = "zh-Hans";
/// <summary>
/// BGI界面语言名称
/// </summary>
[ObservableProperty]
private string _uiCultureInfoName = "zh-Hans";
}
@@ -0,0 +1,203 @@
using BetterGenshinImpact.GameTask.AutoFight.Model;
using BetterGenshinImpact.Model;
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Linq;
using BetterGenshinImpact.GameTask;
using BetterGenshinImpact.GameTask.AutoPathing.Model;
using BetterGenshinImpact.GameTask.Common;
using Microsoft.Extensions.Logging;
namespace BetterGenshinImpact.Core.Config;
[Serializable]
public partial class PathingConditionConfig : ObservableObject
{
[ObservableProperty]
private string _mapMatchingMethod = "TemplateMatch";
// 地图追踪条件配置
[ObservableProperty]
private ObservableCollection<Condition> _partyConditions = [];
[ObservableProperty]
private ObservableCollection<Condition> _avatarConditions = [];
// 只在传送传送点时复活
[ObservableProperty]
private bool _onlyInTeleportRecover = false;
// 使用小道具的间隔时间(ms)
[ObservableProperty]
private int _useGadgetIntervalMs = 0;
// 启用自动吃药功能
[ObservableProperty]
private bool _autoEatEnabled = false;
public static PathingConditionConfig Default => new()
{
AvatarConditions =
[
new Condition
{
Subject = "队伍中角色",
Object = ["绮良良", "莱依拉", "茜特菈莉", "芭芭拉", "七七"],
Result = "循环短E"
},
new Condition
{
Subject = "队伍中角色",
Object = ["钟离"],
Result = "循环长E"
},
new Condition
{
Subject = "队伍中角色",
Object = ["迪希雅"],
Result = "作为主要行走角色"
}
]
};
/// <summary>
/// 找出当前应该切换的队伍名称
/// </summary>
/// <param name="materialName">采集物名称</param>
/// <param name="specialActions">特殊动作</param>
/// <returns></returns>
public string? FilterPartyName(string? materialName, List<string?> specialActions)
{
if (specialActions is { Count: > 0 })
{
// 特殊动作匹配队伍名
foreach (var action in specialActions)
{
if (string.IsNullOrEmpty(action))
{
continue;
}
if (!ConditionDefinitions.ActionCnDic.TryGetValue(action, out var actionCn))
{
continue; // 不校验
}
var condition = PartyConditions.FirstOrDefault(c => c.Subject == "动作" && c.Object.Contains(actionCn));
if (condition is { Result: not null })
{
return condition.Result;
}
}
}
// 采集物匹配队伍名
Condition? materialCondition = null;
if (!string.IsNullOrEmpty(materialName))
{
materialCondition = PartyConditions.FirstOrDefault(c => c.Subject == "采集物" && c.Object.Contains(materialName));
}
if (materialCondition is { Result: not null })
{
return materialCondition.Result;
}
else
{
materialCondition = PartyConditions.FirstOrDefault(c => c.Subject == "采集物" && c.Object.Contains("全部"));
if (materialCondition is { Result: not null })
{
return materialCondition.Result;
}
}
return null;
}
/// <summary>
/// 通过条件配置生成队伍配置
/// </summary>
/// <returns></returns>
public PathingPartyConfig BuildPartyConfigByCondition(CombatScenes combatScenes)
{
PathingPartyConfig partyConfig = PathingPartyConfig.BuildDefault();
// 使用最优先匹配上的条件
foreach (var avatarCondition in AvatarConditions)
{
if (avatarCondition.Result == "循环短E" || avatarCondition.Result == "循环长E")
{
foreach (var avatar in combatScenes.GetAvatars())
{
if (avatarCondition is { Object: not null } && avatarCondition.Object.Contains(avatar.Name))
{
partyConfig.GuardianAvatarIndex = avatar.Index.ToString();
if (avatarCondition.Result == "循环长E")
{
partyConfig.GuardianElementalSkillLongPress = true;
partyConfig.GuardianElementalSkillSecondInterval = avatar.CombatAvatar.SkillHoldCd.ToString(CultureInfo.CurrentCulture);
}
else
{
partyConfig.GuardianElementalSkillLongPress = false;
partyConfig.GuardianElementalSkillSecondInterval = avatar.CombatAvatar.SkillCd.ToString(CultureInfo.CurrentCulture);
}
break;
}
}
if (!string.IsNullOrEmpty(partyConfig.GuardianAvatarIndex))
{
break;
}
}
}
foreach (var avatarCondition in AvatarConditions)
{
if (avatarCondition.Result == "作为主要行走角色")
{
foreach (var avatar in combatScenes.GetAvatars())
{
if (avatarCondition is not null && avatarCondition.Object.Contains(avatar.Name))
{
partyConfig.MainAvatarIndex = avatar.Index.ToString();
break;
}
}
if (!string.IsNullOrEmpty(partyConfig.MainAvatarIndex))
{
break;
}
}
}
// 默认元素力采集角色
// var elementalCollectAvatars = ElementalCollectAvatarConfigs.Lists;
// foreach (var avatar in combatScenes.Avatars)
// {
// var elementalCollectAvatar = elementalCollectAvatars.FirstOrDefault(x => x.Name == avatar.Name);
// if (elementalCollectAvatar != null)
// {
// if (elementalCollectAvatar.ElementalType == ElementalType.Hydro)
// {
// partyConfig.HydroCollectAvatarIndex = avatar.Index.ToString();
// }
// else if (elementalCollectAvatar.ElementalType == ElementalType.Electro)
// {
// partyConfig.ElectroCollectAvatarIndex = avatar.Index.ToString();
// }
// else if (elementalCollectAvatar.ElementalType == ElementalType.Anemo)
// {
// partyConfig.AnemoCollectAvatarIndex = avatar.Index.ToString();
// }
// }
// }
return partyConfig;
}
}
@@ -0,0 +1,142 @@
using BetterGenshinImpact.GameTask;
using BetterGenshinImpact.GameTask.AutoEat;
using BetterGenshinImpact.GameTask.AutoFight;
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace BetterGenshinImpact.Core.Config;
[Serializable]
public partial class PathingPartyConfig : ObservableObject
{
// 配置是否启用,不启用会使用地图追踪内的条件配置
[ObservableProperty]
private bool _enabled = true;
// 是否启用自动拾取
[ObservableProperty]
private bool _autoPickEnabled = true;
// 切换到队伍的名称
[ObservableProperty]
private string _partyName = string.Empty;
[JsonIgnore]
public bool SkipPartySwitch { get; set; }
// 切换队伍前是否前往须弥七天神像
[ObservableProperty]
private bool _isVisitStatueBeforeSwitchParty = false;
// 主要行走追踪的角色编号
[ObservableProperty]
private string _mainAvatarIndex = string.Empty;
// [盾角]使用元素战技的角色编号
[ObservableProperty]
private string _guardianAvatarIndex = string.Empty;
// [盾角]使用元素战技的时间间隔(s)
[ObservableProperty]
private string _guardianElementalSkillSecondInterval = string.Empty;
// [盾角]使用元素战技的方式 长按/短按
[ObservableProperty]
private bool _guardianElementalSkillLongPress = false;
// // normal_attack 配置几号位
// [ObservableProperty]
// private string _normalAttackAvatarIndex = string.Empty;
//
// // elemental_skill 配置几号位
// [ObservableProperty]
// private string _elementalSkillAvatarIndex = string.Empty;
// // hydro_collect 配置几号位
// [ObservableProperty]
// private string _hydroCollectAvatarIndex = string.Empty;
//
// // electro_collect 配置几号位
// [ObservableProperty]
// private string _electroCollectAvatarIndex = string.Empty;
//
// // anemo_collect 配置几号位
// [ObservableProperty]
// private string _anemoCollectAvatarIndex = string.Empty;
[JsonIgnore]
public List<string> AvatarIndexList { get; } = ["", "1", "2", "3", "4"];
// 只在传送传送点时复活
[ObservableProperty]
private bool _onlyInTeleportRecover = false;
//允许在jsScript脚本中使用此地图追踪配置
[ObservableProperty]
private bool _jsScriptUseEnabled = true;
//允许在此调度器中(一般在JS脚本中)调用自动战斗任务时,采用此追踪配置里的战斗策略
[ObservableProperty]
private bool _soloTaskUseFightEnabled = true;
//不在某时执行
[ObservableProperty]
private string _skipDuring = "";
// 使用小道具的间隔时间
[ObservableProperty]
private int _useGadgetIntervalMs = 0;
// 启用进入剧情自动脱离
[ObservableProperty]
private bool _autoSkipEnabled = true;
// 自动冲刺启用
[ObservableProperty]
private bool _autoRunEnabled = true;
// 启用自动吃药功能
[ObservableProperty]
private bool _autoEatEnabled = false;
/// <summary>
/// 自动吃食物配置
/// 供JS脚本使用
/// </summary>
[ObservableProperty]
private AutoEatConfig _autoEatConfig = new();
//在连续执行时是否隐藏
[ObservableProperty]
private bool _hideOnRepeat = false;
//执行周期配置
[ObservableProperty]
private PathingPartyTaskCycleConfig _taskCycleConfig = new();
//任务完成跳过执行配置
[ObservableProperty]
private TaskCompletionSkipRuleConfig _taskCompletionSkipRuleConfig = new();
//优先执行其他配置组
[ObservableProperty]
private PreExecutionPriorityConfig _preExecutionPriorityConfig = new();
//启用自动战斗配置
[ObservableProperty]
private bool _autoFightEnabled = true;
[ObservableProperty]
private AutoFightConfig _autoFightConfig = new();
public static PathingPartyConfig BuildDefault()
{
// 即便是不启用的情况下也设置默认值,减少后续使用的判断
var pathingConditionConfig = TaskContext.Instance().Config.PathingConditionConfig;
return new PathingPartyConfig
{
OnlyInTeleportRecover = pathingConditionConfig.OnlyInTeleportRecover,
UseGadgetIntervalMs = pathingConditionConfig.UseGadgetIntervalMs,
AutoEatEnabled = pathingConditionConfig.AutoEatEnabled
};
}
}
@@ -0,0 +1,70 @@
using System;
using BetterGenshinImpact.Helpers;
using CommunityToolkit.Mvvm.ComponentModel;
namespace BetterGenshinImpact.Core.Config;
[Serializable]
public partial class PathingPartyTaskCycleConfig : ObservableObject
{
//启用执行周期配置
[ObservableProperty]
private bool _enable = false;
//周期分界时间点(小时),如果负数则不启用
[ObservableProperty]
private int _boundaryTime = 0;
// 分界时间是否基于服务器时间(否则基于本地时间)
[ObservableProperty]
private bool _isBoundaryTimeBasedOnServerTime = false;
//不同材料有不同的周期,按需配置,如矿石类是3、突破材料是2,或按照自已想几天执行一次配置即可
[ObservableProperty]
private int _cycle = 1;
//执行周期序号,按时间戳对应的天数,对周期求余值加1,得出的值和配置执一致就会执行,否则跳过任务。
[ObservableProperty]
private int _index = 1;
public int GetExecutionOrder(DateTimeOffset now)
{
try
{
if (_cycle <= 0 || _boundaryTime <0 || _boundaryTime > 24 )
return -1;
// 修正时间:如果当前时间小于当天的分界时间,则视为前一天
DateTime boundaryTimeToday = new DateTime(now.Year, now.Month, now.Day, _boundaryTime, 0, 0);
if (now < boundaryTimeToday)
{
now = now.AddDays(-1); // 归属到前一天
}
// 获取从某个固定点(如 Unix 纪元)起的“修正天数”
// 可以使用 DateTime.UnixEpoch(从 1970-01-01 00:00:00 开始)
DateTime baseDate = DateTime.UnixEpoch; // 即 1970-01-01
TimeSpan daysSinceBase = now.Date - baseDate.Date;
int totalDays = (int)daysSinceBase.TotalDays;
// 执行序号 = (修正天数 % 周期) + 1
int executionOrder = (totalDays % _cycle) + 1;
return executionOrder;
}
catch (Exception e)
{
return -1;
}
}
public int GetExecutionOrder()
{
return GetExecutionOrder(IsBoundaryTimeBasedOnServerTime
? ServerTimeHelper.GetServerTimeNow()
: DateTimeOffset.Now);
}
}
@@ -0,0 +1,25 @@
using System;
using CommunityToolkit.Mvvm.ComponentModel;
namespace BetterGenshinImpact.Core.Config;
[Serializable]
public partial class PreExecutionPriorityConfig: ObservableObject
{
// 配置是否启用
[ObservableProperty]
private bool _enabled = false;
/// <summary>
/// 需要优先检查执行的配置组名称,多个用逗号分隔。
/// </summary>
[ObservableProperty]
private string _groupNames = "";
/// <summary>
/// 最大重试次数,如果优先的任务执行失败了,重试几次。
/// </summary>
[ObservableProperty]
private int _maxRetryCount = 1;
}
@@ -0,0 +1,27 @@
using CommunityToolkit.Mvvm.ComponentModel;
using System;
namespace BetterGenshinImpact.Core.Config;
[Serializable]
public partial class RecordConfig : ObservableObject
{
/// <summary>
/// 视角每移动1度,需要MouseMoveBy的距离
/// 用作脚本记录度数后转化的鼠标移动距离
/// </summary>
[ObservableProperty]
private double _angle2MouseMoveByX = 1.0;
/// <summary>
/// 视角每移动1度,需要DirectInput移动的单位
/// </summary>
[ObservableProperty]
private double _angle2DirectInputX = 1.0;
/// <summary>
/// 图像识别记录相机视角朝向
/// </summary>
[ObservableProperty]
private bool _isRecordCameraOrientation = false;
}
@@ -0,0 +1,30 @@
using OpenCvSharp;
using System;
namespace BetterGenshinImpact.Core.Config;
[Obsolete("Replace with original OpenCvSharp.Rect")]
public class RectConfig
{
public RectConfig()
{
}
public RectConfig(int x, int y, int width, int height)
{
X = x;
Y = y;
Width = width;
Height = height;
}
public int X { get; set; }
public int Y { get; set; }
public int Width { get; set; }
public int Height { get; set; }
public Rect ToRect()
{
return new Rect(X, Y, Width, Height);
}
}
@@ -0,0 +1,59 @@
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Windows;
namespace BetterGenshinImpact.Core.Config;
/// <summary>
/// 脚本配置
/// </summary>
[Serializable]
public partial class ScriptConfig : ObservableObject
{
// 自动更新脚本仓库周期(天)
[ObservableProperty]
private int _autoUpdateScriptRepoPeriod = 1;
// 上次更新脚本仓库时间
[ObservableProperty]
private DateTime _lastUpdateScriptRepoTime = DateTime.MinValue;
// 脚本仓库按钮红点是否展示
[ObservableProperty]
private bool _scriptRepoHintDotVisible = false;
// 已订阅的脚本路径列表
[ObservableProperty]
private List<string> _subscribedScriptPaths = [];
// 选择的更新渠道名称
[ObservableProperty] private string _selectedChannelName = "";
// 自定义渠道的URL
[ObservableProperty] private string _customRepoUrl = "";
// 仓库页面宽度
[ObservableProperty] private double _webviewWidth = 0;
// 仓库页面高度
[ObservableProperty] private double _webviewHeight = 0;
// 仓库页面横向位置
[ObservableProperty] private double _webviewLeft = 0;
// 仓库页面纵向位置
[ObservableProperty] private double _webviewTop = 0;
// 仓库页面是否最大化
[ObservableProperty] private WindowState _webviewState = WindowState.Normal;
// 仓库新手教程是否已阅读
[ObservableProperty] private bool _guideStatus = false;
// 是否在启动时自动更新已订阅的脚本
[ObservableProperty] private bool _autoUpdateSubscribedScripts = false;
// 命令行启动时是否先自动更新已订阅脚本再执行命令
[ObservableProperty] private bool _autoUpdateBeforeCommandLineRun = false;
}
@@ -0,0 +1,33 @@
using CommunityToolkit.Mvvm.ComponentModel;
namespace BetterGenshinImpact.Core.Config;
public partial class TaskCompletionSkipRuleConfig:ObservableObject
{
//启用跳过完成任务
[ObservableProperty]
private bool _enable = false;
//跳过策略
//GroupPhysicalPathSkipPolicy: 配置组且物理路径相同跳过
//PhysicalPathSkipPolicy: 物理路径相同跳过
//SameNameSkipPolicy: 同类型同名跳过
[ObservableProperty]
private string _skipPolicy = "GroupPhysicalPathSkipPolicy";
//周期分界时间点,如果负数则不启用,主要适用于固定时间的刷新物品适用
[ObservableProperty]
private int _boundaryTime = 4;
// 分界时间是否基于服务器时间(否则基于本地时间)
[ObservableProperty]
private bool _isBoundaryTimeBasedOnServerTime = false;
//上一次执行间隔时间,出于精度考虑,这里使用秒为单位
[ObservableProperty]
private int _lastRunGapSeconds = -1;
//间隔时间计算参照,开始时间(StartTime)和结束时间(EndTime)
[ObservableProperty]
private string _referencePoint = "EndTime";
}
@@ -0,0 +1,55 @@
using BetterGenshinImpact.Core.Recorder;
using SharpDX.DirectInput;
using System;
using System.Threading;
using System.Threading.Tasks;
using Vanara.PInvoke;
namespace BetterGenshinImpact.Core.Monitor;
public class DirectInputMonitor : IDisposable
{
private bool _isRunning = true;
private readonly Mouse _mouse;
public static int Interval = 5;
public DirectInputMonitor()
{
var directInput = new DirectInput();
_mouse = new Mouse(directInput);
_mouse.SetCooperativeLevel(IntPtr.Zero, CooperativeLevel.Background | CooperativeLevel.NonExclusive);
}
public MouseState GetMouseState()
{
_mouse.Acquire();
return _mouse.GetCurrentState();
}
public void Start()
{
Task.Run(() =>
{
while (_isRunning)
{
_mouse.Acquire();
MouseState state = _mouse.GetCurrentState();
// Debug.WriteLine($"{state.X} {state.Y} {state.Buttons[0]} {state.Buttons[1]}");
GlobalKeyMouseRecord.Instance.GlobalHookMouseMoveBy(state, Kernel32.GetTickCount());
Thread.Sleep(Interval); // 10ms, equivalent to CLOCKS_PER_SEC/100
}
});
}
public void Stop()
{
_isRunning = false;
}
public void Dispose()
{
_mouse.Dispose();
}
}
@@ -0,0 +1,238 @@
using BetterGenshinImpact.Core.Config;
using BetterGenshinImpact.Core.Recorder;
using BetterGenshinImpact.Core.Simulator;
using BetterGenshinImpact.GameTask;
using BetterGenshinImpact.Model;
using Gma.System.MouseKeyHook;
using System;
using System.Diagnostics;
using System.Threading;
using System.Windows.Forms;
using Vanara.PInvoke;
using Timer = System.Timers.Timer;
// Wine 平台适配
using BetterGenshinImpact.Platform.Wine;
namespace BetterGenshinImpact.Core.Monitor;
public partial class MouseKeyMonitor
{
/// <summary>
/// 长按F变F连发
/// </summary>
private readonly Timer _fTimer = new();
private Keys _pickUpKey = Keys.F;
private User32.VK _pickUpKeyCode = User32.VK.VK_F;
//private readonly Random _random = new();
/// <summary>
/// 长按空格变空格连发
/// </summary>
private readonly Timer _spaceTimer = new();
private Keys _releaseControlKey = Keys.Space;
private User32.VK _releaseControlKeyCode = User32.VK.VK_SPACE;
private DateTime _firstFKeyDownTime = DateTime.MaxValue;
/// <summary>
/// DateTime.MaxValue 代表没有按下
/// </summary>
private DateTime _firstSpaceKeyDownTime = DateTime.MaxValue;
private static IKeyboardMouseEvents? _globalHook;
private static readonly object GlobalHookLock = new object();
public static IKeyboardMouseEvents GlobalHook
{
get
{
if (_globalHook == null)
{
lock (GlobalHookLock)
{
if (_globalHook == null)
{
_globalHook = Hook.GlobalEvents();
}
}
}
return _globalHook;
}
}
private nint _hWnd;
public void Subscribe(nint gameHandle)
{
_hWnd = gameHandle;
// Note: for the application hook, use the Hook.AppEvents() instead
if (!WinePlatformAddon.IsRunningOnWine) {
GlobalHook.KeyDown += GlobalHookKeyDown;
GlobalHook.KeyUp += GlobalHookKeyUp;
GlobalHook.MouseDownExt += GlobalHookMouseDownExt;
GlobalHook.MouseUpExt += GlobalHookMouseUpExt;
GlobalHook.MouseMoveExt += GlobalHookMouseMoveExt;
GlobalHook.MouseWheelExt += GlobalHookMouseWheelExt;
}
TrySubscribeWinePolling();
//_globalHook.KeyPress += GlobalHookKeyPress;
_pickUpKey = TaskContext.Instance().Config.KeyBindingsConfig.PickUpOrInteract.ToWinFormKeys();
_pickUpKeyCode = TaskContext.Instance().Config.KeyBindingsConfig.PickUpOrInteract.ToVK();
_releaseControlKey = TaskContext.Instance().Config.KeyBindingsConfig.Jump.ToWinFormKeys();
_releaseControlKeyCode = TaskContext.Instance().Config.KeyBindingsConfig.Jump.ToVK();
_firstSpaceKeyDownTime = DateTime.MaxValue;
var si = TaskContext.Instance().Config.MacroConfig.SpaceFireInterval;
_spaceTimer.Interval = si;
_spaceTimer.Elapsed += (sender, args) => { Simulation.PostMessage(_hWnd).KeyPress(_releaseControlKeyCode); };
var fi = TaskContext.Instance().Config.MacroConfig.FFireInterval;
_fTimer.Interval = fi;
_fTimer.Elapsed += (sender, args) => { Simulation.PostMessage(_hWnd).KeyPress(_pickUpKeyCode); };
}
private void GlobalHookKeyDown(object? sender, KeyEventArgs e)
{
// Debug.WriteLine("KeyDown: \t{0}", e.KeyCode);
GlobalKeyMouseRecord.Instance.GlobalHookKeyDown(e, Kernel32.GetTickCount());
if (SystemControl.IsGenshinImpactActive())
{
ChatUiHotkeyGuard.PrimeFromChatKey(e.KeyCode);
}
// 热键按下事件
HotKeyDown(sender, e);
if (e.KeyCode == _releaseControlKey)
{
if (_firstSpaceKeyDownTime == DateTime.MaxValue)
{
_firstSpaceKeyDownTime = DateTime.Now;
}
else
{
var timeSpan = DateTime.Now - _firstSpaceKeyDownTime;
if (timeSpan.TotalMilliseconds > 300 && TaskContext.Instance().Config.MacroConfig.SpacePressHoldToContinuationEnabled)
if (!_spaceTimer.Enabled)
_spaceTimer.Start();
}
}
else if (e.KeyCode == _pickUpKey)
{
if (_firstFKeyDownTime == DateTime.MaxValue)
{
_firstFKeyDownTime = DateTime.Now;
}
else
{
var timeSpan = DateTime.Now - _firstFKeyDownTime;
if (timeSpan.TotalMilliseconds > 200 && TaskContext.Instance().Config.MacroConfig.FPressHoldToContinuationEnabled)
if (!_fTimer.Enabled)
_fTimer.Start();
}
}
}
private void GlobalHookKeyUp(object? sender, KeyEventArgs e)
{
// Debug.WriteLine("KeyUp: \t{0}", e.KeyCode);
GlobalKeyMouseRecord.Instance.GlobalHookKeyUp(e, Kernel32.GetTickCount());
// 热键松开事件
HotKeyUp(sender, e);
if (e.KeyCode == _releaseControlKey)
{
if (_firstSpaceKeyDownTime != DateTime.MaxValue)
{
var timeSpan = DateTime.Now - _firstSpaceKeyDownTime;
Debug.WriteLine($"Space按下时间:{timeSpan.TotalMilliseconds}ms");
_firstSpaceKeyDownTime = DateTime.MaxValue;
_spaceTimer.Stop();
}
}
else if (e.KeyCode == _pickUpKey)
{
if (_firstFKeyDownTime != DateTime.MaxValue)
{
var timeSpan = DateTime.Now - _firstFKeyDownTime;
Debug.WriteLine($"F按下时间:{timeSpan.TotalMilliseconds}ms");
_firstFKeyDownTime = DateTime.MaxValue;
_fTimer.Stop();
}
}
}
private void HotKeyDown(object? sender, KeyEventArgs e)
{
if (KeyboardHook.AllKeyboardHooks.TryGetValue(e.KeyCode, out var hook)) hook.KeyDown(sender, e);
}
private void HotKeyUp(object? sender, KeyEventArgs e)
{
if (KeyboardHook.AllKeyboardHooks.TryGetValue(e.KeyCode, out var hook)) hook.KeyUp(sender, e);
}
//private void GlobalHookKeyPress(object? sender, KeyPressEventArgs e)
//{
// Debug.WriteLine("KeyPress: \t{0}", e.KeyChar);
//}
private void GlobalHookMouseDownExt(object? sender, MouseEventExtArgs e)
{
// Debug.WriteLine("MouseDown: {0}; \t Location: {1};\t System Timestamp: {2}", e.Button, e.Location, e.Timestamp);
GlobalKeyMouseRecord.Instance.GlobalHookMouseDown(e);
if (e.Button != MouseButtons.Left)
if (MouseHook.AllMouseHooks.TryGetValue(e.Button, out var hook))
hook.MouseDown(sender, e);
}
private void GlobalHookMouseUpExt(object? sender, MouseEventExtArgs e)
{
// Debug.WriteLine("MouseUp: {0}; \t Location: {1};\t System Timestamp: {2}", e.Button, e.Location, e.Timestamp);
GlobalKeyMouseRecord.Instance.GlobalHookMouseUp(e);
if (e.Button != MouseButtons.Left)
if (MouseHook.AllMouseHooks.TryGetValue(e.Button, out var hook))
hook.MouseUp(sender, e);
}
private void GlobalHookMouseMoveExt(object? sender, MouseEventExtArgs e)
{
// Debug.WriteLine("MouseMove: {0}; \t Location: {1};\t System Timestamp: {2}", e.Button, e.Location, e.Timestamp);
GlobalKeyMouseRecord.Instance.GlobalHookMouseMoveTo(e);
}
private void GlobalHookMouseWheelExt(object? sender, MouseEventExtArgs e)
{
// Debug.WriteLine("MouseMove: {0}; \t Location: {1};\t Delta: {2};\t System Timestamp: {3}", e.Button, e.Location, e.Delta, e.Timestamp);
GlobalKeyMouseRecord.Instance.GlobalHookMouseWheel(e);
}
public void Unsubscribe()
{
if (_globalHook != null && !WinePlatformAddon.IsRunningOnWine)
{
_globalHook.KeyDown -= GlobalHookKeyDown;
_globalHook.KeyUp -= GlobalHookKeyUp;
_globalHook.MouseDownExt -= GlobalHookMouseDownExt;
_globalHook.MouseUpExt -= GlobalHookMouseUpExt;
_globalHook.MouseMoveExt -= GlobalHookMouseMoveExt;
_globalHook.MouseWheelExt -= GlobalHookMouseWheelExt;
//_globalHook.KeyPress -= GlobalHookKeyPress;
_globalHook.Dispose();
_globalHook = null;
}
if (WinePlatformAddon.IsRunningOnWine){
DisposeWineAddon();
}
}
}
@@ -1,48 +0,0 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenCvSharp;
namespace BetterGenshinImpact.Core.Recognition
{
public class CommonRecognition
{
/// <summary>
/// 寻找游戏内按钮
/// </summary>
/// <param name="srcMat"></param>
/// <returns></returns>
public static List<Rect> FindGameButton(Mat srcMat)
{
try
{
var src = srcMat.Clone();
Cv2.CvtColor(src, src, ColorConversionCodes.BGR2RGB);
var lowPurple = new Scalar(236, 229, 216);
var highPurple = new Scalar(236, 229, 216);
Cv2.InRange(src, lowPurple, highPurple, src);
Cv2.Threshold(src, src, 0, 255, ThresholdTypes.Binary);
//var kernel = Cv2.GetStructuringElement(MorphShapes.Rect, new OpenCvSharp.Size(20, 20),
// new OpenCvSharp.Point(-1, -1));
//Cv2.Dilate(src, src, kernel); //膨胀
Cv2.FindContours(src, out var contours, out _, RetrievalModes.External,
ContourApproximationModes.ApproxSimple, null);
if (contours.Length > 0)
{
var boxes = contours.Select(Cv2.BoundingRect).Where(r => r.Width > 50);
return boxes.ToList();
}
}
catch (Exception e)
{
Debug.WriteLine(e);
}
return new List<Rect>();
}
}
}
@@ -0,0 +1,194 @@
using System;
using System.Buffers;
using System.Collections.Generic;
using System.Linq;
using BetterGenshinImpact.Core.Recognition.OCR.Engine.data;
using BetterGenshinImpact.Core.Recognition.OpenCv;
using Microsoft.ML.OnnxRuntime.Tensors;
using OpenCvSharp;
using OpenCvSharp.Dnn;
namespace BetterGenshinImpact.Core.Recognition.OCR.Engine;
public static class OcrUtils
{
/// <summary>
/// 预处理速度比unsafe快5倍以上,且吃的资源还少
/// </summary>
/// <param name="inputImage">输入图像,若不是灰度图会转换</param>
/// <param name="tensorMemoryOwnser">tensor的Memory,用完需要释放</param>
/// <returns></returns>
public static Tensor<float> ToTensorYapDnn(Mat inputImage, out IMemoryOwner<float> tensorMemoryOwnser)
{
using var rt = new ResourcesTracker();
Mat dst;
// 221*32是个什么鬼
if (inputImage.Channels() > 1)
{
var resize = rt.T(ResizeHelper.ResizeTo(inputImage, 221, 32));
dst = rt.NewMat(resize.Size(), MatType.CV_8UC1, Scalar.Black);
Cv2.CvtColor(resize, dst, ColorConversionCodes.BGR2GRAY);
}
else
{
dst = rt.T(ResizeHelper.ResizeTo(inputImage, 221, 32));
}
// 填充到 384x32
var padded = rt.NewMat(new Size(384, 32), MatType.CV_8UC1, Scalar.Black);
padded[new Rect(0, 0, 221, 32)] = dst;
// 使用向量运算代替循环
var blob = rt.T(CvDnn.BlobFromImage(padded, 1.0 / 255.0, default, default, false, false));
var nCols = padded.Cols * padded.Rows;
tensorMemoryOwnser = MemoryPool<float>.Shared.Rent(nCols);
// 内存复制,如果直接传指针构建的话速度还不如多复制一份
blob.AsSpan<float>().CopyTo(tensorMemoryOwnser.Memory.Span);
return new DenseTensor<float>(tensorMemoryOwnser.Memory[..nCols], [1, 1, 32, 384]);
}
/// <summary>
/// 用于Det模型
/// 归一化,标准化并返回Tensor。
/// <br />
/// 归一化:固定范围归一化
/// <br />
/// 标准化:
/// Z-Score Normalization
/// </summary>
public static Tensor<float> NormalizeToTensorDnn(Mat src,
float? scale, // scale float32
float[]? mean, //mean
float[]? std, //std
out IMemoryOwner<float> tensorMemoryOwner, bool swapRb = false, bool crop = false, Size size = default)
{
scale ??= 0.00392156862745f;
mean ??= [0.485f, 0.456f, 0.406f];
std ??= [0.229f, 0.224f, 0.225f];
using var rt = new ResourcesTracker();
// 获取图像参数
var channels = src.Channels();
if (channels != 3)
throw new ArgumentException($"图像通道数必须为3,当前为{channels}");
// var data = rt.T(OcrOperationImpl.NormalizeImageOperation(src, scale, mean, std));
var stdMat = rt.NewMat();
Mat[] bgr = [];
try
{
bgr = src.Split();
for (var i = 0; i < bgr.Length; ++i)
bgr[i].ConvertTo(bgr[i], MatType.CV_32FC1, 1 / std[i],
(0.0 - mean[i]) / std[i] / (float)scale);
Cv2.Merge(bgr, stdMat);
}
finally
{
foreach (var channel in bgr) channel.Dispose();
}
//stdMat.GetArray<float>(out var data);
// 使用DNN模块创建blob
var blob = rt.T(CvDnn.BlobFromImage(
stdMat,
(double)scale,
size,
default,
swapRb,
crop
));
// 租用内存并复制数据
var total = (int)blob.Total();
tensorMemoryOwner = MemoryPool<float>.Shared.Rent(total);
blob.AsSpan<float>().CopyTo(tensorMemoryOwner.Memory.Span);
// 计算输出形状
return new DenseTensor<float>(
tensorMemoryOwner.Memory[..total],
new[] { 1, channels, stdMat.Rows, stdMat.Cols }
);
}
/// <summary>
/// 不支持通道转换
/// <br />
/// 用于PP-OCR的Rec模型,调整大小之后再归一化到-1~1,之后转换为Tensor
/// </summary>
public static Tensor<float> ResizeNormImg(Mat img, OcrShape imageShape,
out IMemoryOwner<float> tensorMemoryOwner, bool padding = true,
InterpolationFlags interpolation = InterpolationFlags.Linear)
{
using var rt = new ResourcesTracker();
// var imgC = imageShape.Channel;
var imgH = imageShape.Height;
var imgW = imageShape.Width;
var h = img.Height;
var w = img.Width;
var resizedImage = rt.NewMat();
if (!padding)
{
Cv2.Resize(img, resizedImage, new Size(imgW, imgH), 0, 0, interpolation);
// resized_w = imgW;
}
else
{
var ratio = w / (double)h;
var resizedW = Math.Ceiling(imgH * ratio) > imgW ? imgW : (int)Math.Ceiling(imgH * ratio);
Cv2.Resize(img, resizedImage, new Size(resizedW, imgH), 0, 0, interpolation);
}
/*
resized_image / 255
resized_image -= 0.5
resized_image /= 0.5
*/
// 归一化到 +-1
// resizedImage.ConvertTo(resizedImage, MatType.CV_32F, 2 / 255f, 1);
var blob = rt.T(CvDnn.BlobFromImage(
resizedImage,
2 / 255f,
default,
new Scalar(127.5, 127.5, 127.5),
false,
false
));
var total = blob.Total();
tensorMemoryOwner = MemoryPool<float>.Shared.Rent((int)total);
blob.AsSpan<float>().CopyTo(tensorMemoryOwner.Memory.Span);
return new DenseTensor<float>(
tensorMemoryOwner.Memory[..(int)total],
new[] { 1, resizedImage.Channels(), resizedImage.Rows, resizedImage.Cols }
);
}
/// <summary>
/// Gets a label by its index.
/// </summary>
/// <param name="i">The index of the label.</param>
/// <param name="labels">The labels to search for the index.</param>
/// <returns>The label at the specified index.</returns>
public static string GetLabelByIndex(int i, IReadOnlyList<string> labels)
{
return i switch
{
var x when x > 0 && x <= labels.Count => labels[x - 1],
var x when x == labels.Count + 1 => " ",
_ => throw new Exception(
$"Unable to GetLabelByIndex: index {i} out of range {labels.Count}, OCR model or labels not matched?")
};
}
public static Mat Tensor2Mat(Tensor<float> tensor)
{
var dimensions = tensor.Dimensions;
if (dimensions.Length != 4 || dimensions[0] != 1 || dimensions[1] != 1)
throw new ArgumentException($"wrong tensor shape: {string.Join(",", dimensions.ToArray())}");
if (tensor is not DenseTensor<float> denseTensor)
return Mat.FromPixelData(dimensions[2], dimensions[3], MatType.CV_32FC1, tensor.ToArray());
var mat = new Mat(new Size(dimensions[3], dimensions[2]), MatType.CV_32FC1);
denseTensor.Buffer.Span.CopyTo(mat.AsSpan<float>());
return mat;
}
}
@@ -0,0 +1,47 @@
using BetterGenshinImpact.Core.Recognition.OCR.Engine.data;
namespace BetterGenshinImpact.Core.Recognition.OCR.Engine;
/// <summary>
/// ppocr的版本配置
/// </summary>
public readonly record struct OcrVersionConfig(
string Name,
OcrImgMode Mode,
bool ChannelFirst,
OcrNormalizeImage NormalizeImage,
OcrShape Shape)
{
// 参数来自 https://github.com/PaddlePaddle/PaddleOCR/tree/main/configs/det/PP-OCRv3
public static OcrVersionConfig PpOcrV3 = new(
"PP-OCRv3",
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)
);
public static OcrVersionConfig PpOcrV4 = new(
"PP-OCRv4",
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));
public static OcrVersionConfig PpOcrV5 = new(
"PP-OCRv5",
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));
}
@@ -0,0 +1,10 @@
namespace BetterGenshinImpact.Core.Recognition.OCR.Engine.data;
/// <summary>
/// 图像的颜色顺序
/// </summary>
public enum OcrImgMode
{
BGR,
RGB
}
@@ -0,0 +1,12 @@
namespace BetterGenshinImpact.Core.Recognition.OCR.Engine.data;
/// <summary>
/// Mat的通道顺序
/// hwc: height width channel
/// chw: channel height width
/// </summary>
public enum OcrMatOrder
{
Hwc,
Chw
}
@@ -0,0 +1,6 @@
namespace BetterGenshinImpact.Core.Recognition.OCR.Engine.data;
/// <summary>
/// 标准归一化的三个参数
/// </summary>
public record OcrNormalizeImage(float Scale, float[] Mean, float[] Std);
@@ -0,0 +1,6 @@
namespace BetterGenshinImpact.Core.Recognition.OCR.Engine.data;
/// <summary>
/// 图像形状表示
/// </summary>
public readonly record struct OcrShape(int Channel, int Width, int Height);
@@ -0,0 +1,12 @@
using OpenCvSharp;
namespace BetterGenshinImpact.Core.Recognition.OCR;
public interface IOcrService
{
public string Ocr(Mat mat);
public string OcrWithoutDetector(Mat mat);
public OcrResult OcrResult(Mat mat);
}
@@ -0,0 +1,154 @@
using System;
using System.Globalization;
using System.Threading.Tasks;
using BetterGenshinImpact.Core.Config;
using BetterGenshinImpact.Core.Recognition.OCR.Paddle;
using BetterGenshinImpact.Core.Recognition.ONNX;
using BetterGenshinImpact.GameTask;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace BetterGenshinImpact.Core.Recognition.OCR;
public class OcrFactory : IDisposable
{
// public static IOcrService Media = Create(OcrEngineTypes.Media);
public static IOcrService Paddle => App.ServiceProvider.GetRequiredService<OcrFactory>().PaddleOcr;
private IOcrService PaddleOcr => _paddleOcrService ??= Create(OcrEngineTypes.Paddle);
private IOcrService? _paddleOcrService;
private readonly ILogger<BgiOnnxFactory> _logger;
private readonly OtherConfig.Ocr _config;
/// <summary>
/// OCR 工厂,不可以直接实例化,请使用 App.ServiceProvider获取实例
/// </summary>
/// <param name="logger"></param>
public OcrFactory(ILogger<BgiOnnxFactory> logger)
{
_logger = logger;
_config = GetConfig();
}
/// <summary>
/// 创建
/// </summary>
private IOcrService Create(OcrEngineTypes type)
{
var result = type switch
{
OcrEngineTypes.Paddle => CreatePaddleOcrInstance(),
_ => throw new ArgumentOutOfRangeException(Enum.GetName(type), type, "不支持的 OCR 引擎类型")
};
_logger.LogDebug("创建了类型为 {Type} 的 OCR服务", Enum.GetName(type));
return result;
}
/// <summary>
/// 获取 OCR 配置
/// 为了单元测试
/// </summary>
/// <returns></returns>
private OtherConfig.Ocr GetConfig()
{
try
{
// 直接使用配置
return TaskContext.Instance().Config.OtherConfig.OcrConfig;
}
catch (Exception e)
{
// 如果配置获取失败,使用默认配置
_logger.LogWarning(e, "获取 OCR 配置失败,使用默认配置");
return new OtherConfig.Ocr();
}
}
/// <summary>
/// 若果配置中没有设置文化信息,则使用默认的文化信息
/// 为了单元测试
/// </summary>
/// <returns></returns>
private CultureInfo GetCultureInfo()
{
try
{
return new CultureInfo(TaskContext.Instance().Config.OtherConfig.GameCultureInfoName);
}
catch (Exception e)
{
var result = new CultureInfo(new OtherConfig().GameCultureInfoName);
_logger.LogInformation("获取游戏文化信息失败,使用默认文化信息: {CultureInfo}", result.Name);
return result;
}
}
private PaddleOcrService CreatePaddleOcrInstance()
{
return _config.PaddleOcrModelConfig switch
{
PaddleOcrModelConfig.V4Auto =>
new PaddleOcrService(App.ServiceProvider.GetRequiredService<BgiOnnxFactory>(),
PaddleOcrService.PaddleOcrModelType.FromCultureInfoV4(GetCultureInfo()) ??
PaddleOcrService.PaddleOcrModelType.V4),
PaddleOcrModelConfig.V5Auto =>
new PaddleOcrService(App.ServiceProvider.GetRequiredService<BgiOnnxFactory>(),
PaddleOcrService.PaddleOcrModelType.FromCultureInfo(GetCultureInfo()) ??
PaddleOcrService.PaddleOcrModelType.V5),
PaddleOcrModelConfig.V5 =>
new PaddleOcrService(App.ServiceProvider.GetRequiredService<BgiOnnxFactory>(),
PaddleOcrService.PaddleOcrModelType.V5),
PaddleOcrModelConfig.V4 =>
new PaddleOcrService(App.ServiceProvider.GetRequiredService<BgiOnnxFactory>(),
PaddleOcrService.PaddleOcrModelType.V4),
PaddleOcrModelConfig.V4En =>
new PaddleOcrService(App.ServiceProvider.GetRequiredService<BgiOnnxFactory>(),
PaddleOcrService.PaddleOcrModelType.V4En),
PaddleOcrModelConfig.V5Korean =>
new PaddleOcrService(App.ServiceProvider.GetRequiredService<BgiOnnxFactory>(),
PaddleOcrService.PaddleOcrModelType.V5Korean),
PaddleOcrModelConfig.V5Latin =>
new PaddleOcrService(App.ServiceProvider.GetRequiredService<BgiOnnxFactory>(),
PaddleOcrService.PaddleOcrModelType.V5Latin),
PaddleOcrModelConfig.V5Eslav =>
new PaddleOcrService(App.ServiceProvider.GetRequiredService<BgiOnnxFactory>(),
PaddleOcrService.PaddleOcrModelType.V5Eslav),
_ => throw new ArgumentOutOfRangeException(nameof(_config.PaddleOcrModelConfig),
_config.PaddleOcrModelConfig, "不支持的 Paddle OCR 模型配置")
};
}
public Task Unload()
{
if (_paddleOcrService is not IDisposable disposable)
{
_paddleOcrService = null;
return Task.CompletedTask;
}
try
{
disposable.Dispose();
_paddleOcrService = null;
}
catch (Exception ex)
{
_logger.LogError(ex, "卸载 OCR 服务时发生错误");
}
return Task.CompletedTask;
}
public void Dispose()
{
Unload().GetAwaiter().GetResult();
GC.SuppressFinalize(this);
}
~OcrFactory()
{
Dispose();
}
}
@@ -0,0 +1,68 @@
using System.Linq;
using OpenCvSharp;
namespace BetterGenshinImpact.Core.Recognition.OCR;
/// <summary>
/// Represents a region detected in an OCR result using Paddle OCR.
/// Sdcb.PaddleOCR
/// </summary>
public record struct OcrResultRegion(RotatedRect Rect, string Text, float Score);
public readonly record struct OcrRecognizerResult
{
/// <summary>
/// Initializes a new instance of the <see cref="OcrRecognizerResult" /> struct.
/// </summary>
/// <param name="text">The recognized text from the image.</param>
/// <param name="score">The confidence score of the text recognition.</param>
public OcrRecognizerResult(string text, float score)
{
Text = text;
Score = score;
}
/// <summary>
/// The recognized text from the image.
/// </summary>
public string Text { get; init; }
/// <summary>
/// The confidence score of the text recognition.
/// </summary>
public float Score { get; init; }
}
/// <summary>
/// Represents the OCR result of a paddle object detection model.
/// </summary>
public record OcrResult
{
/// <summary>
/// Initializes a new instance of the <see cref="OcrResult" /> class with the specified <paramref name="Regions" />.
/// </summary>
/// <param name="Regions">An array of <see cref="OcrResultRegion" /> objects representing the detected text regions.</param>
public OcrResult(OcrResultRegion[] Regions)
{
this.Regions = Regions;
}
/// <summary>
/// Gets an array of <see cref="OcrResultRegion" /> objects representing the detected text regions.
/// </summary>
/// <value>An array of <see cref="OcrResultRegion" /> objects representing the detected text regions.</value>
public OcrResultRegion[] Regions { get; }
/// <summary>
/// Concatenates the text from each <see cref="OcrResultRegion" /> object in <see cref="Regions" />
/// and returns the resulting string, ordered by the region's center positions.
/// </summary>
/// <value>
/// A string containing the concatenated text from each <see cref="OcrResultRegion" /> object
/// in <see cref="Regions" />, ordered by the region's center positions.
/// </value>
public string Text => string.Join("\n", Regions
.OrderBy(x => x.Rect.Center.Y)
.ThenBy(x => x.Rect.Center.X)
.Select(x => x.Text));
}
@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using BetterGenshinImpact.GameTask.AutoSkip.Model;
using BetterGenshinImpact.View.Drawable;
using OpenCvSharp;
namespace BetterGenshinImpact.Core.Recognition.OCR;
public static class OcrResultExtension
{
public static bool RegionHasText(this OcrResult result, ReadOnlySpan<char> text)
{
foreach (ref readonly var item in result.Regions.AsSpan())
if (item.Text.AsSpan().Contains(text, StringComparison.InvariantCulture))
return true;
return false;
}
public static OcrResultRegion FindRegionByText(this OcrResult result, ReadOnlySpan<char> text)
{
foreach (ref readonly var item in result.Regions.AsSpan())
if (item.Text.AsSpan().Contains(text, StringComparison.InvariantCulture))
return item;
return default;
}
public static Rect FindRectByText(this OcrResult result, string text)
{
foreach (ref var item in result.Regions.AsSpan())
if (item.Text.Contains(text))
return item.Rect.BoundingRect();
return default;
}
public static List<RectDrawable> ToRectDrawableList(this OcrResult result, Pen? pen = null)
{
return result.Regions.Select(item => item.Rect.BoundingRect().ToRectDrawable(pen)).ToList();
}
public static List<RectDrawable> ToRectDrawableListOffset(this OcrResult result, int offsetX, int offsetY,
Pen? pen = null)
{
return result.Regions.Select(item => item.Rect.BoundingRect().ToRectDrawable(offsetX, offsetY, pen)).ToList();
}
public static PaddleOcrResultRect ToOcrResultRect(this OcrResultRegion region)
{
return new PaddleOcrResultRect(region.Rect.BoundingRect(), region.Text, region.Score);
}
}
@@ -0,0 +1,200 @@
using System;
using System.Linq;
using BetterGenshinImpact.Core.Recognition.OCR.Engine;
using BetterGenshinImpact.Core.Recognition.ONNX;
using Microsoft.ML.OnnxRuntime;
using Microsoft.ML.OnnxRuntime.Tensors;
using OpenCvSharp;
namespace BetterGenshinImpact.Core.Recognition.OCR.Paddle;
public class Det(BgiOnnxModel model, OcrVersionConfig config, BgiOnnxFactory bgiOnnxFactory)
: IDisposable
{
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 size for dilation during preprocessing.</summary>
public int? DilatedSize { get; set; } = 2;
/// <summary>Gets or sets the score threshold for filtering out possible text boxes.</summary>
public float? BoxScoreThreshold { get; set; } = 0.7f;
/// <summary>Gets or sets the threshold to binarize the text region.</summary>
public float? BoxThreshold { get; set; } = 0.3f;
/// <summary>Gets or sets the minimum size of the text boxes to be considered as valid.</summary>
public int MinSize { get; set; } = 3;
/// <summary>Gets or sets the ratio for enlarging text boxes during post-processing.</summary>
public float UnclipRatio { get; set; } = 2.0f;
~Det()
{
lock (_session)
{
_session.Dispose();
}
}
public void Dispose()
{
lock (_session)
{
_session.Dispose();
}
GC.SuppressFinalize(this);
}
public RotatedRect[] Run(Mat src)
{
using var pred = RunRaw(src, out var resizedSize);
using Mat cbuf = new();
//OpenCvSharp.OpenCVException: 0 <= _colRange.start && _colRange.start <= _colRange.end && _colRange.end <= m.cols
using var roi = pred[0, resizedSize.Height, 0, resizedSize.Width];
roi.ConvertTo(cbuf, MatType.CV_8UC1, 255);
using Mat dilated = new();
using var binary = BoxThreshold != null
? cbuf.Threshold((int)(BoxThreshold * 255), 255, ThresholdTypes.Binary)
: cbuf;
if (DilatedSize != null)
{
using var ones =
Cv2.GetStructuringElement(MorphShapes.Rect, new Size(DilatedSize.Value, DilatedSize.Value));
Cv2.Dilate(binary, dilated, ones);
}
else
{
Cv2.CopyTo(binary, dilated);
}
var contours = dilated.FindContoursAsArray(RetrievalModes.List, ContourApproximationModes.ApproxSimple);
// var size = src.Size();
var scaleRate = 1.0 * src.Width / resizedSize.Width;
var rects = contours
.Where(x => BoxScoreThreshold == null || GetScore(x, pred) > BoxScoreThreshold)
.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);
return largerRect;
})
.OrderBy(v => v.Center.Y)
.ThenBy(v => v.Center.X)
.ToArray();
//{
// using Mat demo = dilated.CvtColor(ColorConversionCodes.GRAY2RGB);
// demo.DrawContours(contours, -1, Scalar.Red);
// Image(demo).Dump();
//}
return rects;
}
public Mat RunRaw(Mat src, out Size resizedSize)
{
var padded = src.Channels() switch
{
4 => src.CvtColor(ColorConversionCodes.BGRA2BGR),
1 => src.CvtColor(ColorConversionCodes.GRAY2BGR),
3 => src,
var x => throw new Exception($"Unexpect src channel: {x}, allow: (1/3/4)")
};
// DetResizeForTest resize_long
using (var resized = MatResize(padded, MaxSize))
{
resizedSize = new Size(resized.Width, resized.Height);
padded = MatPadding32(resized);
}
using (var _ = padded)
{
var inputTensor = OcrUtils.NormalizeToTensorDnn(padded, config.NormalizeImage.Scale,
config.NormalizeImage.Mean, config.NormalizeImage.Std, out var owner);
using (owner)
{
lock (_session)
{
using IDisposableReadOnlyCollection<DisposableNamedOnnxValue> results = _session.Run([
NamedOnnxValue.CreateFromTensor(_session.InputNames[0], inputTensor)
]);
var output = results[0];
if (output.ElementType is not TensorElementType.Float)
throw new Exception($"Unexpected output tensor type: {output.ElementType}");
if (output.ValueType is not OnnxValueType.ONNX_TYPE_TENSOR)
throw new Exception($"Unexpected output tensor value type: {output.ValueType}");
var outputTensor = output.AsTensor<float>();
return OcrUtils.Tensor2Mat(outputTensor);
// 因为一个已知bug,tensor中内存在dml下使用完后会被释放掉,锁之外的代码会报错
}
}
}
}
private static Mat MatPadding32(Mat src)
{
var size = src.Size();
Size newSize = new(
32 * Math.Ceiling(1.0 * size.Width / 32),
32 * Math.Ceiling(1.0 * size.Height / 32));
return src.CopyMakeBorder(0, newSize.Height - size.Height, 0, newSize.Width - size.Width, BorderTypes.Constant,
Scalar.Black);
}
/// <summary>
/// 按比例缩放图像,保持长边不超过 maxSize。
/// </summary>
/// <param name="src"></param>
/// <param name="maxSize"></param>
/// <returns></returns>
private static Mat MatResize(Mat src, int? maxSize)
{
if (maxSize == null) return src.Clone();
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();
}
private static float GetScore(Point[] contour, Mat pred)
{
var width = pred.Width;
var height = pred.Height;
var boxX = contour.Select(v => v.X).ToArray();
var boxY = contour.Select(v => v.Y).ToArray();
var xmin = Math.Clamp(boxX.Min(), 0, width - 1);
var xmax = Math.Clamp(boxX.Max(), 0, width - 1);
var ymin = Math.Clamp(boxY.Min(), 0, height - 1);
var ymax = Math.Clamp(boxY.Max(), 0, height - 1);
var rootPoints = contour
.Select(v => new Point(v.X - xmin, v.Y - ymin))
.ToArray();
using Mat mask = new(ymax - ymin + 1, xmax - xmin + 1, MatType.CV_8UC1, Scalar.Black);
mask.FillPoly(new[] { rootPoints }, new Scalar(1));
using var croppedMat = pred[ymin, ymax + 1, xmin, xmax + 1];
var score = (float)croppedMat.Mean(mask).Val0;
// Debug
//{
// using Mat cu = new Mat();
// croppedMat.ConvertTo(cu, MatType.CV_8UC1, 255);
// Util.HorizontalRun(true, Image(cu), Image(mask), score).Dump();
//}
return score;
}
public string GetConfigName => config.Name;
}
@@ -0,0 +1,358 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using BetterGenshinImpact.Core.Config;
using BetterGenshinImpact.Core.Recognition.OCR.Engine;
using BetterGenshinImpact.Core.Recognition.ONNX;
using BetterGenshinImpact.GameTask.Common.BgiVision;
using OpenCvSharp;
using OpenCvSharp.Extensions;
using YamlDotNet.Core;
using YamlDotNet.Core.Events;
using Size = OpenCvSharp.Size;
namespace BetterGenshinImpact.Core.Recognition.OCR.Paddle;
public class PaddleOcrService : IOcrService, IDisposable
{
/// <summary>
/// Usage:
/// https://github.com/sdcb/PaddleSharp/blob/master/docs/ocr.md
/// 模型列表:
/// https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.5/doc/doc_ch/models_list.md
/// </summary>
private readonly Det _localDetModel;
private readonly Rec _localRecModel;
public record PaddleOcrModelType(
BgiOnnxModel DetectionModel,
OcrVersionConfig DetectionVersion,
BgiOnnxModel RecognitionModel,
OcrVersionConfig RecognitionVersion,
Func<IReadOnlyList<string>> RecLabel,
String PreHeatImagePath
)
{
public static string TestImagePath = Global.Absolute(@"Assets\Model\PaddleOCR\test_pp_ocr.png");
public static string TestNumberImagePath =
Global.Absolute(@"Assets\Model\PaddleOCR\test_pp_ocr_number.png");
private static readonly Func<BgiOnnxModel, IReadOnlyList<string>> DefaultRecLabelFunc =
recModel =>
{
const string modelConfigFileName = "inference.yml";
var configFilePath = Path.Combine(
Path.GetDirectoryName(recModel.ModalPath) ??
throw new InvalidOperationException("Cannot get model directory"),
modelConfigFileName);
if (!File.Exists(configFilePath))
throw new FileNotFoundException(
$"PaddleOCR config file {modelConfigFileName} not found: {configFilePath}");
using var reader = new StreamReader(configFilePath);
var parser = new Parser(reader);
// Traverse YAML to find PostProcess:character_dict
while (parser.MoveNext())
{
if (parser.Current is not YamlDotNet.Core.Events.Scalar { Value: "PostProcess" }) continue;
parser.MoveNext(); // Should be MappingStart
while (parser.MoveNext())
{
if (parser.Current is not YamlDotNet.Core.Events.Scalar { Value: "character_dict" }) continue;
parser.MoveNext(); // Should be SequenceStart
var result = new List<string>();
while (parser.MoveNext())
{
switch (parser.Current)
{
case SequenceEnd:
return result;
case YamlDotNet.Core.Events.Scalar charScalar:
result.Add(charScalar.Value);
break;
}
}
}
}
throw new InvalidOperationException("未在 YAML 的 PostProcess 部分找到 character_dict。");
};
private static PaddleOcrModelType Create(
BgiOnnxModel detectionModel,
OcrVersionConfig detectionVersion,
BgiOnnxModel recognitionModel,
OcrVersionConfig recognitionVersion,
String? preHeatImagePath = null,
Func<IReadOnlyList<string>>? recLabel = null
)
{
return new PaddleOcrModelType(
detectionModel,
detectionVersion,
recognitionModel,
recognitionVersion,
recLabel ?? (() => DefaultRecLabelFunc(recognitionModel)),
TestImagePath);
}
public (Det, Rec) Build(BgiOnnxFactory onnxFactory)
{
return (
new Det(DetectionModel, DetectionVersion, onnxFactory),
new Rec(RecognitionModel, RecLabel(), RecognitionVersion, onnxFactory));
}
public static readonly PaddleOcrModelType V4 = Create(
BgiOnnxModel.PaddleOcrDetV4,
OcrVersionConfig.PpOcrV4,
BgiOnnxModel.PaddleOcrRecV4,
OcrVersionConfig.PpOcrV4);
public static readonly PaddleOcrModelType V4En = Create(
BgiOnnxModel.PaddleOcrDetV4,
OcrVersionConfig.PpOcrV4,
BgiOnnxModel.PaddleOcrRecV4En,
OcrVersionConfig.PpOcrV4,
TestNumberImagePath);
public static readonly PaddleOcrModelType V5 = Create(
BgiOnnxModel.PaddleOcrDetV5,
OcrVersionConfig.PpOcrV5,
BgiOnnxModel.PaddleOcrRecV5,
OcrVersionConfig.PpOcrV5);
public static readonly PaddleOcrModelType V5Latin = Create(
BgiOnnxModel.PaddleOcrDetV5,
OcrVersionConfig.PpOcrV5,
BgiOnnxModel.PaddleOcrRecV5Latin,
OcrVersionConfig.PpOcrV5);
public static readonly PaddleOcrModelType V5Eslav = Create(
BgiOnnxModel.PaddleOcrDetV5,
OcrVersionConfig.PpOcrV5,
BgiOnnxModel.PaddleOcrRecV5Eslav,
OcrVersionConfig.PpOcrV5);
public static readonly PaddleOcrModelType V5Korean = Create(
BgiOnnxModel.PaddleOcrDetV5,
OcrVersionConfig.PpOcrV5,
BgiOnnxModel.PaddleOcrRecV5Korean,
OcrVersionConfig.PpOcrV5);
/// <summary>
/// 这边多语言部分写的比较丑陋,但是能跑。可以根据PP-OCR的语言列表来优化。
/// </summary>
/// <param name="cultureInfo"></param>
/// <returns></returns>
public static PaddleOcrModelType? FromCultureInfo(CultureInfo cultureInfo)
{
HashSet<string> eslavLangs = new(StringComparer.OrdinalIgnoreCase)
{ "ru", "be", "uk" };
HashSet<string> latinLangs = new(StringComparer.OrdinalIgnoreCase)
{
"af", "az", "bs", "cs", "cy", "da", "de", "es", "et", "fr", "ga", "hr", "hu", "id", "is", "it", "ku",
"la",
"lt", "lv", "mi", "ms", "mt", "nl", "no", "oc", "pi", "pl", "pt", "ro", "rs_latin", "sk", "sl", "sq",
"sv",
"sw", "tl", "tr", "uz", "vi", "french", "german"
};
HashSet<string> ocrV5Langs = new(StringComparer.OrdinalIgnoreCase)
{ "zh", "chi", "zho", "en", "japan", "jp" };
// HashSet<string> SPECIAL_LANGS = new(StringComparer.OrdinalIgnoreCase)
// { "ch", "chinese_cht", "en", "japan", "korean" };
List<string> names =
[
cultureInfo.EnglishName.ToLowerInvariant(), cultureInfo.Name.ToLowerInvariant(),
cultureInfo.ThreeLetterISOLanguageName.ToLowerInvariant(),
cultureInfo.TwoLetterISOLanguageName.ToLowerInvariant()
];
foreach (var name in names)
{
if (name.Equals("korean") || name.Equals("ko"))
{
return V5Korean;
}
if (eslavLangs.Contains(name))
{
return V5Eslav;
}
if (latinLangs.Contains(name))
{
return V5Latin;
}
if (ocrV5Langs.Contains(name))
{
return V5;
}
}
return null;
}
/// <summary>
/// 中英文优先使用V4模型,其他语言使用V5模型
/// </summary>
/// <param name="cultureInfo"></param>
/// <returns></returns>
public static PaddleOcrModelType? FromCultureInfoV4(CultureInfo cultureInfo)
{
var v5 = FromCultureInfo(cultureInfo);
// 如果用的是v5, 那么优先用V4的细分模型
if (v5 == V5)
{
List<string> names =
[
cultureInfo.EnglishName.ToLowerInvariant(), cultureInfo.Name.ToLowerInvariant(),
cultureInfo.ThreeLetterISOLanguageName.ToLowerInvariant(),
cultureInfo.TwoLetterISOLanguageName.ToLowerInvariant()
];
foreach (var name in names)
{
if (name.Equals("en"))
{
return V4En;
}
else if (name.Equals("zh-hant") || name.Equals("zh-tw") || name.Equals("zh-hk"))
{
return V5;
}
}
return V4;
}
else
{
return v5;
}
}
}
public PaddleOcrService(BgiOnnxFactory bgiOnnxFactory, PaddleOcrModelType modelType)
{
var (modelsDet, modelsRec) = modelType.Build(bgiOnnxFactory);
_localDetModel = modelsDet;
_localRecModel = modelsRec;
// 预热模型
using var preHeatImageMat = Bv.ImRead(modelType.PreHeatImagePath) ??
throw new FileNotFoundException($"预热图片未找到: {modelType.PreHeatImagePath}");
// Debug输出结果
var preHeatResult = RunAll(preHeatImageMat, 1);
Debug.WriteLine(
$"PaddleOcrService 预热完成,使用模型: {modelType.DetectionModel.Name} 和 {modelType.RecognitionModel.Name},结果: {preHeatResult.Text}");
}
/// <summary>
/// 推荐传入三通道BGR mat,虽然四通道和单通道也做了兼容,但是三通道最快
/// </summary>
public string Ocr(Mat mat)
{
return OcrResult(mat).Text;
}
/// <summary>
/// 推荐传入三通道BGR mat,虽然四通道和单通道也做了兼容,但是三通道最快
/// </summary>
public OcrResult OcrResult(Mat mat)
{
if (mat.Channels() == 4)
{
using var mat3 = mat.CvtColor(ColorConversionCodes.BGRA2BGR);
return _OcrResult(mat3);
}
return _OcrResult(mat);
}
/// <summary>
/// 推荐传入三通道BGR mat,虽然四通道和单通道也做了兼容,但是三通道最快
/// </summary>
public string OcrWithoutDetector(Mat mat)
{
var startTime = Stopwatch.GetTimestamp();
var str = _localRecModel.Run(mat).Text;
var time = Stopwatch.GetElapsedTime(startTime);
Debug.WriteLine($"PaddleOcrWithoutDetector 耗时 {time.TotalMilliseconds}ms 结果: {str}");
return str;
}
private OcrResult _OcrResult(Mat mat)
{
var startTime = Stopwatch.GetTimestamp();
var result = RunAll(mat);
var time = Stopwatch.GetElapsedTime(startTime);
Debug.WriteLine($"PaddleOcr 耗时 {time.TotalMilliseconds}ms 结果: {result.Text}");
return result;
}
/// <summary>
/// 推荐传入三通道BGR mat,虽然四通道和单通道也做了兼容,但是三通道最快
/// </summary>
private OcrResult RunAll(Mat src, int recognizeBatchSize = 0)
{
var rects = _localDetModel.Run(src);
Mat[] mats =
rects.Select(rect =>
{
var roi = src[GetCropedRect(rect.BoundingRect(), src.Size())];
return roi;
})
.ToArray();
try
{
return new OcrResult(_localRecModel.Run(mats, recognizeBatchSize)
.Select((result, i) => new OcrResultRegion(rects[i], result.Text, result.Score))
.ToArray());
}
finally
{
foreach (var mat in mats) mat.Dispose();
}
}
/// <summary>
/// Gets the cropped region of the source image specified by the given rectangle, clamping the rectangle coordinates to
/// the image bounds.
/// </summary>
/// <param name="rect">The rectangle to crop.</param>
/// <param name="size">The size of the source image.</param>
/// <returns>The cropped rectangle.</returns>
private static Rect GetCropedRect(Rect rect, Size size)
{
return Rect.FromLTRB(
Math.Clamp(rect.Left, 0, size.Width),
Math.Clamp(rect.Top, 0, size.Height),
Math.Clamp(rect.Right, 0, size.Width),
Math.Clamp(rect.Bottom, 0, size.Height));
}
public void Dispose()
{
_localDetModel.Dispose();
_localRecModel.Dispose();
}
/// <summary>
/// 返回(DetConfigName, RecConfigName)
/// </summary>
public (string, string) GetConfigName
{
get
{
return (this._localDetModel.GetConfigName, this._localRecModel.GetConfigName);
}
}
}
@@ -0,0 +1,197 @@
using System;
using System.Buffers;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BetterGenshinImpact.Core.Recognition.OCR.Engine;
using BetterGenshinImpact.Core.Recognition.OCR.Engine.data;
using BetterGenshinImpact.Core.Recognition.ONNX;
using Microsoft.ML.OnnxRuntime;
using Microsoft.ML.OnnxRuntime.Tensors;
using OpenCvSharp;
namespace BetterGenshinImpact.Core.Recognition.OCR.Paddle;
public class Rec(
BgiOnnxModel model,
IReadOnlyList<string> labels,
OcrVersionConfig config,
BgiOnnxFactory bgiOnnxFactory)
: IDisposable
{
private readonly InferenceSession _session = bgiOnnxFactory.CreateInferenceSession(model, true);
// _labels = File.ReadAllLines(labelFilePath);
public void Dispose()
{
lock (_session)
{
_session.Dispose();
}
GC.SuppressFinalize(this);
}
~Rec()
{
lock (_session)
{
_session.Dispose();
}
}
/// <summary>
/// Run OCR recognition on multiple images in batches.
/// </summary>
/// <param name="srcs">Array of images for OCR recognition.</param>
/// <param name="batchSize">Size of the batch to run OCR recognition on.</param>
/// <returns>Array of <see cref="OcrRecognizerResult" /> instances corresponding to OCR recognition results of the images.</returns>
public OcrRecognizerResult[] Run(Mat[] srcs, int batchSize = 0)
{
if (srcs.Length == 0) return [];
var chooseBatchSize = batchSize != 0 ? batchSize : Math.Min(8, Environment.ProcessorCount);
return srcs
.Select((x, i) => (mat: x, i))
.OrderBy(x => x.mat.Width)
.Chunk(chooseBatchSize)
.Select(x => (result: RunMulti(x.Select(x1 => x1.mat).ToArray()), ids: x.Select(x1 => x1.i).ToArray()))
.SelectMany(x => x.result.Zip(x.ids, (result, i) => (result, i)))
.OrderBy(x => x.i)
.Select(x => x.result)
.ToArray();
}
public OcrRecognizerResult Run(Mat src)
{
return RunMulti([src]).Single();
}
private OcrRecognizerResult[] RunMulti(Mat[] srcs)
{
if (srcs.Length == 0) return [];
for (var i = 0; i < srcs.Length; ++i)
{
var src = srcs[i];
if (src.Empty())
throw new ArgumentException($"src[{i}] size should not be 0, wrong input picture provided?");
}
var modelHeight = config.Shape.Height;
var maxWidth = (int)Math.Ceiling(srcs.Max(src =>
{
var size = src.Size();
return 1.0 * size.Width / size.Height * modelHeight;
}));
List<IMemoryOwner<float>> owners = [];
(int[], float[])[] resultTensors;
try
{
resultTensors = srcs
// .AsParallel()
.Select(src =>
{
Mat? channel3 = default;
try
{
channel3 = src.Channels() switch
{
4 => src.CvtColor(ColorConversionCodes.BGRA2BGR),
1 => src.CvtColor(ColorConversionCodes.GRAY2BGR),
3 => src,
var x => throw new Exception($"Unexpect src channel: {x}, allow: (1/3/4)")
};
var result = OcrUtils.ResizeNormImg(channel3, new OcrShape(3, maxWidth, modelHeight),
out var owner);
lock (owners)
{
owners.Add(owner);
}
return result;
}
finally
{
// Only dispose Mats created in this scope
if (channel3 != null && !ReferenceEquals(channel3, src))
{
channel3.Dispose();
}
}
})
.Select(inputTensor =>
{
lock (_session)
{
// 多线程推理会出现问题,加锁解决。
using IDisposableReadOnlyCollection<DisposableNamedOnnxValue> results = _session.Run([
NamedOnnxValue.CreateFromTensor(_session.InputNames[0], inputTensor)
]);
var output = results[0];
if (output.ElementType is not TensorElementType.Float)
throw new Exception($"Unexpected output tensor type: {output.ElementType}");
if (output.ValueType is not OnnxValueType.ONNX_TYPE_TENSOR)
throw new Exception($"Unexpected output tensor value type: {output.ValueType}");
var tensor = output.AsTensor<float>();
// 因为一个已知bug,tensor中内存在dml下使用完后会被释放掉,锁之外的代码会报错
return (tensor.Dimensions.ToArray(), tensor.ToArray());
}
}
).ToArray();
}
finally
{
owners.ForEach(x => { x.Dispose(); });
}
return resultTensors.SelectMany(resultTensor =>
{
var resultArray = resultTensor.Item2;
var resultShape = resultTensor.Item1;
var labelCount = resultShape[2];
var charCount = resultShape[1];
return Enumerable.Range(0, resultShape[0])
.Select(i =>
{
StringBuilder sb = new();
var lastIndex = 0;
float score = 0;
var batchOffset = i * charCount * labelCount;
for (var n = 0; n < charCount; ++n)
{
var rowOffset = batchOffset + n * labelCount;
var maxVal = float.MinValue;
var maxIndex = 0;
for (var c = 0; c < labelCount; c++)
{
var value = resultArray[rowOffset + c];
if (value > maxVal)
{
maxVal = value;
maxIndex = c;
}
}
if (maxIndex > 0 && !(n > 0 && maxIndex == lastIndex))
{
score += maxVal;
sb.Append(OcrUtils.GetLabelByIndex(maxIndex, labels));
}
lastIndex = maxIndex;
}
var text = sb.ToString();
return new OcrRecognizerResult(text, text.Length > 0 ? score / text.Length : 0);
})
.ToArray();
}).ToArray();
}
public string GetConfigName => config.Name;
}
@@ -0,0 +1,585 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using BetterGenshinImpact.Core.Config;
using BetterGenshinImpact.GameTask;
using Microsoft.Extensions.Logging;
using Microsoft.ML.OnnxRuntime;
using Microsoft.Win32;
using Vanara;
namespace BetterGenshinImpact.Core.Recognition.ONNX;
public class BgiOnnxFactory
{
private readonly ILogger _logger;
/// <summary>
/// 缓存模型路径。如果一开始使用缓存就一直使用缓存文件,如果没有使用缓存就一直使用原始模型路径。
/// <br />
/// 这样能避免并发加载模型问题。比如使用了未完全构建好的缓存文件,导致模型加载失败。
/// </summary>
private readonly ConcurrentDictionary<BgiOnnxModel, string?> _cachedModelPaths = new();
/// <summary>
/// 请勿直接实例化此类
/// </summary>
/// <param name="logger"></param>
public BgiOnnxFactory(ILogger<BgiOnnxFactory> logger)
{
_logger = logger;
var config = GetConfig();
if (config.AutoAppendCudaPath) AppendCudaPath();
if (string.IsNullOrWhiteSpace(config.AdditionalPath))
AppendPath(config.AdditionalPath.Split(Path.PathSeparator));
OptimizedModel = config.OptimizedModel;
CudaDeviceId = config.CudaDevice;
DmlDeviceId = config.GpuDevice;
TrtUseEmbedMode = config.EmbedTensorRtCache;
EnableCache = config.EnableTensorRtCache;
CpuOcr = config.CpuOcr;
OpenVinoDevice = config.OpenVinoDevice;
OpenVinoCache = config.EnableOpenVinoCache;
ProviderTypes = GetProviderType(config.InferenceDevice);
_logger.LogDebug(
"[ONNX]启用的provider:{Device},初始化参数: InferenceDevice={InferenceDevice}, OptimizedModel={OptimizedModel}, CudaDeviceId={CudaDeviceId}, DmlDeviceId={DmlDeviceId}, EmbedTensorRtCache={EmbedTensorRtCache}, EnableTensorRtCache={EnableTensorRtCache}, CpuOcr={CpuOcr}",
string.Join(",", ProviderTypes.Select<ProviderType, string>(Enum.GetName!)),
config.InferenceDevice,
OptimizedModel,
CudaDeviceId,
DmlDeviceId,
TrtUseEmbedMode,
EnableCache,
CpuOcr);
}
/// <summary>
/// 获取 硬件加速配置
/// 为了单元测试
/// </summary>
/// <returns></returns>
private HardwareAccelerationConfig GetConfig()
{
try
{
// 直接使用配置
return TaskContext.Instance().Config.HardwareAccelerationConfig;
}
catch (Exception e)
{
// 如果配置获取失败,使用默认配置
_logger.LogWarning(e, "获取硬件加速配置失败,使用默认配置");
return new HardwareAccelerationConfig();
}
}
public ProviderType[] ProviderTypes { get; }
public int DmlDeviceId { get; }
public int CudaDeviceId { get; }
public bool OptimizedModel { get; }
public bool TrtUseEmbedMode { get; }
public string OpenVinoDevice { get; }
public bool EnableCache { get; }
public bool CpuOcr { get; }
public bool OpenVinoCache { get; }
/// <summary>
/// 根据InferenceDeviceType选择Provider
/// </summary>
/// <param name="inferenceDeviceType">InferenceDeviceType</param>
/// <returns></returns>
/// <exception cref="InvalidEnumArgumentException"></exception>
private ProviderType[] GetProviderType(InferenceDeviceType inferenceDeviceType)
{
switch (inferenceDeviceType)
{
case InferenceDeviceType.Cpu:
return [ProviderType.Cpu];
case InferenceDeviceType.GpuDirectMl:
//只用dml不加cpu的话在很多场景下性能很差。
return [ProviderType.Dml, ProviderType.Cpu];
case InferenceDeviceType.Gpu:
{
List<ProviderType> list = [];
SessionOptions? testSession = null;
var hasGpu = false;
if (!hasGpu && CudaDeviceId >= 0)
// tensorrt本身包含cuda,设备id也是cuda的id,且比纯cuda效果好很多。
try
{
testSession = SessionOptions.MakeSessionOptionWithTensorrtProvider(CudaDeviceId);
list.Add(ProviderType.TensorRt);
hasGpu = true;
}
catch (Exception e)
{
_logger.LogDebug("[init]无法加载TensorRt。可能不支持,跳过。({Err})", e.Message);
}
finally
{
testSession?.Dispose();
}
if (!hasGpu && DmlDeviceId >= 0)
// dml效果不如tensorrt,但是比纯cuda稳定性强
try
{
testSession = new SessionOptions();
testSession.AppendExecutionProvider_DML(DmlDeviceId);
list.Add(ProviderType.Dml);
hasGpu = true;
}
catch (Exception e)
{
_logger.LogDebug("[init]无法加载DML。可能不支持,跳过。({Err})", e.Message);
}
finally
{
testSession?.Dispose();
}
if (!hasGpu && CudaDeviceId >= 0)
// cuda优先级比较低,因为跑起来并不太理想。
try
{
testSession = SessionOptions.MakeSessionOptionWithCudaProvider(CudaDeviceId);
list.Add(ProviderType.Cuda);
hasGpu = true;
}
catch (Exception e)
{
_logger.LogDebug("[init]无法加载Cuda。可能不支持,跳过。({Err})", e.Message);
}
finally
{
testSession?.Dispose();
}
if (!hasGpu) _logger.LogWarning("[init]GPU自动选择失败,回退到CPU处理");
//无论如何都要加入cpu,一些计算在纯gpu上不被支持或性能很烂
list.Add(ProviderType.Cpu);
return list.ToArray();
}
case InferenceDeviceType.OpenVino:
{
List<ProviderType> list = [];
SessionOptions? testSession = null;
// OpenVino是英特尔的OpenVINO执行提供程序
// 目前来看比Dml强
try
{
testSession = new SessionOptions();
testSession.AppendExecutionProvider("OpenVINO", GetOpenVinoProviderConfig(null));
testSession.GraphOptimizationLevel = GraphOptimizationLevel.ORT_DISABLE_ALL;
list.Add(ProviderType.OpenVino);
}
catch (Exception e)
{
_logger.LogDebug("[init]无法加载OpenVino。可能不支持,跳过。({Err})", e.Message);
}
finally
{
testSession?.Dispose();
}
list.Add(ProviderType.Cpu);
return list.ToArray();
}
default:
throw new InvalidEnumArgumentException("无效的推理设备");
}
}
/// <summary>
/// 自动嗅探并修改path以加载cuda
/// </summary>
private void AppendCudaPath()
{
var cudaVersion =
Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\GPU Computing Toolkit\CUDA",
"FirstVersionInstalled", null)?.ToString() ?? "v12.8";
string[] filePrefix = ["cudnn", "nvrtc", "cudart", "nvinfer", "cublas", "onnx"];
string[] environmentVariableNames = ["PATH", "CUDA_PATH", "CUDNN_PATH", "LD_LIBRARY_PATH"];
// 例如: CUDNN\v9.8\lib\12.8\x64
var validPaths = environmentVariableNames.SelectMany(s => Environment
// 获取所有可能包含CUDA/cuDNN路径的环境变量
.GetEnvironmentVariable(s, EnvironmentVariableTarget.Process)?
.Split(Path.PathSeparator) ?? []).Distinct()
// 环境变量下层文件夹
.SelectMany<string, string>(s =>
// lib路径
[s, Path.Combine(s, cudaVersion), Path.Combine(s, "bin"), Path.Combine(s, "lib")])
.SelectMany<string, string>(
// cuda的版本
s => cudaVersion.StartsWith("v", StringComparison.InvariantCultureIgnoreCase)
? [s, Path.Combine(s, cudaVersion), Path.Combine(s, cudaVersion[1..])]
: [s, Path.Combine(s, cudaVersion)])
.SelectMany<string, string>(s =>
{
// 体系架构
var architecture = Enum.GetName(RuntimeInformation.ProcessArchitecture);
if (architecture is null) return [s];
return
[
s, Path.Combine(s, architecture), Path.Combine(s, architecture.ToLowerInvariant()),
Path.Combine(s, architecture.ToUpperInvariant())
];
})
.Where(basePath => !string.IsNullOrWhiteSpace(basePath))
//构建完了需要搜索的路径,去重。
.Distinct()
//确定路径是否真的存在
.Where(d =>
{
try
{
return Directory.Exists(d);
}
catch (Exception)
{
return false;
}
})
.SelectMany(s =>
//确定需要的文件是否存在
filePrefix.SelectMany(se =>
{
try
{
return Directory.GetFiles(s, $"{se}*.dll").Select(Path.GetDirectoryName).WhereNotNull();
}
catch (Exception)
{
return [];
}
}))
//去重
.Distinct();
AppendPath(validPaths.ToArray());
}
/// <summary>
/// 将附加的path应用进来
/// </summary>
/// <param name="extraPath">附加的path字符串</param>
private void AppendPath(string[] extraPath)
{
if (extraPath.Length <= 0) return;
var pathVariables = Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.Process)
?.Split(Path.PathSeparator).ToList() ?? new List<string>();
pathVariables.AddRange(extraPath);
if (pathVariables.Count <= 0)
{
_logger.LogWarning("[GpuAuto]SetCudaPath:No valid paths found.");
return;
}
var updatedPath = string.Join(Path.PathSeparator, pathVariables.Distinct());
_logger.LogDebug("[GpuAuto]修改进程PATH为:{UpdatedPath}", updatedPath);
Environment.SetEnvironmentVariable("PATH", updatedPath, EnvironmentVariableTarget.Process);
}
/// <summary>
/// 根据模型创建一个YoloPredictor
/// </summary>
/// <param name="model">模型</param>
/// <returns>BgiYoloPredictor</returns>
public BgiYoloPredictor CreateYoloPredictor(BgiOnnxModel model)
{
// logger.LogDebug("[Yolo]创建yolo预测器,模型: {ModelName}", model.Name);
if (!EnableCache) return new BgiYoloPredictor(model, model.ModalPath, CreateSessionOptions(model, false));
var cached = GetCached(model);
return cached == null
? new BgiYoloPredictor(model, model.ModalPath, CreateSessionOptions(model, true))
: new BgiYoloPredictor(model, cached, CreateSessionOptions(model, false));
}
/// <summary>
/// 根据模型创建一个onnx运行时的InferenceSession
/// </summary>
/// <param name="model">模型</param>
/// <param name="ocr">是否是用于ocr的模型,默认false</param>
/// <returns>InferenceSession</returns>
public InferenceSession CreateInferenceSession(BgiOnnxModel model, bool ocr = false)
{
_logger.LogDebug("[ONNX]创建推理会话,模型: {ModelName}", model.Name);
ProviderType[]? providerTypes = null;
if (CpuOcr && ocr) providerTypes = [ProviderType.Cpu];
if (!EnableCache)
return new InferenceSession(model.ModalPath, CreateSessionOptions(model, false, providerTypes));
var cached = GetCached(model, providerTypes);
return cached == null
? new InferenceSession(model.ModalPath, CreateSessionOptions(model, true, providerTypes))
: new InferenceSession(cached, CreateSessionOptions(model, false, providerTypes));
}
/// <summary>
/// 获取带有缓存的模型(目前只支持TensorRT)
/// </summary>
/// <param name="model">模型</param>
/// <param name="forcedProvider">强制使用的 providerTypes</param>
/// <returns>带有缓存的模型绝对路径,null表示尚未创建缓存</returns>
private string? GetCached(BgiOnnxModel model, ProviderType[]? forcedProvider = null)
{
var providerTypes = forcedProvider ?? ProviderTypes;
// 目前只支持TensorRT
if (!providerTypes.Contains(ProviderType.TensorRt)) return null;
var result = _cachedModelPaths.GetOrAdd(model, _GetCached);
if (result is null) return result;
// 判断文件是否存在
if (File.Exists(result)) return result;
_logger.LogWarning("[ONNX]模型 {Model} 的缓存文件可能已被删除,使用原始模型文件。", model.Name);
return null;
}
private string? _GetCached(BgiOnnxModel model)
{
if (model.ModelRelativePath.StartsWith(BgiOnnxModel.ModelCacheRelativePath) &&
model.ModelRelativePath.EndsWith("_ctx.onnx"))
// 这已经是带有缓存的文件路径了
return model.ModalPath;
var ctxA = Path.Combine(model.CachePath, "trt", "_ctx.onnx");
if (File.Exists(ctxA))
{
_logger.LogDebug("[ONNX]模型 {Model} 命中TRT匿名缓存文件: {Path}", model.Name, ctxA);
return ctxA;
}
var ctxB = Path.Combine(model.CachePath, "trt",
Path.GetFileNameWithoutExtension(model.ModalPath) + "_ctx.onnx");
if (File.Exists(ctxB))
{
_logger.LogDebug("[ONNX]模型 {Model} 命中TRT命名缓存文件: {Path}", model.Name, ctxB);
return ctxB;
}
_logger.LogDebug("[ONNX]没有找到模型 {Model} 的模型缓存文件。", model.Name);
return null;
}
/// <summary>
/// 通过模型路径生成SessionOptions <br />
/// 如果加载的模型文件已经是带有缓存的模型,请将cacheFolder设为null避免重复生成。
/// </summary>
/// <param name="model">模型路径</param>
/// <param name="genCache">是否生成缓存。有几种情况下不生成缓存:1为用户主动关闭,即enableCache为false。2为即将加载的模型文件已经是带有缓存的模型文件。</param>
/// <param name="forcedProvider">强制使用的Provider,为空或null则不强制</param>
/// <returns></returns>
/// <exception cref="InvalidEnumArgumentException"></exception>
private SessionOptions CreateSessionOptions(BgiOnnxModel model, bool genCache,
ProviderType[]? forcedProvider = null)
{
var sessionOptions = new SessionOptions();
foreach (var type in
forcedProvider is null || forcedProvider.Length == 0 ? ProviderTypes : forcedProvider)
try
{
switch (type)
{
case ProviderType.Dml:
// DirectML 执行提供程序不支持在 onnxruntime 中使用内存模式优化或并行执行。在创建 InferenceSession 期间提供会话选项时,必须禁用这些选项,否则将返回错误。
sessionOptions.AppendExecutionProvider_DML(DmlDeviceId);
sessionOptions.EnableMemoryPattern = false;
sessionOptions.ExecutionMode = ExecutionMode.ORT_SEQUENTIAL;
break;
case ProviderType.Cpu:
sessionOptions.AppendExecutionProvider_CPU();
// if (model.Name.Contains("PpOcr") || model.Name.Contains("Yap"))
// {
// sessionOptions.IntraOpNumThreads = 2; // 限制算子内部并行线程数
// sessionOptions.InterOpNumThreads = 1; // 限制算子间并行线程数(顺序执行)
// }
break;
case ProviderType.Dnnl:
sessionOptions.AppendExecutionProvider_Dnnl();
break;
case ProviderType.OpenVino:
sessionOptions.AppendExecutionProvider("OpenVINO",
GetOpenVinoProviderConfig(OpenVinoCache ? model.CachePath : null));
sessionOptions.GraphOptimizationLevel = GraphOptimizationLevel.ORT_DISABLE_ALL;
break;
case ProviderType.TensorRt:
using (var options = new OrtTensorRTProviderOptions())
{
options.UpdateOptions(GetTrtProviderConfig(genCache ? model.CachePath : null));
sessionOptions.AppendExecutionProvider_Tensorrt(options);
}
break;
case ProviderType.Cuda:
using (var options = new OrtCUDAProviderOptions())
{
options.UpdateOptions(GetCudaProviderConfig());
sessionOptions.AppendExecutionProvider_CUDA();
}
break;
default:
throw new InvalidEnumArgumentException("无效的推理设备");
}
}
catch (Exception e)
{
_logger.LogError("无法加载指定的 ONNX provider {Provider},跳过。请检查推理设备配置是否正确。({Err})", Enum.GetName(type),
e.Message);
}
if (!OptimizedModel) return sessionOptions;
if (!genCache) return sessionOptions;
var optPath = Path.Combine(model.CachePath, "optimized");
if (!Directory.Exists(optPath)) Directory.CreateDirectory(optPath);
sessionOptions.OptimizedModelFilePath = Path.Combine(optPath, Path.GetFileName(model.ModalPath));
return sessionOptions;
}
/// <summary>
/// 获取TensorRT的配置
/// </summary>
/// <param name="cacheFolder">缓存生成的目录</param>
/// <returns>trt配置</returns>
private Dictionary<string, string> GetTrtProviderConfig(string? cacheFolder)
{
if (cacheFolder is null)
{
// 不使用缓存目录
var r = new Dictionary<string, string>
{
["device_id"] = CudaDeviceId.ToString()
};
return r;
}
var result = new Dictionary<string, string>
{
["trt_engine_cache_enable"] = "1",
["trt_dump_ep_context_model"] = "1",
["trt_ep_context_file_path"] = Path.Combine(cacheFolder, "trt"),
// ["trt_ep_context_embed_mode"] = "1", // 因为yoloSharp是把模型转为嵌入式运行,不这样会爆炸
// ["trt_engine_cache_path"] = ".\\" // 没必要了
["trt_timing_cache_enable"] = "1",
["trt_timing_cache_path"] =
Global.Absolute(Path.Combine(BgiOnnxModel.ModelCacheRelativePath, "trt_timing")),
// ["trt_force_timing_cache"] = "1",
["device_id"] = CudaDeviceId.ToString()
};
if (TrtUseEmbedMode)
{
result["trt_ep_context_embed_mode"] = "1";
}
else
{
result["trt_ep_context_embed_mode"] = "0";
result["trt_engine_cache_path"] = ".\\";
}
if (!Directory.Exists(result["trt_ep_context_file_path"]))
{
// 如果不存在就创建目录
_logger.LogDebug("[ONNX]TensorRT上下文文件路径不存在,创建目录: {Path}", result["trt_ep_context_file_path"]);
try
{
Directory.CreateDirectory(result["trt_ep_context_file_path"]);
}
catch (Exception e)
{
_logger.LogError("无法创建TensorRT上下文文件路径: {Path},请检查权限。({Err})",
result["trt_ep_context_file_path"], e.Message);
// 如果无法创建目录,就不使用缓存
result.Remove("trt_ep_context_file_path");
}
}
if (!Directory.Exists(result["trt_timing_cache_path"]))
{
// 如果不存在就创建目录
_logger.LogDebug("[ONNX]TensorRT计时缓存路径不存在,创建目录: {Path}", result["trt_timing_cache_path"]);
try
{
Directory.CreateDirectory(result["trt_timing_cache_path"]);
}
catch (Exception e)
{
_logger.LogError("无法创建TensorRT计时缓存路径: {Path},请检查权限。({Err})",
result["trt_timing_cache_path"], e.Message);
// 如果无法创建目录,就不使用缓存
result.Remove("trt_timing_cache_path");
}
}
return result;
}
/// <summary>
/// 获取cuda provider的配置
/// </summary>
/// <returns>cuda配置</returns>
private Dictionary<string, string> GetCudaProviderConfig()
{
var result = new Dictionary<string, string>
{
["device_id"] = CudaDeviceId.ToString()
};
return result;
}
/// <summary>
///
/// </summary>
/// <param name="cacheFolder"></param>
/// <returns></returns>
private Dictionary<string, string> GetOpenVinoProviderConfig(string? cacheFolder)
{
var result = new Dictionary<string, string>();
if (!string.IsNullOrWhiteSpace(OpenVinoDevice))
{
result["deice_type"] = OpenVinoDevice;
}
if (!string.IsNullOrWhiteSpace(cacheFolder))
{
// OpenVINO缓存目录
result["cache_dir"] = Path.Combine(cacheFolder, "openvino");
if (!Directory.Exists(result["cache_dir"]))
{
try
{
Directory.CreateDirectory(result["cache_dir"]);
}
catch (Exception e)
{
_logger.LogError("无法创建OpenVINO缓存目录: {Path},请检查权限。({Err})", result["cache_dir"],
e.Message);
// 如果无法创建目录,就不使用缓存
result.Remove("cache_dir");
}
}
}
result["enable_opencl_throttling"] = "true";
return result;
}
}
@@ -0,0 +1,147 @@
using System.Collections.Generic;
using System.Collections.Immutable;
using System.IO;
using BetterGenshinImpact.Core.Config;
namespace BetterGenshinImpact.Core.Recognition.ONNX;
public class BgiOnnxModel
{
/// <summary>
/// 模型使用的缓存文件的相对目录
/// </summary>
public static readonly string ModelCacheRelativePath = Path.Combine("Cache", Global.Version, "Model");
private static readonly List<BgiOnnxModel> RegisteredModels = [];
public string Name { get; private init; }
public string ModelRelativePath { get; private init; }
public string ModalPath => Global.Absolute(ModelRelativePath);
public string CacheRelativePath { get; private init; }
public string CachePath => Global.Absolute(CacheRelativePath);
#region 模型注册
// 模型注册在这里,这样可以方便预先对模型预热和缓存管理等操作,避免冲突。
// 硬编码虽然不那么优雅,但是也没想到什么好的解决办法
/// <summary>
/// yap文字识别
/// </summary>
public static readonly BgiOnnxModel YapModelTraining =
Register("YapModelTraining", @"Assets\Model\Yap\model_training.onnx");
/// <summary>
/// 钓鱼模型
/// </summary>
public static readonly BgiOnnxModel BgiFish = Register("BgiFish", @"Assets\Model\Fish\bgi_fish.onnx");
/// <summary>
/// 秘境中古树
/// </summary>
public static readonly BgiOnnxModel BgiTree = Register("BgiTree", @"Assets\Model\Domain\bgi_tree.onnx");
/// <summary>
/// 用于捡东西等的大世界模型
/// </summary>
public static readonly BgiOnnxModel BgiWorld = Register("BgiTree", @"Assets\Model\World\bgi_world.onnx");
/// <summary>
/// 矿物识别模型
/// </summary>
public static readonly BgiOnnxModel BgiMine = Register("BgiMine", @"Assets\Model\Mine\bgi_mine.onnx");
/// <summary>
/// 角色识别
/// </summary>
public static readonly BgiOnnxModel BgiAvatarSide =
Register("BgiAvatarSide", @"Assets\Model\Common\avatar_side_classify_sim.onnx");
/// <summary>
/// paddleOCR V4 检测模型
/// </summary>
public static readonly BgiOnnxModel PaddleOcrDetV4 =
Register("PpOcrDetV4", @"Assets\Model\PaddleOCR\Det\V4\PP-OCRv4_mobile_det_infer\slim.onnx");
/// <summary>
/// paddleOCR V5 检测模型
/// </summary>
public static readonly BgiOnnxModel PaddleOcrDetV5 =
Register("PpOcrDetV5", @"Assets\Model\PaddleOCR\Det\V5\PP-OCRv5_mobile_det_infer\slim.onnx");
/// <summary>
/// paddleOCR V4 识别模型
/// </summary>
public static readonly BgiOnnxModel PaddleOcrRecV4 =
Register("PpOcrRecV4", @"Assets\Model\PaddleOCR\Rec\V4\PP-OCRv4_mobile_rec_infer\slim.onnx");
/// <summary>
/// paddleOCR V4 英文/数字 识别模型
/// </summary>
public static readonly BgiOnnxModel PaddleOcrRecV4En =
Register("PpOcrRecV4En", @"Assets\Model\PaddleOCR\Rec\V4\en_PP-OCRv4_mobile_rec_infer\slim.onnx");
/// <summary>
/// paddleOCR V5 识别模型
/// </summary>
public static readonly BgiOnnxModel PaddleOcrRecV5 =
Register("PpOcrRecV5", @"Assets\Model\PaddleOCR\Rec\V5\PP-OCRv5_mobile_rec_infer\slim.onnx");
/// <summary>
/// paddleOCR V5 拉丁文 识别模型
/// </summary>
public static readonly BgiOnnxModel PaddleOcrRecV5Latin =
Register("PpOcrRecV5Latin", @"Assets\Model\PaddleOCR\Rec\V5\latin_PP-OCRv5_mobile_rec_infer\slim.onnx");
/// <summary>
/// paddleOCR V5 斯拉夫文 识别模型
/// </summary>
public static readonly BgiOnnxModel PaddleOcrRecV5Eslav =
Register("PpOcrRecV5Eslav", @"Assets\Model\PaddleOCR\Rec\V5\eslav_PP-OCRv5_mobile_rec_infer\slim.onnx");
/// <summary>
/// paddleOCR V5 韩文 识别模型
/// </summary>
public static readonly BgiOnnxModel PaddleOcrRecV5Korean =
Register("PpOcrRecV5Korean", @"Assets\Model\PaddleOCR\Rec\V5\korean_PP-OCRv5_mobile_rec_infer\slim.onnx");
#endregion
private BgiOnnxModel(string name, string modelRelativePath, string cacheRelativePath)
{
Name = name;
ModelRelativePath = modelRelativePath;
CacheRelativePath = cacheRelativePath;
}
public static bool IsModelExist(BgiOnnxModel model)
{
return File.Exists(model.ModalPath);
}
/// <summary>
/// 获取全部已注册的模型文件
/// </summary>
/// <returns></returns>
public static ImmutableList<BgiOnnxModel> GetAll()
{
return RegisteredModels.ToImmutableList();
}
private static BgiOnnxModel Register(string name, string modelRelativePath)
{
return Register(name, modelRelativePath, Path.Combine(ModelCacheRelativePath, name));
}
private static BgiOnnxModel Register(string name, string modelRelativePath, string cacheRelativePath)
{
var model = new BgiOnnxModel(name, modelRelativePath, cacheRelativePath);
var cachePath = model.CachePath;
if (!Directory.Exists(cachePath))
{
Directory.CreateDirectory(cachePath);
}
RegisteredModels.Add(model);
return model;
}
}
@@ -0,0 +1,85 @@
using System;
using BetterGenshinImpact.GameTask.Model.Area;
using OpenCvSharp;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text.Json;
using BetterGenshinImpact.View.Drawable;
using Compunet.YoloSharp;
using Microsoft.ML.OnnxRuntime;
namespace BetterGenshinImpact.Core.Recognition.ONNX;
public class BgiYoloPredictor : IDisposable
{
private readonly BgiOnnxModel _model;
private readonly Lazy<YoloPredictor> _lazyPredictor;
/// <summary>
/// 使用 BgiOnnxFactory 创建这个类的实例
/// </summary>
/// <param name="onnxModel">模型</param>
/// <param name="modelPath">实际要加载的模型文件的绝对路径,在使用模型缓存的场景下可能有差别</param>
/// <param name="sessionOptions">sessionOptions</param>
protected internal BgiYoloPredictor(BgiOnnxModel onnxModel, string modelPath, SessionOptions sessionOptions)
{
_model = onnxModel;
_lazyPredictor = new Lazy<YoloPredictor>(() => new YoloPredictor(modelPath,
new YoloPredictorOptions
{
SessionOptions = sessionOptions
}));
}
public YoloPredictor Predictor => _lazyPredictor.Value;
/// <summary>
/// 检测
/// </summary>
/// <param name="region">图像</param>
/// <returns>类别-矩形框</returns>
public Dictionary<string, List<Rect>> Detect(ImageRegion region)
{
var result = Predictor.Detect(region.CacheImage);
var dict = new Dictionary<string, List<Rect>>();
foreach (var box in result)
{
if (!dict.TryGetValue(box.Name.Name, out var value))
{
dict[box.Name.Name] = [new Rect(box.Bounds.X, box.Bounds.Y, box.Bounds.Width, box.Bounds.Height)];
}
else
{
value.Add(new Rect(box.Bounds.X, box.Bounds.Y, box.Bounds.Width, box.Bounds.Height));
}
}
Debug.WriteLine("YOLO识别结果:" + JsonSerializer.Serialize(dict));
var list = result
.Select(box => new Rect(box.Bounds.X, box.Bounds.Y, box.Bounds.Width, box.Bounds.Height))
.Select(rect => region.ToRectDrawable(rect, _model.Name)).ToList();
VisionContext.Instance().DrawContent.PutOrRemoveRectList(_model.Name, list);
return dict;
}
public void Dispose()
{
if (_lazyPredictor.IsValueCreated)
{
Predictor.Dispose();
}
}
~BgiYoloPredictor()
{
Dispose();
}
}
@@ -0,0 +1,9 @@
namespace BetterGenshinImpact.Core.Recognition.ONNX;
public enum InferenceDeviceType
{
Cpu,
GpuDirectMl,
Gpu,
OpenVino
}
@@ -0,0 +1,13 @@
namespace BetterGenshinImpact.Core.Recognition.ONNX;
public enum ProviderType
{
TensorRt,
Cuda,
Dml,
Cpu,
Dnnl,
OpenVino
}
@@ -0,0 +1,11 @@
using OpenCvSharp;
namespace BetterGenshinImpact.Core.Recognition.ONNX.SVTR;
/// <summary>
/// 文字识别推理(SVTR网络)
/// </summary>
public interface ITextInference
{
public string Inference(Mat mat);
}
@@ -0,0 +1,119 @@
using BetterGenshinImpact.Core.Config;
using Microsoft.ML.OnnxRuntime;
using Microsoft.ML.OnnxRuntime.Tensors;
using OpenCvSharp;
using System;
using System.Buffers;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using BetterGenshinImpact.Core.Recognition.OCR.Engine;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
namespace BetterGenshinImpact.Core.Recognition.ONNX.SVTR;
/// <summary>
/// 来自于 Yap 的拾取文字识别
/// https://github.com/Alex-Beng/Yap
/// </summary>
public class PickTextInference : ITextInference
{
private readonly InferenceSession _session;
private readonly Dictionary<int, string> _wordDictionary;
public PickTextInference()
{
_session = App.ServiceProvider.GetRequiredService<BgiOnnxFactory>().CreateInferenceSession(BgiOnnxModel.YapModelTraining,true);
var wordJsonPath = Global.Absolute(@"Assets\Model\Yap\index_2_word.json");
if (!File.Exists(wordJsonPath)) throw new FileNotFoundException("Yap字典文件不存在", wordJsonPath);
var json = File.ReadAllText(wordJsonPath);
_wordDictionary = JsonConvert.DeserializeObject<Dictionary<int, string>>(json) ??
throw new Exception("index_2_word.json deserialize failed");
}
public string Inference(Mat mat)
{
long startTime = Stopwatch.GetTimestamp();
// 将输入数据调整为 (1, 1, 32, 384) 形状的张量
var reshapedInputData = OcrUtils.ToTensorYapDnn(mat, out var owner);
IDisposableReadOnlyCollection<DisposableNamedOnnxValue> results;
using (owner)
{
// 创建输入 NamedOnnxValue, 运行模型推理
results = _session.Run([NamedOnnxValue.CreateFromTensor("input", reshapedInputData)]);
}
using (results)
{
// 获取输出数据
var boxes = results[0].AsTensor<float>();
var ans = new StringBuilder();
var lastWord = default(string);
for (var i = 0; i < boxes.Dimensions[0]; i++)
{
var maxIndex = 0;
var maxValue = -1.0;
for (var j = 0; j < _wordDictionary.Count; j++)
{
var value = boxes[[i, 0, j]];
if (value > maxValue)
{
maxValue = value;
maxIndex = j;
}
}
var word = _wordDictionary[maxIndex];
if (word != lastWord && word != "|")
{
ans.Append(word);
}
lastWord = word;
}
TimeSpan time = Stopwatch.GetElapsedTime(startTime);
string result = ans.ToString();
Debug.WriteLine($"Yap模型识别 耗时{time.TotalMilliseconds}ms 结果: {result}");
return result;
}
}
[Obsolete("使用CV DNN替代")]
public static Tensor<float> ToTensorUnsafe(Mat src, out IMemoryOwner<float> tensorMemoryOwnser)
{
var channels = src.Channels();
var nRows = src.Rows;
var nCols = src.Cols * channels;
if (src.IsContinuous())
{
nCols *= nRows;
nRows = 1;
}
//var inputData = new float[nCols];
tensorMemoryOwnser = MemoryPool<float>.Shared.Rent(nCols);
var memory = tensorMemoryOwnser.Memory[..nCols];
unsafe
{
for (var i = 0; i < nRows; i++)
{
var b = (byte*)src.Ptr(i);
for (var j = 0; j < nCols; j++)
{
memory.Span[j] = b[j] / 255f;
}
}
}
return new DenseTensor<float>(memory, [1, 1, 32, 384]);
}
}
@@ -0,0 +1,47 @@
using System;
using BetterGenshinImpact.Core.Recognition.OpenCv;
using OpenCvSharp;
namespace BetterGenshinImpact.Core.Recognition.ONNX.SVTR;
public class TextInferenceFactory
{
public static readonly Lazy<ITextInference> Pick = new(() => Create(OcrEngineTypes.YapModel));
public static ITextInference Create(OcrEngineTypes type)
{
return type switch
{
OcrEngineTypes.YapModel => new PickTextInference(),
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null),
};
}
// public static Mat PreProcessForInference(Mat mat)
// {
// if (mat.Channels() == 3)
// {
// mat = mat.CvtColor(ColorConversionCodes.BGR2GRAY);
// }
// else if (mat.Channels() == 4)
// {
// mat = mat.CvtColor(ColorConversionCodes.BGRA2GRAY);
// }
// else if (mat.Channels() != 1)
// {
// throw new ArgumentException("mat must be 1, 3 or 4 channels");
// }
//
// // Yap 已经改用灰度图了 https://github.com/Alex-Beng/Yap/commit/c2ad1e7b1442aaf2d80782a032e00876cd1c6c84
// // 二值化
// // Cv2.Threshold(mat, mat, 0, 255, ThresholdTypes.Otsu | ThresholdTypes.Binary);
// //Cv2.AdaptiveThreshold(mat, mat, 255, AdaptiveThresholdTypes.GaussianC, ThresholdTypes.Binary, 31, 3); // 效果不错 但是和模型不搭
// //mat = OpenCvCommonHelper.Threshold(mat, Scalar.FromRgb(235, 235, 235), Scalar.FromRgb(255, 255, 255)); // 识别物品不太行
// // 不知道为什么要强制拉伸到 221x32
// mat = ResizeHelper.ResizeTo(mat, 221, 32);
// // 填充到 384x32
// var padded = new Mat(new Size(384, 32), MatType.CV_8UC1, Scalar.Black);
// padded[new Rect(0, 0, mat.Width, mat.Height)] = mat;
// //Cv2.ImWrite(Global.Absolute("padded.png"), padded);
// return padded;
// }
}
@@ -0,0 +1,29 @@
using BetterGenshinImpact.Core.Config;
using Microsoft.ML.OnnxRuntime;
using System;
using System.IO;
using System.Text.Json;
namespace BetterGenshinImpact.Core.Recognition.ONNX.YOLO;
[Obsolete]
public class Predictor
{
private readonly InferenceSession _session;
private readonly string[] labels;
public Predictor()
{
var options = new SessionOptions();
var modelPath = Global.Absolute(@"Assets\Model\Fish\bgi_fish.onnx");
if (!File.Exists(modelPath)) throw new FileNotFoundException("自动钓鱼模型文件不存在", modelPath);
_session = new InferenceSession(modelPath, options);
var wordJsonPath = Global.Absolute(@"Assets\Model\Fish\label.json");
if (!File.Exists(wordJsonPath)) throw new FileNotFoundException("自动钓鱼模型分类文件不存在", wordJsonPath);
var json = File.ReadAllText(wordJsonPath);
labels = JsonSerializer.Deserialize<string[]>(json) ?? throw new Exception("label.json deserialize failed");
}
}
@@ -0,0 +1,13 @@
namespace BetterGenshinImpact.Core.Recognition;
public enum OcrEngineTypes
{
// 通用
//Media,
Paddle,
// 特定模型
YasModel,
YapModel
}
@@ -0,0 +1,45 @@
using OpenCvSharp;
namespace BetterGenshinImpact.Core.Recognition.OpenCv;
public class ArithmeticHelper
{
/// <summary>
/// 水平投影
/// </summary>
/// <param name="gray"></param>
/// <returns></returns>
public static int[] HorizontalProjection(Mat gray)
{
var projection = new int[gray.Height];
//对每一行计算投影值
for (var y = 0; y < gray.Height; ++y)
//遍历这一行的每一个像素,如果是有效的,累加投影值
for (var x = 0; x < gray.Width; ++x)
{
var s = gray.Get<Vec2b>(y, x);
if (s.Item0 == 255) projection[y]++;
}
return projection;
}
/// <summary>
/// 垂直投影
/// </summary>
/// <param name="gray"></param>
/// <returns></returns>
public static int[] VerticalProjection(Mat gray)
{
var projection = new int[gray.Width];
//遍历每一列计算投影值
for (var x = 0; x < gray.Width; ++x)
for (var y = 0; y < gray.Height; ++y)
{
var s = gray.Get<Vec2b>(y, x);
if (s.Item0 == 255) projection[x]++;
}
return projection;
}
}
@@ -0,0 +1,110 @@
using OpenCvSharp;
using System;
using System.Collections.Generic;
using System.Drawing;
using Vanara.PInvoke;
using Color = System.Windows.Media.Color;
using Point = OpenCvSharp.Point;
namespace BetterGenshinImpact.Core.Recognition.OpenCv;
public static class CommonExtension
{
public static unsafe Point AsCvPoint(this System.Drawing.Point point)
{
return *(Point*)&point;
}
public static unsafe System.Drawing.Point AsDrawingPoint(this Point point)
{
return *(System.Drawing.Point*)&point;
}
public static System.Windows.Point ToWindowsPoint(this Point point)
{
return new System.Windows.Point(point.X, point.Y);
}
public static unsafe Rect AsCvRect(this Rectangle rectangle)
{
return *(Rect*)&rectangle;
}
public static System.Windows.Rect ToWindowsRectangle(this Rect rect)
{
return new System.Windows.Rect(rect.X, rect.Y, rect.Width, rect.Height);
}
public static System.Windows.Rect ToWindowsRectangleOffset(this Rect rect, int offsetX, int offsetY)
{
return new System.Windows.Rect(rect.X + offsetX, rect.Y + offsetY, rect.Width, rect.Height);
}
public static unsafe Rectangle AsDrawingRectangle(this Rect rect)
{
return *(Rectangle*)&rect;
}
public static System.Drawing.Point GetCenterPoint(this Rectangle rectangle)
{
if (rectangle.IsEmpty) throw new ArgumentException("rectangle is empty");
return new System.Drawing.Point(rectangle.X + rectangle.Width / 2, rectangle.Y + rectangle.Height / 2);
}
public static Point GetCenterPoint(this RECT rectangle)
{
if (rectangle.IsEmpty) throw new ArgumentException("rectangle is empty");
return new Point(rectangle.X + rectangle.Width / 2, rectangle.Y + rectangle.Height / 2);
}
public static Point GetCenterPoint(this Rect rectangle)
{
if (rectangle == default) throw new ArgumentException("rectangle is empty");
return new Point(rectangle.X + rectangle.Width / 2, rectangle.Y + rectangle.Height / 2);
}
public static Rect Multiply(this Rect rect, double assetScale)
{
if (rect == default) throw new ArgumentException("rect is empty");
return new Rect((int)(rect.X * assetScale), (int)(rect.Y * assetScale), (int)(rect.Width * assetScale), (int)(rect.Height * assetScale));
}
public static Color ToWindowsColor(this System.Drawing.Color color)
{
return Color.FromArgb(color.A, color.R, color.G, color.B);
}
public static Point2d ToPoint2d(this Point2f p)
{
return new Point2d(p.X, p.Y);
}
public static List<Point2d> ToPoint2d(this List<Point2f> list)
{
return list.ConvertAll(ToPoint2d);
}
/// <summary>
/// 将矩形钳位到指定尺寸范围内(交集语义),防止 OpenCV ROI 越界
/// </summary>
public static Rect ClampTo(this Rect rect, int maxWidth, int maxHeight)
{
int x1 = Math.Clamp(rect.X, 0, maxWidth);
int y1 = Math.Clamp(rect.Y, 0, maxHeight);
int x2 = Math.Clamp(rect.X + rect.Width, 0, maxWidth);
int y2 = Math.Clamp(rect.Y + rect.Height, 0, maxHeight);
return new Rect(x1, y1, x2 - x1, y2 - y1);
}
/// <summary>
/// 将矩形钳位到 Mat 范围内(交集语义),防止 OpenCV ROI 越界
/// </summary>
public static Rect ClampTo(this Rect rect, Mat mat)
{
return rect.ClampTo(mat.Cols, mat.Rows);
}
}
@@ -0,0 +1,45 @@
using OpenCvSharp;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace BetterGenshinImpact.Core.Recognition.OpenCv;
public class CommonRecognition
{
/// <summary>
/// 寻找游戏内按钮
/// </summary>
/// <param name="srcMat"></param>
/// <returns></returns>
public static List<Rect> FindGameButton(Mat srcMat)
{
try
{
var src = srcMat.Clone();
Cv2.CvtColor(src, src, ColorConversionCodes.BGR2RGB);
var lowPurple = new Scalar(236, 229, 216);
var highPurple = new Scalar(236, 229, 216);
Cv2.InRange(src, lowPurple, highPurple, src);
Cv2.Threshold(src, src, 0, 255, ThresholdTypes.Binary);
//var kernel = Cv2.GetStructuringElement(MorphShapes.Rect, new OpenCvSharp.Size(20, 20),
// new OpenCvSharp.Point(-1, -1));
//Cv2.Dilate(src, src, kernel); //膨胀
Cv2.FindContours(src, out var contours, out _, RetrievalModes.External,
ContourApproximationModes.ApproxSimple);
if (contours.Length > 0)
{
var boxes = contours.Select(Cv2.BoundingRect).Where(r => r.Width > 50);
return boxes.ToList();
}
}
catch (Exception e)
{
Debug.WriteLine(e);
}
return [];
}
}
@@ -0,0 +1,105 @@
using OpenCvSharp;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace BetterGenshinImpact.Core.Recognition.OpenCv;
/// <summary>
/// 形态学操作参数类
/// </summary>
public class MorphologyParam
{
/// <summary>
/// 运算核大小
/// </summary>
public Size KernelSize { get; set; }
/// <summary>
/// 运算方法
/// </summary>
public MorphTypes MorphType { get; set; }
/// <summary>
/// 运算次数
/// </summary>
public int Iterations { get; set; }
/// <summary>
/// 形态学操作参数构造函数
/// </summary>
/// <param name="kernelSize">运算核大小</param>
/// <param name="morphType">运算方法</param>
/// <param name="iterations">运算次数</param>
public MorphologyParam(Size kernelSize, MorphTypes morphType, int iterations)
{
KernelSize = kernelSize;
MorphType = morphType;
Iterations = iterations;
}
}
public class ContoursHelper
{
/// <summary>
/// 找到指定颜色的矩形
/// </summary>
/// <param name="srcMat">图像</param>
/// <param name="low">RGB色彩低位</param>
/// <param name="high">RGB色彩高位</param>
/// <param name="minWidth">矩形最小宽度</param>
/// <param name="minHeight">矩形最小高度</param>
/// <param name="morphologyParam">形态学操作参数(可选)</param>
/// <returns></returns>
public static List<Rect> FindSpecifyColorRects(Mat srcMat, Scalar low, Scalar high, int minWidth = -1, int minHeight = -1, MorphologyParam? morphologyParam = null)
{
try
{
using var src = srcMat.Clone();
Cv2.CvtColor(src, src, ColorConversionCodes.BGR2RGB);
Cv2.InRange(src, low, high, src);
if (morphologyParam != null)
{
using var kernel = Cv2.GetStructuringElement(MorphShapes.Rect, morphologyParam.KernelSize);
Cv2.MorphologyEx(src, src, morphologyParam.MorphType, kernel, iterations: morphologyParam.Iterations);
}
Cv2.FindContours(src, out var contours, out _, RetrievalModes.External,
ContourApproximationModes.ApproxSimple);
if (contours.Length > 0)
{
var boxes = contours.Select(Cv2.BoundingRect).Where(r =>
{
if (minWidth > 0 && r.Width < minWidth)
{
return false;
}
if (minHeight > 0 && r.Height < minHeight)
{
return false;
}
return true;
});
return boxes.ToList();
}
}
catch (Exception e)
{
Debug.WriteLine(e);
}
return [];
}
public static List<Rect> FindSpecifyColorRects(Mat srcMat, Scalar color, int minWidth = -1, int minHeight = -1)
{
return FindSpecifyColorRects(srcMat, color, color, minWidth, minHeight);
}
public static List<Rect> FindSpecifyColorRects(Mat srcMat, Scalar color, int minWidth, int minHeight, MorphologyParam morphologyParam)
{
return FindSpecifyColorRects(srcMat, color, color, minWidth, minHeight, morphologyParam);
}
}
@@ -0,0 +1,59 @@
using OpenCvSharp;
using System;
namespace BetterGenshinImpact.Core.Recognition.OpenCv;
/// <summary>
/// 图片剪裁
/// </summary>
[Obsolete]
public class CropHelper
{
public static Mat CutRightTop(Mat srcMat, int saveRightWidth, int saveTopHeight)
{
srcMat = new Mat(srcMat, new Rect(srcMat.Width - saveRightWidth, 0, saveRightWidth, saveTopHeight));
return srcMat;
}
public static Mat CutRightBottom(Mat srcMat, int saveRightWidth, int saveBottomHeight)
{
srcMat = new Mat(srcMat, new Rect(srcMat.Width - saveRightWidth, srcMat.Height - saveBottomHeight, saveRightWidth, saveBottomHeight));
return srcMat;
}
public static Mat CutLeftTop(Mat srcMat, int saveLeftWidth, int saveTopHeight)
{
srcMat = new Mat(srcMat, new Rect(0, 0, saveLeftWidth, saveTopHeight));
return srcMat;
}
public static Mat CutLeftBottom(Mat srcMat, int saveLeftWidth, int saveBottomHeight)
{
srcMat = new Mat(srcMat, new Rect(0, srcMat.Height - saveBottomHeight, saveLeftWidth, saveBottomHeight));
return srcMat;
}
public static Mat CutTop(Mat srcMat, int saveTopHeight)
{
srcMat = new Mat(srcMat, new Rect(0, 0, srcMat.Width, saveTopHeight));
return srcMat;
}
public static Mat CutBottom(Mat srcMat, int saveBottomHeight)
{
srcMat = new Mat(srcMat, new Rect(0, srcMat.Height - saveBottomHeight, srcMat.Width, saveBottomHeight));
return srcMat;
}
public static Mat CutRight(Mat srcMat, int saveRightWidth)
{
srcMat = new Mat(srcMat, new Rect(srcMat.Width - saveRightWidth, 0, saveRightWidth, srcMat.Height));
return srcMat;
}
public static Mat CutLeft(Mat srcMat, int saveLeftWidth)
{
srcMat = new Mat(srcMat, new Rect(0, 0, saveLeftWidth, srcMat.Height));
return srcMat;
}
}
@@ -0,0 +1,31 @@
namespace BetterGenshinImpact.Core.Recognition.OpenCv.FeatureMatch;
/// <summary>
/// FlannMatch
/// 优点:
/// 1. 速度快:FlannMatch 使用的是近似最近邻搜索算法,适合处理大规模数据集,速度比暴力匹配器快得多。
/// 2. 可扩展性好:适用于高维特征空间,能够处理大量特征点。
/// 缺点:
/// 1. 精度较低:由于是近似搜索,匹配的精度可能不如暴力匹配器高。
/// 2. 复杂性高:需要对参数进行调优,以获得最佳性能。
/// BfMatch
/// 优点:
/// 1. 精度高:BfMatch 进行的是精确匹配,能够找到最优的匹配对。
/// 2. 简单易用:不需要复杂的参数调优,适合初学者和简单应用。
/// 缺点:
/// 1. 速度慢:对于大规模数据集,暴力匹配器的速度较慢,因为它需要计算所有特征点之间的距离。
/// 2. 不适合高维数据:在高维特征空间中,计算量会显著增加,性能下降明显。
/// 选择建议
/// • 大规模数据集:如果你需要处理大量特征点,且对速度要求较高,FlannMatch 是一个更好的选择。
/// • 高精度要求:如果你的应用对匹配精度要求很高,且数据规模较小,BfMatch 会更合适。
/// </summary>
public enum DescriptorMatcherType
{
// 快速近似最近邻搜索库
BruteForce,
// 暴力匹配器
FlannBased
// 更多类型命名见 DescriptorMatcher.Create
}
@@ -0,0 +1,263 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BetterGenshinImpact.GameTask.Common.BgiVision;
using BetterGenshinImpact.Helpers;
using OpenCvSharp;
namespace BetterGenshinImpact.Core.Recognition.OpenCv.FeatureMatch;
public static class Feature2DExtensions
{
private static readonly Dictionary<DescriptorMatcherType, DescriptorMatcher> MatcherFactory = new()
{
{ DescriptorMatcherType.BruteForce, DescriptorMatcher.Create(DescriptorMatcherType.BruteForce.ToString()) },
{ DescriptorMatcherType.FlannBased, DescriptorMatcher.Create(DescriptorMatcherType.FlannBased.ToString()) }
};
private static DescriptorMatcher GetMatcher(DescriptorMatcherType type)
{
return MatcherFactory[type];
}
#region 生成并保存特征
public static void SaveFeatures(this Feature2D feature2D, string trainImagePath, string trainKeyPointsPath, string trainDescriptorsPath)
{
Mat trainDescriptors = new();
var img = Bv.ImRead(trainImagePath, ImreadModes.Grayscale);
feature2D.DetectAndCompute(img, null, out var trainKeyPoints, trainDescriptors);
FeatureStorageHelper.SaveKeyPointArray(trainKeyPoints, trainKeyPointsPath);
FeatureStorageHelper.SaveDescMat(trainDescriptors, trainDescriptorsPath);
}
#endregion
#region 普通匹配
/// <summary>
/// 用于从训练图像和查询图像中找到匹配的特征点,计算透视变换并确定查询图像的中心点在训练图像中的位置。
/// </summary>
/// <param name="feature2D"></param>
/// <param name="trainKeyPoints">训练图像中的关键点集合。</param>
/// <param name="trainDescriptors">训练图像的特征描述子。</param>
/// <param name="queryMat">查询图像的 Mat 对象。</param>
/// <param name="queryMatMask">查询图像的 Mask,用于限定检测特征的区域。</param>
/// <param name="matcherType">描述符匹配器的类型,默认为 DescriptorMatcherType.FlannBased</param>
/// <returns></returns>
public static Point2f Match(this Feature2D feature2D, KeyPoint[] trainKeyPoints, Mat trainDescriptors, Mat queryMat, Mat? queryMatMask = null,
DescriptorMatcherType matcherType = DescriptorMatcherType.FlannBased)
{
SpeedTimer speedTimer = new();
using var queryDescriptors = new Mat();
#pragma warning disable CS8604 // 引用类型参数可能为 null。
feature2D.DetectAndCompute(queryMat, queryMatMask, out var queryKeyPoints, queryDescriptors);
#pragma warning restore CS8604 // 引用类型参数可能为 null。
speedTimer.Record("模板生成KeyPoint");
var matches = GetMatcher(matcherType).Match(queryDescriptors, trainDescriptors);
//Finding the Minimum and Maximum Distance
double minDistance = 1000; //Backward approximation
double maxDistance = 0;
for (int i = 0; i < queryDescriptors.Rows; i++)
{
double distance = matches[i].Distance;
if (distance > maxDistance)
{
maxDistance = distance;
}
if (distance < minDistance)
{
minDistance = distance;
}
}
// Debug.WriteLine($"max distance : {maxDistance}");
// Debug.WriteLine($"min distance : {minDistance}");
var pointsQuery = new List<Point2f>();
var pointsTrain = new List<Point2f>();
//Screening better matching points
// var goodMatches = new List<DMatch>();
for (int i = 0; i < queryDescriptors.Rows; i++)
{
double distance = matches[i].Distance;
if (distance < Math.Max(minDistance * 2, 0.02))
{
pointsQuery.Add(queryKeyPoints[matches[i].QueryIdx].Pt);
pointsTrain.Add(trainKeyPoints[matches[i].TrainIdx].Pt);
//Compression of new ones with distances less than ranges DMatch
// goodMatches.Add(matches[i]);
}
}
speedTimer.Record("FlannMatch");
// var outMat = new Mat();
// algorithm RANSAC Filter the matched results
var pQuery = pointsQuery.ToPoint2d();
var pTrain = pointsTrain.ToPoint2d();
var outMask = new Mat();
// If the original matching result is null, Skip the filtering step
if (pQuery.Count > 0 && pTrain.Count > 0)
{
var hMat = Cv2.FindHomography(pQuery, pTrain, HomographyMethods.Ransac, mask: outMask);
speedTimer.Record("FindHomography");
// 1. 计算查询图像的中心点
var queryCenterPoint = new Point2f(queryMat.Cols / 2f, queryMat.Rows / 2f);
// 2. 使用单应矩阵进行透视变换
Point2f[] queryCenterPoints = [queryCenterPoint];
Point2f[] transformedCenterPoints = Cv2.PerspectiveTransform(queryCenterPoints, hMat);
// 3. 获取变换后的中心点
var trainCenterPoint = transformedCenterPoints[0];
speedTimer.Record("PerspectiveTransform");
speedTimer.DebugPrint();
return trainCenterPoint;
}
speedTimer.DebugPrint();
return new Point2f();
}
#endregion 普通匹配
#region Knn匹配
/// <summary>
/// https://github.com/tignioj/minimap/blob/main/matchmap/sifttest/sifttest5.py
/// Copilot 生成
/// </summary>
/// <returns></returns>
public static Point2f KnnMatch(this Feature2D feature2D, KeyPoint[] trainKeyPoints, Mat trainDescriptors, Mat queryMat, Mat? queryMatMask = null,
DescriptorMatcherType matcherType = DescriptorMatcherType.FlannBased)
{
SpeedTimer speedTimer = new();
using var queryDescriptors = new Mat();
#pragma warning disable CS8604 // 引用类型参数可能为 null。
feature2D.DetectAndCompute(queryMat, queryMatMask, out var queryKeyPoints, queryDescriptors);
#pragma warning restore CS8604 // 引用类型参数可能为 null。
speedTimer.Record("模板生成KeyPoint");
var matches = GetMatcher(matcherType).KnnMatch(queryDescriptors, trainDescriptors, k: 2);
speedTimer.Record("FlannMatch");
// 应用比例测试来过滤匹配点
List<DMatch> goodMatches = [];
foreach (var match in matches)
{
if (match.Length == 2 && match[0].Distance < 0.75 * match[1].Distance)
{
goodMatches.Add(match[0]);
}
}
if (goodMatches.Count < 7)
{
return new Point2f();
}
// 获取匹配点的坐标
var srcPts = goodMatches.Select(m => queryKeyPoints[m.QueryIdx].Pt).ToArray();
var dstPts = goodMatches.Select(m => trainKeyPoints[m.TrainIdx].Pt).ToArray();
speedTimer.Record("GetGoodMatchPoints");
// 使用RANSAC找到变换矩阵
var mask = new Mat();
var hMat = Cv2.FindHomography(srcPts.ToList().ToPoint2d(), dstPts.ToList().ToPoint2d(), HomographyMethods.Ransac, 3.0, mask);
if (hMat.Empty())
{
return new Point2f();
}
speedTimer.Record("FindHomography");
// 计算小地图的中心点
var h = queryMat.Rows;
var w = queryMat.Cols;
var centerPoint = new Point2f(w / 2f, h / 2f);
Point2f[] centerPoints = [centerPoint];
Point2f[] transformedCenter = Cv2.PerspectiveTransform(centerPoints, hMat);
speedTimer.Record("PerspectiveTransform");
speedTimer.DebugPrint();
// 返回小地图在大地图中的中心坐标
return transformedCenter[0];
}
public static Point2f[] KnnMatchCorners(this Feature2D feature2D, KeyPoint[] trainKeyPoints, Mat trainDescriptors, Mat queryMat, Mat? queryMatMask = null,
DescriptorMatcherType matcherType = DescriptorMatcherType.FlannBased)
{
SpeedTimer speedTimer = new();
using var queryDescriptors = new Mat();
#pragma warning disable CS8604 // 引用类型参数可能为 null。
feature2D.DetectAndCompute(queryMat, queryMatMask, out var queryKeyPoints, queryDescriptors);
#pragma warning restore CS8604 // 引用类型参数可能为 null。
speedTimer.Record("模板生成KeyPoint");
var matches = GetMatcher(matcherType).KnnMatch(queryDescriptors, trainDescriptors, k: 2);
speedTimer.Record("FlannMatch");
// 应用比例测试来过滤匹配点
List<DMatch> goodMatches = [];
foreach (var match in matches)
{
if (match.Length == 2 && match[0].Distance < 0.75 * match[1].Distance)
{
goodMatches.Add(match[0]);
}
}
if (goodMatches.Count < 7)
{
return [];
}
// 获取匹配点的坐标
var srcPts = goodMatches.Select(m => queryKeyPoints[m.QueryIdx].Pt).ToArray();
var dstPts = goodMatches.Select(m => trainKeyPoints[m.TrainIdx].Pt).ToArray();
speedTimer.Record("GetGoodMatchPoints");
// 使用RANSAC找到变换矩阵
var mask = new Mat();
var hMat = Cv2.FindHomography(srcPts.ToList().ToPoint2d(), dstPts.ToList().ToPoint2d(), HomographyMethods.Ransac, 3.0, mask);
if (hMat.Empty())
{
return [];
}
speedTimer.Record("FindHomography");
// 返回四个角点
var objCorners = new Point2f[4];
objCorners[0] = new Point2f(0, 0);
objCorners[1] = new Point2f(0, queryMat.Rows);
objCorners[2] = new Point2f(queryMat.Cols, queryMat.Rows);
objCorners[3] = new Point2f(queryMat.Cols, 0);
var sceneCorners = Cv2.PerspectiveTransform(objCorners, hMat);
speedTimer.Record("PerspectiveTransform");
speedTimer.DebugPrint();
return sceneCorners;
}
public static Rect KnnMatchRect(this Feature2D feature2D, KeyPoint[] trainKeyPoints, Mat trainDescriptors, Mat queryMat, Mat? queryMatMask = null)
{
var corners = KnnMatchCorners(feature2D, trainKeyPoints, trainDescriptors, queryMat, queryMatMask);
if (corners.Length == 0)
{
return default;
}
return Cv2.BoundingRect(corners);
}
#endregion Knn匹配
}
@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using OpenCvSharp;
using OpenCvSharp.Features2D;
using OpenCvSharp.XFeatures2D;
namespace BetterGenshinImpact.Core.Recognition.OpenCv.FeatureMatch;
public class Feature2DFactory
{
private static readonly Dictionary<Feature2DType, Feature2D> Instances = new();
private static readonly object Lock = new();
public static Feature2D Get(Feature2DType type)
{
lock (Lock)
{
if (Instances.TryGetValue(type, out var instance))
{
return instance;
}
instance = type switch
{
Feature2DType.SIFT => SIFT.Create(),
Feature2DType.SURF => SURF.Create(100, 4, 3, false, true),
_ => throw new ArgumentException($"不支持的特征检测器类型: {type}")
};
Instances[type] = instance;
return instance;
}
}
}
@@ -0,0 +1,10 @@
namespace BetterGenshinImpact.Core.Recognition.OpenCv.FeatureMatch;
public enum Feature2DType
{
// ReSharper disable once InconsistentNaming
SURF,
// ReSharper disable once InconsistentNaming
SIFT
}
@@ -0,0 +1,100 @@
using BetterGenshinImpact.Core.Config;
using OpenCvSharp;
using OpenCvSharp.Internal.Vectors;
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
namespace BetterGenshinImpact.Core.Recognition.OpenCv.FeatureMatch;
public class FeatureStorage
{
private readonly string _rootPath;
private readonly string _name;
public void SetType(Feature2DType type)
{
TypeName = type.ToString();
}
public FeatureStorage(string name)
{
_name = name;
_rootPath = Global.Absolute(@"Assets\Map\");
}
public FeatureStorage(string name, string rootPath)
{
_name = name;
_rootPath = rootPath;
}
public string TypeName { get; set; } = "UNKNOWN";
public unsafe KeyPoint[]? LoadKeyPointArray()
{
CreateFolder();
var kpPath = Path.Combine(_rootPath, $"{_name}_{TypeName}.kp.bin");
if (File.Exists(kpPath))
{
using var fs = File.Open(kpPath, FileMode.Open);
var sizeOfKeyPoint = Marshal.SizeOf<KeyPoint>();
if (fs.Length % sizeOfKeyPoint != 0) throw new FileFormatException("无法识别的KeyPoint格式");
using var kpVector = new VectorOfKeyPoint((nuint)(fs.Length / sizeOfKeyPoint));
using var ms = new UnmanagedMemoryStream((byte*)kpVector.ElemPtr, fs.Length, fs.Length, FileAccess.Write);
fs.CopyTo(ms);
return kpVector.ToArray();
}
return null;
}
public unsafe void SaveKeyPointArray(KeyPoint[] kpArray)
{
CreateFolder();
var kpPath = Path.Combine(_rootPath, $"{_name}_{TypeName}.kp.bin");
var kpVector = new VectorOfKeyPoint(kpArray);
var sizeOfKeyPoint = Marshal.SizeOf<KeyPoint>();
var kpSpan = new ReadOnlySpan<byte>((byte*)kpVector.ElemPtr, kpArray.Length * sizeOfKeyPoint);
using var fs = new FileStream(kpPath, FileMode.Create);
fs.Write(kpSpan);
}
private void CreateFolder()
{
if (Directory.Exists(_rootPath) == false)
{
Directory.CreateDirectory(_rootPath);
}
}
public Mat? LoadDescMat()
{
CreateFolder();
var files = Directory.GetFiles(_rootPath, $"{_name}_{TypeName}.mat.png", SearchOption.AllDirectories);
if (files.Length == 0)
{
return null;
}
else if (files.Length > 1)
{
Debug.WriteLine($"[FeatureSerializer] Found multiple files: {string.Join(", ", files)}");
}
using var img = new Mat(files[0], ImreadModes.Grayscale);
var mat = new Mat(img.Size(), MatType.CV_32FC1);
img.ConvertTo(mat, MatType.CV_32FC1);
return mat;
}
public void SaveDescMat(Mat descMat)
{
CreateFolder();
// 删除旧文件
var fileName = $"{_name}_{TypeName}.mat.png";
var files = Directory.GetFiles(_rootPath, fileName, SearchOption.AllDirectories);
foreach (var file in files)
{
File.Delete(file);
}
var descPath = Path.Combine(_rootPath, fileName);
descMat.SaveImage(descPath);
}
}
@@ -0,0 +1,57 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using OpenCvSharp;
using OpenCvSharp.Internal.Vectors;
namespace BetterGenshinImpact.Core.Recognition.OpenCv.FeatureMatch;
public class FeatureStorageHelper
{
public static unsafe KeyPoint[]? LoadKeyPointArray(string kpPath)
{
if (File.Exists(kpPath))
{
using var fs = File.Open(kpPath, FileMode.Open);
var sizeOfKeyPoint = Marshal.SizeOf<KeyPoint>();
if (fs.Length % sizeOfKeyPoint != 0)
{
throw new FileFormatException("无法识别的KeyPoint格式");
}
using var kpVector = new VectorOfKeyPoint((nuint)(fs.Length / sizeOfKeyPoint));
using var ms = new UnmanagedMemoryStream((byte*)kpVector.ElemPtr, fs.Length, fs.Length, FileAccess.Write);
fs.CopyTo(ms);
return kpVector.ToArray();
}
return null;
}
public static unsafe void SaveKeyPointArray(KeyPoint[] kpArray, string kpPath)
{
var kpVector = new VectorOfKeyPoint(kpArray);
var sizeOfKeyPoint = Marshal.SizeOf<KeyPoint>();
var kpSpan = new ReadOnlySpan<byte>((byte*)kpVector.ElemPtr, kpArray.Length * sizeOfKeyPoint);
using var fs = new FileStream(kpPath, FileMode.Create);
fs.Write(kpSpan);
}
public static Mat? LoadDescriptorMat(string descriptorPath)
{
if (File.Exists(descriptorPath))
{
using var img = new Mat(descriptorPath, ImreadModes.Grayscale);
var mat = new Mat(img.Size(), MatType.CV_32FC1);
img.ConvertTo(mat, MatType.CV_32FC1);
return mat;
}
return null;
}
public static void SaveDescMat(Mat descMat, string descriptorPath)
{
descMat.SaveImage(descriptorPath);
}
}
@@ -0,0 +1,263 @@
using BetterGenshinImpact.Core.Recognition.OpenCv.Model;
using OpenCvSharp;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace BetterGenshinImpact.Core.Recognition.OpenCv.FeatureMatch;
public class KeyPointFeatureBlockHelper
{
public static KeyPointFeatureBlock[][] SplitFeatures(Size originalImage, int rows, int cols, KeyPoint[] keyPoints, Mat matches)
{
var matchesCols = matches.Cols; // SURF 64 SIFT 128
// Calculate grid size
int cellWidth = originalImage.Width / cols;
int cellHeight = originalImage.Height / rows;
// Initialize arrays to store split features and matches
var splitKeyPoints = new KeyPointFeatureBlock[rows][];
// Initialize each row
for (int i = 0; i < rows; i++)
{
splitKeyPoints[i] = new KeyPointFeatureBlock[cols];
}
// Split features and matches
for (int i = 0; i < keyPoints.Length; i++)
{
int row = (int)(keyPoints[i].Pt.Y / cellHeight);
int col = (int)(keyPoints[i].Pt.X / cellWidth);
// Ensure row and col are within bounds
row = Math.Min(Math.Max(row, 0), rows - 1);
col = Math.Min(Math.Max(col, 0), cols - 1);
// ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
if (splitKeyPoints[row][col] == null)
{
splitKeyPoints[row][col] = new KeyPointFeatureBlock();
}
splitKeyPoints[row][col].KeyPointList.Add(keyPoints[i]);
splitKeyPoints[row][col].KeyPointIndexList.Add(i);
}
// 遍历每个特征块,计算描述子
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < cols; j++)
{
// ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
if (splitKeyPoints[i][j] == null)
{
continue;
}
var block = splitKeyPoints[i][j];
var descriptor = new Mat(block.KeyPointIndexList.Count, matchesCols, MatType.CV_32FC1);
InitBlockMat(block.KeyPointIndexList, descriptor, matches);
block.Descriptor = descriptor;
}
}
return splitKeyPoints;
}
public static (int, int) GetCellIndex(Size originalImage, int rows, int cols, float x, float y)
{
// Calculate grid size
int cellWidth = originalImage.Width / cols;
int cellHeight = originalImage.Height / rows;
// Calculate cell index for the given point
var cellRow = (int)Math.Round(y / cellHeight, 0);
var cellCol = (int)Math.Round(x / cellWidth, 0);
return (cellRow, cellCol);
}
public static (int RowStart, int RowEnd, int ColStart, int ColEnd) GetCellRange(Size originalImage, int rows, int cols, Rect rect)
{
int cellWidth = originalImage.Width / cols;
int cellHeight = originalImage.Height / rows;
var rowStart = (int)(rect.Y / cellHeight);
var rowEnd = (int)((rect.Y + rect.Height) / cellHeight);
var colStart = (int)(rect.X / cellWidth);
var colEnd = (int)((rect.X + rect.Width) / cellWidth);
rowStart = Math.Max(0, Math.Min(rowStart, rows - 1));
rowEnd = Math.Max(0, Math.Min(rowEnd, rows - 1));
colStart = Math.Max(0, Math.Min(colStart, cols - 1));
colEnd = Math.Max(0, Math.Min(colEnd, cols - 1));
if (rowEnd < rowStart)
{
rowEnd = rowStart;
}
if (colEnd < colStart)
{
colEnd = colStart;
}
return (rowStart, rowEnd, colStart, colEnd);
}
public static KeyPointFeatureBlock MergeFeaturesInRange(KeyPointFeatureBlock[][] splitKeyPoints, Mat matches, int rowStart, int rowEnd, int colStart, int colEnd)
{
var rows = splitKeyPoints.Length;
if (rows == 0)
{
return new KeyPointFeatureBlock();
}
var cols = splitKeyPoints[0].Length;
rowStart = Math.Max(0, Math.Min(rowStart, rows - 1));
rowEnd = Math.Max(0, Math.Min(rowEnd, rows - 1));
colStart = Math.Max(0, Math.Min(colStart, cols - 1));
colEnd = Math.Max(0, Math.Min(colEnd, cols - 1));
var matchesCols = matches.Cols;
var neighboringKeyPoints = new List<KeyPoint>();
var neighboringKeyPointIndices = new List<int>();
for (int i = rowStart; i <= rowEnd; i++)
{
for (int j = colStart; j <= colEnd; j++)
{
if (splitKeyPoints[i][j] != null)
{
neighboringKeyPoints.AddRange(splitKeyPoints[i][j].KeyPointList);
neighboringKeyPointIndices.AddRange(splitKeyPoints[i][j].KeyPointIndexList);
}
}
}
var mergedKeyPointBlock = new KeyPointFeatureBlock
{
MergedCenterCellCol = (colStart + colEnd) / 2,
MergedCenterCellRow = (rowStart + rowEnd) / 2,
KeyPointList = neighboringKeyPoints,
KeyPointIndexList = neighboringKeyPointIndices
};
mergedKeyPointBlock.Descriptor = new Mat(mergedKeyPointBlock.KeyPointIndexList.Count, matchesCols, MatType.CV_32FC1);
InitBlockMat(mergedKeyPointBlock.KeyPointIndexList, mergedKeyPointBlock.Descriptor, matches);
return mergedKeyPointBlock;
}
public static KeyPointFeatureBlock MergeNeighboringFeatures(KeyPointFeatureBlock[][] splitKeyPoints, Mat matches, int cellRow, int cellCol)
{
var matchesCols = matches.Cols; // SURF 64 SIFT 128
// Initialize lists to store neighboring features and matches
var neighboringKeyPoints = new List<KeyPoint>();
var neighboringKeyPointIndices = new List<int>();
// Loop through 9 neighboring cells
for (int i = Math.Max(cellRow - 1, 0); i <= Math.Min(cellRow + 1, splitKeyPoints.Length - 1); i++)
{
for (int j = Math.Max(cellCol - 1, 0); j <= Math.Min(cellCol + 1, splitKeyPoints[i].Length - 1); j++)
{
// ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
if (splitKeyPoints[i][j] != null)
{
neighboringKeyPoints.AddRange(splitKeyPoints[i][j].KeyPointList);
neighboringKeyPointIndices.AddRange(splitKeyPoints[i][j].KeyPointIndexList);
}
}
}
// Merge neighboring features
var mergedKeyPointBlock = new KeyPointFeatureBlock
{
MergedCenterCellCol = cellCol,
MergedCenterCellRow = cellRow,
KeyPointList = neighboringKeyPoints,
KeyPointIndexList = neighboringKeyPointIndices
};
mergedKeyPointBlock.Descriptor = new Mat(mergedKeyPointBlock.KeyPointIndexList.Count, matchesCols, MatType.CV_32FC1);
InitBlockMat(mergedKeyPointBlock.KeyPointIndexList, mergedKeyPointBlock.Descriptor, matches);
return mergedKeyPointBlock;
}
/// <summary>
/// 按行拷贝matches到descriptor
/// </summary>
/// <param name="keyPointIndexList">记录了哪些行需要拷贝</param>
/// <param name="descriptor">拷贝结果</param>
/// <param name="matches">原始数据</param>
private static unsafe void InitBlockMat(List<int> keyPointIndexList, Mat descriptor, Mat matches)
{
Size size = matches.Size();
Matrix<float> destMatrix = new(descriptor.DataPointer, size.Width, size.Height);
Matrix<float> sourceMatrix = new(matches.DataPointer, size.Width, size.Height);
Span<int> keyPointIndexSpan = CollectionsMarshal.AsSpan(keyPointIndexList);
ref int keyPointIndexRef = ref MemoryMarshal.GetReference(keyPointIndexSpan);
for (int i = 0; i < keyPointIndexSpan.Length; i++)
{
ref int index = ref Unsafe.Add(ref keyPointIndexRef, i);
sourceMatrix[index].CopyTo(destMatrix[i]);
}
}
private readonly ref struct Matrix<T>
{
private readonly ref T reference;
private readonly int width;
private readonly int height;
public unsafe Matrix(void* pointer, int width, int height)
{
reference = ref Unsafe.AsRef<T>(pointer);
this.width = width;
this.height = height;
}
public Span<T> this[int row]
{
get
{
if (row < 0 || row >= height)
{
throw new IndexOutOfRangeException();
}
return MemoryMarshal.CreateSpan(ref Unsafe.Add(ref reference, row * width), width);
}
}
}
/// <summary>
/// 按行拷贝matches到descriptor
/// </summary>
/// <param name="keyPointIndexList">记录了哪些行需要拷贝</param>
/// <param name="descriptor">拷贝结果</param>
/// <param name="matches">原始数据</param>
[Obsolete]
private static unsafe void InitBlockMat2(IReadOnlyList<int> keyPointIndexList, Mat descriptor, Mat matches)
{
int cols = matches.Cols;
float* ptrDest = (float*)descriptor.DataPointer;
for (int i = 0; i < keyPointIndexList.Count; i++)
{
var index = keyPointIndexList[i];
float* ptrSrcRow = (float*)matches.Ptr(index);
for (int j = 0; j < cols; j++)
{
*(ptrDest + i * cols + j) = ptrSrcRow[j];
}
}
}
}
@@ -0,0 +1,103 @@
using System;
using System.Diagnostics;
using OpenCvSharp;
namespace BetterGenshinImpact.Core.Recognition.OpenCv;
public class ImageDifferenceDetector
{
/// <summary>
/// 找出四张灰度图中与其他三张差异最大的图片
/// 投票机制:每张图片投票给与它差异最大的图片,如果某张图片获得3票则返回其索引
/// </summary>
/// <param name="images">包含4张Mat对象的数组</param>
/// <returns>差异最大的图片索引(0-3),如果没有图片获得3票则返回-1</returns>
public static int FindMostDifferentImage(Mat[] images)
{
try
{
if (images is not { Length: 4 })
{
throw new ArgumentException("必须提供4张图片");
}
// 验证所有图片尺寸相同
Size firstSize = images[0].Size();
for (int i = 1; i < 4; i++)
{
if (images[i].Size() != firstSize)
{
throw new ArgumentException("所有图片必须具有相同的尺寸");
}
}
// 存储每张图片获得的投票数
int[] votes = new int[4];
// 每张图片投票给与它差异最大的图片
for (int i = 0; i < 4; i++)
{
int maxDiffImageIndex = -1;
double maxDifference = 0;
// 找出与图片i差异最大的图片
for (int j = 0; j < 4; j++)
{
if (i != j)
{
double difference = CalculateDifference(images[i], images[j]);
Debug.WriteLine($"{i} vs {j} 差异像素数量: {difference}");
if (difference > maxDifference)
{
maxDifference = difference;
maxDiffImageIndex = j;
}
}
}
// 图片i投票给差异最大的图片
if (maxDiffImageIndex != -1)
{
votes[maxDiffImageIndex]++;
Debug.WriteLine($"图片 {i} 投票给图片 {maxDiffImageIndex} (差异值: {maxDifference:F2})");
}
}
// 输出投票结果
Debug.WriteLine("\n投票结果:");
for (int i = 0; i < 4; i++)
{
Debug.WriteLine($"图片 {i}: {votes[i]} 票");
}
// 检查是否有图片获得3票
for (int i = 0; i < 4; i++)
{
if (votes[i] >= 3)
{
return i;
}
}
return -1;
}
catch (Exception ex)
{
Debug.WriteLine($"FindMostDifferentImage 出错: {ex.Message}");
return -1;
}
}
/// <summary>
/// 计算差值
/// </summary>
private static double CalculateDifference(Mat img1, Mat img2)
{
using var diff = new Mat();
// 计算差值的绝对值
Cv2.Absdiff(img1, img2, diff);
// 统计非零像素点(即颜色不同的像素点)
return Cv2.CountNonZero(diff);
}
}
@@ -0,0 +1,244 @@
using Microsoft.Extensions.Logging;
using OpenCvSharp;
using System;
using System.Collections.Generic;
namespace BetterGenshinImpact.Core.Recognition.OpenCv;
/// <summary>
/// 多目标模板匹配demo
/// https://github.com/shimat/opencvsharp/issues/182
/// </summary>
public class MatchTemplateHelper
{
private static readonly ILogger<MatchTemplateHelper> _logger = App.GetLogger<MatchTemplateHelper>();
/// <summary>
/// 模板匹配
/// </summary>
/// <param name="srcMat">原图像</param>
/// <param name="dstMat">模板</param>
/// <param name="matchMode">匹配方式</param>
/// <param name="maskMat">遮罩</param>
/// <param name="threshold">阈值</param>
/// <returns>左上角的标点,由于(0,0)点作为未匹配的结果,所以不能做完全相同的模板匹配</returns>
public static Point MatchTemplate(Mat srcMat, Mat dstMat, TemplateMatchModes matchMode, Mat? maskMat = null, double threshold = 0.8)
{
try
{
using var result = new Mat();
Cv2.MatchTemplate(srcMat, dstMat, result, matchMode, maskMat!);
if (matchMode is TemplateMatchModes.SqDiff or TemplateMatchModes.CCoeff or TemplateMatchModes.CCorr)
{
Cv2.Normalize(result, result, 0, 1, NormTypes.MinMax);
}
Cv2.MinMaxLoc(result, out var minValue, out var maxValue, out var minLoc, out var maxLoc);
if (matchMode is TemplateMatchModes.SqDiff or TemplateMatchModes.SqDiffNormed)
{
if (minValue <= 1 - threshold)
{
return minLoc;
}
}
else
{
if (maxValue >= threshold)
{
return maxLoc;
}
}
return default;
}
catch (Exception ex)
{
_logger.LogError(ex.Message);
_logger.LogDebug(ex, ex.Message);
return default;
}
}
/// <summary>
/// 模板匹配多个结果
/// 不好用
/// </summary>
/// <param name="srcMat"></param>
/// <param name="dstMat"></param>
/// <param name="maskMat"></param>
/// <param name="threshold"></param>
/// <param name="maxCount"></param>
/// <returns></returns>
[Obsolete]
public static List<Point> MatchTemplateMulti(Mat srcMat, Mat dstMat, Mat? maskMat = null, double threshold = 0.8, int maxCount = 8)
{
var points = new List<Point>();
try
{
using var result = new Mat();
Cv2.MatchTemplate(srcMat, dstMat, result, TemplateMatchModes.CCoeffNormed, maskMat!);
var mask = new Mat(result.Height, result.Width, MatType.CV_8UC1, Scalar.White);
var maskSub = new Mat(result.Height, result.Width, MatType.CV_8UC1, Scalar.Black);
while (true)
{
Cv2.MinMaxLoc(result, out _, out var maxValue, out _, out var maxLoc, mask);
var maskRect = new Rect(maxLoc.X, maxLoc.Y, dstMat.Width, dstMat.Height);
maskSub.Rectangle(maskRect, Scalar.White, -1);
mask -= maskSub;
if (maxValue >= threshold)
points.Add(maxLoc);
else
break;
}
return points;
}
catch (Exception ex)
{
_logger.LogError(ex.Message);
_logger.LogDebug(ex, ex.Message);
return points;
}
}
public static List<Point> MatchTemplateMulti(Mat srcMat, Mat dstMat, double threshold)
{
return MatchTemplateMulti(srcMat, dstMat, null, threshold);
}
/// <summary>
/// 在一张图中查找多个模板
/// 查到一个遮盖一个的笨方法,效率很低,但是很准确
/// </summary>
/// <param name="srcMat"></param>
/// <param name="imgSubDictionary"></param>
/// <param name="threshold"></param>
/// <returns></returns>
public static Dictionary<string, List<Point>> MatchMultiPicForOnePic(Mat srcMat, Dictionary<string, Mat> imgSubDictionary, double threshold = 0.8)
{
var dictionary = new Dictionary<string, List<Point>>();
foreach (var kvp in imgSubDictionary)
{
var list = new List<Point>();
while (true)
{
var point = MatchTemplate(srcMat, kvp.Value, TemplateMatchModes.CCoeffNormed, null, threshold);
if (point != new Point())
{
// 把结果给遮掩掉,避免重复识别
Cv2.Rectangle(srcMat, point, new Point(point.X + kvp.Value.Width, point.Y + kvp.Value.Height), Scalar.Black, -1);
list.Add(point);
}
else
{
break;
}
}
dictionary.Add(kvp.Key, list);
}
return dictionary;
}
/// <summary>
/// 在一张图中查找多个模板
/// 查到一个遮盖一个的笨方法,效率很低,但是很准确
/// </summary>
/// <param name="srcMat"></param>
/// <param name="imgSubList"></param>
/// <param name="threshold"></param>
/// <returns></returns>
public static List<Rect> MatchMultiPicForOnePic(Mat srcMat, List<Mat> imgSubList, double threshold = 0.8)
{
List<Rect> list = [];
foreach (var sub in imgSubList)
while (true)
{
var point = MatchTemplate(srcMat, sub, TemplateMatchModes.CCoeffNormed, null, threshold);
if (point != new Point())
{
// 把结果给遮掩掉,避免重复识别
Cv2.Rectangle(srcMat, point, new Point(point.X + sub.Width, point.Y + sub.Height), Scalar.Black, -1);
list.Add(new Rect(point.X, point.Y, sub.Width, sub.Height));
}
else
{
break;
}
}
return list;
}
/// <summary>
/// 在一张图中查找一个个模板
/// </summary>
/// <param name="srcMat"></param>
/// <param name="dstMat"></param>
/// <param name="maskMat"></param>
/// <param name="threshold"></param>
/// <returns></returns>
public static List<Rect> MatchOnePicForOnePic(Mat srcMat, Mat dstMat, Mat? maskMat = null, double threshold = 0.8)
{
List<Rect> list = [];
while (true)
{
var point = MatchTemplate(srcMat, dstMat, TemplateMatchModes.CCoeffNormed, maskMat, threshold);
if (point != new Point())
{
// 把结果给遮掩掉,避免重复识别
Cv2.Rectangle(srcMat, point, new Point(point.X + dstMat.Width, point.Y + dstMat.Height), Scalar.Black, -1);
list.Add(new Rect(point.X, point.Y, dstMat.Width, dstMat.Height));
}
else
{
break;
}
}
return list;
}
/// <summary>
/// 在一张图中查找一个个模板
/// </summary>
/// <param name="srcMat"></param>
/// <param name="dstMat"></param>
/// <param name="matchMode"></param>
/// <param name="maskMat"></param>
/// <param name="threshold"></param>
/// <param name="maxCount"></param>
/// <returns></returns>
public static List<Rect> MatchOnePicForOnePic(Mat srcMat, Mat dstMat, TemplateMatchModes matchMode, Mat? maskMat, double threshold, int maxCount = -1)
{
List<Rect> list = [];
if (maxCount < 0)
{
maxCount = srcMat.Width * srcMat.Height / dstMat.Width / dstMat.Height;
}
for (int i = 0; i < maxCount; i++)
{
var point = MatchTemplate(srcMat, dstMat, matchMode, maskMat, threshold);
if (point != new Point())
{
// 把结果给遮掩掉,避免重复识别
Cv2.Rectangle(srcMat, point, new Point(point.X + dstMat.Width, point.Y + dstMat.Height), Scalar.Black, -1);
list.Add(new Rect(point.X, point.Y, dstMat.Width, dstMat.Height));
}
else
{
break;
}
}
return list;
}
}
@@ -0,0 +1,34 @@
using OpenCvSharp;
using System.Collections.Generic;
namespace BetterGenshinImpact.Core.Recognition.OpenCv.Model;
/// <summary>
/// 特征块
/// 对特征按图像区域进行划分
/// </summary>
public class KeyPointFeatureBlock
{
public List<KeyPoint> KeyPointList { get; set; } = [];
private KeyPoint[]? keyPointArray;
public KeyPoint[] KeyPointArray
{
get
{
keyPointArray ??= [.. KeyPointList];
return keyPointArray;
}
}
/// <summary>
/// 在完整 KeyPoint[] 中的下标
/// </summary>
public List<int> KeyPointIndexList { get; set; } = [];
public Mat? Descriptor;
public int MergedCenterCellCol = -1;
public int MergedCenterCellRow = -1;
}
@@ -0,0 +1,168 @@
using System;
using System.Collections.Generic;
using OpenCvSharp;
using System.Diagnostics;
using System.Linq;
namespace BetterGenshinImpact.Core.Recognition.OpenCv;
public class OpenCvCommonHelper
{
/// <summary>
/// 计算灰度图中某个颜色的像素个数
/// </summary>
/// <param name="mat"></param>
/// <param name="color"></param>
/// <returns></returns>
public static int CountGrayMatColor(Mat mat, byte color)
{
Debug.Assert(mat.Depth() == MatType.CV_8U);
return SplitChannal(mat, m => CountGrayMatColorC1(m, color)).Sum();
}
private static IEnumerable<T> SplitChannal<T>(Mat mat, Func<Mat, T> func)
{
if (mat.Empty()) return [];
if (mat.Channels() == 1)
{
return [func.Invoke(mat)];
}
Mat[]? channels = null;
try
{
channels = mat.Split();
return channels.AsParallel().Select(func);
}
finally
{
// 释放所有分离出的通道内存
if (channels is not null)
foreach (var ch in channels)
ch.Dispose();
}
}
/// <summary>
/// 仅限单通道,统计等于color的颜色
/// </summary>
/// <param name="mat">矩阵</param>
/// <param name="color">值</param>
/// <returns></returns>
public static int CountGrayMatColorC1(Mat mat, byte color)
{
Debug.Assert(mat.Depth() == MatType.CV_8U);
Debug.Assert(mat.Channels() == 1);
using var dst = new Mat();
Cv2.Compare(mat, color, dst, CmpType.EQ);
return Cv2.CountNonZero(dst);
}
/// <summary>
/// 仅限单通道,统计颜色在lowColor和highColor中范围
/// </summary>
/// <param name="mat">矩阵</param>
/// <param name="lowColor">低</param>
/// <param name="highColor">高</param>
/// <returns></returns>
public static int CountGrayMatColorC1(Mat mat, byte lowColor, byte highColor)
{
using var mask = new Mat();
// 使用InRange直接生成二值掩膜
Cv2.InRange(mat, new Scalar(lowColor), new Scalar(highColor), mask);
return Cv2.CountNonZero(mask);
}
public static int CountGrayMatColor(Mat mat, byte lowColor, byte highColor)
{
return SplitChannal(mat, m => CountGrayMatColorC1(m, lowColor, highColor)).Sum();
}
public static Mat Threshold(Mat src, Scalar low, Scalar high)
{
using var mask = new Mat();
using var rgbMat = new Mat();
Cv2.CvtColor(src, rgbMat, ColorConversionCodes.BGR2RGB);
Cv2.InRange(rgbMat, low, high, mask);
// Cv2.Threshold(mask, mask, 0, 255, ThresholdTypes.Binary); //二值化 //不需要
return mask.Clone();
}
public static Mat InRangeHsv(Mat src, Scalar low, Scalar high)
{
using var rgbMat = src.CvtColor(ColorConversionCodes.BGR2HSV);
return rgbMat.InRange(low, high);
}
public static Mat InRangeHsvFull(Mat src, Scalar low, Scalar high)
{
using var rgbMat = src.CvtColor(ColorConversionCodes.BGR2HSV_FULL);
return rgbMat.InRange(low, high);
}
public static Scalar CommonHSV2OpenCVHSVFull(Scalar commonHSV)
{
return new Scalar(commonHSV.Val0 / 255 * 180, commonHSV.Val1 * 255, commonHSV.Val2 * 255);
}
public static Mat Threshold(Mat src, Scalar s)
{
return Threshold(src, s, s);
}
/// <summary>
/// 和二值化的颜色刚好相反
/// </summary>
/// <param name="src"></param>
/// <param name="s"></param>
/// <returns></returns>
public static Mat CreateMask(Mat src, Scalar s)
{
var mask = new Mat();
Cv2.InRange(src, s, s, mask);
return ~ mask;
}
/// <summary>
/// 检测多个点是否都在指定颜色范围内
/// </summary>
/// <param name="image">输入图像</param>
/// <param name="points">要检测的点集合</param>
/// <param name="lower">颜色下限</param>
/// <param name="upper">颜色上限</param>
/// <returns>所有点都在范围内返回 true,否则 false</returns>
public static bool CheckPointsInRange(Mat image, Point[] points, Scalar lower, Scalar upper)
{
if (image.Empty()) return false;
if (points.Length == 0) return true;
var channels = image.Channels();
var isContinuous = image.IsContinuous();
var step = image.Step();
var width = image.Width;
var height = image.Height;
unsafe
{
var dataPtr = (byte*)image.Data;
foreach (var (x, y) in points)
{
if (x < 0 || x >= width || y < 0 || y >= height)
{
Debug.WriteLine($"坐标({x}, {y}) 超过图片范围 ({width}, {height})");
continue;
}
var index = isContinuous ? (y * width + x) * channels : y * step + x * channels;
for (var ch = 0; ch < channels; ch++)
{
byte pixelValue = dataPtr[index + ch];
if (pixelValue < lower[ch] || pixelValue > upper[ch])
{
return false;
}
}
}
}
return true;
}
}
@@ -0,0 +1,47 @@
using OpenCvSharp;
using System;
namespace BetterGenshinImpact.Core.Recognition.OpenCv;
public class ResizeHelper
{
/// <summary>
/// 等比放大的
/// </summary>
/// <param name="src"></param>
/// <param name="scale"></param>
/// <param name="interpolation"></param>
/// <returns></returns>
public static Mat Resize(Mat src, double scale, InterpolationFlags interpolation = InterpolationFlags.Linear)
{
if (Math.Abs(scale - 1) > 0.00001)
{
return Resize(src, scale, scale, interpolation);
}
return src;
}
public static Mat Resize(Mat src, double widthScale, double heightScale, InterpolationFlags interpolation = InterpolationFlags.Linear)
{
if (Math.Abs(widthScale - 1) > 0.00001 || Math.Abs(heightScale - 1) > 0.00001)
{
var dst = new Mat();
Cv2.Resize(src, dst, new Size(src.Width * widthScale, src.Height * heightScale), 0, 0, interpolation);
return dst;
}
return src;
}
public static Mat ResizeTo(Mat src, int width, int height)
{
if (src.Width != width || src.Height != height)
{
var dst = new Mat();
Cv2.Resize(src, dst, new Size(width, height));
return dst;
}
return src;
}
}
@@ -0,0 +1,133 @@
using OpenCvSharp;
using System;
using System.Linq;
namespace BetterGenshinImpact.Core.Recognition.OpenCv.TemplateMatch;
public class FastSqDiffMatcher : IDisposable
{
public readonly Mat[] Source;
private readonly Mat[] _sourceSq;
/// <summary>
/// 初始化模板匹配器
/// </summary>
/// <param name="source">源图像</param>
/// <param name="templateSize">模板尺寸</param>
public FastSqDiffMatcher(Mat source, Size templateSize)
{
if (source.Empty())
throw new Exception("源图像为空");
if (templateSize.Width > source.Width || templateSize.Height > source.Height)
throw new Exception("模板图尺寸超过源图片尺寸");
Source = source.Split();
using Mat sourceF = new Mat();
source.ConvertTo(sourceF, MatType.CV_32F);
Cv2.Multiply(sourceF, sourceF, sourceF);
_sourceSq = sourceF.Split();
}
/// <summary>
/// 执行模板匹配
/// </summary>
/// <param name="maskedTemplates">模板图像</param>
/// <param name="maskF">遮罩图像</param>
/// <returns>最佳匹配位置</returns> (Point, double)
public (Point Loc, double Val) Match(Mat[] maskedTemplates, Mat maskF)
{
return Match(Source, _sourceSq, maskedTemplates, maskF);
}
public (Point Loc, double Val) Match(Mat[] maskedTemplates, Mat maskF, Rect rect, int[]? channels = null)
{
var sourceRoi = SelectMatsByIndex(GetRegionViews(Source, rect), channels);
var sourceSqRoi = SelectMatsByIndex(GetRegionViews(_sourceSq, rect), channels);
var maskedTemplatesSelect = SelectMatsByIndex(maskedTemplates, channels);
return Match(sourceRoi, sourceSqRoi, maskedTemplatesSelect, maskF);
}
private (Point Loc, double Val) Match(Mat[] source, Mat[] sourceSq, Mat[] maskedTemplates, Mat maskF)
{
var n = source.Length;
if (maskedTemplates.Length != n)
throw new Exception($"模板图通道数 {maskedTemplates.Length} 与源图像通道数 {n} 不匹配");
// 计算互相关图
using var crossCorr = new Mat();
using var temp = new Mat();
Cv2.MatchTemplate(source[0], maskedTemplates[0], crossCorr, TemplateMatchModes.CCorr);
for (var i = 1; i < n; i++)
{
Cv2.MatchTemplate(source[i], maskedTemplates[i], temp, TemplateMatchModes.CCorr);
Cv2.Add(crossCorr, temp, crossCorr);
}
Cv2.Multiply(crossCorr, -2, crossCorr);
// 计算源图像与遮罩的加权平方图
for (var i = 0; i < n; i++)
{
Cv2.MatchTemplate(sourceSq[i], maskF, temp, TemplateMatchModes.CCorr);
Cv2.Add(crossCorr, temp, crossCorr);
}
Cv2.MinMaxLoc(crossCorr, out var minVal, out _, out var minLoc, out _);
return (minLoc, minVal);
}
/// <summary>
///
/// </summary>
/// <param name="template">模板图</param>
/// <param name="mask">遮罩, 类型为 8UC1, 且尺寸与 template 相同</param>
/// <returns></returns>
/// <exception cref="Exception"></exception>
public static (Mat[] maskedTemplates, Mat maskF) PreProcess(Mat template, Mat mask)
{
if (mask.Type() != MatType.CV_8UC1)
throw new Exception("遮罩格式不对");
if (template.Size() != mask.Size())
throw new Exception("模板图与遮罩尺寸不匹配");
var maskF = new Mat();
mask.ConvertTo(maskF, MatType.CV_32F);
Cv2.Normalize(maskF, maskF, 0, 1, NormTypes.MinMax);
using var maskedTemplate = new Mat(template.Size(), template.Type(), Scalar.All(0));
Cv2.BitwiseAnd(template, template, maskedTemplate, mask);
var maskedTemplates = maskedTemplate.Split();
return (maskedTemplates, maskF);
}
public static double GetTplSumSq(Mat[] maskedTemplates, int[]? channels = null)
{
return SelectMatsByIndex(maskedTemplates, channels).Sum(maskedTpl => Cv2.Norm(maskedTpl, NormTypes.L2SQR));
}
public static Mat[] SelectMatsByIndex(Mat[] matArray, int[]? channels = null)
{
return channels?.Where(index => index >= 0 && index < matArray.Length)
.Select(index => matArray[index])
.ToArray()
?? matArray;
}
public static Mat[] GetRegionViews(Mat[] images, Rect rect)
{
return images.Select(img => img.SubMat(rect)).ToArray();
}
public void Dispose()
{
foreach (var img in Source)
{
img.Dispose();
}
foreach (var img in _sourceSq)
{
img.Dispose();
}
}
}
@@ -0,0 +1,87 @@
using System;
using System.Diagnostics;
using BetterGenshinImpact.Core.Config;
using OpenCvSharp;
using static BetterGenshinImpact.Core.Recognition.OpenCv.TemplateMatch.MiniMapMatchConfig;
namespace BetterGenshinImpact.Core.Recognition.OpenCv.TemplateMatch;
public class MatchContext : IDisposable
{
public Mat[] MaskedMiniMapRoughs;
public Mat MaskRoughF;
public Mat MiniMapExact = new Mat();
public Mat MaskExact = new Mat();
public TemplateMatchNormalizer NormalizerRough;
public TemplateMatchNormalizer NormalizerRoughChan;
public TemplateMatchNormalizer NormalizerExact;
public double TplSumSq;
public double TplSumSqChan;
public int[] Channels = [0, 1];
private bool _disposed = false;
public MatchContext(Mat miniMap, Mat mask)
{
/*
var name1 = "miniMap.png";
var path = Global.Absolute($@"log\screenshot\{name1}");
Cv2.ImWrite(path, miniMap);
var name2 = "mask.png";
path = Global.Absolute($@"log\screenshot\{name2}");
Cv2.ImWrite(path, mask);
*/
GetRoughMiniMap(miniMap, mask);
GetExactMiniMap(miniMap, mask);
}
public void GetRoughMiniMap(Mat miniMap, Mat mask)
{
using var miniMapRough = new Mat();
using var maskRough = new Mat();
Cv2.Resize(miniMap, miniMapRough, new Size(RoughSize, RoughSize), interpolation: InterpolationFlags.Area);
Cv2.Resize(mask, maskRough, new Size(RoughSize, RoughSize), interpolation: InterpolationFlags.Nearest);
(MaskedMiniMapRoughs, MaskRoughF) = FastSqDiffMatcher.PreProcess(miniMapRough, maskRough);
TplSumSq = FastSqDiffMatcher.GetTplSumSq(MaskedMiniMapRoughs);
TplSumSqChan = FastSqDiffMatcher.GetTplSumSq(MaskedMiniMapRoughs, Channels);
NormalizerRough = new TemplateMatchNormalizer(MaskedMiniMapRoughs, maskRough);
NormalizerRoughChan = new TemplateMatchNormalizer(MaskedMiniMapRoughs, maskRough, TemplateMatchModes.SqDiff, Channels);
}
public void GetExactMiniMap(Mat miniMap, Mat mask)
{
using var miniMapGray = new Mat();
Cv2.CvtColor(miniMap, miniMapGray, ColorConversionCodes.BGR2GRAY);
Cv2.Resize(miniMapGray, MiniMapExact, new Size(ExactSize, ExactSize), interpolation: InterpolationFlags.Cubic);
Cv2.Resize(mask, MaskExact, new Size(ExactSize, ExactSize), interpolation: InterpolationFlags.Nearest);
NormalizerExact = new TemplateMatchNormalizer(MiniMapExact, MaskExact);
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (_disposed) return;
if (disposing)
{
// 释放托管资源
DisposeMatArray(ref MaskedMiniMapRoughs);
MaskRoughF.Dispose();
MiniMapExact.Dispose();
MaskExact.Dispose();
}
_disposed = true;
}
private void DisposeMatArray(ref Mat[] matArray)
{
foreach (var mat in matArray)
{
mat.Dispose();
}
}
}
Loaded 100 of 1917 files, more files were not shown because too many files have changed in this diff. Show more