From 7137e52605a166a9f24cebc3690d64a0fbbe792e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E4=BA=91?= Date: Sun, 5 Jan 2025 01:57:16 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=A1=AE=E4=BF=9D=E4=BC=A0=E9=80=81?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=BC=80=E5=A7=8B=E5=89=8D=E4=B8=80=E5=AE=9A?= =?UTF-8?q?=E4=BD=8D=E4=BA=8E=E5=9C=B0=E5=9B=BE=E7=95=8C=E9=9D=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs b/BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs index 454e4b24..31712f0a 100644 --- a/BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs +++ b/BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs @@ -157,6 +157,12 @@ public class TpTask(CancellationToken ct) var ra1 = CaptureToRectArea(); if (!Bv.IsInBigMapUi(ra1)) { + while (!Bv.IsInMainUi(ra1)) + { + Simulation.SendInput.Keyboard.KeyPress(User32.VK.VK_ESCAPE); + await Delay(1000, ct); + ra1 = CaptureToRectArea(); + } Simulation.SendInput.Keyboard.KeyPress(User32.VK.VK_M); await Delay(1000, ct); for (int i = 0; i < 3; i++) From a57aed9ce7e66c06ecd7c36d5d52eed937b198c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=89=E9=B8=AD=E8=9B=8B?= Date: Sun, 5 Jan 2025 14:57:54 +0800 Subject: [PATCH 2/5] fix genshin install path get --- .../Genshin/Paths/RegistryGameLocator.cs | 21 ++++++++++++++---- .../Genshin/Paths/UnityLogGameLocator.cs | 22 +++++++++++++++---- .../ViewModel/Pages/HomePageViewModel.cs | 4 ++-- 3 files changed, 37 insertions(+), 10 deletions(-) diff --git a/BetterGenshinImpact/Genshin/Paths/RegistryGameLocator.cs b/BetterGenshinImpact/Genshin/Paths/RegistryGameLocator.cs index 1faadeec..f0b4f5b6 100644 --- a/BetterGenshinImpact/Genshin/Paths/RegistryGameLocator.cs +++ b/BetterGenshinImpact/Genshin/Paths/RegistryGameLocator.cs @@ -18,25 +18,38 @@ public class RegistryGameLocator var cn = Registry.GetValue($@"HKEY_CURRENT_USER\Software\miHoYo\HYP\1_1\hk4e_cn", "GameInstallPath", null) as string; if (!string.IsNullOrEmpty(cn)) { - return Path.Combine(cn, "YuanShen.exe"); + var filePath = Path.Combine(cn, "YuanShen.exe"); + if (File.Exists(filePath)) + { + return filePath; + } } var global = Registry.GetValue($@"HKEY_CURRENT_USER\Software\Cognosphere\HYP\1_0\hk4e_global", "GameInstallPath", null) as string; if (!string.IsNullOrEmpty(global)) { - return Path.Combine(global, "GenshinImpact.exe"); + var filePath = Path.Combine(global, "GenshinImpact.exe"); + if (File.Exists(filePath)) + { + return filePath; + } } var bilibili = Registry.GetValue($@"HKEY_CURRENT_USER\Software\miHoYo\HYP\standalone\14_0\hk4e_cn\umfgRO5gh5\hk4e_cn", "GameInstallPath", null) as string; if (!string.IsNullOrEmpty(bilibili)) { - return Path.Combine(bilibili, "YuanShen.exe"); + var filePath = Path.Combine(bilibili, "YuanShen.exe"); + if (File.Exists(filePath)) + { + return filePath; + } } } catch (Exception e) { - TaskControl.Logger.LogDebug(e, "Failed to locate game path."); + TaskControl.Logger.LogDebug(e, "Failed to locate game path from HYP."); } + return null; } } \ No newline at end of file diff --git a/BetterGenshinImpact/Genshin/Paths/UnityLogGameLocator.cs b/BetterGenshinImpact/Genshin/Paths/UnityLogGameLocator.cs index a31501d4..55939921 100644 --- a/BetterGenshinImpact/Genshin/Paths/UnityLogGameLocator.cs +++ b/BetterGenshinImpact/Genshin/Paths/UnityLogGameLocator.cs @@ -23,15 +23,29 @@ public partial class UnityLogGameLocator string logFilePathOversea = Path.Combine(appDataPath, @"..\LocalLow\miHoYo\Genshin Impact\output_log.txt"); string logFilePathChinese = Path.Combine(appDataPath, @"..\LocalLow\miHoYo\原神\output_log.txt"); - // Fallback to the CN server. - string logFilePath = File.Exists(logFilePathChinese) ? logFilePathChinese : logFilePathOversea; - return await LocateGamePathAsync(logFilePath).ConfigureAwait(false); + if (File.Exists(logFilePathChinese)) + { + var p1 = await LocateGamePathAsync(logFilePathChinese).ConfigureAwait(false); + if (p1 is not null && File.Exists(p1)) + { + return p1; + } + } + + if (File.Exists(logFilePathOversea)) + { + var p2 = await LocateGamePathAsync(logFilePathOversea).ConfigureAwait(false); + if (p2 is not null && File.Exists(p2)) + { + return p2; + } + } } catch (Exception e) { TaskControl.Logger.LogDebug(e, "Failed to locate game path."); - return null; } + return null; } private static async ValueTask LocateGamePathAsync(string logFilePath) diff --git a/BetterGenshinImpact/ViewModel/Pages/HomePageViewModel.cs b/BetterGenshinImpact/ViewModel/Pages/HomePageViewModel.cs index 47888dfb..604cfed6 100644 --- a/BetterGenshinImpact/ViewModel/Pages/HomePageViewModel.cs +++ b/BetterGenshinImpact/ViewModel/Pages/HomePageViewModel.cs @@ -337,14 +337,14 @@ public partial class HomePageViewModel : ObservableObject, INavigationAware, IVi { Task.Run(async () => { - var p1 = await UnityLogGameLocator.LocateSingleGamePathAsync(); + var p1 = RegistryGameLocator.GetDefaultGameInstallPath(); if (!string.IsNullOrEmpty(p1)) { Config.GenshinStartConfig.InstallPath = p1; } else { - var p2 = RegistryGameLocator.GetDefaultGameInstallPath(); + var p2 = await UnityLogGameLocator.LocateSingleGamePathAsync(); if (!string.IsNullOrEmpty(p2)) { Config.GenshinStartConfig.InstallPath = p2; From 01eaa190d8526434c9975899d0b1d3f92f2734bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=AA=E7=B1=BD=E9=98=B3=E5=A4=96=E5=A9=86?= <2915414902@qq.com> Date: Sun, 5 Jan 2025 18:54:35 +0800 Subject: [PATCH 3/5] Update README.md Update Screenshot --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 458d7752..1d70a8ab 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ BetterGI · 更好的原神, 一个基于计算机视觉技术,意图让原 ## 截图 - +![0 39 1](https://github.com/user-attachments/assets/8fb0bfd9-e0db-4289-800f-1bc2efb221aa) ## 下载 From f0af8134ce5874a0602ea2742f516552f5350179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=89=E9=B8=AD=E8=9B=8B?= Date: Sun, 5 Jan 2025 19:09:59 +0800 Subject: [PATCH 4/5] =?UTF-8?q?Delete=201=E5=B2=A9=E6=B0=B4=E9=9B=B7?= =?UTF-8?q?=E7=81=AB=E5=9B=9B=E7=A5=9E.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1岩水雷火四神.txt | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 1岩水雷火四神.txt diff --git a/1岩水雷火四神.txt b/1岩水雷火四神.txt deleted file mode 100644 index b7849e04..00000000 --- a/1岩水雷火四神.txt +++ /dev/null @@ -1,7 +0,0 @@ -// 作者:百事都不通 -// 描述:四神指钟离、芙宁娜、雷电将军、玛薇卡 - -钟离 s(0.2),e(hold),wait(0.3),w(0.2),q -芙宁娜 e,wait(0.3),q -雷电将军 e -玛薇卡 e \ No newline at end of file From 57a83cc171c412b4ee65567649be780890b1fd1c Mon Sep 17 00:00:00 2001 From: Feiran Zhang Date: Mon, 6 Jan 2025 03:00:04 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8C=9C=E7=89=B9?= =?UTF-8?q?=E8=8F=88=E8=8E=89=E4=BD=9C=E4=B8=BA=E5=BE=AA=E7=8E=AF=E7=9F=AD?= =?UTF-8?q?E=E8=A7=92=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BetterGenshinImpact/Core/Config/PathingConditionConfig.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BetterGenshinImpact/Core/Config/PathingConditionConfig.cs b/BetterGenshinImpact/Core/Config/PathingConditionConfig.cs index c3a9b396..1a2acac0 100644 --- a/BetterGenshinImpact/Core/Config/PathingConditionConfig.cs +++ b/BetterGenshinImpact/Core/Config/PathingConditionConfig.cs @@ -34,7 +34,7 @@ public partial class PathingConditionConfig : ObservableObject new Condition { Subject = "队伍中角色", - Object = ["绮良良", "莱依拉", "芭芭拉", "七七"], + Object = ["绮良良", "莱依拉", "茜特菈莉", "芭芭拉", "七七"], Result = "循环短E" },