Look at path slowaim

This commit is contained in:
TotallyNotElite 2018-12-04 14:24:13 +01:00
parent 89f5592dfc
commit 9fa76cf563
3 changed files with 64 additions and 2 deletions

View File

@ -66,6 +66,7 @@
<List width="170">
<AutoVariable width="fill" target="misc.pathing" label="Enable Pathing"/>
<AutoVariable width="fill" target="misc.pathing.draw" label="Draw Path"/>
<AutoVariable width="fill" target="misc.pathing.look-at-path" label="Look at Path"/>
<AutoVariable width="fill" target="navbot.enabled" label="Enable Navbot"/>
<!--AutoVariable width="fill" target="navbot.scout-mode" label="Enable Scout Mode"/>
<AutoVariable width="fill" target="navbot.spy-mode" label="Enable Spy Mode"/-->

View File

@ -60,7 +60,6 @@ static settings::Bool backtrackAimbot{ "aimbot.backtrack", "0" };
static settings::Float max_range{ "aimbot.target.max-range", "4096" };
static settings::Bool ignore_vaccinator{ "aimbot.target.ignore-vaccinator",
"1" };
settings::Bool ignore_cloak{ "aimbot.target.ignore-cloaked-spies", "1" };
static settings::Bool ignore_deadringer{ "aimbot.target.ignore-deadringer",
"1" };
static settings::Bool buildings_sentry{ "aimbot.target.sentry", "1" };
@ -76,6 +75,7 @@ static settings::Float fovcircle_opacity{ "aimbot.fov-circle.opacity", "0.7" };
namespace hacks::shared::aimbot
{
settings::Bool ignore_cloak{ "aimbot.target.ignore-cloaked-spies", "1" };
bool shouldBacktrack()
{
return *enable && *backtrackAimbot;

View File

@ -38,6 +38,7 @@ enum ignore_status : uint8_t
void ResetPather();
void repath();
void DoSlowAim(Vector &input_angle);
struct ignoredata
{
@ -623,7 +624,9 @@ static HookedFunction
{
Vector next = crumbs.front();
next.z = g_pLocalPlayer->v_Eye.z;
AimAt(g_pLocalPlayer->v_Eye, next, current_user_cmd);
Vector angle = GetAimAtAngles(g_pLocalPlayer->v_Eye, next);
DoSlowAim(angle);
current_user_cmd->viewangles = angle;
}
// Detect when jumping is necessary
@ -716,6 +719,64 @@ static CatCommand nav_path_no_local("nav_path_no_local", "Debug nav path",
static CatCommand nav_reset_ignores("nav_reset_ignores", "Reset all ignores.",
[]() { ignoremanager::reset(); });
void DoSlowAim(Vector &input_angle)
{
static float slow_change_dist_y{};
static float slow_change_dist_p{};
auto viewangles = current_user_cmd->viewangles;
// Yaw
if (viewangles.y != input_angle.y)
{
// Check if input angle and user angle are on opposing sides of yaw so
// we can correct for that
bool slow_opposing = false;
if ((input_angle.y < -90 && viewangles.y > 90) ||
(input_angle.y > 90 && viewangles.y < -90))
slow_opposing = true;
// Direction
bool slow_dir = false;
if (slow_opposing)
{
if (input_angle.y > 90 && viewangles.y < -90)
slow_dir = true;
}
else if (viewangles.y > input_angle.y)
slow_dir = true;
// Speed, check if opposing. We dont get a new distance due to the
// opposing sides making the distance spike, so just cheap out and reuse
// our last one.
if (!slow_opposing)
slow_change_dist_y = std::abs(viewangles.y - input_angle.y) / 5;
// Move in the direction of the input angle
if (slow_dir)
input_angle.y = viewangles.y - slow_change_dist_y;
else
input_angle.y = viewangles.y + slow_change_dist_y;
}
// Pitch
if (viewangles.x != input_angle.x)
{
// Get speed
slow_change_dist_p = std::abs(viewangles.x - input_angle.x) / 5;
// Move in the direction of the input angle
if (viewangles.x > input_angle.x)
input_angle.x = viewangles.x - slow_change_dist_p;
else
input_angle.x = viewangles.x + slow_change_dist_p;
}
// Clamp as we changed angles
fClampAngle(input_angle);
}
void clearInstructions()
{
crumbs.clear();