Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C 

Rapid Fire keeps closing after you input a number

So I'm trying to make a rapid fire hack with 2 options. If you enter 1 then the program should make a you do 5 shots, and if you enter 2 then it's full auto, but once you input a number the program closes.

CODE:
Code
#include <windows.h>
#include <iostream>
#include <string>
#include <ctime>
#define KeyDown(Key) (GetAsyncKeyState(Key) & 0x8000)// keyboard hook

using namespace std;

int main()
{
    int Option;
    cout << "\n\n\t\t    1.x5 Shot" << endl;
    cout << "\n\n\t\t    2.Full Auto" << endl;
    cin >> Option;
    
    POINT p;
    
    if (Option == 2)
    {
       if (KeyDown(0x46))
       {
       GetCursorPos( &p );//Gets Position of cursor
       mouse_event(MOUSEEVENTF_LEFTDOWN, p.x, p.y, 0, NULL);//Left click hold down
       Sleep(50);
       mouse_event(MOUSEEVENTF_LEFTUP, p.x, p.y, 0, 0);//Left click lets go
       Sleep(50);
       cout << "\n\n\t\tFull Auto Working!" << endl;
       }
    }
    else if (Option == 1)
    {
       int rep = 0;
       if (KeyDown (0x46))
       {
          while(rep < 5)
          {
          GetCursorPos ( &p );
          mouse_event (MOUSEEVENTF_LEFTDOWN, p.x, p.y, 0, NULL);
          Sleep(50);
          mouse_event(MOUSEEVENTF_LEFTUP, p.x, p.y, 0, 0);
          rep++;
          cout << "Tripple shot working!" << endl;
          }
       }
    return 0;
    }
}
You have to add a loop around everything if you want it to stay open and accept multiple commands.

Code
while (true)
{
    //Your code should be in this loop

    //After you accept input

    if (Option == -1) //Or some whatever else to exit the loop
  break;

    //If they don't use a closing value, your program will execute normally as above
}

return 0; //Then the program closes normally : EDITED
And just a heads up, unless every gun in the game you're working with is semi-auto and depends solely on how quickly you click the mouse, that won't work. You'll actually have to hack the fire rate of the game. As in get the memory value where its stored and modify it.
(Nov 14, 2013 11:57 PM)xSilent Wrote:  You have to add a loop around everything if you want it to stay open and accept multiple commands.

Code
while (true)
{
    //Your code should be in this loop

    //After you accept input

    if (Option == -1) //Or some whatever else to exit the loop
  break;

    //If they don't use a closing value, your program will execute normally as above
}

return 0; //Then the program to close normally.

Oh I get it, thanks I got it to work.


(Nov 15, 2013 07:20 AM)Mouse❤️ Wrote:  And just a heads up, unless every gun in the game you're working with is semi-auto and depends solely on how quickly you click the mouse, that won't work. You'll actually have to hack the fire rate of the game. As in get the memory value where its stored and modify it.

It works with CoD4 and BO2 last time I used it.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by Fivepoint0Oct 23, 2018 05:24 PM 3 191 Oct 23, 2018 05:24 PM
Last Post: Fivepoint0
[Python] by ChukozyAug 15, 2017 11:39 PM 3 104 Aug 15, 2017 11:39 PM
Last Post: CR1T
[Java] by TahhOct 17, 2016 11:24 AM 0 136 Oct 17, 2016 11:24 AM
Last Post: Tahh