From 2d3395b4916f515d70261570afaedb7e540fe42b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=89=E9=B8=AD=E8=9B=8B?= Date: Wed, 1 Jan 2025 01:52:41 +0800 Subject: [PATCH 1/3] typo & ui --- .../Core/Script/ScriptRepoUpdater.cs | 2 +- .../View/Pages/TaskSettingsPage.xaml | 349 +++++++++--------- .../Pages/View/ScriptGroupConfigView.xaml | 2 +- 3 files changed, 178 insertions(+), 175 deletions(-) diff --git a/BetterGenshinImpact/Core/Script/ScriptRepoUpdater.cs b/BetterGenshinImpact/Core/Script/ScriptRepoUpdater.cs index 8885efcd..5b339c75 100644 --- a/BetterGenshinImpact/Core/Script/ScriptRepoUpdater.cs +++ b/BetterGenshinImpact/Core/Script/ScriptRepoUpdater.cs @@ -451,7 +451,7 @@ public class ScriptRepoUpdater : Singleton { _webWindow = new WebpageWindow { - Title = "enshin Copilot Scripts | BetterGI 脚本本地中央仓库", + Title = "Genshin Copilot Scripts | BetterGI 脚本本地中央仓库", Width = 1366, Height = 768, }; diff --git a/BetterGenshinImpact/View/Pages/TaskSettingsPage.xaml b/BetterGenshinImpact/View/Pages/TaskSettingsPage.xaml index 5d4b5d00..056568c6 100644 --- a/BetterGenshinImpact/View/Pages/TaskSettingsPage.xaml +++ b/BetterGenshinImpact/View/Pages/TaskSettingsPage.xaml @@ -117,8 +117,8 @@ Grid.Column="1" Margin="0,0,12,0" Content="脚本仓库" - Command="{Binding OpenLocalScriptRepoCommand}" - Icon="{ui:SymbolIcon Archive24}"/> + Command="{Binding OpenLocalScriptRepoCommand}" + Icon="{ui:SymbolIcon Archive24}" /> + Command="{Binding OpenLocalScriptRepoCommand}" + Icon="{ui:SymbolIcon Archive24}" /> - - - - - - - - - - - - - + + + - - @@ -493,49 +466,49 @@ - - - - - - - - - - - - + + + + + + + + + + - - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -565,92 +538,94 @@ Text="{Binding Config.AutoFightConfig.FinishDetectConfig.FastCheckParams, Mode=TwoWay}" TextWrapping="Wrap" /> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + @@ -668,7 +643,7 @@ + Grid.Column="0" + FontTypography="Body" + Text="战斗超时(秒)" + TextWrapping="Wrap" /> + Grid.Column="0" + Foreground="{ui:ThemeResource TextFillColorTertiaryBrush}" + Text="当战斗超过一定时间后,自动停止战斗" + TextWrapping="Wrap" /> + Grid.RowSpan="2" + Grid.Column="1" + Margin="0,0,36,0" + MinWidth="120" + Text="{Binding Config.AutoFightConfig.Timeout}" /> + + + + + + + + + + + + + - @@ -799,8 +802,8 @@ Grid.Column="1" Margin="0,0,12,0" Content="脚本仓库" - Command="{Binding OpenLocalScriptRepoCommand}" - Icon="{ui:SymbolIcon Archive24}"/> + Command="{Binding OpenLocalScriptRepoCommand}" + Icon="{ui:SymbolIcon Archive24}" /> Date: Wed, 1 Jan 2025 09:20:08 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=BD=93=E6=9C=80=E5=90=8E=E5=87=BA?= =?UTF-8?q?=E6=8B=9B=E4=BA=BA=E4=B8=BA=E4=B8=87=E5=8F=B6=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E4=B8=94=E5=89=A9=E4=BD=99cd>3=E6=97=B6=EF=BC=8C=E8=B7=B3?= =?UTF-8?q?=E8=BF=87=E6=AD=A4=E6=AC=A1=E4=B8=87=E5=8F=B6=E6=8B=BE=E5=8F=96?= =?UTF-8?q?=20(#906)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GameTask/AutoFight/AutoFightTask.cs | 38 +++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/BetterGenshinImpact/GameTask/AutoFight/AutoFightTask.cs b/BetterGenshinImpact/GameTask/AutoFight/AutoFightTask.cs index 0bc00272..79700074 100644 --- a/BetterGenshinImpact/GameTask/AutoFight/AutoFightTask.cs +++ b/BetterGenshinImpact/GameTask/AutoFight/AutoFightTask.cs @@ -213,7 +213,7 @@ public class AutoFightTask : ISoloTask return; }*/ var fightEndFlag = false; - + string lastFighttName = ""; // 战斗操作 var fightTask = Task.Run(async () => { @@ -234,9 +234,9 @@ public class AutoFightTask : ISoloTask } command.Execute(combatScenes); - - + + lastFighttName = command.Name; if (!fightEndFlag && _taskParam is { FightFinishDetectEnabled: true } ) { @@ -329,23 +329,31 @@ public class AutoFightTask : ISoloTask var kazuha = combatScenes.Avatars.FirstOrDefault(a => a.Name == "枫原万叶"); if (kazuha != null) { + var time = DateTime.UtcNow - kazuha.LastSkillTime; + //当万叶最后一个出招,并且cd大于3时,此时不再触发万叶拾取 + if (!(lastFighttName== "枫原万叶" && time.TotalSeconds>3)) + { + Logger.LogInformation("使用枫原万叶长E拾取掉落物"); await Delay(300, ct); if (kazuha.TrySwitch()) { - - var time = DateTime.UtcNow - kazuha.LastSkillTime; - if (time.TotalMilliseconds > 0 && time.TotalSeconds <= kazuha.SkillHoldCd) - { - Logger.LogInformation("枫原万叶长E技能可能处于冷却中,等待 {Time} s",time.TotalSeconds); - await Delay((int)Math.Ceiling(time.TotalMilliseconds), ct); - } - kazuha.UseSkill(true); - await Task.Delay(100); - Simulation.SendInput.Mouse.LeftButtonClick(); - await Delay(1500, ct); + if (time.TotalMilliseconds > 0 && time.TotalSeconds <= kazuha.SkillHoldCd) + { + Logger.LogInformation("枫原万叶长E技能可能处于冷却中,等待 {Time} s",time.TotalSeconds); + await Delay((int)Math.Ceiling(time.TotalMilliseconds), ct); + } + kazuha.UseSkill(true); + await Task.Delay(100); + Simulation.SendInput.Mouse.LeftButtonClick(); + await Delay(1500, ct); + } - + } + else + { + Logger.LogInformation("最后一次由万叶出招,不再重复拾取!"); + } } From c95343e9538c58d98478cd903544e2431c9d4ab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=89=E9=B8=AD=E8=9B=8B?= Date: Wed, 1 Jan 2025 10:48:29 +0800 Subject: [PATCH 3/3] #846 daily reward party --- .../Core/Config/OneDragonFlowConfig.cs | 5 +++ .../Common/Job/GoToAdventurersGuildTask.cs | 8 ++++- .../View/Pages/OneDragonFlowPage.xaml | 31 +++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/BetterGenshinImpact/Core/Config/OneDragonFlowConfig.cs b/BetterGenshinImpact/Core/Config/OneDragonFlowConfig.cs index db09a4c9..620b03db 100644 --- a/BetterGenshinImpact/Core/Config/OneDragonFlowConfig.cs +++ b/BetterGenshinImpact/Core/Config/OneDragonFlowConfig.cs @@ -34,6 +34,11 @@ public partial class OneDragonFlowConfig : ObservableObject [ObservableProperty] private bool _weeklyDomainEnabled = false; + + // 领取每日奖励的好感队伍名称 + [ObservableProperty] + private string _dailyRewardPartyName = string.Empty; + #region 每周秘境配置 diff --git a/BetterGenshinImpact/GameTask/Common/Job/GoToAdventurersGuildTask.cs b/BetterGenshinImpact/GameTask/Common/Job/GoToAdventurersGuildTask.cs index caa03fd8..7c064cf5 100644 --- a/BetterGenshinImpact/GameTask/Common/Job/GoToAdventurersGuildTask.cs +++ b/BetterGenshinImpact/GameTask/Common/Job/GoToAdventurersGuildTask.cs @@ -24,13 +24,19 @@ public class GoToAdventurersGuildTask private readonly ChooseTalkOptionTask _chooseTalkOptionTask = new(); - public async Task Start(string country, CancellationToken ct) + public async Task Start(string country, CancellationToken ct, string? dailyRewardPartyName = null) { Logger.LogInformation("→ {Name} 开始", Name); for (int i = 0; i < _retryTimes; i++) { try { + // 如果有好感队伍名称,先切换到好感队伍 + if (!string.IsNullOrEmpty(dailyRewardPartyName)) + { + await new SwitchPartyTask().Start(dailyRewardPartyName, ct); + } + await DoOnce(country, ct); break; } diff --git a/BetterGenshinImpact/View/Pages/OneDragonFlowPage.xaml b/BetterGenshinImpact/View/Pages/OneDragonFlowPage.xaml index db9d69ab..1fa53de7 100644 --- a/BetterGenshinImpact/View/Pages/OneDragonFlowPage.xaml +++ b/BetterGenshinImpact/View/Pages/OneDragonFlowPage.xaml @@ -504,6 +504,37 @@ SelectedItem="{Binding SelectedConfig.AdventurersGuildCountry, Mode=TwoWay}" ItemsSource="{Binding AdventurersGuildCountry}" /> + + + + + + + + + + + + + + + + +