0.39.1 & fix some bug

This commit is contained in:
辉鸭蛋 2025-01-02 22:49:38 +08:00
parent c0fecd079e
commit c80799cbee
3 changed files with 28 additions and 21 deletions

View File

@ -10,7 +10,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ApplicationIcon>Assets\Images\logo.ico</ApplicationIcon>
<AssemblyName>BetterGI</AssemblyName>
<AssemblyVersion>0.39.0</AssemblyVersion>
<AssemblyVersion>0.39.1</AssemblyVersion>
<Platforms>x64</Platforms>
<DebugType>embedded</DebugType>
</PropertyGroup>

View File

@ -117,13 +117,13 @@ public class AutoDomainTask : ISoloTask
var combatScenes = new CombatScenes().InitializeTeam(CaptureToRectArea());
// 前置进入秘境
EnterDomain();
await EnterDomain();
for (var i = 0; i < _taskParam.DomainRoundNum; i++)
{
// 0. 关闭秘境提示
Logger.LogDebug("0. 关闭秘境提示");
CloseDomainTip();
await CloseDomainTip();
// 队伍没初始化成功则重试
RetryTeamInit(combatScenes);
@ -249,7 +249,7 @@ public class AutoDomainTask : ISoloTask
Thread.Sleep(3000);
Simulation.SendInput.Keyboard.KeyUp(VK.VK_W);
}
await Delay(3000, _ct); // 站稳
}
else
@ -277,7 +277,7 @@ public class AutoDomainTask : ISoloTask
return true;
}
private void EnterDomain()
private async Task EnterDomain()
{
var fightAssets = AutoFightContext.Instance.FightAssets;
@ -288,7 +288,7 @@ public class AutoDomainTask : ISoloTask
Simulation.SendInput.Keyboard.KeyPress(VK.VK_F);
Logger.LogInformation("自动秘境:{Text}", "进入秘境");
// 秘境开门动画 5s
Sleep(5000, _ct);
await Delay(5000, _ct);
}
int retryTimes = 0, clickCount = 0;
@ -302,14 +302,14 @@ public class AutoDomainTask : ISoloTask
clickCount++;
}
Sleep(1500, _ct);
await Delay(1500, _ct);
}
// 载入动画
Sleep(3000, _ct);
await Delay(3000, _ct);
}
private void CloseDomainTip()
private async Task CloseDomainTip()
{
// 2min的载入时间总够了吧
var retryTimes = 0;
@ -319,16 +319,16 @@ public class AutoDomainTask : ISoloTask
using var cactRectArea = CaptureToRectArea().Find(AutoFightContext.Instance.FightAssets.ClickAnyCloseTipRa);
if (!cactRectArea.IsEmpty())
{
Sleep(1000, _ct);
await Delay(1000, _ct);
cactRectArea.Click();
break;
}
// todo 添加小地图角标位置检测 防止有人手点了
Sleep(1000, _ct);
await Delay(1000, _ct);
}
Sleep(1500, _ct);
await Delay(1500, _ct);
}
private List<CombatCommand> FindCombatScriptAndSwitchAvatar(CombatScenes combatScenes)

View File

@ -34,25 +34,27 @@ public class AutoAlbumTask(AutoMusicGameParam taskParam) : ISoloTask
public async Task StartOneAlbum(CancellationToken ct)
{
using var iconRa = CaptureToRectArea().Find(AutoMusicAssets.Instance.UiLeftTopAlbumIcon);
if (!iconRa.IsExist())
{
throw new Exception("当前未处于专辑界面,请在专辑界面运行本任务");
}
// 12个音乐
for (int i = 0; i < 13; i++)
{
using var iconRa = CaptureToRectArea().Find(AutoMusicAssets.Instance.UiLeftTopAlbumIcon);
if (!iconRa.IsExist())
{
throw new Exception("当前未处于专辑界面,请在专辑界面运行本任务");
}
using var doneRa = CaptureToRectArea().Find(AutoMusicAssets.Instance.AlbumMusicComplate);
if (doneRa.IsExist())
{
Logger.LogInformation("当前乐{Num}所有奖励已领取,切换下一首", i + 1);
Logger.LogInformation("当前{Num}所有奖励已领取,切换下一首", i + 1);
GameCaptureRegion.GameRegion1080PPosClick(310, 220);
await Delay(800, ct);
continue;
}
Logger.LogInformation("当前乐{Num}存在未领取奖励,前往演奏", i + 1);
Logger.LogInformation("当前{Num}存在未领取奖励,前往演奏", i + 1);
Bv.ClickWhiteConfirmButton(CaptureToRectArea());
await Delay(800, ct);
// 点击传说
@ -86,10 +88,15 @@ public class AutoAlbumTask(AutoMusicGameParam taskParam) : ISoloTask
// 等待任意一个任务完成
await Task.WhenAny(checkTask, musicTask);
await cts.CancelAsync();
Logger.LogInformation("当前乐{Num}演奏结束", i + 1);
Logger.LogInformation("当前{Num}演奏结束", i + 1);
await Delay(2000, ct);
await Bv.WaitUntilFound(AutoMusicAssets.Instance.UiLeftTopAlbumIcon, ct);
Logger.LogInformation("切换下一首");
GameCaptureRegion.GameRegion1080PPosClick(310, 220);
await Delay(800, ct);
}
Logger.LogInformation("当前专辑所有音乐演奏结束");
Logger.LogInformation("当前专辑所有演奏结束");
}
}