Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // rustnorecoil.cpp: definisce il punto di ingresso dell'applicazione console.
- //
- #include "stdafx.h"
- #include <thread>
- #include <Windows.h>
- #include <iostream>
- #include <stdio.h>
- #include <string>
- using namespace std;
- namespace AssaultRifle
- {
- const size_t WEAPON = 1;
- const size_t SHOTS = 29;
- DWORD recoilTableY[WEAPON][SHOTS] = {
- { 50, 55, 55, 45, 30, 30, 25, 25, 15, 15, 15, 20, 25, 30, 35, 30, 35, 25, 10, 15, 10, 10, 15, 15, 25, 25, 30, 30, 25 }
- };
- DWORD recoilTableX[WEAPON][SHOTS] = {
- { -35, -10, -60, -50, -5, 15, 20, 45, 40, 30, 75, 5, 40, -35, -25, -35, -30, -25, -35 , -40, -40, -45, -25, 15, 20, 30, 60, 70, 50 }
- };
- }
- void UpdateMenu();
- void SetColor(int ForgC);
- void Toggle();
- void Norecoil();
- void Semirifle();
- int Changes = 0;
- bool semirifle = false;
- bool norecoil = false;
- bool updated = false;
- string bools[2] = { "[OFF]", "[ON]" };
- void UpdateMenu()
- {
- int temp = -1;
- if (temp != Changes)
- {
- temp = Changes;
- system("cls");
- SetColor(15);
- cout << "--- Stupid Rust Cheats ---" << endl;
- cout << "__________________________" << endl << endl;
- if (norecoil)
- {
- SetColor(10);
- cout << " [F8] AK Ezrecoil\t\t=\t" << bools[norecoil] << endl;
- }
- else
- {
- SetColor(12);
- cout << " [F8] AK Ezrecoil\t\t=\t" << bools[norecoil] << endl;
- }
- if (semirifle)
- {
- SetColor(10);
- cout << " [F7] Semi Rifle Automatic\t\t=\t" << bools[semirifle] << endl;
- }
- else
- {
- SetColor(12);
- cout << " [F7] Semi Rifle Automatic\t\t=\t" << bools[semirifle] << endl;
- }
- }
- }
- void SetColor(int ForgC)
- {
- WORD wColor;
- HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
- CONSOLE_SCREEN_BUFFER_INFO csbi;
- //We use csbi for the wAttributes word.
- if (GetConsoleScreenBufferInfo(hStdOut, &csbi))
- {
- //Mask out all but the background attribute, and add in the forgournd color
- wColor = (csbi.wAttributes & 0xF0) + (ForgC & 0x0F);
- SetConsoleTextAttribute(hStdOut, wColor);
- }
- return;
- }
- void Toggle()
- {
- if (GetAsyncKeyState(VK_F8))
- {
- norecoil = !norecoil;
- Changes++;
- updated = true;
- Sleep(100);
- }
- if (GetAsyncKeyState(VK_F9))
- {
- semirifle = !semirifle;
- Changes++;
- updated = true;
- Sleep(100);
- }
- }
- void Norecoil()
- {
- if (norecoil)
- {
- size_t iCount = 0;
- while (GetAsyncKeyState(1) < 0)
- {
- int x = AssaultRifle::recoilTableX[0][iCount];
- int y = AssaultRifle::recoilTableY[0][iCount];
- int fireRate = 134;
- int xSplit = x / 5;
- int ySplit = y / 5;
- int tSplit = fireRate / 5;
- if (iCount < AssaultRifle::SHOTS)
- {
- for (int i = 0; i < 5; i++)
- {
- Sleep(tSplit);
- mouse_event(1u, xSplit, ySplit, 0, 0);
- if (iCount < AssaultRifle::SHOTS)
- {
- if (i == 4)
- {
- iCount++;
- }
- }
- }
- }
- }
- }
- }
- void Semirifle()
- {
- const int shots = 15;
- int semishotsfired = 0;
- if (semirifle)
- {
- while (GetAsyncKeyState(0x01) < 0)
- {
- if (semishotsfired < shots)
- {
- keybd_event(VK_PRIOR, 0, 0, 0);
- Sleep(5);
- keybd_event(VK_PRIOR, 0, KEYEVENTF_KEYUP, 0);
- Sleep(5);
- mouse_event(1u, 0, 85, 0, 0);
- Sleep(173);
- if (semishotsfired < shots) semishotsfired++;
- }
- }
- }
- }
- int main()
- {
- do {
- Semirifle();
- Norecoil();
- Toggle();
- if (updated)
- updated = false;
- UpdateMenu();
- Sleep(100);
- } while (updated == false);
- cin.ignore();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement