Added Zoom Distance to Aimbot

added zoom distance to aimbot because it's useful :)
This commit is contained in:
MasterCatPL 2024-04-12 20:42:31 +02:00
parent 8499408f6b
commit b4690eac1d
6 changed files with 21 additions and 14 deletions

View File

@ -64,7 +64,7 @@ set(EnableProfiler 0 CACHE BOOL "Enable Profiler")
set(EnableGUI 1 CACHE BOOL "Enable GUI")
set(EnableIPC 1 CACHE BOOL "Enable IPC")
set(DataPath "/opt/cathook/data" CACHE FILEPATH "Data location")
set(VACBypass 0 CACHE BOOL "Textmode VAC bypass")
set(VACBypass 1 CACHE BOOL "Textmode VAC bypass")
set(EnableTextmodeStdin 0 CACHE BOOL "Textmode Stdin -> Console bridge (EXPERIMENTAL)")
set(EnableWarnings 0 CACHE BOOL "Enable compile warnings")
set(EnableNullNexus 1 CACHE BOOL "Enable NullNexus chat and other features")

10
TODO
View File

@ -1,13 +1,15 @@
update CGameRules and fix navbot
fix bot fail during path after respawn in navparser
fix crashes (i hope BenCat07 will fix it)
fix EventLogging (crash)
fix skyboxchanger (not working and crash)
add zoom and rev distance to cathook (optional)
add rev distance to cathook (optional)
fix hitbox update in ESP (crash) i had delete it
fix hitboxupdate in ESP (crash) i had delete it
need regenerate nav files
update ClassIDs

View File

@ -104,7 +104,7 @@
<AutoVariable width="fill" target="aimbot.target.ignore-deadringer" label="Ignore Dead Ringer"/>
</List>
</Box>
<Box padding="12 6 6 6" width="content" height="content" name="Autoshoot" x="170" y="290">
<Box padding="12 6 6 6" width="content" height="content" name="Autoshoot" x="170" y="270">
<List width="150">
<AutoVariable width="fill" target="aimbot.autoshoot" label="Enable autoshoot" tooltip="Make the aimbot automatically fire your weapon."/>
<AutoVariable width="fill" target="aimbot.wait-for-charge" label="Wait for charge" tooltip="Hold fire until a single shot is enough to kill the target."/>
@ -112,6 +112,7 @@
<AutoVariable width="fill" target="aimbot.auto.spin-up" label="Auto spin-up" tooltip="Spin up the minigun automatically if an enemy is found."/>
<AutoVariable width="fill" target="aimbot.auto.tapfire" label="Tapfire minigun"/>
<AutoVariable width="fill" target="aimbot.auto.zoom" label="Auto zoom" tooltip="Intelligently zoom if applicable to current weapon type."/>
<AutoVariable width="fill" target="aimbot.zoom.distance" label="Zoom distance"/>
<AutoVariable width="fill" target="aimbot.auto.unzoom" label="Auto unzoom" tooltip="Intelligently unzoom if applicable to current weapon type."/>
</List>
</Box>

View File

@ -1,10 +1,11 @@
/*#pragma once
#pragma once
#include <array>
#include <stdint.h>
// #include <array>
// #include <stdint.h>
namespace hacks::tf2::NavBot
{
/*
bool init(bool first_cm);
namespace task
{
@ -69,6 +70,6 @@ struct bot_class_config
float min;
float preferred;
float max;
};
};*/
std::pair<CachedEntity *, float> getNearestPlayerDistance();
} // namespace hacks::tf2::NavBot
*/

View File

@ -19,6 +19,7 @@
#include "FollowBot.hpp"
#include "Warp.hpp"
#include "AntiCheatBypass.hpp"
#include "NavBot.hpp"
namespace hacks::shared::aimbot
{
static settings::Boolean normal_enable{ "aimbot.enable", "false" };
@ -60,6 +61,7 @@ static settings::Boolean auto_spin_up{ "aimbot.auto.spin-up", "0" };
static settings::Boolean minigun_tapfire{ "aimbot.auto.tapfire", "false" };
static settings::Boolean auto_zoom{ "aimbot.auto.zoom", "0" };
static settings::Boolean auto_unzoom{ "aimbot.auto.unzoom", "0" };
static settings::Int zoom_distance{ "aimbot.zoom.distance", "1250" }; // that's default zoom distance
static settings::Boolean backtrackAimbot{ "aimbot.backtrack", "0" };
static settings::Boolean backtrackLastTickOnly("aimbot.backtrack.only-last-tick", "true");
@ -429,6 +431,7 @@ bool validateTickFOV(tf2::backtrack::BacktrackData &tick)
void doAutoZoom(bool target_found)
{
bool isIdle = target_found ? false : hacks::shared::followbot::isIdle();
auto nearest = hacks::tf2::NavBot::getNearestPlayerDistance();
// Keep track of our zoom time
static Timer zoomTime{};
@ -443,14 +446,14 @@ void doAutoZoom(bool target_found)
return;
}
if (auto_zoom && g_pLocalPlayer->holding_sniper_rifle && (target_found || isIdle))
if (auto_zoom && g_pLocalPlayer->holding_sniper_rifle && (target_found || isIdle || nearest.second < *zoom_distance))
{
if (target_found)
zoomTime.update();
if (not g_pLocalPlayer->bZoomed)
current_user_cmd->buttons |= IN_ATTACK2;
}
else if (!target_found)
else if (!target_found && nearest.second >= *zoom_distance)
{
// Auto-Unzoom
if (auto_unzoom)

View File

@ -255,7 +255,7 @@ void refreshSniperSpots()
sniper_spots.emplace_back(hiding_spot.m_pos);
}
static std::pair<CachedEntity *, float> getNearestPlayerDistance()
std::pair<CachedEntity *, float> getNearestPlayerDistance()
{
float distance = FLT_MAX;
CachedEntity *best_ent = nullptr;