Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
05174c37c2 | ||
|
|
4f0ffc3980 | ||
|
|
0a86f4726f |
No files matched your search
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<AssemblyName>BetterGI</AssemblyName>
|
||||
<Version>0.47.0</Version>
|
||||
<Version>0.46.3-alpha.1</Version>
|
||||
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
|
||||
|
||||
@@ -51,8 +51,6 @@ public class AutoArtifactSalvageTask : ISoloTask
|
||||
|
||||
private readonly int? maxNumToCheck;
|
||||
|
||||
private bool returnToMainUi = true;
|
||||
|
||||
public AutoArtifactSalvageTask(int star, string? regularExpression = null, int? maxNumToCheck = null)
|
||||
{
|
||||
this.star = star;
|
||||
@@ -61,8 +59,7 @@ public class AutoArtifactSalvageTask : ISoloTask
|
||||
IStringLocalizer<AutoArtifactSalvageTask> stringLocalizer = App.GetService<IStringLocalizer<AutoArtifactSalvageTask>>() ?? throw new NullReferenceException();
|
||||
CultureInfo cultureInfo = new CultureInfo(TaskContext.Instance().Config.OtherConfig.GameCultureInfoName);
|
||||
quickSelectLocalizedString = stringLocalizer.WithCultureGet(cultureInfo, "快速选择");
|
||||
numOfStarLocalizedString =
|
||||
[
|
||||
numOfStarLocalizedString = [
|
||||
stringLocalizer.WithCultureGet(cultureInfo, "1星圣遗物"),
|
||||
stringLocalizer.WithCultureGet(cultureInfo, "2星圣遗物"),
|
||||
stringLocalizer.WithCultureGet(cultureInfo, "3星圣遗物"),
|
||||
@@ -70,18 +67,10 @@ public class AutoArtifactSalvageTask : ISoloTask
|
||||
];
|
||||
}
|
||||
|
||||
public AutoArtifactSalvageTask(int star, bool returnToMainUi) : this(star)
|
||||
{
|
||||
this.returnToMainUi = returnToMainUi;
|
||||
}
|
||||
|
||||
public async Task Start(CancellationToken ct)
|
||||
{
|
||||
this.ct = ct;
|
||||
if (returnToMainUi)
|
||||
{
|
||||
await _returnMainUiTask.Start(ct);
|
||||
}
|
||||
await _returnMainUiTask.Start(ct);
|
||||
|
||||
// B键打开背包
|
||||
input.SimulateAction(GIActions.OpenInventory);
|
||||
@@ -171,7 +160,6 @@ public class AutoArtifactSalvageTask : ISoloTask
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Bv.ClickWhiteConfirmButton(ra4);
|
||||
await Delay(500, ct);
|
||||
|
||||
@@ -215,11 +203,9 @@ public class AutoArtifactSalvageTask : ISoloTask
|
||||
{
|
||||
input.Keyboard.KeyPress(User32.VK.VK_ESCAPE);
|
||||
|
||||
if (returnToMainUi)
|
||||
{
|
||||
await _returnMainUiTask.Start(ct);
|
||||
}
|
||||
await _returnMainUiTask.Start(ct);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private async Task Salvage5Star(string regularExpression, int maxNumToCheck)
|
||||
@@ -228,7 +214,7 @@ public class AutoArtifactSalvageTask : ISoloTask
|
||||
|
||||
using var ra0 = CaptureToRectArea();
|
||||
Rect gridRoi = new Rect((int)(ra0.Width * 0.025), (int)(ra0.Width * 0.055), (int)(ra0.Width * 0.66), (int)(ra0.Width * 0.4));
|
||||
GridScreen gridScreen = new GridScreen(gridRoi, 3, 40, 28, 0.018, this.logger, this.ct); // 圣遗物分解Grid有4行9列
|
||||
GridScreen gridScreen = new GridScreen(gridRoi, 3, 40, 28, 0.018, this.logger, this.ct); // 圣遗物分解Grid有4行9列
|
||||
await foreach (ImageRegion itemRegion in gridScreen)
|
||||
{
|
||||
Rect gridRect = itemRegion.ToRect();
|
||||
@@ -254,7 +240,6 @@ public class AutoArtifactSalvageTask : ISoloTask
|
||||
await Delay(100, ct);
|
||||
}
|
||||
}
|
||||
|
||||
count--;
|
||||
if (count <= 0)
|
||||
{
|
||||
@@ -283,7 +268,6 @@ public class AutoArtifactSalvageTask : ISoloTask
|
||||
{
|
||||
msg = "匹配失败!";
|
||||
}
|
||||
|
||||
return match.Success;
|
||||
}
|
||||
|
||||
@@ -311,12 +295,12 @@ public class AutoArtifactSalvageTask : ISoloTask
|
||||
Cv2.FindContours(pinkThreshold, out var contours, out _, RetrievalModes.External,
|
||||
ContourApproximationModes.ApproxSimple, null);
|
||||
|
||||
var allPinkContours = contours.Where(c => c.Max(p => p.X) < pinkMask.Width * 0.2) // 都在左侧
|
||||
.SelectMany(c => c); // 拼凑零碎的像素
|
||||
var allPinkContours = contours.Where(c => c.Max(p => p.X) < pinkMask.Width * 0.2) // 都在左侧
|
||||
.SelectMany(c => c); // 拼凑零碎的像素
|
||||
if (allPinkContours.Any())
|
||||
{
|
||||
var bounding = Cv2.BoundingRect(allPinkContours);
|
||||
if (bounding.Width > pinkMask.Width * 0.07 && bounding.Height > pinkMask.Height * 0.3) //不能太小
|
||||
if (bounding.Width > pinkMask.Width * 0.07 && bounding.Height > pinkMask.Height * 0.3) //不能太小
|
||||
{
|
||||
return ArtifactStatus.Locked;
|
||||
}
|
||||
@@ -333,11 +317,11 @@ public class AutoArtifactSalvageTask : ISoloTask
|
||||
Cv2.FindContours(greenMask, out contours, out _, RetrievalModes.External,
|
||||
ContourApproximationModes.ApproxSimple, null);
|
||||
|
||||
var allGreenContours = contours.SelectMany(c => c); // 拼凑零碎的像素
|
||||
var allGreenContours = contours.SelectMany(c => c); // 拼凑零碎的像素
|
||||
if (allGreenContours.Any())
|
||||
{
|
||||
var bounding = Cv2.BoundingRect(allGreenContours);
|
||||
if (bounding.Width > greenMask.Width * 0.2 && bounding.Height > greenMask.Height * 0.8) //不能太小;至少存在右上角勾号的绿色背景,忽略上底边的绿线(因有缩放动画,每次都要重新框定不利缩减步骤)
|
||||
if (bounding.Width > greenMask.Width * 0.2 && bounding.Height > greenMask.Height * 0.8) //不能太小;至少存在右上角勾号的绿色背景,忽略上底边的绿线(因有缩放动画,每次都要重新框定不利缩减步骤)
|
||||
{
|
||||
return ArtifactStatus.Selected;
|
||||
}
|
||||
@@ -355,12 +339,10 @@ public class AutoArtifactSalvageTask : ISoloTask
|
||||
/// 啥也没有
|
||||
/// </summary>
|
||||
None,
|
||||
|
||||
/// <summary>
|
||||
/// 左上角有粉色锁定标记
|
||||
/// </summary>
|
||||
Locked,
|
||||
|
||||
/// <summary>
|
||||
/// 上下有绿色选择框
|
||||
/// </summary>
|
||||
|
||||
@@ -80,8 +80,4 @@ public partial class AutoDomainConfig : ObservableObject
|
||||
// 使用脆弱树脂刷取副本次数
|
||||
[ObservableProperty]
|
||||
private int _fragileResinUseCount = 0;
|
||||
|
||||
// 战斗死亡后重试次数
|
||||
[ObservableProperty]
|
||||
private int _reviveRetryCount = 3;
|
||||
}
|
||||
@@ -105,8 +105,8 @@ public class AutoDomainTask : ISoloTask
|
||||
Init();
|
||||
Notify.Event(NotificationEvent.DomainStart).Success("自动秘境启动");
|
||||
|
||||
// 复活重试
|
||||
for (var i = 0; i < _config.ReviveRetryCount; i++)
|
||||
// 3次复活重试
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -1236,4 +1236,4 @@ public class AutoDomainTask : ISoloTask
|
||||
|
||||
await new AutoArtifactSalvageTask(star).Start(_ct);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,6 @@ namespace BetterGenshinImpact.GameTask.AutoPathing.Handler;
|
||||
public class MiningHandler : IActionHandler
|
||||
{
|
||||
private readonly CombatScript _miningCombatScript = CombatScriptParser.ParseContext("""
|
||||
诺艾尔 attack(2.0)
|
||||
荒泷一斗 attack(2.0)
|
||||
迪希雅 attack(2.0)
|
||||
玛薇卡 attack(2.0)
|
||||
@@ -25,6 +24,7 @@ public class MiningHandler : IActionHandler
|
||||
娜维娅 attack(2.0)
|
||||
菲米尼 attack(2.0)
|
||||
迪卢克 attack(2.0)
|
||||
诺艾尔 attack(2.0)
|
||||
卡维 attack(2.0)
|
||||
雷泽 attack(2.0)
|
||||
优菈 attack(2.0)
|
||||
|
||||
@@ -65,8 +65,11 @@ public class AutoStygianOnslaughtTask : ISoloTask
|
||||
Notify.Event(NotificationEvent.DomainStart).Success($"{Name}启动");
|
||||
|
||||
await DoDomain();
|
||||
|
||||
await Delay(3000, ct);
|
||||
|
||||
|
||||
await Delay(2000, ct);
|
||||
await Bv.WaitForMainUi(_ct, 30);
|
||||
await Delay(2000, ct);
|
||||
|
||||
await ArtifactSalvage();
|
||||
Notify.Event(NotificationEvent.DomainEnd).Success($"{Name}结束");
|
||||
@@ -513,6 +516,6 @@ public class AutoStygianOnslaughtTask : ISoloTask
|
||||
star = 4;
|
||||
}
|
||||
|
||||
await new AutoArtifactSalvageTask(star, false).Start(_ct);
|
||||
await new AutoArtifactSalvageTask(star).Start(_ct);
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ namespace BetterGenshinImpact.GameTask.Common.Job;
|
||||
/// </summary>
|
||||
public class LowerHeadThenWalkToTask
|
||||
{
|
||||
private Rect CaptureRect => TaskContext.Instance().SystemInfo.ScaleMax1080PCaptureRect;
|
||||
private RECT CaptureRect => TaskContext.Instance().SystemInfo.CaptureAreaRect;
|
||||
|
||||
private double AssetScale => TaskContext.Instance().SystemInfo.AssetScale;
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
using OpenCvSharp;
|
||||
using Vanara.PInvoke;
|
||||
using Vanara.PInvoke;
|
||||
|
||||
namespace BetterGenshinImpact.GameTask.Model;
|
||||
|
||||
public class BaseIndependentTask
|
||||
{
|
||||
protected SystemInfo Info => TaskContext.Instance().SystemInfo;
|
||||
protected Rect CaptureRect => TaskContext.Instance().SystemInfo.ScaleMax1080PCaptureRect;
|
||||
protected RECT CaptureRect => TaskContext.Instance().SystemInfo.CaptureAreaRect;
|
||||
protected double AssetScale => TaskContext.Instance().SystemInfo.AssetScale;
|
||||
}
|
||||
@@ -1226,32 +1226,7 @@
|
||||
Margin="0,0,36,0"
|
||||
IsChecked="{Binding Config.AutoDomainConfig.AutoEat, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
<Grid Margin="16">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:TextBlock Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
FontTypography="Body"
|
||||
Text="角色死亡后重试次数"
|
||||
TextWrapping="Wrap" />
|
||||
<ui:TextBlock Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Foreground="{ui:ThemeResource TextFillColorTertiaryBrush}"
|
||||
Text="秘境战斗中,发生角色死亡重试的次数"
|
||||
TextWrapping="Wrap" />
|
||||
<ui:TextBox Text="{Binding Config.AutoDomainConfig.ReviveRetryCount, Mode=TwoWay}"
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
Grid.Column="1"
|
||||
MinWidth="90"
|
||||
Margin="0,0,36,0" />
|
||||
</Grid>
|
||||
|
||||
</StackPanel>
|
||||
</ui:CardExpander>
|
||||
|
||||
@@ -1280,7 +1255,7 @@
|
||||
Foreground="{ui:ThemeResource TextFillColorTertiaryBrush}"
|
||||
TextWrapping="Wrap">
|
||||
在接触钥匙后的界面启动本任务 -
|
||||
<Hyperlink Command="{Binding GoToAutoStygianOnslaughtUrlCommand}"
|
||||
<Hyperlink Command="{Binding GoToAutoDomainUrlCommand}"
|
||||
Foreground="{ui:ThemeResource TextFillColorSecondaryBrush}">
|
||||
点击查看使用教程
|
||||
</Hyperlink>
|
||||
|
||||
Reference in new issue
Block a user