This commit is contained in:
LightCat 2018-08-28 15:24:56 +02:00
parent 8e62ac5cf6
commit 904eddf1b6
15 changed files with 98 additions and 63 deletions

13
TODO
View File

@ -20,23 +20,16 @@ Improve Projectile Aimbot. A lot. // //
ProjPredOrigin // //
MAX -> MIN priority // //
// //
Hunter Rifle? // //
// //
// //
Ambassador bodyshotting // //
No Trigger Mediguns // //
More projectile weapons aimbot (wrap assassin, wrangler, stickybomb, airstrike) // //
Auto trigger DR before rockets // //
// //
// //
Make building aimbot compensate for gravity on projectile weapons // //
// //
add Spectator Silent for projectile weapons // //
// //
Improve aimbot accuracy // //
// //
// //
// //
// //
// //
//------------------------------------------------------------------------------------------------------------------// //
@ -97,10 +90,8 @@ dominatesay assistsay worldsay // //
//Followbots //
//------------------------------------------------------------------------------------------------------------------// //
// //
Proper medic followbot AI, breadcrumb followbot is good but a nav system would be better // //
// //
Bot option for aiming at owner's prey (just for fun) // //
Bot pathfinding & navigation files system // //
Proper entity classes (actually I might just use a lot of helper functions taking IClientEntity* as first arg) // //
// //
//------------------------------------------------------------------------------------------------------------------// //
@ -117,15 +108,11 @@ Proper entity classes (actually I might just use a lot of helper functions takin
// //
Spy alert uses angles // //
// //
Add ignore gunslinger to melee crit hack // //
// //
Priority system optimization and testing // //
General optimization and refactoring // //
// //
XorString or something to make it harder to detect. // //
// //
TF2C teams // //
TF2C merc // //
HL2DM teams // //
// //
//------------------------------------------------------------------------------------------------------------------// //

View File

@ -50,6 +50,7 @@
<Option name="FakeLeft" value="19"/>
<Option name="FakeRight" value="20"/>
<Option name="FakeREdge" value="21"/>
<Option name="OmegaFake" value="22"/>
</Select>
</LabeledObject>
</List>

View File

@ -168,7 +168,7 @@ struct offsets
}
static constexpr uint32_t PreDataUpdate()
{
return PlatformOffset(14, undefined, undefined);
return PlatformOffset(17, undefined, undefined);
}
static constexpr uint32_t Paint()
{

View File

@ -11,5 +11,5 @@ namespace hacks::tf2::autobackstab
{
void CreateMove();
const Vector GetWorldSpaceCenter(CachedEntity *ent);
void Draw();
} // namespace hacks::tf2::autobackstab

View File

@ -163,13 +163,9 @@ public:
else
{
if (AreRandomCritsEnabled(self))
{
return CalcIsAttackCriticalHelper(self);
}
else
{
return CalcIsAttackCriticalHelperNoCrits(self);
}
}
}
}

View File

@ -20,7 +20,12 @@ int *g_PredictionRandomSeed = nullptr;
namespace criticals
{
CatCommand test("crit_debug_print", "debug", []() {
bool test = (*((unsigned char *) RAW_ENT(LOCAL_E) + 9645) & 2) >> 1;
int test2 = (*((unsigned char *) RAW_ENT(LOCAL_E) + 9645) & 2);
int test3 = (*((unsigned *) RAW_ENT(LOCAL_E) + 9645));
logging::Info("%d, %d, %d", test, test2, test3);
});
int find_next_random_crit_for_weapon(IClientEntity *weapon)
{
int tries = 0, number = current_user_cmd->command_number, found = 0, seed,

View File

@ -404,10 +404,7 @@ void FakeCrouch(CUserCmd *cmd)
void ProcessUserCmd(CUserCmd *cmd)
{
if (!enable)
{
*bSendPackets = true;
return;
}
if (!ShouldAA(cmd))
return;
static bool keepmode = true;
@ -416,6 +413,7 @@ void ProcessUserCmd(CUserCmd *cmd)
float &y = cmd->viewangles.y;
static bool flip = false;
static bool bsendflip = true;
static float rngyaw = 0.0f;
bool clamp = !no_clamping;
switch ((int) yaw_mode)
{
@ -546,6 +544,15 @@ void ProcessUserCmd(CUserCmd *cmd)
y = useEdge(y) + 180.0f;
}
break;
case 22: // Omegayaw
if (*bSendPackets)
{
rngyaw = RandFloatRange(-180.0f, 180.0f);
y = rngyaw;
}
else
y = rngyaw - 180.0f;
break;
default:
break;
}

View File

@ -256,4 +256,49 @@ void CreateMove()
}
}
}
const Vector GetWorldSpaceCenter(CachedEntity *ent)
{
Vector vMin, vMax;
RAW_ENT(ent)->GetRenderBounds(vMin, vMax);
Vector vWorldSpaceCenter = RAW_ENT(ent)->GetAbsOrigin();
vWorldSpaceCenter.z += (vMin.z + vMax.z) / 2;
return vWorldSpaceCenter;
}
void Draw()
{
int idx = -1;
Vector result{};
WhatIAmLookingAt(&idx, &result);
if (idx == -1)
return;
CachedEntity *target = ENTITY(idx);
if (CE_BAD(target))
return;
Vector angle = NET_VECTOR(RAW_ENT(LOCAL_E), netvar.m_angEyeAngles);
Vector tarAngle = NET_VECTOR(RAW_ENT(target), netvar.m_angEyeAngles);
Vector wsc_spy_to_victim = GetWorldSpaceCenter(target) - GetWorldSpaceCenter(LOCAL_E);
wsc_spy_to_victim.z = 0;
wsc_spy_to_victim.NormalizeInPlace();
Vector eye_spy = angle;
eye_spy.z = 0;
eye_spy.NormalizeInPlace();
Vector eye_victim = tarAngle;
eye_victim.z = 0;
eye_victim.NormalizeInPlace();
float dot1 = DotProduct(wsc_spy_to_victim, eye_victim);
float dot2 = DotProduct(wsc_spy_to_victim, eye_spy);
float dot3 = DotProduct(eye_spy, eye_victim);
bool IsBehind = dot1 <= 0.0f;
bool LookingAtVic = dot2 <= 0.5f;
bool InBackstabAngleRange = dot3 <= -0.3f;
rgba_t col1 = IsBehind ? colors::red : colors::green;
rgba_t col2 = LookingAtVic ? colors::red : colors::green;
rgba_t col3 = InBackstabAngleRange ? colors::red : colors::green;
AddCenterString(format("Behind target: ", dot1), col1);
AddCenterString(format("Looking at Target: ", dot2), col2);
AddCenterString(format("In Angle Range: ", dot3), col3);
}
} // namespace hacks::tf2::autobackstab

View File

@ -14,6 +14,7 @@
static settings::Bool autojoin_team{ "autojoin.team", "false" };
static settings::Int autojoin_class{ "autojoin.class", "0" };
static settings::Bool auto_queue{ "autojoin.auto-queue", "false" };
static settings::Bool party_bypass{ "autojoin.party-bypass", "false" };
namespace hacks::shared::autojoin
{
@ -42,7 +43,8 @@ static Timer req_timer{};
void updateSearch()
{
// segfaults for no reason
/*static bool calld = false;
static bool calld = false;
/*
if (party_bypass && !calld)
{
static unsigned char patch[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };
@ -97,6 +99,7 @@ void updateSearch()
typedef int (*GetPendingInvites_t)(uintptr_t);
GetPendingInvites_t GetPendingInvites = GetPendingInvites_t(offset1);
int invites = GetPendingInvites(offset0);
re::CTFGCClientSystem *gc = re::CTFGCClientSystem::GTFGCClientSystem();
re::CTFPartyClient *pc = re::CTFPartyClient::GTFPartyClient();
if (current_user_cmd && gc && gc->BConnectedToMatchServer(false) &&

View File

@ -261,25 +261,13 @@ bool ValidTick(BacktrackData &i, CachedEntity *ent)
return true;
if (istickinvalid[ent->m_IDX][i.index])
return false;
if (hacks::shared::aimbot::IsBacktracking())
{
if (IsVectorVisible(g_pLocalPlayer->v_Eye, i.hitboxes[head].center,
true))
if (fabsf(NET_FLOAT(RAW_ENT(ent), netvar.m_flSimulationTime) *
1000.0f -
getLatency() - i.simtime * 1000.0f) <= 200.0f)
{
istickvalid[ent->m_IDX][i.index] = true;
return true;
}
}
else if (fabsf(NET_FLOAT(RAW_ENT(ent), netvar.m_flSimulationTime) *
1000.0f -
getLatency() - i.simtime * 1000.0f) <= 200.0f)
{
istickvalid[ent->m_IDX][i.index] = true;
return true;
}
if (IsVectorVisible(g_pLocalPlayer->v_Eye, i.hitboxes[head].center, true))
if (fabsf(NET_FLOAT(RAW_ENT(ent), netvar.m_flSimulationTime) * 1000.0f -
getLatency() - i.simtime * 1000.0f) <= 200.0f)
{
istickvalid[ent->m_IDX][i.index] = true;
return true;
}
istickinvalid[ent->m_IDX][i.index] = true;
return false;
}

View File

@ -492,14 +492,25 @@ void CreateMove()
}
else
{
int bestscr = INT_MAX;
hacks::shared::backtrack::BacktrackData besttick{};
for (auto i : hacks::shared::backtrack::headPositions
[tar->m_IDX])
{
if (!hacks::shared::backtrack::ValidTick(i, tar))
continue;
nav::NavTo(i.entorigin, false, false);
break;
{
int scr = i.tickcount;
if (scr < bestscr)
{
bestscr = scr;
besttick = i;
}
}
}
if (besttick.tickcount)
nav::NavTo(besttick.entorigin, false, false);
else if (!nav::NavTo(tar->m_vecOrigin(), false))
last_tar = -1;
}
}
}

View File

@ -49,7 +49,7 @@ bool CanBacktrack()
? ENTITY(hacks::shared::backtrack::iBestTarget)
: nullptr;
if (CE_BAD(tar))
return false;
return true;
for (auto i : hacks::shared::backtrack::headPositions[tar->m_IDX])
{
if (!hacks::shared::backtrack::ValidTick(i, tar))
@ -88,10 +88,10 @@ bool CanBacktrack()
angles.y = i.viewangles;
current_user_cmd->tick_count = i.tickcount;
current_user_cmd->buttons |= IN_ATTACK;
return false;
return true;
}
}
return true;
return false;
}
// The main "loop" of the triggerbot
void CreateMove()
@ -116,7 +116,7 @@ void CreateMove()
// Check if can backtrack, shoot if we can
if (hacks::shared::backtrack::isBacktrackEnabled)
if (!CanBacktrack())
if (CanBacktrack())
return;
// Check if dormant or null to prevent crashes
@ -442,7 +442,7 @@ bool HeadPreferable(CachedEntity *target)
{
// Switch based on the priority type we need
switch ((int) hitbox_mode)
switch (*hitbox_mode)
{
case 0:
{ // AUTO-HEAD priority
@ -558,25 +558,19 @@ bool UpdateAimkey()
// Only while key is depressed, enable
case 1:
if (!key_down)
{
allow_trigger_key = false;
}
break;
// Only while key is not depressed, enable
case 2:
if (key_down)
{
allow_trigger_key = false;
}
break;
// Aimkey acts like a toggle switch
case 3:
if (!pressed_last_tick && key_down)
trigger_key_flip = !trigger_key_flip;
if (!trigger_key_flip)
{
allow_trigger_key = false;
}
}
pressed_last_tick = key_down;
}

View File

@ -1155,13 +1155,10 @@ void WhatIAmLookingAt(int *result_eindex, Vector *result_pos)
if (result_pos)
*result_pos = trace.endpos;
if (result_eindex)
{
*result_eindex = 0;
}
*result_eindex = -1;
if (trace.m_pEnt && result_eindex)
{
*result_eindex = ((IClientEntity *) (trace.m_pEnt))->entindex();
}
}
bool IsSentryBuster(CachedEntity *entity)

View File

@ -168,6 +168,7 @@ void DrawCheatVisuals()
{
criticals::draw();
}
hacks::tf2::autobackstab::Draw();
#ifndef FEATURE_FIDGET_SPINNER_ENABLED
DrawSpinner();
#endif

View File

@ -94,7 +94,7 @@ static void initPlayerlist()
controller =
std::make_unique<zerokernel::special::PlayerListController>(*pl);
controller->setKickButtonCallback([](int uid) {
hack::command_stack().push("callvote kick " + uid);
hack::command_stack().push(format("callvote kick ", uid));
});
controller->setOpenSteamCallback([](unsigned steam) {
CSteamID id{};