mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-03-15 07:43:20 +08:00
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using BetterGenshinImpact.Core.Recognition;
|
||||
using BetterGenshinImpact.GameTask.Model;
|
||||
using BetterGenshinImpact.Helpers;
|
||||
using OpenCvSharp;
|
||||
using System.Drawing;
|
||||
using Vanara.PInvoke;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace BetterGenshinImpact.GameTask.QucikBuy.Assets;
|
||||
|
||||
public class QuickBuyAssets : BaseAssets<QuickBuyAssets>
|
||||
{
|
||||
private readonly ILogger<QuickBuyAssets> _logger = App.GetLogger<QuickBuyAssets>();
|
||||
|
||||
public RecognitionObject SereniteaPotCoin;
|
||||
|
||||
private QuickBuyAssets()
|
||||
{
|
||||
SereniteaPotCoin = new RecognitionObject
|
||||
{
|
||||
Name = "SereniteaPotCoin",
|
||||
RecognitionType = RecognitionTypes.TemplateMatch,
|
||||
TemplateImageMat = GameTaskManager.LoadAssetImage("QucikBuy", "SereniteaPotCoin.png"),
|
||||
RegionOfInterest = new Rect((int)(1630 * AssetScale),(int)(30 * AssetScale),(int)(200 * AssetScale),(int)(40 * AssetScale)),
|
||||
DrawOnWindow = false
|
||||
}.InitTemplate();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
using BetterGenshinImpact.Core.Simulator;
|
||||
using BetterGenshinImpact.GameTask.AutoPick.Assets;
|
||||
using BetterGenshinImpact.GameTask.Common;
|
||||
using BetterGenshinImpact.GameTask.Model.Area;
|
||||
using BetterGenshinImpact.GameTask.QucikBuy.Assets;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using Wpf.Ui.Violeta.Controls;
|
||||
@@ -23,6 +25,30 @@ public class QuickBuyTask
|
||||
|
||||
try
|
||||
{
|
||||
ImageRegion ra = TaskControl.CaptureToRectArea();
|
||||
if (ra.Find(QuickBuyAssets.Instance.SereniteaPotCoin).IsExist())
|
||||
{
|
||||
// 尘歌壶购买逻辑
|
||||
GameCaptureRegion.GameRegionClick((size, scale) => (200 * scale, 200 * scale));
|
||||
TaskControl.CheckAndSleep(100);
|
||||
// 选中左边点
|
||||
GameCaptureRegion.GameRegion1080PPosMove(1450, 690);
|
||||
TaskControl.CheckAndSleep(100);
|
||||
Simulation.SendInput.Mouse.LeftButtonDown();
|
||||
TaskControl.CheckAndSleep(50);
|
||||
|
||||
// 向右滑动
|
||||
Simulation.SendInput.Mouse.MoveMouseBy(1000, 0);
|
||||
TaskControl.CheckAndSleep(200);
|
||||
Simulation.SendInput.Mouse.LeftButtonUp();
|
||||
TaskControl.CheckAndSleep(100);
|
||||
|
||||
GameCaptureRegion.GameRegion1080PPosClick(1600, 1020);
|
||||
TaskControl.CheckAndSleep(200); // 等待窗口消失
|
||||
GameCaptureRegion.GameRegion1080PPosClick(960, 850);
|
||||
|
||||
return;
|
||||
}
|
||||
// 点击购买/兑换 右下225x60
|
||||
GameCaptureRegion.GameRegionClick((size, scale) => (size.Width - 225 * scale, size.Height - 60 * scale));
|
||||
TaskControl.CheckAndSleep(100); // 等待窗口弹出
|
||||
|
||||
Reference in New Issue
Block a user