I have made a triggerbot. The only problem is I don't know why my hotkey isn't working. I constantly need to hold VK_NUMPAD1 to shoot when someone is in my crosshair but I want it to toggle on and off when an enemy is in the crosshair it needs to shoot automatically without holding the number 1 button is my hotkey wrong? Also my game crashes after a new match is starting. I hope you guys have some suggestions. On my previous thread no one replied. Hope someone is out there who can help me. Thanks !
#include "pch.h"
#include <iostream>
#include <Windows.h>
using namespace std;
struct offS
{
DWORD dwLocalPlayer = 0xD2FB74;
DWORD dwForceAttack = 0x3174E0C;
DWORD dwEntityList = 0x4D4386C;
DWORD m_iCrosshairId = 0xB3D4;
DWORD m_iHealth = 0x100;
DWORD m_iTeamNum = 0xF4;
}valS;
struct dataS
{
DWORD l_Player;
DWORD g_Module;
DWORD c_Id;
DWORD eic_Id;
int e_Team;
int e_Health;
int all_Team;
}datS;
void triggerMain()
{
datS.g_Module = (DWORD)GetModuleHandle("client_panorama.dll");
datS.l_Player = *(DWORD*)(datS.g_Module + valS.dwLocalPlayer);
if (datS.l_Player == NULL)
{
while (datS.l_Player == NULL)
{
datS.l_Player = *(DWORD*)(datS.g_Module + valS.dwLocalPlayer);
}
}
bool trueFalse = false;
while (true)
{
datS.l_Player = *(DWORD*)(datS.g_Module + valS.dwLocalPlayer);
datS.all_Team = *(int*)(datS.l_Player + valS.m_iTeamNum);
datS.c_Id = *(DWORD*)(datS.l_Player + valS.m_iCrosshairId);
datS.eic_Id = *(DWORD*)(datS.g_Module + valS.dwEntityList + (datS.c_Id - 1) * 0x10);
datS.e_Health = *(int*)(datS.eic_Id + valS.m_iHealth);
datS.e_Team = *(int*)(datS.eic_Id + valS.m_iTeamNum);
if (GetAsyncKeyState(VK_NUMPAD1) & 1)
{
trueFalse = !trueFalse;
if (trueFalse && datS.all_Team != datS.e_Team && datS.e_Health > 0)
{
*(DWORD*)(datS.g_Module + valS.dwForceAttack) = 6;
}
}
}
}
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
{
DisableThreadLibraryCalls(hModule);
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)triggerMain, NULL, NULL, NULL);
}
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}