I tried this.
And it didn't do nothing in game how can I make it work?
Code:
#define WINVER 0x0500
#include <stdio.h>
#include <windows.h>
#include <iostream>
#define KeyDown(Key) (GetAsyncKeyState(Key) & 0x8000)// keyboard hook
using namespace std;
int main()
{
for (int i=0; i<700; i++)//The Loop
{
// This structure will be used to create the keyboard
// input event.
INPUT ip;
// Pause for 5 seconds.
Sleep(10000);
// Set up a generic keyboard event.
ip.type = INPUT_KEYBOARD;
ip.ki.wScan = 0; // hardware scan code for key
ip.ki.time = 0;
ip.ki.dwExtraInfo = 0;
//Actual button pressing starts below
ip.ki.wVk = 0x20; //Presses Space to Jump in game
Sleep(100);
ip.ki.dwFlags = 0; // 0 for key press
SendInput(1, &ip, sizeof(INPUT));
//end
ip.ki.wVk = 0x44; //Presses "D" to move left
ip.ki.dwFlags = 0; // 0 for key press
SendInput(1, &ip, sizeof(INPUT));
ip.ki.dwFlags = KEYEVENTF_KEYUP; // KEYEVENTF_KEYUP for key release
//end
ip.ki.wVk = 0x41; //Presses "A" to move left
Sleep(100);
ip.ki.dwFlags = 0; // 0 for key press
SendInput(1, &ip, sizeof(INPUT));
ip.ki.dwFlags = KEYEVENTF_KEYUP; // KEYEVENTF_KEYUP for key release
;//end
SendInput(1, &ip, sizeof(INPUT));
ip.ki.wVk = 0x44; //Presses "D" to move right
Sleep(100);
ip.ki.dwFlags = 0; // 0 for key press
SendInput(1, &ip, sizeof(INPUT));
ip.ki.dwFlags = KEYEVENTF_KEYUP; // KEYEVENTF_KEYUP for key release
//end
SendInput(1, &ip, sizeof(INPUT));
ip.ki.wVk = 0x57; //Presses "W" to move Foward
Sleep(100);
ip.ki.dwFlags = 0; // 0 for key press
SendInput(1, &ip, sizeof(INPUT));
ip.ki.dwFlags = KEYEVENTF_KEYUP; // KEYEVENTF_KEYUP for key release
//end
SendInput(1, &ip, sizeof(INPUT));
ip.ki.wVk = 0x53; //Presses "S" to move Foward
Sleep(100);
ip.ki.dwFlags = 0; // 0 for key press
SendInput(1, &ip, sizeof(INPUT));
ip.ki.dwFlags = KEYEVENTF_KEYUP; // KEYEVENTF_KEYUP for key release
Sleep(1000);//end
ip.ki.wVk = 0x20; //Presses Space to Jump in game
Sleep(100);
ip.ki.dwFlags = 0; // 0 for key press
SendInput(1, &ip, sizeof(INPUT));
Sleep(1000);//end
ip.ki.wVk = 0x61; //Presses "1" to switch to gun 1
Sleep(100);
ip.ki.dwFlags = 0; // 0 for key press
SendInput(1, &ip, sizeof(INPUT));
Sleep(1000);//end
ip.ki.wVk = 0x62; //Presses "2" to switch to handgun
Sleep(100);
ip.ki.dwFlags = 0; // 0 for key press
SendInput(1, &ip, sizeof(INPUT));
Sleep(1000);//end
ip.ki.wVk = 0x63; //Presses "3" to switch to knife
Sleep(100);
ip.ki.dwFlags = 0; // 0 for key press
SendInput(1, &ip, sizeof(INPUT));
Sleep(1000);//end
ip.ki.wVk = 0x64; //Presses "4" to switch to grenade
Sleep(100);
ip.ki.dwFlags = 0; // 0 for key press
SendInput(1, &ip, sizeof(INPUT));
Sleep(1000);//end
//Cursor starts jumping to these coords
SetCursorPos(700,700);//Jump custor to coords
Sleep(100);
SetCursorPos(500,500);//Jump custor to coords
Sleep(100);
SetCursorPos(400,200);//Jump custor to coords
Sleep(100);
SetCursorPos(200,400);//Jump custor to coords
Sleep(100);
SetCursorPos(20,20);//Jump custor to coords
}
}