Skip to content

Instantly share code, notes, and snippets.

@nirinium
Last active December 12, 2019 17:55
Show Gist options
  • Save nirinium/c8812cb0b7dd492f2f7e9e978875d221 to your computer and use it in GitHub Desktop.
Save nirinium/c8812cb0b7dd492f2f7e9e978875d221 to your computer and use it in GitHub Desktop.
// Rapid Fire.cpp : Defines the entry point for the console application.// Copyright 2013 @ EPiC REV
#include "stdafx.h"
#include <iostream>
#include <Windows.h>
#include <time.h>
using namespace std;
int main()
{
cout << "===============================================================================" << endl;
cout << "External Rapid Fire by Nirinium " << endl;
cout << "===============================================================================" << endl;
cout << "Press right-click in game to rapid fire." << endl;
bool RapidFire = false;
int AutoFireTimer = clock();
int currentTime;
bool MouseDown = false;
while(true)
{
//Check for right mouse button to be down.
if(GetAsyncKeyState(VK_RBUTTON) & 0x8000)RapidFire = true;
else RapidFire = false;
if(RapidFire)
{
//only go if so many milliseconds have passed.
if(!MouseDown)
{
MouseDown = true;
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); //
}
if(clock() - AutoFireTimer > 21)
{
MouseDown = false;
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); //
AutoFireTimer = clock();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment