public static void MouseClick(IntPtr hwnd, int x, int y) { int loc = (y * 0x10000) + x; PostMessage(hwnd, WM_MOUSEMOVE, (IntPtr)0x00000000, (UIntPtr)loc); PostMessage(hwnd, WM_LBUTTONDOWN, (IntPtr)0x00000001, (UIntPtr)loc); PostMessage(hwnd, WM_LBUTTONUP, (IntPtr)0x00000000, (UIntPtr)loc); } }
/// <summary> /// Controls logging in the next character. Credit to Mag for this. /// </summary> private void LoginNextCharacter() { int XPixelOffset = 121; int YTopOfBox = 209; int YBottomOfBox = 532; float characterNameSize = (YBottomOfBox - YTopOfBox) / (float)TotalSlots; int yOffset = (int)(YTopOfBox + (characterNameSize / 2) + (characterNameSize * Machine.NextCharacterIndex)); // Select the character Simulate.MouseClick(Core.Decal.Hwnd, XPixelOffset, yOffset); // Click the Enter button Simulate.MouseClick(Core.Decal.Hwnd, 0x015C, 0x0185); }