Re: Key Space
Posted: Tue Dec 26, 2017 2:29 am
I think still need to keep aion client foreground
Code: Select all
[DllImport("user32.dll")]
static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, int dwExtraInfo);
[DllImport("user32.dll")]
static extern uint MapVirtualKeyEx(uint uCode, uint uMapType, IntPtr dwhkl);
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool SetForegroundWindow(uint hWnd);
public override void OnLoad()
{
SetForegroundWindow(Game.Process.ProcessWindowHandle);
}
public static void EngageFlight()
{
if (Game.Process.GetUnsignedInteger(Game.Base() + (ulong)Game.Resolver["ControllerSingle"]["FlightCooldownRemainingTime"].Value) == 0)
{
Game.Process.SetByte(Game.Player.GetAddress(0) + Game.Resolver["ActorSingle"]["Action"].Value, 7);
Thread.Sleep(210);
keybd_event(0x20, (byte)(MapVirtualKeyEx(0x20, 0, IntPtr.Zero)), 0, 0);
Thread.Sleep(210);
keybd_event(0x20, (byte)(MapVirtualKeyEx(0x20, 0, IntPtr.Zero)), 2, 0);
Game.Process.SetByte(Game.Player.GetAddress(0) + Game.Resolver["ActorSingle"]["Action"].Value, 0);
}
}
public static void EngageFlight()
{
if (Game.Process.GetUnsignedInteger(Game.Base() + (ulong)Game.Resolver["ControllerSingle"]["FlightCooldownRemainingTime"].Value) == 0)
{
float
pZ = Game.Process.GetFloat(Game.Player.GetAddress(2) + Game.Resolver["ActorPosition"]["Position"].Value + 8);
keybd_event(0x20, (byte)(MapVirtualKeyEx(0x20, 0, IntPtr.Zero)), 0, 0);
Thread.Sleep(210);
keybd_event(0x20, (byte)(MapVirtualKeyEx(0x20, 0, IntPtr.Zero)), 2, 0);
Thread.Sleep(210);
Game.Process.SetFloat(Game.Player.GetAddress(2) + Game.Resolver["ActorPosition"]["Position"].Value + 8, pZ + 4);
}
}