[C++] Rapid Fire [Any Game]
Made this 'cos bored and trying to expand my programming horizon.
Sleep(x) is in milliseconds and controls whenever mouse1 is pressed.
while(GetASyncKeyState(0x06)) is saying whenever mouse5 is pressed, spam mouse1 every x milliseconds.
You can find a list of virtual key codes
here. You can use the hex equivalent (0x0Y) or VK_XXX.
Anyway, here it is bb <3
Code:
#include <iostream>
#include <windows.h>
#include <time.h>
using namespace std;
int main()
{
int AutoFireTMR = clock();
while(!GetAsyncKeyState(VK_DELETE)) {
Sleep(25);
while(GetAsyncKeyState(0x06)) {
if(clock() - AutoFireTMR > 25) {
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
AutoFireTMR = clock();
}
}
}
}