
Untitled
By: a guest on
Aug 8th, 2012 | syntax:
None | size: 0.91 KB | hits: 25 | expires: Never
#include <windows.h>
const int PRESS_BASE = 400;
const int PRESS_INCREMENT = 150;
const int PRESS_INCREMENT_INTERVAL = 4000; // != 0 !!!
const int WAIT_BASE = 200;
const int WAIT_INCREMENT = 0;
const int WAIT_INCREMENT_INTERVAL = 500; // != 0 !!!
//basketball
void main()
{
int startTime = -1;
while(true)
{
if(GetAsyncKeyState(VK_RCONTROL))
{
if(startTime == -1)
startTime = GetTickCount();
int runtime = GetTickCount() - startTime;
INPUT ip;
ZeroMemory(&ip,sizeof(INPUT));
ip.type = INPUT_KEYBOARD;
ip.ki.wVk = VK_SPACE;
SendInput(1,&ip,sizeof(INPUT));
Sleep( PRESS_BASE + (runtime/PRESS_INCREMENT_INTERVAL) * PRESS_INCREMENT);
ip.ki.dwFlags |= KEYEVENTF_KEYUP;
SendInput(1,&ip,sizeof(INPUT));
runtime = GetTickCount() - startTime;
Sleep( WAIT_BASE + (runtime/WAIT_INCREMENT_INTERVAL) * WAIT_INCREMENT);
}
else
startTime = -1;
}
}