commit
9faffb6b92
@ -2,7 +2,7 @@ version: 2
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
docker:
|
docker:
|
||||||
- image: registry.gitlab.com/nullworks/cathook-ci-docker/ubuntu-cat-dependencies:build
|
- image: nullworks/cathook-docker-ci:latest
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run:
|
- run:
|
||||||
|
9
TODO
9
TODO
@ -23,12 +23,10 @@ MAX -> MIN priority // //
|
|||||||
// //
|
// //
|
||||||
// //
|
// //
|
||||||
No Trigger Mediguns // //
|
No Trigger Mediguns // //
|
||||||
More projectile weapons aimbot (wrap assassin, wrangler, stickybomb, airstrike) // //
|
More projectile weapons aimbot (wrap assassin, wrangler, airstrike) // //
|
||||||
// //
|
// //
|
||||||
// //
|
// //
|
||||||
Make building aimbot compensate for gravity on projectile weapons // //
|
|
||||||
// //
|
// //
|
||||||
add Spectator Silent for projectile weapons // //
|
|
||||||
// //
|
// //
|
||||||
// //
|
// //
|
||||||
// //
|
// //
|
||||||
@ -57,10 +55,9 @@ fullbright toggle // //
|
|||||||
FLAG ESP? // //
|
FLAG ESP? // //
|
||||||
// //
|
// //
|
||||||
ESP Icons // //
|
ESP Icons // //
|
||||||
ESP Distance sort // //
|
ESP Distance sort // // // //
|
||||||
Show sapped buildings in ESP // // // //
|
|
||||||
carrying esp // //
|
carrying esp // //
|
||||||
Spy Cam // //
|
Spy Cam // //
|
||||||
// //
|
// //
|
||||||
//------------------------------------------------------------------------------------------------------------------// //
|
//------------------------------------------------------------------------------------------------------------------// //
|
||||||
// //
|
// //
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<Tab name="Misc2">
|
<Tab name="Misc2">
|
||||||
<TabContainer width="fill" height="fill">
|
<TabContainer width="fill" height="fill">
|
||||||
<Include path="nullifiedcat/misc/remove.xml"/>
|
<Include path="nullifiedcat/misc/remove.xml"/>
|
||||||
|
<Include path="nullifiedcat/misc/sandwich.xml"/>
|
||||||
</TabContainer>
|
</TabContainer>
|
||||||
</Tab>
|
</Tab>
|
13
data/menu/nullifiedcat/misc/sandwich.xml
Normal file
13
data/menu/nullifiedcat/misc/sandwich.xml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<Tab name="Sandwich Aimbot" padding="4 4 4 4">
|
||||||
|
<List width="220">
|
||||||
|
<AutoVariable width="fill" target="sandwichaim.enable" label="Enable"/>
|
||||||
|
<AutoVariable width="fill" target="sandwichaim.aimkey" label="Aimkey"/>
|
||||||
|
<LabeledObject width="fill" label="Aimkey mode">
|
||||||
|
<Select target="sandwichaim.aimkey-mode">
|
||||||
|
<Option name="Disable" value="0"/>
|
||||||
|
<Option name="Pressed" value="1"/>
|
||||||
|
<Option name="Not pressed" value="2"/>
|
||||||
|
</Select>
|
||||||
|
</LabeledObject>
|
||||||
|
</List>
|
||||||
|
</Tab>
|
@ -66,6 +66,7 @@ public:
|
|||||||
offset_t m_hBuilder;
|
offset_t m_hBuilder;
|
||||||
offset_t m_iObjectType;
|
offset_t m_iObjectType;
|
||||||
offset_t m_bMiniBuilding;
|
offset_t m_bMiniBuilding;
|
||||||
|
offset_t m_bHasSapper;
|
||||||
offset_t m_bBuilding;
|
offset_t m_bBuilding;
|
||||||
offset_t m_iTeleState;
|
offset_t m_iTeleState;
|
||||||
offset_t m_flTeleRechargeTime;
|
offset_t m_flTeleRechargeTime;
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include "core/profiler.hpp"
|
#include "core/profiler.hpp"
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "memory"
|
||||||
|
|
||||||
class HookedFunction;
|
class HookedFunction;
|
||||||
namespace HookTools
|
namespace HookTools
|
||||||
@ -30,6 +31,9 @@ class HookedFunction
|
|||||||
std::function<void()> m_func;
|
std::function<void()> m_func;
|
||||||
int m_priority;
|
int m_priority;
|
||||||
std::string m_name;
|
std::string m_name;
|
||||||
|
#if ENABLE_PROFILER
|
||||||
|
ProfilerSection section = ProfilerSection("UNNAMED_FUNCTIONS");
|
||||||
|
#endif
|
||||||
void init(HookedFunctions_types type, std::string name, int priority,
|
void init(HookedFunctions_types type, std::string name, int priority,
|
||||||
std::function<void()> func)
|
std::function<void()> func)
|
||||||
{
|
{
|
||||||
@ -44,11 +48,17 @@ class HookedFunction
|
|||||||
case HF_Paint:
|
case HF_Paint:
|
||||||
m_name = "PAINT_";
|
m_name = "PAINT_";
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
m_name = "UNDEFINED_";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
m_name.append(name);
|
m_name.append(name);
|
||||||
m_priority = priority;
|
m_priority = priority;
|
||||||
m_func = func;
|
m_func = func;
|
||||||
m_type = type;
|
m_type = type;
|
||||||
|
#if ENABLE_PROFILER
|
||||||
|
section.m_name = m_name;
|
||||||
|
#endif
|
||||||
HookTools::GetHookedFunctions().push_back(this);
|
HookTools::GetHookedFunctions().push_back(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +69,6 @@ public:
|
|||||||
if (m_type == type)
|
if (m_type == type)
|
||||||
{
|
{
|
||||||
#if ENABLE_PROFILER
|
#if ENABLE_PROFILER
|
||||||
static ProfilerSection section(m_name);
|
|
||||||
ProfilerNode node(section);
|
ProfilerNode node(section);
|
||||||
#endif
|
#endif
|
||||||
m_func();
|
m_func();
|
||||||
|
@ -17,6 +17,8 @@ Vector SimpleLatencyPrediction(CachedEntity *ent, int hb);
|
|||||||
|
|
||||||
bool PerformProjectilePrediction(CachedEntity *target, int hitbox);
|
bool PerformProjectilePrediction(CachedEntity *target, int hitbox);
|
||||||
|
|
||||||
|
Vector BuildingPrediction(CachedEntity *building, Vector vec, float speed,
|
||||||
|
float gravity);
|
||||||
Vector ProjectilePrediction(CachedEntity *ent, int hb, float speed,
|
Vector ProjectilePrediction(CachedEntity *ent, int hb, float speed,
|
||||||
float gravitymod, float entgmod);
|
float gravitymod, float entgmod);
|
||||||
Vector ProjectilePrediction_Engine(CachedEntity *ent, int hb, float speed,
|
Vector ProjectilePrediction_Engine(CachedEntity *ent, int hb, float speed,
|
||||||
|
@ -125,19 +125,19 @@ constexpr rgba_t empty = FromRGBA8(0, 0, 0, 0);
|
|||||||
|
|
||||||
constexpr rgba_t FromHSL(float h, float s, float v)
|
constexpr rgba_t FromHSL(float h, float s, float v)
|
||||||
{
|
{
|
||||||
if (s <= 0.0)
|
if (s <= 0.0f)
|
||||||
{ // < is bogus, just shuts up warnings
|
{ // < is bogus, just shuts up warnings
|
||||||
return rgba_t{ v, v, v, 1.0f };
|
return rgba_t{ v, v, v, 1.0f };
|
||||||
}
|
}
|
||||||
float hh = h;
|
float hh = h;
|
||||||
if (hh >= 360.0)
|
if (hh >= 360.0f)
|
||||||
hh = 0.0;
|
hh = 0.0f;
|
||||||
hh /= 60.0;
|
hh /= 60.0f;
|
||||||
long i = long(hh);
|
long i = long(hh);
|
||||||
float ff = hh - i;
|
float ff = hh - i;
|
||||||
float p = v * (1.0 - s);
|
float p = v * (1.0f - s);
|
||||||
float q = v * (1.0 - (s * ff));
|
float q = v * (1.0f - (s * ff));
|
||||||
float t = v * (1.0 - (s * (1.0 - ff)));
|
float t = v * (1.0f - (s * (1.0f - ff)));
|
||||||
|
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
@ -149,7 +149,6 @@ constexpr rgba_t FromHSL(float h, float s, float v)
|
|||||||
return rgba_t{ p, v, t, 1.0f };
|
return rgba_t{ p, v, t, 1.0f };
|
||||||
case 3:
|
case 3:
|
||||||
return rgba_t{ p, q, v, 1.0f };
|
return rgba_t{ p, q, v, 1.0f };
|
||||||
break;
|
|
||||||
case 4:
|
case 4:
|
||||||
return rgba_t{ t, p, v, 1.0f };
|
return rgba_t{ t, p, v, 1.0f };
|
||||||
case 5:
|
case 5:
|
||||||
|
@ -133,7 +133,7 @@ std::optional<colors::rgba_t> forceEspColorSteamId(unsigned id)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
std::optional<colors::rgba_t> forceEspColor(CachedEntity *entity)
|
std::optional<colors::rgba_t> forceEspColor(CachedEntity *entity)
|
||||||
{
|
{
|
||||||
|
@ -124,6 +124,8 @@ void NetVars::Init()
|
|||||||
this->m_bBuilding = gNetvars.get_offset("DT_BaseObject", "m_hBuilding");
|
this->m_bBuilding = gNetvars.get_offset("DT_BaseObject", "m_hBuilding");
|
||||||
this->m_iObjectType =
|
this->m_iObjectType =
|
||||||
gNetvars.get_offset("DT_BaseObject", "m_iObjectType");
|
gNetvars.get_offset("DT_BaseObject", "m_iObjectType");
|
||||||
|
this->m_bHasSapper =
|
||||||
|
gNetvars.get_offset("DT_BaseObject", "m_bHasSapper");
|
||||||
this->m_bMiniBuilding =
|
this->m_bMiniBuilding =
|
||||||
gNetvars.get_offset("DT_BaseObject", "m_bMiniBuilding");
|
gNetvars.get_offset("DT_BaseObject", "m_bMiniBuilding");
|
||||||
this->m_iTeleState =
|
this->m_iTeleState =
|
||||||
|
@ -76,10 +76,16 @@ static settings::Float fovcircle_opacity{ "aimbot.fov-circle.opacity", "0.7" };
|
|||||||
|
|
||||||
namespace hacks::shared::aimbot
|
namespace hacks::shared::aimbot
|
||||||
{
|
{
|
||||||
|
bool shouldBacktrack()
|
||||||
|
{
|
||||||
|
return *enable && *backtrackAimbot;
|
||||||
|
}
|
||||||
|
|
||||||
bool IsBacktracking()
|
bool IsBacktracking()
|
||||||
{
|
{
|
||||||
return !(!aimkey || !aimkey.isKeyDown()) && *enable && *backtrackAimbot;
|
return !(!aimkey || !aimkey.isKeyDown()) && shouldBacktrack();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Current Entity
|
// Current Entity
|
||||||
int target_eid{ 0 };
|
int target_eid{ 0 };
|
||||||
CachedEntity *target = 0;
|
CachedEntity *target = 0;
|
||||||
@ -107,18 +113,14 @@ void CreateMove()
|
|||||||
|
|
||||||
// Auto-Unzoom
|
// Auto-Unzoom
|
||||||
if (auto_unzoom)
|
if (auto_unzoom)
|
||||||
{
|
|
||||||
if (g_pLocalPlayer->holding_sniper_rifle && g_pLocalPlayer->bZoomed &&
|
if (g_pLocalPlayer->holding_sniper_rifle && g_pLocalPlayer->bZoomed &&
|
||||||
zoomTime.test_and_set(3000))
|
zoomTime.test_and_set(3000))
|
||||||
{
|
|
||||||
current_user_cmd->buttons |= IN_ATTACK2;
|
current_user_cmd->buttons |= IN_ATTACK2;
|
||||||
}
|
|
||||||
}
|
|
||||||
if (g_pLocalPlayer->weapon()->m_iClassID() == CL_CLASS(CTFMinigun))
|
if (g_pLocalPlayer->weapon()->m_iClassID() == CL_CLASS(CTFMinigun))
|
||||||
{
|
|
||||||
if (auto_spin_up && !zoomTime.check(3000))
|
if (auto_spin_up && !zoomTime.check(3000))
|
||||||
current_user_cmd->buttons |= IN_ATTACK2;
|
current_user_cmd->buttons |= IN_ATTACK2;
|
||||||
}
|
|
||||||
// We do this as we need to pass whether the aimkey allows aiming to both
|
// We do this as we need to pass whether the aimkey allows aiming to both
|
||||||
// the find target and aiming system. If we just call the func than toggle
|
// the find target and aiming system. If we just call the func than toggle
|
||||||
// aimkey would break so we save it to a var to use it twice
|
// aimkey would break so we save it to a var to use it twice
|
||||||
@ -208,7 +210,9 @@ void CreateMove()
|
|||||||
|
|
||||||
// flNextPrimaryAttack meme
|
// flNextPrimaryAttack meme
|
||||||
// target_eid = target_entity->m_IDX;
|
// target_eid = target_entity->m_IDX;
|
||||||
if (only_can_shoot)
|
if (only_can_shoot &&
|
||||||
|
g_pLocalPlayer->weapon()->m_iClassID() != CL_CLASS(CTFMinigun) &&
|
||||||
|
g_pLocalPlayer->weapon()->m_iClassID() != CL_CLASS(CTFLaserPointer))
|
||||||
{
|
{
|
||||||
|
|
||||||
// Handle Compound bow
|
// Handle Compound bow
|
||||||
@ -434,8 +438,7 @@ bool IsTargetStateGood(CachedEntity *entity)
|
|||||||
{
|
{
|
||||||
PROF_SECTION(PT_aimbot_targetstatecheck);
|
PROF_SECTION(PT_aimbot_targetstatecheck);
|
||||||
|
|
||||||
if (hacks::shared::backtrack::isBacktrackEnabled &&
|
if (shouldBacktrack() && entity->m_Type() != ENTITY_PLAYER)
|
||||||
entity->m_Type() != ENTITY_PLAYER)
|
|
||||||
return false;
|
return false;
|
||||||
// Checks for Players
|
// Checks for Players
|
||||||
if (entity->m_Type() == ENTITY_PLAYER)
|
if (entity->m_Type() == ENTITY_PLAYER)
|
||||||
@ -695,7 +698,7 @@ void Aim(CachedEntity *entity)
|
|||||||
auto hitboxmin = entity->hitboxes.GetHitbox(cd.hitbox)->min;
|
auto hitboxmin = entity->hitboxes.GetHitbox(cd.hitbox)->min;
|
||||||
auto hitboxmax = entity->hitboxes.GetHitbox(cd.hitbox)->max;
|
auto hitboxmax = entity->hitboxes.GetHitbox(cd.hitbox)->max;
|
||||||
auto hitboxcenter = entity->hitboxes.GetHitbox(cd.hitbox)->center;
|
auto hitboxcenter = entity->hitboxes.GetHitbox(cd.hitbox)->center;
|
||||||
if (hacks::shared::backtrack::isBacktrackEnabled)
|
if (shouldBacktrack())
|
||||||
{
|
{
|
||||||
hitboxcenter =
|
hitboxcenter =
|
||||||
hacks::shared::backtrack::headPositions
|
hacks::shared::backtrack::headPositions
|
||||||
@ -766,7 +769,7 @@ void Aim(CachedEntity *entity)
|
|||||||
|
|
||||||
if (silent && !slow_aim)
|
if (silent && !slow_aim)
|
||||||
g_pLocalPlayer->bUseSilentAngles = true;
|
g_pLocalPlayer->bUseSilentAngles = true;
|
||||||
if (hacks::shared::backtrack::isBacktrackEnabled)
|
if (shouldBacktrack())
|
||||||
{
|
{
|
||||||
auto i = hacks::shared::backtrack::headPositions
|
auto i = hacks::shared::backtrack::headPositions
|
||||||
[hacks::shared::backtrack::iBestTarget]
|
[hacks::shared::backtrack::iBestTarget]
|
||||||
@ -821,8 +824,9 @@ void DoAutoshoot()
|
|||||||
float chargebegin = *((float *) ((unsigned) RAW_ENT(LOCAL_W) + 3152));
|
float chargebegin = *((float *) ((unsigned) RAW_ENT(LOCAL_W) + 3152));
|
||||||
float chargetime = g_GlobalVars->curtime - chargebegin;
|
float chargetime = g_GlobalVars->curtime - chargebegin;
|
||||||
|
|
||||||
// Release Sticky if > chargetime
|
// Release Sticky if > chargetime, 3.85 is the max second chargetime,
|
||||||
if ((chargetime >= (float) sticky_autoshoot) && begansticky > 3)
|
// but we want a percent so here we go
|
||||||
|
if ((chargetime >= 3.85f * *sticky_autoshoot) && begansticky > 3)
|
||||||
{
|
{
|
||||||
current_user_cmd->buttons &= ~IN_ATTACK;
|
current_user_cmd->buttons &= ~IN_ATTACK;
|
||||||
hacks::shared::antiaim::SetSafeSpace(3);
|
hacks::shared::antiaim::SetSafeSpace(3);
|
||||||
@ -879,6 +883,8 @@ void DoAutoshoot()
|
|||||||
|
|
||||||
if (attack)
|
if (attack)
|
||||||
current_user_cmd->buttons |= IN_ATTACK;
|
current_user_cmd->buttons |= IN_ATTACK;
|
||||||
|
if (LOCAL_W->m_iClassID() == CL_CLASS(CTFLaserPointer))
|
||||||
|
current_user_cmd->buttons |= IN_ATTACK2;
|
||||||
hacks::shared::antiaim::SetSafeSpace(1);
|
hacks::shared::antiaim::SetSafeSpace(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -891,7 +897,7 @@ const Vector &PredictEntity(CachedEntity *entity)
|
|||||||
if (cd.predict_tick == tickcount)
|
if (cd.predict_tick == tickcount)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
if (!hacks::shared::backtrack::isBacktrackEnabled || projectile_mode)
|
if (!shouldBacktrack() || projectile_mode)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Players
|
// Players
|
||||||
@ -922,7 +928,8 @@ const Vector &PredictEntity(CachedEntity *entity)
|
|||||||
}
|
}
|
||||||
else if (entity->m_Type() == ENTITY_BUILDING)
|
else if (entity->m_Type() == ENTITY_BUILDING)
|
||||||
{
|
{
|
||||||
result = GetBuildingPosition(entity);
|
result = BuildingPrediction(entity, GetBuildingPosition(entity),
|
||||||
|
cur_proj_speed, cur_proj_grav);
|
||||||
// Other
|
// Other
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1135,7 +1142,7 @@ bool VischeckPredictedEntity(CachedEntity *entity)
|
|||||||
|
|
||||||
// Update info
|
// Update info
|
||||||
cd.vcheck_tick = tickcount;
|
cd.vcheck_tick = tickcount;
|
||||||
if (!hacks::shared::backtrack::isBacktrackEnabled || projectile_mode)
|
if (!shouldBacktrack() || projectile_mode)
|
||||||
cd.visible = IsEntityVectorVisible(entity, PredictEntity(entity));
|
cd.visible = IsEntityVectorVisible(entity, PredictEntity(entity));
|
||||||
else
|
else
|
||||||
cd.visible = IsVectorVisible(
|
cd.visible = IsVectorVisible(
|
||||||
|
@ -7,6 +7,7 @@ if(NOT LagbotMode)
|
|||||||
target_sources(cathook PRIVATE
|
target_sources(cathook PRIVATE
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/Achievement.cpp"
|
"${CMAKE_CURRENT_LIST_DIR}/Achievement.cpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/Aimbot.cpp"
|
"${CMAKE_CURRENT_LIST_DIR}/Aimbot.cpp"
|
||||||
|
"${CMAKE_CURRENT_LIST_DIR}/MiscAimbot.cpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/Announcer.cpp"
|
"${CMAKE_CURRENT_LIST_DIR}/Announcer.cpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/AntiAim.cpp"
|
"${CMAKE_CURRENT_LIST_DIR}/AntiAim.cpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/AntiAntiAim.cpp"
|
"${CMAKE_CURRENT_LIST_DIR}/AntiAntiAim.cpp"
|
||||||
|
@ -1039,12 +1039,15 @@ void _FASTCALL ProcessEntity(CachedEntity *ent)
|
|||||||
? "Teleporter"
|
? "Teleporter"
|
||||||
: (classid == CL_CLASS(CObjectSentrygun) ? "Sentry Gun"
|
: (classid == CL_CLASS(CObjectSentrygun) ? "Sentry Gun"
|
||||||
: "Dispenser"));
|
: "Dispenser"));
|
||||||
int level = CE_INT(ent, netvar.iUpgradeLevel);
|
int level = CE_INT(ent, netvar.iUpgradeLevel);
|
||||||
int IsMini = CE_INT(ent, netvar.m_bMiniBuilding);
|
bool IsMini = CE_BYTE(ent, netvar.m_bMiniBuilding);
|
||||||
|
bool IsSapped = CE_BYTE(ent, netvar.m_bHasSapper);
|
||||||
if (!IsMini)
|
if (!IsMini)
|
||||||
AddEntityString(ent, format("LV ", level, ' ', name));
|
AddEntityString(ent, format("LV ", level, ' ', name));
|
||||||
else
|
else
|
||||||
AddEntityString(ent, format("Mini ", name));
|
AddEntityString(ent, format("Mini ", name));
|
||||||
|
if (IsSapped)
|
||||||
|
AddEntityString(ent, "*Sapped*");
|
||||||
if (classid == CL_CLASS(CObjectTeleporter))
|
if (classid == CL_CLASS(CObjectTeleporter))
|
||||||
{
|
{
|
||||||
float next_teleport =
|
float next_teleport =
|
||||||
|
@ -25,14 +25,14 @@ const std::string tf_classes_killsay[] = { "class", "scout", "sniper",
|
|||||||
|
|
||||||
const std::string tf_teams_killsay[] = { "RED", "BLU" };
|
const std::string tf_teams_killsay[] = { "RED", "BLU" };
|
||||||
|
|
||||||
static std::string lastmsg = "";
|
static std::string lastmsg{};
|
||||||
|
|
||||||
TextFile file{};
|
TextFile file{};
|
||||||
|
|
||||||
std::string ComposeKillSay(IGameEvent *event)
|
std::string ComposeKillSay(IGameEvent *event)
|
||||||
{
|
{
|
||||||
const std::vector<std::string> *source = nullptr;
|
const std::vector<std::string> *source = nullptr;
|
||||||
switch ((int) killsay_mode)
|
switch (*killsay_mode)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
source = &file.lines;
|
source = &file.lines;
|
||||||
@ -46,8 +46,10 @@ std::string ComposeKillSay(IGameEvent *event)
|
|||||||
case 4:
|
case 4:
|
||||||
source = &builtin_nonecore_mlg;
|
source = &builtin_nonecore_mlg;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (!source || source->size() == 0)
|
if (!source || source->empty())
|
||||||
return "";
|
return "";
|
||||||
if (!event)
|
if (!event)
|
||||||
return "";
|
return "";
|
||||||
@ -58,18 +60,18 @@ std::string ComposeKillSay(IGameEvent *event)
|
|||||||
if (g_IEngine->GetPlayerForUserID(kid) != g_IEngine->GetLocalPlayer())
|
if (g_IEngine->GetPlayerForUserID(kid) != g_IEngine->GetLocalPlayer())
|
||||||
return "";
|
return "";
|
||||||
std::string msg = source->at(rand() % source->size());
|
std::string msg = source->at(rand() % source->size());
|
||||||
while (msg == lastmsg)
|
// checks if the killsays.txt file is not 1 line. 100% sure it's going
|
||||||
{
|
// to crash if it is.
|
||||||
|
while (msg == lastmsg && source->size() > 1)
|
||||||
msg = source->at(rand() % source->size());
|
msg = source->at(rand() % source->size());
|
||||||
}
|
|
||||||
lastmsg = msg;
|
lastmsg = msg;
|
||||||
player_info_s info;
|
player_info_s info{};
|
||||||
g_IEngine->GetPlayerInfo(g_IEngine->GetPlayerForUserID(vid), &info);
|
g_IEngine->GetPlayerInfo(g_IEngine->GetPlayerForUserID(vid), &info);
|
||||||
ReplaceString(msg, "%name%", std::string(info.name));
|
ReplaceString(msg, "%name%", std::string(info.name));
|
||||||
CachedEntity *ent = ENTITY(g_IEngine->GetPlayerForUserID(vid));
|
CachedEntity *ent = ENTITY(g_IEngine->GetPlayerForUserID(vid));
|
||||||
int clz = g_pPlayerResource->GetClass(ent);
|
int clz = g_pPlayerResource->GetClass(ent);
|
||||||
ReplaceString(msg, "%class%", tf_classes_killsay[clz]);
|
ReplaceString(msg, "%class%", tf_classes_killsay[clz]);
|
||||||
player_info_s infok;
|
player_info_s infok{};
|
||||||
g_IEngine->GetPlayerInfo(g_IEngine->GetPlayerForUserID(kid), &infok);
|
g_IEngine->GetPlayerInfo(g_IEngine->GetPlayerForUserID(kid), &infok);
|
||||||
ReplaceString(msg, "%killer%", std::string(infok.name));
|
ReplaceString(msg, "%killer%", std::string(infok.name));
|
||||||
ReplaceString(msg, "%team%", tf_teams_killsay[ent->m_iTeam() - 2]);
|
ReplaceString(msg, "%team%", tf_teams_killsay[ent->m_iTeam() - 2]);
|
||||||
@ -87,10 +89,8 @@ class KillSayEventListener : public IGameEventListener2
|
|||||||
if (!killsay_mode)
|
if (!killsay_mode)
|
||||||
return;
|
return;
|
||||||
std::string message = hacks::shared::killsay::ComposeKillSay(event);
|
std::string message = hacks::shared::killsay::ComposeKillSay(event);
|
||||||
if (message.size())
|
if (!message.empty())
|
||||||
{
|
|
||||||
chat_stack::Say(message, false);
|
chat_stack::Say(message, false);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ const std::vector<std::string> builtin_default = {
|
|||||||
"You must really like that respawn timer, %name%.",
|
"You must really like that respawn timer, %name%.",
|
||||||
|
|
||||||
"If your main is %class%, you should give up.",
|
"If your main is %class%, you should give up.",
|
||||||
"Hey %name%, i see you can't play %class%. Try quitting the game."
|
"Hey %name%, i see you can't play %class%. Try quitting the game.",
|
||||||
"%team% is filled with spergs",
|
"%team% is filled with spergs",
|
||||||
"%name%@gmail.com to vacreview@valvesoftware.com\nFOUND CHEATER",
|
"%name%@gmail.com to vacreview@valvesoftware.com\nFOUND CHEATER",
|
||||||
"\n☐ Not rekt\n ☑ Rekt\n ☑ Really Rekt\n ☑ Tyrannosaurus Rekt"
|
"\n☐ Not rekt\n ☑ Rekt\n ☑ Really Rekt\n ☑ Tyrannosaurus Rekt"
|
||||||
|
116
src/hacks/MiscAimbot.cpp
Normal file
116
src/hacks/MiscAimbot.cpp
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
//
|
||||||
|
// Created by bencat07 on 28.09.18.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "common.hpp"
|
||||||
|
#include <settings/Bool.hpp>
|
||||||
|
#include <settings/Int.hpp>
|
||||||
|
#include <settings/Key.hpp>
|
||||||
|
static settings::Bool enable{ "sandwichaim.enable", "false" };
|
||||||
|
static settings::Button aimkey{ "sandwichaim.aimkey", "<null>" };
|
||||||
|
static settings::Int aimkey_mode{ "sandwichaim.aimkey-mode", "0" };
|
||||||
|
|
||||||
|
float sandwich_speed = 350.0f;
|
||||||
|
float grav = 0.25f;
|
||||||
|
std::pair<CachedEntity *, Vector> FindBestEnt(bool teammate, bool Predict, bool zcheck)
|
||||||
|
{
|
||||||
|
CachedEntity *bestent = nullptr;
|
||||||
|
float bestscr = FLT_MAX;
|
||||||
|
Vector predicted{};
|
||||||
|
for (int i = 0; i < g_IEngine->GetMaxClients(); i++)
|
||||||
|
{
|
||||||
|
CachedEntity *ent = ENTITY(i);
|
||||||
|
if (CE_BAD(ent) || !(ent->m_bAlivePlayer()) ||
|
||||||
|
(teammate && ent->m_iTeam() != LOCAL_E->m_iTeam()) || ent == LOCAL_E)
|
||||||
|
continue;
|
||||||
|
if (!teammate && ent->m_iTeam() == LOCAL_E->m_iTeam())
|
||||||
|
continue;
|
||||||
|
if (!ent->hitboxes.GetHitbox(1))
|
||||||
|
continue;
|
||||||
|
Vector target{};
|
||||||
|
if (Predict)
|
||||||
|
target = ProjectilePrediction(ent, 1, sandwich_speed, grav,
|
||||||
|
PlayerGravityMod(ent));
|
||||||
|
else
|
||||||
|
target = ent->hitboxes.GetHitbox(1)->center;
|
||||||
|
if (!IsEntityVectorVisible(ent, target))
|
||||||
|
continue;
|
||||||
|
if (zcheck && (ent->m_vecOrigin().z - LOCAL_E->m_vecOrigin().z) > 80.0f)
|
||||||
|
continue;
|
||||||
|
float scr = ent->m_flDistance();
|
||||||
|
if (g_pPlayerResource->GetClass(ent) == tf_medic)
|
||||||
|
scr *= 0.1f;
|
||||||
|
if (scr < bestscr)
|
||||||
|
{
|
||||||
|
bestent = ent;
|
||||||
|
predicted = target;
|
||||||
|
bestscr = scr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {bestent, predicted};
|
||||||
|
}
|
||||||
|
static HookedFunction
|
||||||
|
SandwichAim(HookedFunctions_types::HF_CreateMove, "SandwichAim", 1, []() {
|
||||||
|
if (!*enable)
|
||||||
|
return;
|
||||||
|
if (CE_BAD(LOCAL_E) || !LOCAL_E->m_bAlivePlayer())
|
||||||
|
return;
|
||||||
|
if (aimkey)
|
||||||
|
{
|
||||||
|
switch (*aimkey_mode)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
if (!aimkey.isKeyDown())
|
||||||
|
return;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if (aimkey.isKeyDown())
|
||||||
|
return;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (LOCAL_W->m_iClassID() != CL_CLASS(CTFLunchBox))
|
||||||
|
return;
|
||||||
|
Vector Predict;
|
||||||
|
CachedEntity *bestent = nullptr;
|
||||||
|
std::pair<CachedEntity *, Vector> result{};
|
||||||
|
result = FindBestEnt(true, true, false);
|
||||||
|
bestent = result.first;
|
||||||
|
Predict = result.second;
|
||||||
|
if (bestent)
|
||||||
|
{
|
||||||
|
Vector tr = Predict - g_pLocalPlayer->v_Eye;
|
||||||
|
Vector angles;
|
||||||
|
VectorAngles(tr, angles);
|
||||||
|
// Clamping is important
|
||||||
|
fClampAngle(angles);
|
||||||
|
current_user_cmd->viewangles = angles;
|
||||||
|
current_user_cmd->buttons |= IN_ATTACK2;
|
||||||
|
g_pLocalPlayer->bUseSilentAngles = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
static settings::Bool charge_aim{ "chargeaim.enable", "false"};
|
||||||
|
static HookedFunction ChargeAimbot(HookedFunctions_types::HF_CreateMove, "ChargeAim", 1, [](){
|
||||||
|
if (!*charge_aim)
|
||||||
|
return;
|
||||||
|
if (CE_BAD(LOCAL_E) || !LOCAL_E->m_bAlivePlayer())
|
||||||
|
return;
|
||||||
|
if (!HasCondition<TFCond_Charging>(LOCAL_E))
|
||||||
|
return;
|
||||||
|
std::pair<CachedEntity *, Vector> result{};
|
||||||
|
result = FindBestEnt(false, false, true);
|
||||||
|
CachedEntity *bestent = result.first;
|
||||||
|
if (bestent && result.second.IsValid())
|
||||||
|
{
|
||||||
|
Vector tr = result.second - g_pLocalPlayer->v_Eye;
|
||||||
|
Vector angles;
|
||||||
|
VectorAngles(tr, angles);
|
||||||
|
// Clamping is important
|
||||||
|
fClampAngle(angles);
|
||||||
|
current_user_cmd->viewangles = angles;
|
||||||
|
current_user_cmd->buttons |= IN_ATTACK2;
|
||||||
|
g_pLocalPlayer->bUseSilentAngles = true;
|
||||||
|
}
|
||||||
|
});
|
@ -182,9 +182,9 @@ CachedEntity *NearestEnemy()
|
|||||||
return bestent;
|
return bestent;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
Timer cdr{};
|
Timer ammo_health_cooldown{};
|
||||||
Timer cd2{};
|
Timer init_timer{};
|
||||||
Timer cd3{};
|
Timer nav_cooldown{};
|
||||||
Timer engi_spot_cd{};
|
Timer engi_spot_cd{};
|
||||||
Timer nav_enemy_cd{};
|
Timer nav_enemy_cd{};
|
||||||
std::vector<Vector> preferred_sniper_spots;
|
std::vector<Vector> preferred_sniper_spots;
|
||||||
@ -217,9 +217,9 @@ void initonce()
|
|||||||
for (int i = 0; i < afkTicks.size(); i++)
|
for (int i = 0; i < afkTicks.size(); i++)
|
||||||
afkTicks[i].update();
|
afkTicks[i].update();
|
||||||
priority_spots.clear();
|
priority_spots.clear();
|
||||||
cdr.update();
|
ammo_health_cooldown.update();
|
||||||
cd2.update();
|
init_timer.update();
|
||||||
cd3.update();
|
nav_cooldown.update();
|
||||||
engi_spot_cd.update();
|
engi_spot_cd.update();
|
||||||
sniper_spots.clear();
|
sniper_spots.clear();
|
||||||
preferred_sniper_spots.clear();
|
preferred_sniper_spots.clear();
|
||||||
@ -451,7 +451,7 @@ static HookedFunction
|
|||||||
if (*stay_near && nav_enemy_cd.test_and_set(1000) &&
|
if (*stay_near && nav_enemy_cd.test_and_set(1000) &&
|
||||||
(!HasLowAmmo()) & (!HasLowHealth()))
|
(!HasLowAmmo()) & (!HasLowHealth()))
|
||||||
NavToEnemy();
|
NavToEnemy();
|
||||||
if (HasLowHealth() && cdr.test_and_set(5000))
|
if (HasLowHealth() && ammo_health_cooldown.test_and_set(5000))
|
||||||
{
|
{
|
||||||
CachedEntity *med = nearestHealth();
|
CachedEntity *med = nearestHealth();
|
||||||
if (CE_GOOD(med))
|
if (CE_GOOD(med))
|
||||||
@ -461,7 +461,7 @@ static HookedFunction
|
|||||||
nav::NavTo(med->m_vecOrigin(), true, true, 7);
|
nav::NavTo(med->m_vecOrigin(), true, true, 7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (HasLowAmmo() && cdr.test_and_set(5000))
|
if (HasLowAmmo() && ammo_health_cooldown.test_and_set(5000))
|
||||||
{
|
{
|
||||||
CachedEntity *ammo = nearestAmmo();
|
CachedEntity *ammo = nearestAmmo();
|
||||||
if (CE_GOOD(ammo))
|
if (CE_GOOD(ammo))
|
||||||
@ -488,7 +488,7 @@ static HookedFunction
|
|||||||
g_GlobalVars->curtime)
|
g_GlobalVars->curtime)
|
||||||
{
|
{
|
||||||
waittime = 1000;
|
waittime = 1000;
|
||||||
cd3.update();
|
nav_cooldown.update();
|
||||||
if (nav::priority == 1337)
|
if (nav::priority == 1337)
|
||||||
nav::clearInstructions();
|
nav::clearInstructions();
|
||||||
nav::NavTo(GetBuildingPosition(ent), false, false);
|
nav::NavTo(GetBuildingPosition(ent), false, false);
|
||||||
@ -499,20 +499,20 @@ static HookedFunction
|
|||||||
{
|
{
|
||||||
if (!nav::ReadyForCommands && !spy_mode && !heavy_mode &&
|
if (!nav::ReadyForCommands && !spy_mode && !heavy_mode &&
|
||||||
!engi_mode)
|
!engi_mode)
|
||||||
cd3.update();
|
nav_cooldown.update();
|
||||||
if (target_sentry && NavToSentry(3))
|
if (target_sentry && NavToSentry(3))
|
||||||
return;
|
return;
|
||||||
bool isready = (spy_mode || heavy_mode || engi_mode)
|
bool isready = (spy_mode || heavy_mode || engi_mode)
|
||||||
? true
|
? true
|
||||||
: nav::ReadyForCommands;
|
: nav::ReadyForCommands;
|
||||||
if (isready && cd3.test_and_set(waittime))
|
if (isready && nav_cooldown.test_and_set(waittime))
|
||||||
{
|
{
|
||||||
waittime =
|
waittime =
|
||||||
/*(spy_mode || heavy_mode || engi_mode) ? 100 : 2000*/ 0;
|
/*(spy_mode || heavy_mode || engi_mode) ? 100 : 2000*/ 0;
|
||||||
if (!spy_mode && !heavy_mode && !engi_mode)
|
if (!spy_mode && !heavy_mode && !engi_mode)
|
||||||
{
|
{
|
||||||
cd3.update();
|
nav_cooldown.update();
|
||||||
if (cd2.test_and_set(5000))
|
if (init_timer.test_and_set(5000))
|
||||||
Init();
|
Init();
|
||||||
if (!NavToSniperSpot(5))
|
if (!NavToSniperSpot(5))
|
||||||
waittime = 1;
|
waittime = 1;
|
||||||
@ -522,7 +522,7 @@ static HookedFunction
|
|||||||
CachedEntity *tar = NearestEnemy();
|
CachedEntity *tar = NearestEnemy();
|
||||||
if (CE_BAD(tar) && last_tar == -1 && nav::ReadyForCommands)
|
if (CE_BAD(tar) && last_tar == -1 && nav::ReadyForCommands)
|
||||||
{
|
{
|
||||||
if (cd2.test_and_set(5000))
|
if (init_timer.test_and_set(5000))
|
||||||
Init();
|
Init();
|
||||||
if (!NavToSniperSpot(4))
|
if (!NavToSniperSpot(4))
|
||||||
waittime = 1;
|
waittime = 1;
|
||||||
@ -535,25 +535,36 @@ static HookedFunction
|
|||||||
if (!nav::NavTo(tar->m_vecOrigin(), false))
|
if (!nav::NavTo(tar->m_vecOrigin(), false))
|
||||||
last_tar = -1;
|
last_tar = -1;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
auto unsorted_ticks = hacks::shared::backtrack::headPositions[tar->m_IDX];
|
{
|
||||||
std::vector<hacks::shared::backtrack::BacktrackData> sorted_ticks;
|
auto unsorted_ticks = hacks::shared::backtrack::
|
||||||
for (int i = 0; i < 66; i++) {
|
headPositions[tar->m_IDX];
|
||||||
if (hacks::shared::backtrack::ValidTick(unsorted_ticks[i], tar))
|
std::vector<hacks::shared::backtrack::BacktrackData>
|
||||||
|
sorted_ticks;
|
||||||
|
for (int i = 0; i < 66; i++)
|
||||||
|
{
|
||||||
|
if (hacks::shared::backtrack::ValidTick(
|
||||||
|
unsorted_ticks[i], tar))
|
||||||
sorted_ticks.push_back(unsorted_ticks[i]);
|
sorted_ticks.push_back(unsorted_ticks[i]);
|
||||||
}
|
}
|
||||||
if (sorted_ticks.empty()) {
|
if (sorted_ticks.empty())
|
||||||
|
{
|
||||||
if (!nav::NavTo(tar->m_vecOrigin(), false))
|
if (!nav::NavTo(tar->m_vecOrigin(), false))
|
||||||
last_tar = -1;
|
last_tar = -1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::sort(sorted_ticks.begin(), sorted_ticks.end(),
|
std::sort(
|
||||||
[](const hacks::shared::backtrack::BacktrackData &a,
|
sorted_ticks.begin(), sorted_ticks.end(),
|
||||||
const hacks::shared::backtrack::BacktrackData &b) {
|
[](const hacks::shared::backtrack::BacktrackData
|
||||||
return a.tickcount > b.tickcount;
|
&a,
|
||||||
});
|
const hacks::shared::backtrack::BacktrackData
|
||||||
|
&b) {
|
||||||
|
return a.tickcount > b.tickcount;
|
||||||
|
});
|
||||||
|
|
||||||
if (!sorted_ticks[5].tickcount || nav::NavTo(sorted_ticks[5].entorigin, false, false))
|
if (!sorted_ticks[5].tickcount ||
|
||||||
|
nav::NavTo(sorted_ticks[5].entorigin, false,
|
||||||
|
false))
|
||||||
if (!nav::NavTo(tar->m_vecOrigin(), false))
|
if (!nav::NavTo(tar->m_vecOrigin(), false))
|
||||||
last_tar = -1;
|
last_tar = -1;
|
||||||
}
|
}
|
||||||
@ -563,7 +574,7 @@ static HookedFunction
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Init things
|
// Init things
|
||||||
if (cd2.test_and_set(5000))
|
if (init_timer.test_and_set(5000))
|
||||||
Init();
|
Init();
|
||||||
// If No spots set just return
|
// If No spots set just return
|
||||||
if (nest_spots.empty())
|
if (nest_spots.empty())
|
||||||
@ -674,7 +685,7 @@ static HookedFunction
|
|||||||
else if (sniper_spots.size() &&
|
else if (sniper_spots.size() &&
|
||||||
nav::ReadyForCommands)
|
nav::ReadyForCommands)
|
||||||
{
|
{
|
||||||
if (cd2.test_and_set(5000))
|
if (init_timer.test_and_set(5000))
|
||||||
Init();
|
Init();
|
||||||
if (!NavToSniperSpot(1))
|
if (!NavToSniperSpot(1))
|
||||||
waittime = 1;
|
waittime = 1;
|
||||||
|
@ -165,8 +165,7 @@ class HurtListener : public IGameEventListener
|
|||||||
public:
|
public:
|
||||||
virtual void FireGameEvent(KeyValues *event)
|
virtual void FireGameEvent(KeyValues *event)
|
||||||
{
|
{
|
||||||
if (strcmp("player_hurt", event->GetName()) &&
|
if (strcmp("player_hurt", event->GetName()))
|
||||||
strcmp("player_death", event->GetName()))
|
|
||||||
return;
|
return;
|
||||||
if (g_IEngine->GetPlayerForUserID(event->GetInt("attacker")) ==
|
if (g_IEngine->GetPlayerForUserID(event->GetInt("attacker")) ==
|
||||||
g_IEngine->GetLocalPlayer())
|
g_IEngine->GetLocalPlayer())
|
||||||
@ -174,9 +173,7 @@ public:
|
|||||||
if (CE_GOOD(LOCAL_W) &&
|
if (CE_GOOD(LOCAL_W) &&
|
||||||
(LOCAL_W->m_iClassID() == CL_CLASS(CTFSniperRifle) ||
|
(LOCAL_W->m_iClassID() == CL_CLASS(CTFSniperRifle) ||
|
||||||
LOCAL_W->m_iClassID() == CL_CLASS(CTFSniperRifleDecap)))
|
LOCAL_W->m_iClassID() == CL_CLASS(CTFSniperRifleDecap)))
|
||||||
OnHit(strcmp("player_death", event->GetName())
|
OnHit(event->GetBool("crit"));
|
||||||
? event->GetBool("crit")
|
|
||||||
: true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -26,7 +26,8 @@ static settings::Bool engine_pred{ "misc.engine-prediction", "false" };
|
|||||||
static settings::Bool debug_projectiles{ "debug.projectiles", "false" };
|
static settings::Bool debug_projectiles{ "debug.projectiles", "false" };
|
||||||
static settings::Int semiauto{ "misc.semi-auto", "0" };
|
static settings::Int semiauto{ "misc.semi-auto", "0" };
|
||||||
static settings::Int fakelag_amount{ "misc.fakelag", "0" };
|
static settings::Int fakelag_amount{ "misc.fakelag", "0" };
|
||||||
static settings::Bool auto_disguise{ "misc.autodisguise", "true" };
|
static settings::Bool auto_disguise{ "misc.autodisguise", "false" };
|
||||||
|
static settings::Bool fuckmode{ "misc.fuckmode", "false" };
|
||||||
|
|
||||||
class CMoveData;
|
class CMoveData;
|
||||||
#if LAGBOT_MODE
|
#if LAGBOT_MODE
|
||||||
@ -142,9 +143,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
|
|||||||
{
|
{
|
||||||
if (CE_GOOD(LOCAL_W) && minigun_jump &&
|
if (CE_GOOD(LOCAL_W) && minigun_jump &&
|
||||||
LOCAL_W->m_iClassID() == CL_CLASS(CTFMinigun))
|
LOCAL_W->m_iClassID() == CL_CLASS(CTFMinigun))
|
||||||
{
|
|
||||||
CE_INT(LOCAL_W, netvar.iWeaponState) = 0;
|
CE_INT(LOCAL_W, netvar.iWeaponState) = 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
ret = original::CreateMove(this_, input_sample_time, cmd);
|
ret = original::CreateMove(this_, input_sample_time, cmd);
|
||||||
@ -201,6 +200,12 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
|
|||||||
ipc::UpdateServerAddress();
|
ipc::UpdateServerAddress();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
if (*fuckmode)
|
||||||
|
{
|
||||||
|
static int prevbuttons = 0;
|
||||||
|
current_user_cmd->buttons |= prevbuttons;
|
||||||
|
prevbuttons |= current_user_cmd->buttons;
|
||||||
|
}
|
||||||
hooked_methods::CreateMove();
|
hooked_methods::CreateMove();
|
||||||
|
|
||||||
if (nolerp)
|
if (nolerp)
|
||||||
|
@ -21,7 +21,15 @@ static bool retrun = false;
|
|||||||
static Timer sendmsg{};
|
static Timer sendmsg{};
|
||||||
static Timer gitgud{};
|
static Timer gitgud{};
|
||||||
|
|
||||||
std::string clear( 200, '\n' );
|
// Using repeated char causes crash on some systems. Suboptimal solution.
|
||||||
|
const static std::string clear(
|
||||||
|
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||||
|
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||||
|
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||||
|
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||||
|
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||||
|
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||||
|
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
|
||||||
std::string lastfilter{};
|
std::string lastfilter{};
|
||||||
std::string lastname{};
|
std::string lastname{};
|
||||||
|
|
||||||
@ -60,7 +68,7 @@ DEFINE_HOOKED_METHOD(DispatchUserMessage, bool, void *this_, int type,
|
|||||||
{
|
{
|
||||||
if (!isHackActive())
|
if (!isHackActive())
|
||||||
return original::DispatchUserMessage(this_, type, buf);
|
return original::DispatchUserMessage(this_, type, buf);
|
||||||
if (retrun && gitgud.test_and_set(300))
|
if (retrun && type != 47 && gitgud.test_and_set(300))
|
||||||
{
|
{
|
||||||
PrintChat("\x07%06X%s\x01: %s", 0xe05938, lastname.c_str(),
|
PrintChat("\x07%06X%s\x01: %s", 0xe05938, lastname.c_str(),
|
||||||
lastfilter.c_str());
|
lastfilter.c_str());
|
||||||
@ -96,16 +104,14 @@ DEFINE_HOOKED_METHOD(DispatchUserMessage, bool, void *this_, int type,
|
|||||||
std::string message{};
|
std::string message{};
|
||||||
for (i = 0; i < 3; i++)
|
for (i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
int starcount = 0;
|
|
||||||
while ((c = data[j++]) && (loop_index < s))
|
while ((c = data[j++]) && (loop_index < s))
|
||||||
{
|
{
|
||||||
loop_index++;
|
loop_index++;
|
||||||
if (clean_chat)
|
if (clean_chat)
|
||||||
|
{
|
||||||
if ((c == '\n' || c == '\r') && (i == 1 || i == 2))
|
if ((c == '\n' || c == '\r') && (i == 1 || i == 2))
|
||||||
{
|
data[j - 1] = '\0';
|
||||||
data[j - 1] = '*';
|
}
|
||||||
starcount++;
|
|
||||||
}
|
|
||||||
if (i == 1)
|
if (i == 1)
|
||||||
name.push_back(c);
|
name.push_back(c);
|
||||||
if (i == 2)
|
if (i == 2)
|
||||||
@ -178,7 +184,7 @@ DEFINE_HOOKED_METHOD(DispatchUserMessage, bool, void *this_, int type,
|
|||||||
if (boost::contains(message2, filter) && !filtered)
|
if (boost::contains(message2, filter) && !filtered)
|
||||||
{
|
{
|
||||||
filtered = true;
|
filtered = true;
|
||||||
chat_stack::Say(". " + clear, true);
|
chat_stack::Say("." + clear, true);
|
||||||
retrun = true;
|
retrun = true;
|
||||||
lastfilter = format(filter);
|
lastfilter = format(filter);
|
||||||
lastname = format(name);
|
lastname = format(name);
|
||||||
|
@ -55,17 +55,11 @@ DEFINE_HOOKED_METHOD(DrawModelExecute, void, IVModelRender *this_,
|
|||||||
{
|
{
|
||||||
IClientEntity *ent = unk->GetIClientEntity();
|
IClientEntity *ent = unk->GetIClientEntity();
|
||||||
if (ent)
|
if (ent)
|
||||||
{
|
|
||||||
if (ent->entindex() == spectator_target)
|
if (ent->entindex() == spectator_target)
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ent && !effect_chams::g_EffectChams.drawing &&
|
if (ent && !effect_chams::g_EffectChams.drawing &&
|
||||||
effect_chams::g_EffectChams.ShouldRenderChams(ent))
|
effect_chams::g_EffectChams.ShouldRenderChams(ent))
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return original::DrawModelExecute(this_, state, info, bone);
|
return original::DrawModelExecute(this_, state, info, bone);
|
||||||
|
@ -150,7 +150,7 @@ CatCommand debug_get_ingame_ipc(
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
unsigned highest = 0;
|
unsigned highest = 0;
|
||||||
std::vector<unsigned> botlist{};
|
std::vector<unsigned> botlist{};
|
||||||
for (unsigned i = 1; 0 < cat_ipc::max_peers; i++)
|
for (unsigned i = 1; i < cat_ipc::max_peers; i++)
|
||||||
{
|
{
|
||||||
if (!ipc::peer->memory->peer_data[i].free)
|
if (!ipc::peer->memory->peer_data[i].free)
|
||||||
{
|
{
|
||||||
|
@ -192,6 +192,8 @@ CatCommand pl_set_state(
|
|||||||
continue;
|
continue;
|
||||||
std::string currname(info.name);
|
std::string currname(info.name);
|
||||||
std::replace(currname.begin(), currname.end(), ' ', '-');
|
std::replace(currname.begin(), currname.end(), ' ', '-');
|
||||||
|
std::replace_if(currname.begin(), currname.end(),
|
||||||
|
[](char x) { return !isprint(x); }, '*');
|
||||||
if (currname.find(name) != 0)
|
if (currname.find(name) != 0)
|
||||||
continue;
|
continue;
|
||||||
id = i;
|
id = i;
|
||||||
@ -258,6 +260,8 @@ static int cat_pl_set_state_completionCallback(
|
|||||||
continue;
|
continue;
|
||||||
std::string name(info.name);
|
std::string name(info.name);
|
||||||
std::replace(name.begin(), name.end(), ' ', '-');
|
std::replace(name.begin(), name.end(), ' ', '-');
|
||||||
|
std::replace_if(name.begin(), name.end(),
|
||||||
|
[](char x) { return !isprint(x); }, '*');
|
||||||
names.push_back(name);
|
names.push_back(name);
|
||||||
}
|
}
|
||||||
std::sort(names.begin(), names.end());
|
std::sort(names.begin(), names.end());
|
||||||
|
@ -256,7 +256,66 @@ Vector ProjectilePrediction_Engine(CachedEntity *ent, int hb, float speed,
|
|||||||
result.y - origin.y, result.z - origin.z);*/
|
result.y - origin.y, result.z - origin.z);*/
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Vector BuildingPrediction(CachedEntity *building, Vector vec, float speed,
|
||||||
|
float gravity)
|
||||||
|
{
|
||||||
|
if (!vec.z || CE_BAD(building))
|
||||||
|
return Vector();
|
||||||
|
Vector result = vec;
|
||||||
|
// if (not debug_pp_extrapolate) {
|
||||||
|
//} else {
|
||||||
|
// result = SimpleLatencyPrediction(ent, hb);
|
||||||
|
//
|
||||||
|
//}
|
||||||
|
float latency = g_IEngine->GetNetChannelInfo()->GetLatency(FLOW_OUTGOING) +
|
||||||
|
g_IEngine->GetNetChannelInfo()->GetLatency(FLOW_INCOMING);
|
||||||
|
|
||||||
|
if (speed == 0.0f)
|
||||||
|
return Vector();
|
||||||
|
trace::filter_no_player.SetSelf(RAW_ENT(building));
|
||||||
|
float dtg = DistanceToGround(vec);
|
||||||
|
// TODO ProjAim
|
||||||
|
float medianTime = g_pLocalPlayer->v_Eye.DistTo(result) / speed;
|
||||||
|
float range = 1.5f;
|
||||||
|
float currenttime = medianTime - range;
|
||||||
|
if (currenttime <= 0.0f)
|
||||||
|
currenttime = 0.01f;
|
||||||
|
float besttime = currenttime;
|
||||||
|
float mindelta = 65536.0f;
|
||||||
|
Vector bestpos = result;
|
||||||
|
int maxsteps = 300;
|
||||||
|
for (int steps = 0; steps < maxsteps;
|
||||||
|
steps++, currenttime += ((float) (2 * range) / (float) maxsteps))
|
||||||
|
{
|
||||||
|
Vector curpos = result;
|
||||||
|
curpos += 0 * currenttime;
|
||||||
|
if (debug_pp_extrapolate)
|
||||||
|
{
|
||||||
|
curpos += 0 * currenttime * latency;
|
||||||
|
}
|
||||||
|
if (dtg > 0.0f)
|
||||||
|
{
|
||||||
|
curpos.z -= currenttime * currenttime * 400.0f * 0;
|
||||||
|
if (curpos.z < result.z - dtg)
|
||||||
|
curpos.z = result.z - dtg;
|
||||||
|
}
|
||||||
|
float rockettime = g_pLocalPlayer->v_Eye.DistTo(curpos) / speed;
|
||||||
|
if (debug_pp_rockettimeping)
|
||||||
|
rockettime +=
|
||||||
|
g_IEngine->GetNetChannelInfo()->GetLatency(FLOW_OUTGOING);
|
||||||
|
if (fabs(rockettime - currenttime) < mindelta)
|
||||||
|
{
|
||||||
|
besttime = currenttime;
|
||||||
|
bestpos = curpos;
|
||||||
|
mindelta = fabs(rockettime - currenttime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (debug_pp_rockettimeping)
|
||||||
|
besttime += g_IEngine->GetNetChannelInfo()->GetLatency(FLOW_OUTGOING);
|
||||||
|
bestpos.z += (400 * besttime * besttime * gravity);
|
||||||
|
// S = at^2/2 ; t = sqrt(2S/a)*/
|
||||||
|
return bestpos;
|
||||||
|
}
|
||||||
Vector ProjectilePrediction(CachedEntity *ent, int hb, float speed,
|
Vector ProjectilePrediction(CachedEntity *ent, int hb, float speed,
|
||||||
float gravitymod, float entgmod)
|
float gravitymod, float entgmod)
|
||||||
{
|
{
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
#include "projlogging.hpp"
|
#include "projlogging.hpp"
|
||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
|
|
||||||
|
Vector prevloc[2048]{};
|
||||||
namespace projectile_logging
|
namespace projectile_logging
|
||||||
{
|
{
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
for (int i = 1; i < HIGHEST_ENTITY; i++)
|
for (int i = 1; i < HIGHEST_ENTITY; i++)
|
||||||
@ -18,13 +18,31 @@ void Update()
|
|||||||
CachedEntity *ent = ENTITY(i);
|
CachedEntity *ent = ENTITY(i);
|
||||||
if (CE_BAD(ent))
|
if (CE_BAD(ent))
|
||||||
continue;
|
continue;
|
||||||
if (ent->m_Type() == ENTITY_PROJECTILE)
|
const model_t *model = RAW_ENT(ent)->GetModel();
|
||||||
|
bool issandwich = false;
|
||||||
|
if (model && tickcount % 33 == 0)
|
||||||
{
|
{
|
||||||
int owner = CE_INT(ent, 0x894) & 0xFFF;
|
std::string model_name(g_IModelInfo->GetModelName(model));
|
||||||
|
if (model_name.find("plate") != std::string::npos)
|
||||||
|
{
|
||||||
|
issandwich = true;
|
||||||
|
Vector abs_orig = RAW_ENT(ent)->GetAbsOrigin();
|
||||||
|
float movement = prevloc[i].DistTo(abs_orig);
|
||||||
|
logging::Info("Sandwich movement: %f", movement);
|
||||||
|
prevloc[i] = abs_orig;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ent->m_Type() == ENTITY_PROJECTILE || issandwich)
|
||||||
|
{
|
||||||
|
/*int owner = CE_INT(ent, 0x894) & 0xFFF;
|
||||||
if (owner != LOCAL_W->m_IDX)
|
if (owner != LOCAL_W->m_IDX)
|
||||||
continue;
|
continue;*/
|
||||||
if (tickcount % 20 == 0)
|
if (tickcount % 20 == 0)
|
||||||
{
|
{
|
||||||
|
Vector abs_orig = RAW_ENT(ent)->GetAbsOrigin();
|
||||||
|
float movement = prevloc[i].DistTo(abs_orig);
|
||||||
|
logging::Info("movement: %f", movement);
|
||||||
|
prevloc[i] = abs_orig;
|
||||||
const Vector &v = ent->m_vecVelocity;
|
const Vector &v = ent->m_vecVelocity;
|
||||||
const Vector &a = ent->m_vecAcceleration;
|
const Vector &a = ent->m_vecAcceleration;
|
||||||
Vector eav;
|
Vector eav;
|
||||||
|
@ -9,9 +9,9 @@
|
|||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
#include <settings/Bool.hpp>
|
#include <settings/Bool.hpp>
|
||||||
|
|
||||||
static settings::Bool requeue{ "hack.requeue-on-kick", "false" };
|
static settings::Bool vote_kicky{ "votelogger.autovote.yes", "false" };
|
||||||
static settings::Bool vote_kicky{ "hack.autovote.yes", "false" };
|
static settings::Bool vote_kickn{ "votelogger.autovote.no", "false" };
|
||||||
static settings::Bool vote_kickn{ "hack.autovote.no", "false" };
|
static settings::Bool party_say{ "votelogger.partysay", "true" };
|
||||||
|
|
||||||
namespace votelogger
|
namespace votelogger
|
||||||
{
|
{
|
||||||
@ -29,9 +29,8 @@ void dispatchUserMessage(bf_read &buffer, int type)
|
|||||||
{
|
{
|
||||||
// TODO: Add always vote no/vote no on friends. Cvar is "vote option2"
|
// TODO: Add always vote no/vote no on friends. Cvar is "vote option2"
|
||||||
was_local_player = false;
|
was_local_player = false;
|
||||||
auto caller = (unsigned char) buffer.ReadByte();
|
int team = buffer.ReadByte();
|
||||||
// unknown
|
int caller = buffer.ReadByte();
|
||||||
buffer.ReadByte();
|
|
||||||
char reason[64];
|
char reason[64];
|
||||||
char name[64];
|
char name[64];
|
||||||
buffer.ReadString(reason, 64, false, nullptr);
|
buffer.ReadString(reason, 64, false, nullptr);
|
||||||
@ -41,9 +40,12 @@ void dispatchUserMessage(bf_read &buffer, int type)
|
|||||||
eid >>= 1;
|
eid >>= 1;
|
||||||
|
|
||||||
unsigned steamID = 0;
|
unsigned steamID = 0;
|
||||||
player_info_s info{};
|
// info is the person getting kicked,
|
||||||
if (g_IEngine->GetPlayerInfo(eid, &info))
|
// info2 is the person calling the kick.
|
||||||
steamID = info.friendsID;
|
player_info_s info{}, info2{};
|
||||||
|
if (!g_IEngine->GetPlayerInfo(eid, &info))
|
||||||
|
break;
|
||||||
|
steamID = info.friendsID;
|
||||||
if (eid == LOCAL_E->m_IDX)
|
if (eid == LOCAL_E->m_IDX)
|
||||||
was_local_player = true;
|
was_local_player = true;
|
||||||
if (*vote_kickn)
|
if (*vote_kickn)
|
||||||
@ -58,14 +60,32 @@ void dispatchUserMessage(bf_read &buffer, int type)
|
|||||||
playerlist::AccessData(info.friendsID).state ==
|
playerlist::AccessData(info.friendsID).state ==
|
||||||
playerlist::k_EState::DEFAULT)
|
playerlist::k_EState::DEFAULT)
|
||||||
g_IEngine->ClientCmd_Unrestricted("vote option1");
|
g_IEngine->ClientCmd_Unrestricted("vote option1");
|
||||||
|
if (*party_say)
|
||||||
|
{
|
||||||
|
if (g_IEngine->GetPlayerInfo(caller, &info2))
|
||||||
|
{
|
||||||
|
// because tf2 is stupid and doesn't have escape characters,
|
||||||
|
// use the greek question marks instead. big brain.
|
||||||
|
// Clang-format why, TODO: Don't use format func
|
||||||
|
g_IEngine->ExecuteClientCmd(
|
||||||
|
format("say_party [CAT] votekick called: ",
|
||||||
|
boost::replace_all_copy((std::string) info2.name,
|
||||||
|
";", ";"),
|
||||||
|
" => ",
|
||||||
|
boost::replace_all_copy((std::string) info.name, ";",
|
||||||
|
";"),
|
||||||
|
" (", reason, ")")
|
||||||
|
.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
logging::Info("Vote called to kick %s [U:1:%u] for %s", name, steamID,
|
logging::Info("Vote called to kick %s [U:1:%u] for %s", name, steamID,
|
||||||
reason);
|
reason);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 47:
|
case 47:
|
||||||
logging::Info("Vote passed");
|
logging::Info("Vote passed");
|
||||||
if (was_local_player && requeue)
|
// if (was_local_player && requeue)
|
||||||
tfmm::startQueue();
|
// tfmm::startQueue();
|
||||||
break;
|
break;
|
||||||
case 48:
|
case 48:
|
||||||
logging::Info("Vote failed");
|
logging::Info("Vote failed");
|
||||||
|
Reference in New Issue
Block a user