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] = {
- { 44, 48, 50, 46, 31, 31, 24, 24, 16, 13, 14, 20, 26, 32, 34, 29, 33, 23, 12, 14, 10, 12, 17, 15, 25, 28, 30, 27, 26 }
- };
- DWORD recoilTableX[WEAPON][SHOTS] = {
- { -32, -3, -57, -52, -2, 15, 20, 43, 41, 31, 75, 3, 38, -33, -26, -36, -30, -27, -36 , -40, -39, -44, -22, 13, 19, 28, 58, 68, 47 }
- };
- }
- void UpdateMenu();
- void SetColor(int ForgC);
- void Toggle();
- void Norecoil();
- int Changes = 0;
- 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 << "--- OG_Bozzik#2177 and
- Dysfunctional#4011 Recoil Script---" << endl;
- cout << "__________________________" << endl << endl;
- if (norecoil)
- {
- SetColor(10);
- cout << " [F8] AK Recoil\t\t=\t" << bools[norecoil] << endl;
- }
- else
- {
- SetColor(12);
- cout << " [F8] AK Recoil\t\t=\t" << bools[norecoil] << 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);
- }
- }
- void Norecoil()
- {
- if (norecoil)
- {
- size_t iCount = 0;
- int fireRate = 134;
- while (GetAsyncKeyState(1) < 0)
- {
- if (iCount < AssaultRifle::SHOTS)
- {
- mouse_event(1u, AssaultRifle::recoilTableX[0][iCount], AssaultRifle::recoilTableY[0][iCount], 0, 3u);
- Sleep(fireRate);
- if (iCount < AssaultRifle::SHOTS) iCount++;
- }
- }
- int main()
- {
- do {
- Norecoil();
- Toggle();
- if (updated)
- updated = false;
- UpdateMenu();
- Sleep(100);
- } while (updated == false);
- cin.ignore();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement