Skip to content

Commit

Permalink
Aimbot Single locked target if still active
Browse files Browse the repository at this point in the history
- Distance comparator
- Radius augment
  • Loading branch information
Izocel committed Jan 6, 2025
1 parent 2b4a261 commit b63440d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 8 deletions.
12 changes: 11 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,17 @@
"chrono": "cpp",
"forward_list": "cpp",
"iomanip": "cpp",
"sstream": "cpp"
"sstream": "cpp",
"any": "cpp",
"codecvt": "cpp",
"filesystem": "cpp",
"fstream": "cpp",
"functional": "cpp",
"list": "cpp",
"numeric": "cpp",
"unordered_map": "cpp",
"valarray": "cpp",
"xhash": "cpp"
},
"cSpell.words": [
"MOUSEEVENTF",
Expand Down
12 changes: 9 additions & 3 deletions Application/Modules/AimBotModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class AimBotModule : public Module

Player target;
uintptr_t ptrFound = NULL;
float minDistance = NULL;

for (Player &player : ENEMIES)
{
if (!player.IsValidTarget())
Expand All @@ -60,9 +62,13 @@ class AimBotModule : public Module
break;
}

ptrFound = player.entity;
target = player;
break;
float distance = player.position.EuclideanDistance(MyLocalPlayer.position);
if (!minDistance || distance < minDistance)
{
minDistance = distance;
ptrFound = player.entity;
target = player;
}
}

if (ptrFound)
Expand Down
2 changes: 1 addition & 1 deletion Application/Modules/Configs.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ struct EspConfig : public ModuleConfig
struct AimConfig : public ModuleConfig
{
bool isAimActive = false, isClickActive = false, showAimCircle = false;
Circle aimCircle = {.radius = 72, .color = White12, .borderColor = White25};
Circle aimCircle = {.radius = 128.0F, .color = White12, .borderColor = White25};
float smoothness = 1.5F;
};
17 changes: 14 additions & 3 deletions Engine/Math/vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,22 @@ struct Vector3
* @param other The other vector to calculate the distance to.
* @return A Vector3 object containing the distance between the two vectors.
*/
Vector3
Distance(Vector3 other)
Vector3 Distance(Vector3 other)
{
return {this->x - other.x, this->y - other.y, this->z - other.z};
};

/**
* Calculates the Euclidean distance between two 3D vectors.
*
* @param other The other vector to calculate the distance to.
* @return The Euclidean distance between the two vectors.
*/
float EuclideanDistance(Vector3 other)
{
return std::sqrt(std::pow(this->x - other.x, 2) + std::pow(this->y - other.y, 2) + std::pow(this->z - other.z, 2));
}

/**
* Calculates the relative angle of a vector in 3D space.
*
Expand All @@ -106,7 +116,8 @@ struct Vector3
* the horizontal plane, the angle in the XY plane, and a fixed 0.0f
* for the Z-axis.
*/
Vector3 ToAngle(float heightDifference = 0)
Vector3
ToAngle(float heightDifference = 0)
{
return {
std::atan2(-(z + heightDifference), std::hypot(x, y)) * (180.0f / std::numbers::pi_v<float>),
Expand Down

0 comments on commit b63440d

Please sign in to comment.