Time based backtracking for Indigo paste.

11 March 2018

Views: 2,380

Go into Settings.cpp and remove this: int aim_Backtracktickrate = 16;
and add this: int aim_Backtracktime = 200;

Go into Settings.h and remove this: extern int aim_Backtracktickrate;
and add this: extern int aim_Backtracktime

(YOULL MOST LIKELY NOT BE ABLE TO USE DRAW BACKTRACK.)

Go into LagComp.cpp and at the top add this: http://prntscr.com/ipr8ry

Heres the code:

int BacktrackTicks()
{
// Gets server tickrate
float timepertick = Interfaces::GlobalVars()->interval_per_tick;
if (timepertick == 0) timepertick += 0.001; // prevents game from crashing when unconnected
float tickrate = 1 / timepertick;

// actual b1g calculations yay
int gayxd = Settings::Aimbot::aim_Backtracktime / 200 * tickrate; // slider from 1-200ms
if (gayxd < 1) return 1; //prevents crash, thank me l8r
else return gayxd;
}

Replace your void BackTrack::legitBackTrack(CUserCmd* cmd) function with this: http://prntscr.com/iprche

Heres the code:

void BackTrack::legitBackTrack(CUserCmd* cmd)
{
if (Settings::Aimbot::aim_Backtrack)
{
int bestTargetIndex = -1;
float bestFov = FLT_MAX;
CBaseEntity* pLocal = (CBaseEntity*)Interfaces::EntityList()->GetClientEntity(Interfaces::Engine()->GetLocalPlayer());
PlayerInfo info;
if (pLocal->IsDead())
return;

for (int i = 0; i < Interfaces::Engine()->GetMaxClients(); i++)
{
auto entity = (CBaseEntity*)Interfaces::EntityList()->GetClientEntity(i);

if (!entity || !pLocal)
continue;

if (entity == pLocal)
continue;

if (!Interfaces::Engine()->GetPlayerInfo(i, &info))
continue;

if (entity->IsDormant())
continue;

if (entity->GetTeam() == pLocal->GetTeam())
continue;

if (!entity->IsDead())
{

float simtime = entity->GetSimTime();
Vector hitboxPos = entity->GetHitboxPosition(0);

headPositions[i][cmd->command_number % BacktrackTicks()] = backtrackData{ simtime, hitboxPos };
Vector ViewDir = angle_vector(cmd->viewangles + (pLocal->GetAimPunchAngle() * 2.f));
float FOVDistance = distance_point_to_line(hitboxPos, pLocal->GetEyePosition(), ViewDir);

if (bestFov > FOVDistance)
{
bestFov = FOVDistance;
bestTargetIndex = i;
}
}
}

float bestTargetSimTime;
if (bestTargetIndex != -1)
{
float tempFloat = FLT_MAX;
Vector ViewDir = angle_vector(cmd->viewangles + (pLocal->GetAimPunchAngle() * 2.f));
for (int t = 0; t < BacktrackTicks(); ++t)
{
float tempFOVDistance = distance_point_to_line(headPositions[bestTargetIndex][t].hitboxPos, pLocal->GetEyePosition(), ViewDir);
if (tempFloat > tempFOVDistance && headPositions[bestTargetIndex][t].simtime > pLocal->GetSimTime() - 1)
{
tempFloat = tempFOVDistance;
bestTargetSimTime = headPositions[bestTargetIndex][t].simtime;
}
}

cmd->tick_count = TIME_TO_TICKS(bestTargetSimTime);
}
}
}

At the bottom of LagComp.cpp add this: http://prntscr.com/ipr9by

Heres the code:

BackTrack* backtracking = new BackTrack();
backtrackData headPositions[64][25]; //support for 128tick servers

Go into LagComp.h and add this at the top: http://prntscr.com/ipr9x7

Heres the code:

#define PI 3.14159265358979323846f
#define MAXBACKTRACKTICKS ((int)Settings::Aimbot::aim_Backtracktime)
#define TICK_INTERVAL (Interfaces::GlobalVars()->interval_per_tick)
#define TIME_TO_TICKS( dt ) ( (int)( 0.5f + (float)(dt) / TICK_INTERVAL ) )

At the bottom of LagComp.h add this: http://prntscr.com/ipracn

Heres the code:

extern backtrackData headPositions[64][25]; //same

extern BackTrack* backtracking;

int BacktrackTicks();

Go into yor client.cpp and add this: ImGui::SliderInt("Ticks (ms)", &Settings::Aimbot::aim_Backtracktime, 1, 200);

IF YOU WANT TO SEE IF YOUR DRAW BACKTRACK WILL WORK JUST C+P THIS IN YOUR ESP.CPP:

Heres the code:

if (Settings::Aimbot::aim_Backtrack && Settings::Aimbot::aim_DrawBacktrack) // Use Esp Visible Combo to change from visible only and not visible.
{
for (int i = 0; i < Interfaces::EntityList()->GetHighestEntityIndex(); i++)
{
CBaseEntity* local = (CBaseEntity*)Interfaces::EntityList()->GetClientEntity(Interfaces::Engine()->GetLocalPlayer());
CBaseEntity *entity = (CBaseEntity*)Interfaces::EntityList()->GetClientEntity(i);
CPlayer* pPlayer = g_pPlayers->GetPlayer(i);
PlayerInfo pinfo;
if (entity == nullptr)
continue;
if (entity == local)
continue;
if (entity->IsDormant())
continue;
if (entity->GetTeam() == local->GetTeam())
continue;
if (Interfaces::Engine()->GetPlayerInfo(i, &pinfo) && !entity->IsDead())
{
if (Settings::Esp::esp_Visible >= 3)
{
if (!local->IsDead() && pPlayer->bVisible)
{
for (int t = 0; t < Settings::Aimbot::aim_Backtracktime; ++t)
{
Vector screenbacktrack[64][13];

if (headPositions[i][t].simtime && headPositions[i][t].simtime + 1 > local->GetSimTime())
{
if (WorldToScreen(headPositions[i][t].hitboxPos, screenbacktrack[i][t]))
{
g_pRender->DrawLine(screenbacktrack[i][t].x - 3.5, screenbacktrack[i][t].y, screenbacktrack[i][t].x + 3.5, screenbacktrack[i][t].y, Color(255, 0, 0, 75));
g_pRender->DrawLine(screenbacktrack[i][t].x, screenbacktrack[i][t].y - 3.5, screenbacktrack[i][t].x, screenbacktrack[i][t].y + 3.5, Color(255, 0, 0, 75));
}
}
}
}
else
{
memset(&headPositions[0][0], 0, sizeof(headPositions));
}
}
else
{
if (!local->IsDead())
{
for (int t = 0; t < Settings::Aimbot::aim_Backtracktime; ++t)
{
Vector screenbacktrack[64][13];

if (headPositions[i][t].simtime && headPositions[i][t].simtime + 1 > local->GetSimTime())
{
if (WorldToScreen(headPositions[i][t].hitboxPos, screenbacktrack[i][t]))
{
g_pRender->DrawLine(screenbacktrack[i][t].x - 3.5, screenbacktrack[i][t].y, screenbacktrack[i][t].x + 3.5, screenbacktrack[i][t].y, Color(255, 0, 0, 75));
g_pRender->DrawLine(screenbacktrack[i][t].x, screenbacktrack[i][t].y - 3.5, screenbacktrack[i][t].x, screenbacktrack[i][t].y + 3.5, Color(255, 0, 0, 75));
}
}
}
}
else
{
memset(&headPositions[0][0], 0, sizeof(headPositions));
}
}
}
}
}
}

Share