HelpExternal Strafe Hack

Posts 16–17 of 17 · Page 2 of 2
Code:
#include <iostream>
#include <ctime>
#include <windows.h>
POINT Center, CurPos;
bool FirstTime = true;
int SendKeyPress(unsigned short KeyCode, bool IsDown);

int main()
{
	printf("Z to set strafe center point");
	while (true)
	{
		if (GetAsyncKeyState(0x5A) & (1 << 15))
		{
			if (FirstTime)
			{
				GetCursorPos(&Center);
				FirstTime = false;
				printf("Strafebot activated\nHold Z to strafe");
				MessageBox(NULL, "Center Position Set", "Strafe Bot", NULL);

			}
			GetCursorPos(&CurPos);
			if (CurPos.x > Center.x)
			{
				SendKeyPress(0x20, true);
				Sleep(2);
				SendKeyPress(0x20, false);
			}
			else if (CurPos.x < Center.x)
			{
				SendKeyPress(0x1e, true);
				Sleep(2);
				SendKeyPress(0x1e, false);
			}
		}
	}
	return 0;
}

int SendKeyPress(unsigned short KeyCode, bool KeyDown)
{
	INPUT InputData;
	InputData.type = INPUT_KEYBOARD;
	InputData.ki.wScan = KeyCode;
	InputData.ki.time = time(NULL);
	InputData.ki.dwExtraInfo = 0;
	if (KeyDown)
		InputData.ki.dwFlags = KEYEVENTF_SCANCODE;
	else
		InputData.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
	return SendInput(1, &InputData, sizeof(InputData));

}
Try this
1 week has passed and no further replies have been made by the OP. Assuming solved.

/Closed.
Posts 16–17 of 17 · Page 2 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?