mirror of
https://github.com/babalae/better-genshin-impact
synced 2025-01-08 11:57:53 +08:00
0.39.1 & fix some bug
This commit is contained in:
parent
c0fecd079e
commit
c80799cbee
@ -10,7 +10,7 @@
|
|||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<ApplicationIcon>Assets\Images\logo.ico</ApplicationIcon>
|
<ApplicationIcon>Assets\Images\logo.ico</ApplicationIcon>
|
||||||
<AssemblyName>BetterGI</AssemblyName>
|
<AssemblyName>BetterGI</AssemblyName>
|
||||||
<AssemblyVersion>0.39.0</AssemblyVersion>
|
<AssemblyVersion>0.39.1</AssemblyVersion>
|
||||||
<Platforms>x64</Platforms>
|
<Platforms>x64</Platforms>
|
||||||
<DebugType>embedded</DebugType>
|
<DebugType>embedded</DebugType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@ -117,13 +117,13 @@ public class AutoDomainTask : ISoloTask
|
|||||||
var combatScenes = new CombatScenes().InitializeTeam(CaptureToRectArea());
|
var combatScenes = new CombatScenes().InitializeTeam(CaptureToRectArea());
|
||||||
|
|
||||||
// 前置进入秘境
|
// 前置进入秘境
|
||||||
EnterDomain();
|
await EnterDomain();
|
||||||
|
|
||||||
for (var i = 0; i < _taskParam.DomainRoundNum; i++)
|
for (var i = 0; i < _taskParam.DomainRoundNum; i++)
|
||||||
{
|
{
|
||||||
// 0. 关闭秘境提示
|
// 0. 关闭秘境提示
|
||||||
Logger.LogDebug("0. 关闭秘境提示");
|
Logger.LogDebug("0. 关闭秘境提示");
|
||||||
CloseDomainTip();
|
await CloseDomainTip();
|
||||||
|
|
||||||
// 队伍没初始化成功则重试
|
// 队伍没初始化成功则重试
|
||||||
RetryTeamInit(combatScenes);
|
RetryTeamInit(combatScenes);
|
||||||
@ -249,7 +249,7 @@ public class AutoDomainTask : ISoloTask
|
|||||||
Thread.Sleep(3000);
|
Thread.Sleep(3000);
|
||||||
Simulation.SendInput.Keyboard.KeyUp(VK.VK_W);
|
Simulation.SendInput.Keyboard.KeyUp(VK.VK_W);
|
||||||
}
|
}
|
||||||
|
|
||||||
await Delay(3000, _ct); // 站稳
|
await Delay(3000, _ct); // 站稳
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -277,7 +277,7 @@ public class AutoDomainTask : ISoloTask
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EnterDomain()
|
private async Task EnterDomain()
|
||||||
{
|
{
|
||||||
var fightAssets = AutoFightContext.Instance.FightAssets;
|
var fightAssets = AutoFightContext.Instance.FightAssets;
|
||||||
|
|
||||||
@ -288,7 +288,7 @@ public class AutoDomainTask : ISoloTask
|
|||||||
Simulation.SendInput.Keyboard.KeyPress(VK.VK_F);
|
Simulation.SendInput.Keyboard.KeyPress(VK.VK_F);
|
||||||
Logger.LogInformation("自动秘境:{Text}", "进入秘境");
|
Logger.LogInformation("自动秘境:{Text}", "进入秘境");
|
||||||
// 秘境开门动画 5s
|
// 秘境开门动画 5s
|
||||||
Sleep(5000, _ct);
|
await Delay(5000, _ct);
|
||||||
}
|
}
|
||||||
|
|
||||||
int retryTimes = 0, clickCount = 0;
|
int retryTimes = 0, clickCount = 0;
|
||||||
@ -302,14 +302,14 @@ public class AutoDomainTask : ISoloTask
|
|||||||
clickCount++;
|
clickCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
Sleep(1500, _ct);
|
await Delay(1500, _ct);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 载入动画
|
// 载入动画
|
||||||
Sleep(3000, _ct);
|
await Delay(3000, _ct);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CloseDomainTip()
|
private async Task CloseDomainTip()
|
||||||
{
|
{
|
||||||
// 2min的载入时间总够了吧
|
// 2min的载入时间总够了吧
|
||||||
var retryTimes = 0;
|
var retryTimes = 0;
|
||||||
@ -319,16 +319,16 @@ public class AutoDomainTask : ISoloTask
|
|||||||
using var cactRectArea = CaptureToRectArea().Find(AutoFightContext.Instance.FightAssets.ClickAnyCloseTipRa);
|
using var cactRectArea = CaptureToRectArea().Find(AutoFightContext.Instance.FightAssets.ClickAnyCloseTipRa);
|
||||||
if (!cactRectArea.IsEmpty())
|
if (!cactRectArea.IsEmpty())
|
||||||
{
|
{
|
||||||
Sleep(1000, _ct);
|
await Delay(1000, _ct);
|
||||||
cactRectArea.Click();
|
cactRectArea.Click();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo 添加小地图角标位置检测 防止有人手点了
|
// todo 添加小地图角标位置检测 防止有人手点了
|
||||||
Sleep(1000, _ct);
|
await Delay(1000, _ct);
|
||||||
}
|
}
|
||||||
|
|
||||||
Sleep(1500, _ct);
|
await Delay(1500, _ct);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<CombatCommand> FindCombatScriptAndSwitchAvatar(CombatScenes combatScenes)
|
private List<CombatCommand> FindCombatScriptAndSwitchAvatar(CombatScenes combatScenes)
|
||||||
|
@ -34,25 +34,27 @@ public class AutoAlbumTask(AutoMusicGameParam taskParam) : ISoloTask
|
|||||||
|
|
||||||
public async Task StartOneAlbum(CancellationToken ct)
|
public async Task StartOneAlbum(CancellationToken ct)
|
||||||
{
|
{
|
||||||
|
using var iconRa = CaptureToRectArea().Find(AutoMusicAssets.Instance.UiLeftTopAlbumIcon);
|
||||||
|
if (!iconRa.IsExist())
|
||||||
|
{
|
||||||
|
throw new Exception("当前未处于专辑界面,请在专辑界面运行本任务");
|
||||||
|
}
|
||||||
|
|
||||||
// 12个音乐
|
// 12个音乐
|
||||||
for (int i = 0; i < 13; i++)
|
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);
|
using var doneRa = CaptureToRectArea().Find(AutoMusicAssets.Instance.AlbumMusicComplate);
|
||||||
if (doneRa.IsExist())
|
if (doneRa.IsExist())
|
||||||
{
|
{
|
||||||
Logger.LogInformation("当前音乐{Num}所有奖励已领取,切换下一首", i + 1);
|
Logger.LogInformation("当前乐曲{Num}所有奖励已领取,切换下一首", i + 1);
|
||||||
GameCaptureRegion.GameRegion1080PPosClick(310, 220);
|
GameCaptureRegion.GameRegion1080PPosClick(310, 220);
|
||||||
await Delay(800, ct);
|
await Delay(800, ct);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.LogInformation("当前音乐{Num}存在未领取奖励,前往演奏", i + 1);
|
Logger.LogInformation("当前乐曲{Num}存在未领取奖励,前往演奏", i + 1);
|
||||||
Bv.ClickWhiteConfirmButton(CaptureToRectArea());
|
Bv.ClickWhiteConfirmButton(CaptureToRectArea());
|
||||||
await Delay(800, ct);
|
await Delay(800, ct);
|
||||||
// 点击传说
|
// 点击传说
|
||||||
@ -86,10 +88,15 @@ public class AutoAlbumTask(AutoMusicGameParam taskParam) : ISoloTask
|
|||||||
// 等待任意一个任务完成
|
// 等待任意一个任务完成
|
||||||
await Task.WhenAny(checkTask, musicTask);
|
await Task.WhenAny(checkTask, musicTask);
|
||||||
await cts.CancelAsync();
|
await cts.CancelAsync();
|
||||||
Logger.LogInformation("当前音乐{Num}演奏结束", i + 1);
|
Logger.LogInformation("当前乐曲{Num}演奏结束", i + 1);
|
||||||
await Delay(2000, ct);
|
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("当前专辑所有乐曲演奏结束");
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user