Code:
#include "stdafx.h"
[junk_enable /]
[enc_string_enable /]
#pragma region HackBack
#pragma region decl
#pragma region group1//these change with updates
DWORD DwEntityList = 0x049ED1B4;
DWORD DwEnginePointer = 0x00559434;
DWORD DwLocalPlayer = 0x00A4B98C;
DWORD DwViewAngle = 0x4CE0;
#pragma endregion
#pragma region group2//these normally don't
const DWORD DwCrosshairId = 0x2400;
const DWORD DwVecViewOrigin = 0x104;
const DWORD DwVecOrigin = 0x134;
const DWORD DwVecPunch = 0x13E8;
const DWORD DwTeamNumber = 0xF0;
const DWORD DwShotsFired = 0x1D60;
const DWORD DwFlags = 0x100;
const DWORD DwBoneMatrix = 0xA78;
const DWORD DwEntitySize = 0x10;
const DWORD DwHealth = 0xFC;
const DWORD DwLifeState = 0x25B;
const DWORD DwVecVelocity = 0x110;
#pragma endregion
#pragma region group3//other shit
HANDLE TargetProcess;
DWORD DwClient;
DWORD DwEngine;
bool KILLAPP = false;
bool Thread1Paused = false;
bool TRIG = true;
bool AIM = true;
string aimval = "ON";
string trigval = "ON";
float PitchMinPunch = 2.f;
float PitchMaxPunch = 2.f;
float YawMinPunch = 2.f;
float YawMaxPunch = 2.f;
int TargetBone = 2;
float smoothamount = 20.f;
DWORD TrigVkeyCode = 4;
DWORD AimVkeyCode = 1;
#pragma endregion
#pragma endregion
[junk_disable /]
[enc_string_disable /]
struct PModule {
DWORD dwBase, dwSize;
};
[junk_enable /]
[enc_string_enable /]
PModule modEngine, modClient;
struct //ghetto memory class
{
template <typename ReadType> ReadType R(DWORD Address, bool isarray = false, int elementcount = 1, ReadType SrcData = 0)
{
if (!isarray)
{
ReadType Data;
ReadProcessMemory(TargetProcess, (LPVOID)(Address), &Data, sizeof(ReadType), 0);
return Data;
}
else if (isarray)
{
ReadProcessMemory(TargetProcess, (LPVOID)(Address), (ReadType*)SrcData, sizeof(ReadType)* elementcount, 0);
return NULL;
}
}
template<typename WriteType> WriteType W(DWORD Address, WriteType Data, bool isarray = false, int elementcount = 1)
{
if (!isarray)
{
WriteProcessMemory(TargetProcess, (LPVOID)(Address), &Data, sizeof(WriteType)* elementcount, 0);
return Data;
}
else if (isarray)
{
WriteProcessMemory(TargetProcess, (LPVOID)(Address), (WriteType*)Data, sizeof(WriteType)* elementcount, 0);
return NULL;
}
}
bool DataCompare(const BYTE* pData, const BYTE* pMask, const char* pszMask) {
for (; *pszMask; ++pszMask, ++pData, ++pMask) {
if (*pszMask == 'x' && *pData != *pMask) {
return false;
}
}
return (*pszMask == NULL);
}
DWORD FindPattern(DWORD start, DWORD size, const char* sig, const char* mask) {
BYTE* data = new BYTE[size];
unsigned long bytesRead;
if (!ReadProcessMemory(TargetProcess, (LPVOID)start, data, size, &bytesRead)) {
return NULL;
}
for (DWORD i = 0; i < size; i++) {
if (DataCompare((const BYTE*)(data + i), (const BYTE*)sig, mask)) {
return start + i;
}
}
return NULL;
}
DWORD FindPatternArr(DWORD start, DWORD size, const char* mask, int count, ...) {
char* sig = new char[count + 1];
va_list ap;
va_start(ap, count);
for (int i = 0; i < count; i++) {
char read = va_arg(ap, char);
sig[i] = read;
}
va_end(ap);
sig[count] = '\0';
return FindPattern(start, size, sig, mask);
}
}Mem;
PModule GetModuleHandleByName(char* ModuleName, DWORD ProcID)
{
HANDLE module = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, ProcID);
MODULEENTRY32 mEntry;
mEntry.dwSize = sizeof(mEntry);
do {
if (!strcmp(mEntry.szModule, (LPSTR)ModuleName)) {
CloseHandle(module);
PModule mod;
mod.dwBase = (DWORD)mEntry.modBaseAddr;
mod.dwSize = mEntry.modBaseSize;
return mod;
}
} while (Module32Next(module, &mEntry));
CloseHandle(module);
PModule mode = { 0, 0 };
return mode;
}
HANDLE GetProcessHandleByName(char* ProcessName)
{
PROCESSENTRY32 ENTRY;
ENTRY.dwSize = sizeof(PROCESSENTRY32);
HANDLE HSNAP = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
if (Process32First(HSNAP, &ENTRY) == TRUE)
{
if (!strcmp(ENTRY.szExeFile, ProcessName))
{
HANDLE HPROC = OpenProcess(PROCESS_ALL_ACCESS, FALSE, ENTRY.th32ProcessID);
return HPROC;
}
else
{
while (Process32Next(HSNAP, &ENTRY) == TRUE)
{
if (!strcmp(ENTRY.szExeFile, ProcessName))
{
HANDLE HPROC = OpenProcess(PROCESS_ALL_ACCESS, FALSE, ENTRY.th32ProcessID);
return HPROC;
}
}
return 0;
}
}
CloseHandle(HSNAP);
}
#pragma endregion
struct
{
DWORD GetBaseEntity(int PlayerNumber)
{
return Mem.R<DWORD>(DwClient + DwEntityList + (DwEntitySize * PlayerNumber));
}
bool IsDead(int PlayerNumber)
{
DWORD BaseEntity = GetBaseEntity(PlayerNumber);
if (BaseEntity)
{
return Mem.R<bool>(BaseEntity + DwLifeState);
}
}
int GetTeam(int PlayerNumber)
{
DWORD BaseEntity = GetBaseEntity(PlayerNumber);
if (BaseEntity)
{
return Mem.R<int>(BaseEntity + DwTeamNumber);
}
}
void GetVelocity(int PlayerNumber, float* Buffer)
{
DWORD BaseEntity = GetBaseEntity(PlayerNumber);
if (BaseEntity)
{
Mem.R<float*>(BaseEntity + DwVecVelocity, true, 3, Buffer);
}
}
void GetBonePosition(int PlayerNumber, float* BonePosition)
{
DWORD BaseEntity = GetBaseEntity(PlayerNumber);
if (BaseEntity)
{
DWORD BoneMatrix = Mem.R<DWORD>(BaseEntity + DwBoneMatrix);
if (BoneMatrix)
{
Mem.R<float*>(BoneMatrix + 0x30 * TargetBone + 0x0C, true, 1, &BonePosition[0]);
Mem.R<float*>(BoneMatrix + 0x30 * TargetBone + 0x1C, true, 1, &BonePosition[1]);
Mem.R<float*>(BoneMatrix + 0x30 * TargetBone + 0x2C, true, 1, &BonePosition[2]);
}
}
}
}EntityList;
struct
{
DWORD GetPlayerBase()
{
return Mem.R<DWORD>(DwClient + DwLocalPlayer);
}
void SetAngles(float* Angles)
{
DWORD AnglePointer = Mem.R<DWORD>(DwEngine + DwEnginePointer);
if (AnglePointer)
{
Mem.W<float*>(AnglePointer + DwViewAngle, Angles, true, 3);
}
}
void GetVelocity(float* Buffer)
{
DWORD PlayerBase = GetPlayerBase();
if (PlayerBase)
{
Mem.R<float*>(PlayerBase + DwVecVelocity, true, 3, Buffer);
}
}
void GetAngles(float* Angles)
{
DWORD AnglePointer = Mem.R<DWORD>(DwEngine + DwEnginePointer);
if (AnglePointer)
{
Mem.R<float*>(AnglePointer + DwViewAngle, true, 3, Angles);
}
}
int GetTeam()
{
DWORD PlayerBase = GetPlayerBase();
if (PlayerBase)
{
return Mem.R<int>(PlayerBase + DwTeamNumber);
}
}
int GetCrosshairId()
{
DWORD PlayerBase = GetPlayerBase();
if (PlayerBase)
{
return Mem.R<int>(PlayerBase + DwCrosshairId) - 1;
}
}
void GetPunch(float* Punch)
{
DWORD PlayerBase = GetPlayerBase();
if (PlayerBase)
{
Mem.R<float*>(PlayerBase + DwVecPunch, true, 2, Punch);
}
}
float GetViewOrigin()
{
DWORD PlayerBase = GetPlayerBase();
if (PlayerBase)
{
float Vecview[3];
Mem.R<float*>(PlayerBase + DwVecViewOrigin, true, 3, Vecview);
return Vecview[2];
}
}
void GetPosition(float* Position)
{
DWORD PlayerBase = GetPlayerBase();
if (PlayerBase)
{
Mem.R<float*>(PlayerBase + DwVecOrigin, true, 3, Position);
}
}
int GetShotsFired()
{
DWORD PlayerBase = GetPlayerBase();
if (PlayerBase)
{
return Mem.R<int>(PlayerBase + DwShotsFired);
}
}
}Player;
void AngleNormalize(float* angle)
{
if (angle[0] > 89.0f && angle[0] <= 180.0f)
{
angle[0] = 89.0f;
}
if (angle[0] > 180.f)
{
angle[0] -= 360.f;
}
if (angle[0] < -89.0f)
{
angle[0] = -89.0f;
}
if (angle[1] > 180.f)
{
angle[1] -= 360.f;
}
if (angle[1] < -180.f)
{
angle[1] += 360.f;
}
if (angle[2] != 0.0f)
{
angle[2] = 0.0f;
}
}
void calcang(float *src, float *dst, float *angles)
{
random_device Random;
mt19937 RandomGen(Random());
uniform_real<float> RandomXdistrib(PitchMinPunch, PitchMaxPunch);
uniform_real<float> RandomYdistrib(YawMinPunch, YawMaxPunch);
float MyPunch[2];
Player.GetPunch(MyPunch);
float pitchreduction = RandomXdistrib(RandomGen);
float yawreduction = RandomYdistrib(RandomGen);
float delta[3] = { (src[0] - dst[0]), (src[1] - dst[1]), ((src[2] + Player.GetViewOrigin()) - dst[2]) };
float hyp = sqrt(delta[0] * delta[0] + delta[1] * delta[1]);
angles[0] = atanf(delta[2] / hyp) * 57.295779513082f - MyPunch[0] * pitchreduction;
angles[1] = atanf(delta[1] / delta[0]) * 57.295779513082f - MyPunch[1] * yawreduction;
angles[2] = 0.0f;
if (delta[0] >= 0.0)
{
angles[1] += 180.0f;
}
}
void SmoothAngleSet(float* dest, float* orig)
{
float SmoothAngles[3];
SmoothAngles[0] = dest[0] - orig[0];
SmoothAngles[1] = dest[1] - orig[1];
SmoothAngles[2] = 0.0f;
AngleNormalize(SmoothAngles);
SmoothAngles[0] = orig[0] + SmoothAngles[0] / 100.0f * smoothamount;
SmoothAngles[1] = orig[1] + SmoothAngles[1] / 100.0f * smoothamount;
SmoothAngles[2] = 0.0f;
AngleNormalize(SmoothAngles);
Player.SetAngles(SmoothAngles);
Sleep(1);
}
void Click()
{
mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
Sleep(1);
mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
Sleep(30);
}
void VelocityComp(int PlayerNumber, float* EnemyPos)
{
float EnemyVelocity[3];
float MyVelocity[3];
EntityList.GetVelocity(PlayerNumber, EnemyVelocity);
Player.GetVelocity(MyVelocity);
EnemyPos[0] = EnemyPos[0] + (EnemyVelocity[0] / 100.f) * (40.f / smoothamount); //not sure why 40 works. I tried a lot of different values and 40 seems to scale perfectly
EnemyPos[1] = EnemyPos[1] + (EnemyVelocity[1] / 100.f) * (40.f / smoothamount);
EnemyPos[2] = EnemyPos[2] + (EnemyVelocity[2] / 100.f) * (40.f / smoothamount);
EnemyPos[0] = EnemyPos[0] - (MyVelocity[0] / 100.f) * (40.f / smoothamount);
EnemyPos[1] = EnemyPos[1] - (MyVelocity[1] / 100.f) * (40.f / smoothamount);
EnemyPos[2] = EnemyPos[2] - (MyVelocity[2] / 100.f) * (40.f / smoothamount);
}
DWORD WINAPI AB(LPVOID params)
{
cout << "$ Aimbot/Triggerbot thread is running..." << endl;
while (true)
{
Sleep(1);
if (KILLAPP)
{
cout << "$ Ending thread..." << endl;
ExitThread(0);
}
if (AIM || TRIG)
{
Thread1Paused = false;
if (AIM)
{
int PlayerNumber = Player.GetCrosshairId();
while (GetAsyncKeyState(AimVkeyCode) < 0 && Player.GetShotsFired() > 1 && PlayerNumber < 64 && PlayerNumber >= 0 && EntityList.GetTeam(PlayerNumber) != Player.GetTeam() && EntityList.IsDead(PlayerNumber) != true)
{
int TempPlayerNumber = Player.GetCrosshairId();
if (TempPlayerNumber < 64 && TempPlayerNumber >= 0 && EntityList.GetTeam(TempPlayerNumber) != Player.GetTeam() && EntityList.IsDead(TempPlayerNumber) != true)
{
PlayerNumber = TempPlayerNumber;
}
float PlayerPos[3];
float EnemyPos[3];
float AimAngle[3];
float CurrentAngle[3];
Player.GetPosition(PlayerPos);
EntityList.GetBonePosition(PlayerNumber, EnemyPos);
VelocityComp(PlayerNumber, EnemyPos);
calcang(PlayerPos, EnemyPos, AimAngle);
AngleNormalize(AimAngle);
Player.GetAngles(CurrentAngle);
AngleNormalize(CurrentAngle);
SmoothAngleSet(AimAngle, CurrentAngle);
Sleep(1);
}
}
if (TRIG)
{
if (GetAsyncKeyState(TrigVkeyCode) < 0 && TrigVkeyCode != 1)
{
int PlayerNumber = Player.GetCrosshairId();
if (PlayerNumber < 64 && PlayerNumber >= 0 && EntityList.GetTeam(PlayerNumber) != Player.GetTeam() && EntityList.IsDead(PlayerNumber) != true)
{
Click();
}
else
{
Sleep(1);
}
}
}
}
else
{
Thread1Paused = true;
Sleep(500);
}
}
}
void Init()
{
cout << "$ Waiting for process..." << endl;
TargetProcess = NULL;
while (!TargetProcess)
{
cout << ".";
TargetProcess = GetProcessHandleByName("csgo.exe");
Sleep(500);
}
cout << endl;
cout << "$ Getting Client handle..." << endl;
DwClient = NULL;
while (!DwClient)
{
cout << ".";
modClient = GetModuleHandleByName("client.dll", GetProcessId(TargetProcess));
DwClient = modClient.dwBase;
Sleep(500);
}
cout << endl;
cout << "$ Getting Engine handle..." << endl;
DwEngine = NULL;
while (!DwEngine)
{
cout << ".";
modEngine = GetModuleHandleByName("engine.dll", GetProcessId(TargetProcess));
DwEngine = modEngine.dwBase;
Sleep(500);
}
cout << endl;
cout << "$ Getting Local Player offset..." << endl;
DwLocalPlayer = 0x0;
while (!DwLocalPlayer) {
cout << ".";
DWORD lpStart = Mem.FindPatternArr(modClient.dwBase, modClient.dwSize, "xxx????xx????xxxxx?", 19, 0x8D, 0x34, 0x85, 0x0, 0x0, 0x0, 0x0, 0x89, 0x15, 0x0, 0x0, 0x0, 0x0, 0x8B, 0x41, 0x8, 0x8B, 0x48, 0x0);
DWORD lpP1 = Mem.R<DWORD>(lpStart + 3);
BYTE lpP2 = Mem.R<BYTE>(lpStart + 18);
DwLocalPlayer = (lpP1 + lpP2) - modClient.dwBase;
}
std::cout << endl;
cout << "$ Getting Entity List offset..." << endl;
DwEntityList = 0x0;
while (!DwEntityList) {
cout << ".";
DWORD elStart = Mem.FindPatternArr(modClient.dwBase, modClient.dwSize, "x????xx?xxx", 11, 0x5, 0x0, 0x0, 0x0, 0x0, 0xC1, 0xE9, 0x0, 0x39, 0x48, 0x4);
DWORD elP1 = Mem.R<DWORD>(elStart + 1);
BYTE elP2 = Mem.R<BYTE>(elStart + 7);
DwEntityList = (elP1 + elP2) - modClient.dwBase;
}
std::cout << endl;
cout << "$ Getting Engine Pointer and SetViewAngle offset..." << endl;
DwEnginePointer = 0x0;
while (!DwEnginePointer) {
cout << ".";
DWORD epStart = Mem.FindPatternArr(modEngine.dwBase, modEngine.dwSize, "xxxxxxxx????xxxxxxxxxx????xxxx????xxx", 37, 0xF3, 0x0F, 0x5C, 0xC1, 0xF3, 0x0F, 0x10, 0x15, 0x0, 0x0, 0x0, 0x0, 0x0F, 0x2F, 0xD0, 0x76, 0x04, 0xF3, 0x0F, 0x58, 0xC1, 0xA1, 0x0, 0x0, 0x0, 0x0, 0xF3, 0x0F, 0x11, 0x80, 0x0, 0x0, 0x0, 0x0, 0xD9, 0x46, 0x04);
DwEnginePointer = Mem.R<DWORD>(epStart + 22) - modEngine.dwBase;
DwViewAngle = Mem.R<DWORD>(epStart + 30);
}
std::cout << endl;
cout << "$ Done." << endl;
}
void PrintIntro() {
cout << "$ ---Puddin' Poppin's CS:GO subtle-aimbot & triggerbot--- ~ENJOY!" << endl;
cout << "$ --- Modified by Merccy ---" << endl << endl;
}
void PrintInstructions() {
cout << "$ Instructions:" << endl << "$ CRTL+F10 to reload hack" << endl << "$ CTRL+F8 to close" << endl << "$ CTRL+NUMPAD0 to manually set options" << endl << "$ CTRL+NUMPAD1 to toggle subtle-aimbot" << endl << "$ CTRL+NUMPAD2 to toggle triggerbot" << endl << "$ CTRL+NUMPAD3 to print current settings" << endl << "$ CTRL+NUMPAD4 to clear the console" << endl;
}
int main()
{
PrintIntro();
system("pause");
cout << endl << endl;
Init();
CreateThread(0, 0x1000, &AB, 0, 0, 0);
Sleep(1000);
PrintInstructions();
cout << "$ AIM: " << aimval << " | TRIG: " << trigval << endl << endl;
while (true)
{
if (GetAsyncKeyState(VK_CONTROL) < 0 && GetAsyncKeyState(VK_F8) < 0)
{
while (GetAsyncKeyState(VK_CONTROL) < 0 && GetAsyncKeyState(VK_F8) < 0)
{
Sleep(100);
}
KILLAPP = true;
if (KILLAPP)
{
cout << "$ Ending Main thread..." << endl;
ExitThread(0);
}
}
if (GetAsyncKeyState(VK_CONTROL) < 0 && GetAsyncKeyState(VK_NUMPAD3) < 0)
{
while (GetAsyncKeyState(VK_CONTROL) < 0 && GetAsyncKeyState(VK_NUMPAD3) < 0)
{
Sleep(100);
}
cout << "$ Current settings: " << endl << "$ Smoothing factor (float) = " << smoothamount << endl << "$ Minimum RCS pitch compensation scale (float) = " << PitchMinPunch << endl << "$ Maximum RCS pitch compensation scale (float) = " << PitchMaxPunch << endl << "$ Minimum RCS yaw compensation scale (float) = " << YawMinPunch << endl << "$ Maximum RCS yaw compensation scale (float) = " << YawMaxPunch << endl << "$ Bone number to target(int) = " << TargetBone << endl << "$ Virtual-Key code of button to use for aimbot (int) = " << AimVkeyCode << endl << "$ Virtual-Key code of button to use for triggerbot (int) = " << TrigVkeyCode << endl << "$ Done." << endl;
}
if (GetAsyncKeyState(VK_CONTROL) & 0x8000 && GetAsyncKeyState(VK_NUMPAD4) & 0x8000) {
while (GetAsyncKeyState(VK_CONTROL) & 0x8000 && GetAsyncKeyState(VK_NUMPAD4) & 0x8000) {
Sleep(100);
}
system("cls");
PrintIntro();
PrintInstructions();
cout << "$ AIM: " << aimval << " | TRIG: " << trigval << endl << endl;
}
if (GetAsyncKeyState(VK_CONTROL) < 0 && GetAsyncKeyState(VK_F10) < 0)
{
while (GetAsyncKeyState(VK_CONTROL) < 0 && GetAsyncKeyState(VK_F10) < 0)
{
Sleep(100);
}
cout << "$ Reloading hack..." << endl;
bool storedAIM = AIM;
bool storedTRIG = TRIG;
AIM = false;
TRIG = false;
cout << "$ Waiting for threads to enter paused state...";
while (!Thread1Paused)
{
cout << ".";
Sleep(500);
}
cout << endl << "$ Done." << endl;
Init();
cout << "$ Done. Threads should be restored." << endl;
AIM = storedAIM;
TRIG = storedTRIG;
}
if (GetAsyncKeyState(VK_CONTROL) < 0 && GetAsyncKeyState(VK_NUMPAD0) < 0)
{
while (GetAsyncKeyState(VK_CONTROL) < 0 && GetAsyncKeyState(VK_NUMPAD0) < 0)
{
Sleep(100);
}
cout << "$ Options manual reset started..." << endl;
bool storedAIM = AIM;
bool storedTRIG = TRIG;
AIM = false;
TRIG = false;
cout << "$ Waiting for threads to enter paused state..." << endl;
while (!Thread1Paused)
{
cout << ".";
Sleep(500);
}
cout << endl << "$ Done." << endl;
cout << "$ Options: " << endl;
cout << "$ Smoothing factor (float) = ";
cin.sync();
float tempSmoothWriteCount;
if (cin >> tempSmoothWriteCount)
{
smoothamount = tempSmoothWriteCount;
}
else
{
cout << "$ Invalid Value. Keeping default..." << endl;
cin.clear();
cin.ignore(10000, '\n');
}
cout << "$ Minimum RCS pitch compensation scale (float) = ";
cin.sync();
float tempPitchMinPunch;
if (cin >> tempPitchMinPunch)
{
PitchMinPunch = tempPitchMinPunch;
}
else
{
cout << "$ Invalid Value. Keeping default..." << endl;
cin.clear();
cin.ignore(10000, '\n');
}
cout << "$ Maximum RCS pitch compensation scale (float) = ";
cin.sync();
float tempPitchMaxPunch;
if (cin >> tempPitchMaxPunch)
{
PitchMaxPunch = tempPitchMaxPunch;
}
else
{
cout << "$ Invalid Value. Keeping default..." << endl;
cin.clear();
cin.ignore(10000, '\n');
}
cout << "$ Minimum RCS yaw compensation scale (float) = ";
cin.sync();
float tempYawMinPunch;
if (cin >> tempYawMinPunch)
{
YawMinPunch = tempYawMinPunch;
}
else
{
cout << "$ Invalid Value. Keeping default..." << endl;
cin.clear();
cin.ignore(10000, '\n');
}
cout << "$ Maximum RCS yaw compensation scale (float) = ";
cin.sync();
float tempYawMaxPunch;
if (cin >> tempYawMaxPunch)
{
YawMaxPunch = tempYawMaxPunch;
}
else
{
cout << "$ Invalid Value. Keeping default..." << endl;
cin.clear();
cin.ignore(10000, '\n');
}
cout << "$ Bone number to target(int) = ";
cin.sync();
int tempboneid;
if (cin >> tempboneid)
{
TargetBone = tempboneid;
}
else
{
cout << "$ Invalid Value. Keeping default..." << endl;
cin.clear();
cin.ignore(10000, '\n');
}
cout << "$ Virtual-Key code of button to use for aimbot (int) = ";
cin.sync();
int tempaimkey;
if (cin >> tempaimkey)
{
AimVkeyCode = tempaimkey;
}
else
{
cout << "$ Invalid Value. Keeping default..." << endl;
cin.clear();
cin.ignore(10000, '\n');
}
cout << "$ Virtual-Key code of button to use for triggerbot (int) = ";
cin.sync();
int temptrigkey;
if (cin >> temptrigkey)
{
TrigVkeyCode = temptrigkey;
}
else
{
cout << "$ Invalid Value. Keeping default..." << endl;
cin.clear();
cin.ignore(10000, '\n');
}
cout << "$ Done. Threads should be restored." << endl;
AIM = storedAIM;
TRIG = storedTRIG;
}
if (GetAsyncKeyState(VK_CONTROL) < 0 && GetAsyncKeyState(VK_NUMPAD1) < 0)
{
while (GetAsyncKeyState(VK_CONTROL) < 0 && GetAsyncKeyState(VK_NUMPAD1) < 0)
{
Sleep(100);
}
if (AIM)
{
AIM = false;
}
else
{
AIM = true;
}
if (AIM)
{
aimval = "ON";
}
else
{
aimval = "OFF";
}
cout << "$ AIM: " << aimval << " | TRIG: " << trigval << endl;
}
if (GetAsyncKeyState(VK_CONTROL) < 0 && GetAsyncKeyState(VK_NUMPAD2) < 0)
{
while (GetAsyncKeyState(VK_CONTROL) < 0 && GetAsyncKeyState(VK_NUMPAD2) < 0)
{
Sleep(100);
}
if (TRIG)
{
TRIG = false;
}
else
{
TRIG = true;
}
if (TRIG)
{
trigval = "ON";
}
else
{
trigval = "OFF";
}
cout << "$ AIM: " << aimval << " | TRIG: " << trigval << endl;
}
Sleep(25);
}
return 0;
}