Skip to content

Commit

Permalink
Aimbot Single locked target if still active
Browse files Browse the repository at this point in the history
  • Loading branch information
Izocel committed Jan 6, 2025
1 parent 5980a4e commit 2b4a261
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 38 deletions.
11 changes: 5 additions & 6 deletions Application/Instances/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class Player

std::vector<Line3D> bones;
std::vector<Line> screenBones;
Player *currentTarget;

Position screenFeet, screenEye;
Box screenBox;
Expand Down Expand Up @@ -102,27 +101,27 @@ class Player
return Read<T>(entity + ptr_diff);
};

const bool IsLocalPlayer()
const bool IsLocalPlayer() const
{
return isLocalPlayer;
}

const bool IsEnemy()
const bool IsEnemy() const
{
return !isLocalPlayer && !isTeammate;
}

const bool IsAlive()
const bool IsAlive() const
{
return isAlive && health > 0;
}

const bool IsScreenVisible()
const bool IsScreenVisible() const
{
return isScreenVisible;
}

const bool IsValidTarget()
const bool IsValidTarget() const
{
return IsScreenVisible() && IsEnemy() && IsAlive();
}
Expand Down
78 changes: 49 additions & 29 deletions Application/Modules/AimBotModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,41 @@ struct ModulesConfig
class AimBotModule : public Module
{
AimConfig config;
uintptr_t currentTargetPtr;

bool SetCurrentTarget()
void UpdateConfigs()
{
if (MyLocalPlayer.currentTarget && MyLocalPlayer.currentTarget->IsValidTarget())
return true;
config.isClickActive = 0;
config.aimCircle.p = ClientCenterPosition;

// uses page up to increment smoothness
if (GetAsyncKeyState(SB_PAGEUP) & 1)
config.smoothness += 0.1F;

// uses page up to decrement smoothness
if (GetAsyncKeyState(SB_PAGEDOWN) & 1)
config.smoothness -= 0.1F;

// VK_XBUTTON1 (Mouse 4) toggles aim lock
if (GetAsyncKeyState(VK_XBUTTON1) & 1)
config.isAimActive = !config.isAimActive;

// VK_XBUTTON2 (Mouse 5) hold for auto shoot on target
GetAsyncKeyState(VK_XBUTTON2) & 1;
if (GetAsyncKeyState(VK_XBUTTON2) & 1)
config.isClickActive = 1;
}

void UpdateTarget()
{
if (!config.isAimActive)
{
currentTargetPtr = NULL;
return;
}

Player target;
uintptr_t ptrFound = NULL;
for (Player &player : ENEMIES)
{
if (!player.IsValidTarget())
Expand All @@ -24,24 +53,23 @@ class AimBotModule : public Module
if (!InterSects(player.screenBox, config.aimCircle))
continue;

MyLocalPlayer.currentTarget = &player;
return true;
}

return false;
}

void UpdateConfigs()
{
config.aimCircle.p = ClientCenterPosition;
if (currentTargetPtr && currentTargetPtr == player.entity)
{
ptrFound = player.entity;
target = player;
break;
}

// uses page up to increment smoothness
if (GetAsyncKeyState(SB_PAGEUP) & 1)
config.smoothness += 0.1F;
ptrFound = player.entity;
target = player;
break;
}

// uses page up to decrement smoothness
if (GetAsyncKeyState(SB_PAGEDOWN) & 1)
config.smoothness -= 0.1F;
if (ptrFound)
{
currentTargetPtr = ptrFound;
MyLocalPlayer.SetViewAngles(target.aimAngle, config.smoothness);
}
}

void Execute() override
Expand All @@ -51,19 +79,11 @@ class AimBotModule : public Module
if (!config.isActive)
return;

if (!SetCurrentTarget())
return;

// VK_XBUTTON1 (Mouse 4) only needs a 'toggle' (on/off)
if (config.isAimActive && GetKeyState(VK_XBUTTON1))
{
MyLocalPlayer.SetViewAngles(MyLocalPlayer.currentTarget->aimAngle, config.smoothness);
}
UpdateTarget();

// VK_XBUTTON2 (Mouse 5) need a 'hold'
if (config.isClickActive && MyLocalPlayer.crossIndex >= 0)
{
if (!GetAsyncKeyState(VK_XBUTTON2) || !GetAsyncKeyState(VK_XBUTTON2))
if (!config.isClickActive)
return;

mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
Expand Down
6 changes: 3 additions & 3 deletions Application/Modules/Configs.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct EspConfig : public ModuleConfig

struct AimConfig : public ModuleConfig
{
bool isAimActive = true, isClickActive = true, showAimCircle = false;
Circle aimCircle = {.radius = 64, .color = White12, .borderColor = White25};
float smoothness = 1.33F;
bool isAimActive = false, isClickActive = false, showAimCircle = false;
Circle aimCircle = {.radius = 72, .color = White12, .borderColor = White25};
float smoothness = 1.5F;
};

0 comments on commit 2b4a261

Please sign in to comment.