diff --git a/BetterGenshinImpact/BetterGenshinImpact.csproj b/BetterGenshinImpact/BetterGenshinImpact.csproj index 257da5d7..a1e828e5 100644 --- a/BetterGenshinImpact/BetterGenshinImpact.csproj +++ b/BetterGenshinImpact/BetterGenshinImpact.csproj @@ -260,6 +260,12 @@ Always + + Always + + + Always + Always diff --git a/BetterGenshinImpact/GameTask/AutoSkip/Assets/1920x1080/collect.png b/BetterGenshinImpact/GameTask/AutoSkip/Assets/1920x1080/collect.png new file mode 100644 index 00000000..9e4fe3aa Binary files /dev/null and b/BetterGenshinImpact/GameTask/AutoSkip/Assets/1920x1080/collect.png differ diff --git a/BetterGenshinImpact/GameTask/AutoSkip/Assets/1920x1080/re.png b/BetterGenshinImpact/GameTask/AutoSkip/Assets/1920x1080/re.png new file mode 100644 index 00000000..e107c1ad Binary files /dev/null and b/BetterGenshinImpact/GameTask/AutoSkip/Assets/1920x1080/re.png differ diff --git a/BetterGenshinImpact/GameTask/AutoSkip/Assets/AutoSkipAssets.cs b/BetterGenshinImpact/GameTask/AutoSkip/Assets/AutoSkipAssets.cs index 83c36f6b..5c736d90 100644 --- a/BetterGenshinImpact/GameTask/AutoSkip/Assets/AutoSkipAssets.cs +++ b/BetterGenshinImpact/GameTask/AutoSkip/Assets/AutoSkipAssets.cs @@ -17,6 +17,9 @@ public class AutoSkipAssets public RecognitionObject PageCloseRo; + public RecognitionObject CollectRo; + public RecognitionObject ReRo; + //public Mat BinaryStopAutoButtonMat; @@ -96,5 +99,23 @@ public class AutoSkipAssets RegionOfInterest = new Rect(info.CaptureAreaRect.Width - info.CaptureAreaRect.Width / 8 , 0, info.CaptureAreaRect.Width / 8, info.CaptureAreaRect.Height / 8), DrawOnWindow = true }.InitTemplate(); + + // 一键派遣 + CollectRo = new RecognitionObject + { + Name = "Collect", + RecognitionType = RecognitionTypes.TemplateMatch, + TemplateImageMat = GameTaskManager.LoadAssetImage("AutoSkip", "collect.png"), + RegionOfInterest = new Rect(0, info.CaptureAreaRect.Height - info.CaptureAreaRect.Height / 3, info.CaptureAreaRect.Width / 4, info.CaptureAreaRect.Height / 3), + DrawOnWindow = true + }.InitTemplate(); + ReRo = new RecognitionObject + { + Name = "Re", + RecognitionType = RecognitionTypes.TemplateMatch, + TemplateImageMat = GameTaskManager.LoadAssetImage("AutoSkip", "re.png"), + RegionOfInterest = new Rect(info.CaptureAreaRect.Width/2, info.CaptureAreaRect.Height - info.CaptureAreaRect.Height / 4, info.CaptureAreaRect.Width / 4, info.CaptureAreaRect.Height / 4), + DrawOnWindow = true + }.InitTemplate(); } } \ No newline at end of file diff --git a/BetterGenshinImpact/GameTask/AutoSkip/AutoSkipTrigger.cs b/BetterGenshinImpact/GameTask/AutoSkip/AutoSkipTrigger.cs index b74c47a5..039c1efa 100644 --- a/BetterGenshinImpact/GameTask/AutoSkip/AutoSkipTrigger.cs +++ b/BetterGenshinImpact/GameTask/AutoSkip/AutoSkipTrigger.cs @@ -148,8 +148,8 @@ public class AutoSkipTrigger : ITaskTrigger exploreIconRa.ClickCenter(); // 等待探索派遣界面打开 - Thread.Sleep(1000); - new ExpeditionTask().Run(content); + Thread.Sleep(800); + new OneKeyExpeditionTask().Run(_autoSkipAssets); exploreIconRa.Dispose(); return; } diff --git a/BetterGenshinImpact/GameTask/AutoSkip/ExpeditionTask.cs b/BetterGenshinImpact/GameTask/AutoSkip/ExpeditionTask.cs index da3c9644..80ce9a8f 100644 --- a/BetterGenshinImpact/GameTask/AutoSkip/ExpeditionTask.cs +++ b/BetterGenshinImpact/GameTask/AutoSkip/ExpeditionTask.cs @@ -6,6 +6,7 @@ using Microsoft.Extensions.Logging; using OpenCvSharp; using OpenCvSharp.Extensions; using Sdcb.PaddleOCR; +using System; using System.Collections.Generic; using System.Drawing; using System.Linq; @@ -16,7 +17,10 @@ namespace BetterGenshinImpact.GameTask.AutoSkip; /// 重新探索派遣 /// /// 必须在已经有探索派遣完成的情况下使用 +/// +/// 于 4.3 版本废弃 /// +[Obsolete] public class ExpeditionTask { private static readonly List ExpeditionCharacterList = new(); diff --git a/BetterGenshinImpact/GameTask/AutoSkip/OneKeyExpeditionTask.cs b/BetterGenshinImpact/GameTask/AutoSkip/OneKeyExpeditionTask.cs new file mode 100644 index 00000000..87dcc33e --- /dev/null +++ b/BetterGenshinImpact/GameTask/AutoSkip/OneKeyExpeditionTask.cs @@ -0,0 +1,29 @@ +using BetterGenshinImpact.GameTask.AutoSkip.Assets; +using BetterGenshinImpact.GameTask.Common; +using BetterGenshinImpact.View.Drawable; +using Microsoft.Extensions.Logging; +using OpenCvSharp; + +namespace BetterGenshinImpact.GameTask.AutoSkip; + +public class OneKeyExpeditionTask +{ + public void Run(AutoSkipAssets assets) + { + // 1.全部领取 + var content = TaskControl.CaptureToContent(); + content.CaptureRectArea.Find(assets.CollectRo, ra => + { + ra.ClickCenter(); + TaskControl.Logger.LogInformation("探索派遣:{Text}", "全部领取"); + TaskControl.Sleep(500); + // 2.重新派遣 + content = TaskControl.CaptureToContent(); + content.CaptureRectArea.Find(assets.ReRo, ra2 => + { + ra2.ClickCenter(); + TaskControl.Logger.LogInformation("探索派遣:{Text}", "再次派遣"); + }); + }); + } +} \ No newline at end of file diff --git a/BetterGenshinImpact/GameTask/Macro/QuickEnhanceArtifactMacro.cs b/BetterGenshinImpact/GameTask/Macro/QuickEnhanceArtifactMacro.cs index d5d9e252..5e36fa9e 100644 --- a/BetterGenshinImpact/GameTask/Macro/QuickEnhanceArtifactMacro.cs +++ b/BetterGenshinImpact/GameTask/Macro/QuickEnhanceArtifactMacro.cs @@ -5,6 +5,9 @@ using System.Windows; namespace BetterGenshinImpact.GameTask.Macro; +/// +/// 于 4.3 版本废弃 +/// [Obsolete] public class QuickEnhanceArtifactMacro {