Merge branch 'master' of https://github.com/nullifiedcat/cathook/
This commit is contained in:
commit
9f7fe4ab85
@ -96,9 +96,7 @@ static CatVar aimbot_debug(CV_SWITCH, "aimbot_debug", "0", "Aimbot Debug", "Disp
|
||||
static CatVar engine_projpred(CV_SWITCH, "debug_aimbot_engine_pp", "0", "Engine ProjPred");
|
||||
// Followbot vars
|
||||
static CatVar auto_spin_up(CV_SWITCH, "aimbot_spin_up", "0", "Auto Spin Up", "Spin up minigun if you can see target, useful for followbots");
|
||||
/* TODO IMPLEMENT
|
||||
static CatVar auto_zoom(CV_SWITCH, "aimbot_auto_zoom", "0", "Auto Zoom", "Automatically zoom in if you can see target, useful for followbots");
|
||||
*/
|
||||
|
||||
static CatVar fovcircle_opacity(CV_FLOAT, "aimbot_fov_draw_opacity", "0.7", "FOV Circle Opacity", "Defines opacity of FOV circle", 0.0f, 1.0f);
|
||||
static CatVar rageonly(CV_SWITCH, "aimbot_rage_only", "0", "Ignore non-rage targets", "Use playerlist to set up rage targets");
|
||||
@ -370,9 +368,26 @@ bool IsTargetStateGood(CachedEntity* entity) {
|
||||
IF_GAME (IsTF()) {
|
||||
// If settings allow waiting for charge, and current charge cant kill target, dont aim
|
||||
if (wait_for_charge && g_pLocalPlayer->holding_sniper_rifle) {
|
||||
float bdmg = CE_FLOAT(g_pLocalPlayer->weapon(), netvar.flChargedDamage);
|
||||
if (g_GlobalVars->curtime - g_pLocalPlayer->flZoomBegin <= 1.0f) bdmg = 50.0f;
|
||||
if ((bdmg * 3) < (HasDarwins(entity) ? (entity->m_iHealth * 1.15) : entity->m_iHealth)) {
|
||||
|
||||
// Grab netvar for current charge damage and multiply by 3 for headshot
|
||||
float cdmg = CE_FLOAT(LOCAL_W, netvar.flChargedDamage) * 3;
|
||||
|
||||
// Darwins damage correction, Darwins protects against 15% of damage
|
||||
if (HasDarwins(entity))
|
||||
cdmg = (cdmg * .85) - 1;
|
||||
// Vaccinator damage correction, Vac charge protects against 75% of damage
|
||||
if (HasCondition<TFCond_UberBulletResist>(entity)) {
|
||||
cdmg = (cdmg * .25) - 1;
|
||||
// Passive bullet resist protects against 10% of damage
|
||||
} else if (HasCondition<TFCond_SmallBulletResist>(entity)) {
|
||||
cdmg = (cdmg * .90) - 1;
|
||||
}
|
||||
// Invis damage correction, Invis spies get protection from 10% of damage
|
||||
if (IsPlayerInvisible(entity))
|
||||
cdmg = (cdmg * .80) - 1;
|
||||
|
||||
// Check if player will die from headshot or if target has more health than normal overheal allows.
|
||||
if ( !(entity->m_iHealth <= 150 || entity->m_iHealth <= cdmg || !g_pLocalPlayer->bZoomed || entity->m_iHealth > entity->m_iMaxHealth + (entity->m_iMaxHealth * 0.5)) ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -458,6 +473,9 @@ bool IsTargetStateGood(CachedEntity* entity) {
|
||||
// Check if sticky aimbot is enabled
|
||||
if (!stickybot) return false;
|
||||
|
||||
// Only hitscan weapons can break stickys so check for them.
|
||||
if (!(GetWeaponMode() == weapon_hitscan || GetWeaponMode() == weapon_melee)) return false;
|
||||
|
||||
// Check if target is within range
|
||||
if (EffectiveTargetingRange()) {
|
||||
if (entity->m_flDistance > (int)EffectiveTargetingRange()) return false;
|
||||
@ -501,6 +519,7 @@ void Aim(CachedEntity* entity) {
|
||||
// Grab the targets vector, and vector it for the eye angles
|
||||
tr = (PredictEntity(entity) - g_pLocalPlayer->v_Eye);
|
||||
VectorAngles(tr, angles);
|
||||
|
||||
// Clamp angles
|
||||
fClampAngle(angles);
|
||||
|
||||
@ -516,8 +535,10 @@ void Aim(CachedEntity* entity) {
|
||||
|
||||
// A function to check whether player can autoshoot
|
||||
bool CanAutoShoot() {
|
||||
|
||||
// First check whether user settings allow autoshoot
|
||||
if (autoshoot) {
|
||||
|
||||
// A var for weapons not to use with autoshoot
|
||||
static int forbiddenWeapons[] = { CL_CLASS(CTFCompoundBow), CL_CLASS(CTFKnife) };
|
||||
int weapon_class;
|
||||
@ -532,9 +553,20 @@ bool CanAutoShoot() {
|
||||
}
|
||||
}
|
||||
|
||||
// Check if zoomed, and zoom if not, then zoom
|
||||
IF_GAME (IsTF()) {
|
||||
if (g_pLocalPlayer->clazz == tf_class::tf_sniper) {
|
||||
if (g_pLocalPlayer->holding_sniper_rifle) {
|
||||
if (auto_zoom && !HasCondition<TFCond_Zoomed>(LOCAL_E)) {
|
||||
g_pUserCmd->buttons |= IN_ATTACK2;
|
||||
attack = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check if ambassador can headshot
|
||||
IF_GAME (IsTF2()) {
|
||||
// Check if players current weapon is an ambasador
|
||||
if (IsAmbassador(g_pLocalPlayer->weapon())) {
|
||||
// Check if ambasador can headshot
|
||||
if (!AmbassadorCanHeadshot()) return false;
|
||||
@ -622,7 +654,10 @@ int BestHitbox(CachedEntity* target) {
|
||||
headonly = true;
|
||||
// If player is using an ambassador, set headonly to true
|
||||
} else if (IsAmbassador(g_pLocalPlayer->weapon())) {
|
||||
headonly = true;
|
||||
// We only want to aim for the head if the ambassador can headshot
|
||||
headonly = AmbassadorCanHeadshot();
|
||||
// 18 health is a good number to use as thats the usual minimum damage it can do with a bodyshot, but damage could potentially be higher
|
||||
if (target->m_iHealth <= 18) headonly = false;
|
||||
// If player is using a rocket based weapon, prefer the hip
|
||||
} else if (ci == CL_CLASS(CTFRocketLauncher) ||
|
||||
ci == CL_CLASS(CTFRocketLauncher_AirStrike) ||
|
||||
|
@ -13,6 +13,8 @@
|
||||
namespace hacks { namespace shared { namespace esp {
|
||||
|
||||
CatVar show_weapon(CV_SWITCH, "esp_weapon", "1", "Show weapon name", "Show which weapon does the enemy use");
|
||||
CatEnum tracers_enum({ "OFF", "CENTER", "BOTTOM" });
|
||||
CatVar tracers(tracers_enum, "esp_tracers", "0", "Tracers", "SDraws a line from the player to a position on your screen");
|
||||
CatVar local_esp(CV_SWITCH, "esp_local", "1", "ESP Local Player", "Shows local player ESP in thirdperson");
|
||||
CatVar buildings(CV_SWITCH, "esp_buildings", "1", "Building ESP", "Show buildings");
|
||||
CatVar enabled(CV_SWITCH, "esp_enabled", "0", "ESP", "Master ESP switch");
|
||||
@ -651,6 +653,25 @@ void _FASTCALL ProcessEntityPT(CachedEntity* ent) {
|
||||
}
|
||||
}
|
||||
|
||||
if (tracers && ent->m_Type == ENTITY_PLAYER) {
|
||||
|
||||
// Grab the screen resolution and save to some vars
|
||||
int width, height;
|
||||
g_IEngine->GetScreenSize(width, height);
|
||||
|
||||
// Center values on screen
|
||||
width = width / 2;
|
||||
// Only center height if we are using center mode
|
||||
if ((int)tracers == 1) height = height / 2;
|
||||
|
||||
// Get world to screen
|
||||
Vector scn;
|
||||
draw::WorldToScreen(ent->m_vecOrigin, scn);
|
||||
|
||||
// Draw a line
|
||||
drawgl::Line(scn.x, scn.y, width - scn.x, height - scn.y, fg);
|
||||
}
|
||||
|
||||
if (ent->m_Type == ENTITY_PLAYER) {
|
||||
if (joy_esp) {
|
||||
auto hb = ent->hitboxes.GetHitbox(0);
|
||||
|
@ -14,17 +14,10 @@
|
||||
namespace hacks { namespace shared { namespace followbot {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Big Followbot TODO list
|
||||
1. Fix crash when setting followbot_idx var and remove the fix var in its place
|
||||
2. Test with followbots to ensure that vector followbot and crumb followbot work as intended
|
||||
3. Clean the finished code and push to main from fork
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// User settings
|
||||
CatVar bot(CV_SWITCH, "fb_bot", "0", "Master Followbot Switch", "Set to 1 in followbots' configs");
|
||||
|
@ -213,9 +213,94 @@ void Shutdown_hook(void* _this, const char* reason) {
|
||||
|
||||
static CatVar resolver(CV_SWITCH, "resolver", "0", "Resolve angles");
|
||||
|
||||
CatEnum namesteal_enum({ "OFF", "PASSIVE", "ACTIVE" });
|
||||
CatVar namesteal(namesteal_enum, "name_stealer", "0", "Name Stealer", "Attemt to steal your teammates names. Usefull for avoiding kicks\nPassive only changes when the name stolen is no longer the best name to use\nActive Attemps to change the name whenever possible");
|
||||
|
||||
static std::string stolen_name;
|
||||
|
||||
// Func to get a new entity to steal name from
|
||||
bool StolenName(){
|
||||
|
||||
// Array to store potential namestealer targets with a bookkeeper to tell how full it is
|
||||
int potential_targets[32];
|
||||
int potential_targets_length = 0;
|
||||
|
||||
// Go through entities looking for potential targets
|
||||
for (int i = 1; i < HIGHEST_ENTITY; i++) {
|
||||
CachedEntity* ent = ENTITY(i);
|
||||
|
||||
// Check if ent is a good target
|
||||
if (!ent) continue;
|
||||
if (ent == LOCAL_E) continue;
|
||||
if (!ent->m_Type == ENTITY_PLAYER) continue;
|
||||
if (ent->m_bEnemy) continue;
|
||||
|
||||
// Check if name is current one
|
||||
player_info_s info;
|
||||
if (g_IEngine->GetPlayerInfo(ent->m_IDX, &info)) {
|
||||
|
||||
// If our name is the same as current, than change it
|
||||
if (std::string(info.name) == stolen_name) {
|
||||
// Since we found the ent we stole our name from and it is still good, if user settings are passive, then we return true and dont alter our name
|
||||
if ((int)namesteal == 1) {
|
||||
return true;
|
||||
// Otherwise we continue to change our name to something else
|
||||
} else continue;
|
||||
}
|
||||
|
||||
// a ent without a name is no ent we need, contine for a different one
|
||||
} else continue;
|
||||
|
||||
// Save the ent to our array
|
||||
potential_targets[potential_targets_length] = i;
|
||||
potential_targets_length++;
|
||||
|
||||
// With our maximum amount of players reached, dont search for anymore
|
||||
if (potential_targets_length >= 32) break;
|
||||
}
|
||||
|
||||
// Checks to prevent crashes
|
||||
if (potential_targets_length == 0) return false;
|
||||
|
||||
// Get random number that we can use with our array
|
||||
int target_random_num = floor(RandFloatRange(0, potential_targets_length - 0.1F));
|
||||
|
||||
// Get a idx from our random array position
|
||||
int new_target = potential_targets[target_random_num];
|
||||
|
||||
// Grab username of user
|
||||
player_info_s info;
|
||||
if (g_IEngine->GetPlayerInfo(new_target, &info)) {
|
||||
|
||||
// If our name is the same as current, than change it and return true
|
||||
stolen_name = std::string(info.name);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Didnt get playerinfo
|
||||
return false;
|
||||
}
|
||||
|
||||
const char* GetFriendPersonaName_hook(ISteamFriends* _this, CSteamID steamID) {
|
||||
static const GetFriendPersonaName_t original = (GetFriendPersonaName_t)hooks::steamfriends.GetMethod(offsets::GetFriendPersonaName());
|
||||
|
||||
// Check User settings if namesteal is allowed
|
||||
if (namesteal && steamID == g_ISteamUser->GetSteamID()) {
|
||||
|
||||
// We dont want to steal names while not in-game as there are no targets to steal from
|
||||
if (g_IEngine->IsInGame()) {
|
||||
|
||||
// Check if we have a username to steal, func automaticly steals a name in it.
|
||||
if (StolenName()) {
|
||||
|
||||
// Return the name that has changed from the func above
|
||||
return format(stolen_name, "\x0F").c_str();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((strlen(force_name.GetString()) > 1) && steamID == g_ISteamUser->GetSteamID()) {
|
||||
|
||||
return force_name_newlined;
|
||||
}
|
||||
return original(_this, steamID);
|
||||
|
@ -135,7 +135,6 @@
|
||||
"type": "list",
|
||||
"name": "Triggerbot Preferences",
|
||||
"list": [
|
||||
"trigger_accuracy",
|
||||
"trigger_zoomed",
|
||||
"trigger_maxrange",
|
||||
"trigger_charge",
|
||||
@ -183,6 +182,7 @@
|
||||
"esp_buildings",
|
||||
"esp_local",
|
||||
"esp_powerups",
|
||||
"esp_tracers",
|
||||
{
|
||||
"type": "list",
|
||||
"name": "Emoji ESP",
|
||||
@ -407,6 +407,7 @@
|
||||
"name",
|
||||
"fakelag",
|
||||
"disconnect_reason",
|
||||
"name_stealer",
|
||||
"minigun_jump",
|
||||
"spycrab",
|
||||
"skinchanger",
|
||||
|
Reference in New Issue
Block a user