mirror of
https://github.com/babalae/better-genshin-impact
synced 2025-01-08 11:57:53 +08:00
mod: 使用新方案替代直接从KeyBindings中读取按键
This commit is contained in:
parent
c904ae5150
commit
15f363196c
@ -7,6 +7,7 @@ using BetterGenshinImpact.GameTask.AutoPathing.Model;
|
||||
using Vanara.PInvoke;
|
||||
using static BetterGenshinImpact.GameTask.Common.TaskControl;
|
||||
using BetterGenshinImpact.Core.Config;
|
||||
using BetterGenshinImpact.Core.Simulator.Extensions;
|
||||
|
||||
namespace BetterGenshinImpact.GameTask.AutoPathing.Handler;
|
||||
|
||||
@ -19,7 +20,7 @@ public class ElementalSkillHandler : IActionHandler
|
||||
public async Task RunAsync(CancellationToken ct, WaypointForTrack? waypointForTrack = null, object? config = null)
|
||||
{
|
||||
Logger.LogInformation("执行 {Text}", "释放元素战技");
|
||||
Simulation.SendInput.Keyboard.KeyPress(TaskContext.Instance().Config.KeyBindingsConfig.ElementalSkill.ToVK()) ;
|
||||
Simulation.SendInput.SimulateAction(GIActions.ElementalSkill);
|
||||
await Delay(1000, ct);
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using BetterGenshinImpact.Core.Config;
|
||||
using BetterGenshinImpact.Core.Simulator;
|
||||
using BetterGenshinImpact.Core.Simulator.Extensions;
|
||||
using BetterGenshinImpact.GameTask.AutoPathing.Model;
|
||||
using BetterGenshinImpact.Helpers;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@ -55,7 +56,7 @@ public class NahidaCollectHandler : IActionHandler
|
||||
await Delay(200, ct);
|
||||
|
||||
// 按住E技能 无死角扫码
|
||||
Simulation.SendInput.Keyboard.KeyDown(TaskContext.Instance().Config.KeyBindingsConfig.ElementalSkill.ToVK());
|
||||
Simulation.SendInput.SimulateAction(GIActions.ElementalSkill, KeyType.KeyDown);
|
||||
await Delay(200, ct);
|
||||
|
||||
// 先地面来一圈
|
||||
@ -77,7 +78,7 @@ public class NahidaCollectHandler : IActionHandler
|
||||
Simulation.SendInput.Mouse.MoveMouseBy(x, y);
|
||||
await Delay(30, ct);
|
||||
}
|
||||
Simulation.SendInput.Keyboard.KeyUp(TaskContext.Instance().Config.KeyBindingsConfig.ElementalSkill.ToVK());
|
||||
Simulation.SendInput.SimulateAction(GIActions.ElementalSkill, KeyType.KeyUp);
|
||||
|
||||
lastETime = DateTime.Now;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user