From be955a54c47fda11bbe46fd654444883b6738e21 Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Sat, 28 Jul 2018 21:39:42 +0300 Subject: [PATCH] removing more catvars --- include/hacks/CMakeLists.txt | 1 - include/hacks/LagExploit.hpp | 22 -- src/hacks/Bunnyhop.cpp | 12 +- src/hacks/CMakeLists.txt | 1 - src/hacks/FollowBot.cpp | 1 - src/hacks/LagExploit.cpp | 584 ----------------------------- src/hacks/Noisemaker.cpp | 10 +- src/hacks/ac/aimbot.cpp | 11 +- src/hacks/ac/antiaim.cpp | 4 +- src/hacks/ac/bhop.cpp | 6 +- src/hooks/DispatchUserMessage.cpp | 16 +- src/hooks/GetFriendPersonaName.cpp | 12 +- src/hooks/LevelInit.cpp | 10 +- src/hooks/Paint.cpp | 4 +- src/hooks/SendNetMsg.cpp | 8 +- src/hooks/Shutdown.cpp | 6 +- src/hooks/others.cpp | 1 - src/online/Online.cpp | 4 +- 18 files changed, 45 insertions(+), 668 deletions(-) delete mode 100755 include/hacks/LagExploit.hpp delete mode 100644 src/hacks/LagExploit.cpp diff --git a/include/hacks/CMakeLists.txt b/include/hacks/CMakeLists.txt index 05602927..e33002f2 100644 --- a/include/hacks/CMakeLists.txt +++ b/include/hacks/CMakeLists.txt @@ -28,7 +28,6 @@ target_sources(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}/HealArrows.hpp" "${CMAKE_CURRENT_LIST_DIR}/KillSay.hpp" "${CMAKE_CURRENT_LIST_DIR}/Killstreak.hpp" - "${CMAKE_CURRENT_LIST_DIR}/LagExploit.hpp" "${CMAKE_CURRENT_LIST_DIR}/LightESP.hpp" "${CMAKE_CURRENT_LIST_DIR}/Misc.hpp" "${CMAKE_CURRENT_LIST_DIR}/Noisemaker.hpp" diff --git a/include/hacks/LagExploit.hpp b/include/hacks/LagExploit.hpp deleted file mode 100755 index 64715fbd..00000000 --- a/include/hacks/LagExploit.hpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - * LagExploit.hpp - * - * Created on: May 7, 2017 - * Author: nullifiedcat - */ - -#pragma once - -#include "common.hpp" - -// Idea from UC (instant bomb defuse thread) - -namespace hacks::shared::lagexploit -{ -extern const model_t *pointarr[5]; -extern bool bcalled; -void CreateMove(); -void Draw(); -void AddExploitTicks(int ticks); -bool ExploitActive(); -} diff --git a/src/hacks/Bunnyhop.cpp b/src/hacks/Bunnyhop.cpp index 4dbbe015..430281ff 100644 --- a/src/hacks/Bunnyhop.cpp +++ b/src/hacks/Bunnyhop.cpp @@ -5,19 +5,15 @@ * Author: nullifiedcat */ +#include #include "common.hpp" +static settings::Bool enable{ "bunnyhop.enable", "false" }; + namespace hacks::shared::bunnyhop { // Var for user settings -static CatVar - enabled(CV_SWITCH, "bhop_enabled", "0", "Bunnyhop", - "Enable Bunnyhop. All extra features like autojump and perfect " - "jump limit were temporary removed."); -// CatVar perfect_jump_limit(CV_INT, "bhop_enabled", "0", "Bunnyhop", "Enable -// Bunnyhop. All extra features like autojump and perfect jump limit were -// temporary removed."); static int ticks_last_jump = 0; // static int perfect_jumps = 0; @@ -26,7 +22,7 @@ static int ticks_last_jump = 0; void CreateMove() { // Check user settings if bhop is enabled - if (!enabled) + if (!enable) return; if (!g_pUserCmd) return; diff --git a/src/hacks/CMakeLists.txt b/src/hacks/CMakeLists.txt index de1aa694..bd7efdc8 100644 --- a/src/hacks/CMakeLists.txt +++ b/src/hacks/CMakeLists.txt @@ -26,7 +26,6 @@ if(NOT LagbotMode) "${CMAKE_CURRENT_LIST_DIR}/HealArrows.cpp" "${CMAKE_CURRENT_LIST_DIR}/KillSay.cpp" "${CMAKE_CURRENT_LIST_DIR}/Killstreak.cpp" - "${CMAKE_CURRENT_LIST_DIR}/LagExploit.cpp" "${CMAKE_CURRENT_LIST_DIR}/LightESP.cpp" "${CMAKE_CURRENT_LIST_DIR}/Misc.cpp" "${CMAKE_CURRENT_LIST_DIR}/Noisemaker.cpp" diff --git a/src/hacks/FollowBot.cpp b/src/hacks/FollowBot.cpp index 5ea3d2f9..fd155d65 100644 --- a/src/hacks/FollowBot.cpp +++ b/src/hacks/FollowBot.cpp @@ -8,7 +8,6 @@ #include "common.hpp" #include -#include #include namespace hacks::shared::followbot diff --git a/src/hacks/LagExploit.cpp b/src/hacks/LagExploit.cpp deleted file mode 100644 index a9d2da47..00000000 --- a/src/hacks/LagExploit.cpp +++ /dev/null @@ -1,584 +0,0 @@ -/* - * LagExploit.cpp - * - * Created on: May 7, 2017 - * Author: nullifiedcat - */ - -#include -#include -#include "common.hpp" - -namespace hacks::shared::lagexploit -{ - -static CatVar toggle(CV_SWITCH, "se_toggle", "0", "toggle", - "Toggle sequence exploit"); -static CatVar shoot(CV_SWITCH, "se_shoot", "0", "Instant revvup/shoot", - "Instant revvup/shoot two shots at once"); - -// SHOUTOUTS TO BLACKFIRE -static CatVar doom(CV_SWITCH, "se_doom", "0", "Shoot 2+ shots at once", - "See Center string on activation."); -static CatVar piss(CV_SWITCH, "se_piss", "0", "Piss", "Spam Jarate"); -static CatVar razorback(CV_SWITCH, "se_antirazorback", "0", "Anti-Razorback", - "Stab through razorbacks"); -static CatVar stickyspam(CV_SWITCH, "se_stickyspam", "0", "Sticky spam", - "Allows Spam of stickies simply by holding Mouse1."); -static CatVar - infinitecharge(CV_SWITCH, "se_infinite_charge", "0", - "Infinite sticky charge", - "Infinitely charge stickies, (can be used for sniping " - "and or b1g dmg using the quickiebomb launcher)"); -static CatVar cloak(CV_SWITCH, "se_cloak", "0", "Instant decloak/cloak", ""); -static CatVar cap(CV_SWITCH, "se_cap", "0", "Auto instant cap", ""); -static CatVar cart(CV_SWITCH, "se_cart", "0", "Farm cart points", - "Automatically farm points by touching " - "the cart (only works on attacking " - "team)"); -static CatVar instant_weapon_switch(CV_SWITCH, "se_switch", "0", - "Instant weapon switch", ""); -static CatVar key(CV_KEY, "se_key", "0", "Sequence exploit key"); -static CatVar weaponswitch(CV_KEY, "se_switch_key", "0", - "Switch spam key (for gru) key"); -static CatVar delay1(CV_INT, "se_switch_delay1", "0", - "Delay before switching to melee"); -static CatVar delay2(CV_INT, "se_switch_delay2", "0", - "Delay before switching to Primary"); -static CatVar - master_switch(CV_SWITCH, "se_master", "0", "Enable sequence exploit", - "Master switch for the sequence exploit\nDisabling this " - "disables everything else that uses it"); -static CatVar value(CV_INT, "se_value", "900", "Sequence exploit value", - "Value of user cmds to spam with"); -static CatVar - cap_range(CV_FLOAT, "se_cap_range", "200.0f", "Autocap range", - "Autocap range, increase if you notice that you only lagy " - "once you are already in the cap zone"); -CatCommand do_lagexploit("se_do", "Sequence exploit (for use in scripts)", - []() { AddExploitTicks(6); }); -int exticks = 0; -const model_t *pointarr[5] = { nullptr, nullptr, nullptr, nullptr, nullptr }; -bool bcalled = false; -void AddExploitTicks(int ticks) -{ - exticks = std::max(ticks, exticks); -} -bool active = false; -bool ExploitActive() -{ - if (toggle) - return true; - if (exticks > 0) - { - return true; - } - if (g_IInputSystem->IsButtonDown((ButtonCode_t)((int) key))) - { - return true; - } - if (active) - return true; - return false; -} - -static CatVar infinite_packs(CV_SWITCH, "infinite_packs", "0", - "Infinite Pickups", - "Activate sequence exploit when standing on " - "pickups while having not full HP/Ammo"); -float servertime, nextattack, nextattack2; -static int lastwep = 0; -void CreateMove() -{ - if (!bcalled) - for (int i = 1; i < HIGHEST_ENTITY; i++) - { - CachedEntity *pEnt = ENTITY(i); - if (!CE_GOOD(pEnt)) - continue; - const model_t *model = RAW_ENT(pEnt)->GetModel(); - if (!model) - continue; - const char *model_name = g_IModelInfo->GetModelName(model); - if (strstr("models/props_gameplay/cap_point_base.mdl", model_name)) - pointarr[0] = model; - if (strstr("models/props_trainyard/bomb_cart.mdl", model_name)) - pointarr[1] = model; - if (strstr("models/props_2fort/trainwheel001.mdl", model_name)) - pointarr[2] = model; - if (strstr("models/custom/dirty_bomb_cart.mdl", model_name)) - pointarr[3] = model; - if (strstr("models/props_trainyard/bomb_cart_red.mdl", model_name)) - pointarr[4] = model; - } - bcalled = true; - if (!master_switch) - return; - active = false; - if (CE_BAD(LOCAL_E)) - return; - if (!LOCAL_E->m_bAlivePlayer()) - return; - if (exticks > 0) - exticks--; - int classid = LOCAL_W->m_iClassID(); - if (!exticks) - { - // Infinite pickups (health and ammo) - if (infinite_packs && CE_GOOD(LOCAL_E)) - { - ICollideable *p = RAW_ENT(LOCAL_E)->GetCollideable(); - const Vector &max1 = - p->OBBMaxs() + RAW_ENT(LOCAL_E)->GetAbsOrigin(); - const Vector &min1 = - p->OBBMins() + RAW_ENT(LOCAL_E)->GetAbsOrigin(); - for (int i = 1; i < entity_cache::max; i++) - { - CachedEntity *e = ENTITY(i); - // CE_BAD is used to prevent removeconding on empty spaces where - // the item hasn't respawned Class check to ensure entity is - // pickup item - if (CE_BAD(e) || e->m_iClassID() != CL_CLASS(CBaseAnimating)) - { - continue; - } - - ICollideable *c = RAW_ENT(e)->GetCollideable(); - - // Bounds check - const Vector &max2 = - c->OBBMaxs() + e->m_vecOrigin() + Vector(8, 8, 8); - const Vector &min2 = - c->OBBMins() + e->m_vecOrigin() - Vector(8, 8, 8); - if ((min1.x <= max2.x && max1.x >= min2.x) && - (min1.y <= max2.y && max1.y >= min2.y) && - (min1.z <= max2.z && max1.z >= min2.z)) - { - // logging::Info("Collision with %d", i); - - // Lag for health - if (LOCAL_E->m_iHealth() < LOCAL_E->m_iMaxHealth() && - (e->m_ItemType() == ITEM_HEALTH_SMALL || - e->m_ItemType() == ITEM_HEALTH_MEDIUM || - e->m_ItemType() == ITEM_HEALTH_LARGE)) - { - AddExploitTicks(3); - } - // Lag for ammo / metal - // TODO: Alternative to - LOCAL_E->m_iAmmo < - // LOCAL_E->m_iMaxAmmo That is pseudocode but checking each - // weapon for ammo + engie for metal would be ideal - if (CE_INT(g_pLocalPlayer->weapon(), netvar.m_iAmmo) < 5 && - (e->m_ItemType() == ITEM_AMMO_SMALL || - e->m_ItemType() == ITEM_AMMO_MEDIUM || - e->m_ItemType() == ITEM_AMMO_LARGE)) - { - AddExploitTicks(3); - } - } - } - } - } - - // Previously was in GetUserCmd - // Thanks Blackfire for helping me improve removecond! - - if (!g_pUserCmd) - return; - if (!g_pUserCmd->command_number) - return; - int amount = 0; - if (cart) - { - for (int i = 1; i < HIGHEST_ENTITY; i++) - { - if (!pointarr[1] && !pointarr[2] && !pointarr[3] && !pointarr[4]) - continue; - CachedEntity *pEnt = ENTITY(i); - if (!CE_GOOD(pEnt)) - continue; - if (pEnt->m_iTeam() == LOCAL_E->m_iTeam()) - continue; - const model_t *model = RAW_ENT(pEnt)->GetModel(); - if (!model) - continue; - if (model == pointarr[1] || model == pointarr[2] || - model == pointarr[3] || model == pointarr[4]) - { - if (!CE_GOOD(LOCAL_E)) - continue; - ICollideable *c = RAW_ENT(pEnt)->GetCollideable(); - ICollideable *p = RAW_ENT(LOCAL_E)->GetCollideable(); - const Vector &max1 = - p->OBBMaxs() + RAW_ENT(LOCAL_E)->GetAbsOrigin(); - const Vector &min1 = - p->OBBMins() + RAW_ENT(LOCAL_E)->GetAbsOrigin(); - const Vector &max2 = - c->OBBMaxs() + pEnt->m_vecOrigin() + Vector(25, 25, 25); - const Vector &min2 = - c->OBBMins() + pEnt->m_vecOrigin() - Vector(25, 25, 25); - if ((min1.x <= max2.x && max1.x >= min2.x) && - (min1.y <= max2.y && max1.y >= min2.y) && - (min1.z <= max2.z && max1.z >= min2.z)) - { - amount = 50; - } - } - } - } - if (weaponswitch.KeyDown()) - { - static int aa = 0, bb = 0; - if (aa > (int) delay1) - { - g_IEngine->ExecuteClientCmd("slot1"); - aa = 0; - } - if (bb > (int) delay1 + (int) delay2) - { - g_IEngine->ExecuteClientCmd("slot3"); - bb = 0; - } - aa++; - bb++; - } - static bool bWasHolding = false; - bool bIsHolding = ((g_pUserCmd->buttons & IN_ATTACK) || - (g_pUserCmd->buttons & IN_ATTACK2)); - - if (cap) - { - for (int i = 1; i < HIGHEST_ENTITY; i++) - { - if (!pointarr[0]) - continue; - CachedEntity *pEnt = ENTITY(i); - if (!CE_GOOD(pEnt)) - continue; - if (pEnt->m_iTeam() == LOCAL_E->m_iTeam()) - continue; - const model_t *model = RAW_ENT(pEnt)->GetModel(); - if (!model) - continue; - if (model == pointarr[0]) - { - if (!CE_GOOD(LOCAL_E)) - continue; - ICollideable *c = RAW_ENT(pEnt)->GetCollideable(); - ICollideable *p = RAW_ENT(LOCAL_E)->GetCollideable(); - const Vector &max1 = - p->OBBMaxs() + RAW_ENT(LOCAL_E)->GetAbsOrigin(); - const Vector &min1 = - p->OBBMins() + RAW_ENT(LOCAL_E)->GetAbsOrigin(); - const Vector &max2 = - c->OBBMaxs() + pEnt->m_vecOrigin() + - Vector((float) cap_range, (float) cap_range, - (float) cap_range); - const Vector &min2 = - c->OBBMins() + pEnt->m_vecOrigin() - - Vector((float) cap_range, (float) cap_range, - (float) cap_range); - if ((min1.x <= max2.x && max1.x >= min2.x) && - (min1.y <= max2.y && max1.y >= min2.y) && - (min1.z <= max2.z && max1.z >= min2.z)) - { - amount = (int) value; - } - } - } - } - if (cloak && shoot && CE_INT(LOCAL_E, netvar.iClass) != tf_class::tf_spy) - { - if ((g_pUserCmd->buttons & IN_ATTACK) && !bWasHolding && - HasCondition(LOCAL_E)) - { - g_pUserCmd->buttons &= ~IN_ATTACK; - g_pUserCmd->buttons |= IN_ATTACK2; - amount = 2 * 90; - } - else if (CanShoot() && bIsHolding && !bWasHolding && - classid != CL_CLASS(CTFFlareGun)) - amount = 1 * 90; - else if (CanShoot() && bIsHolding && !bWasHolding && - classid == CL_CLASS(CTFFlareGun)) - amount = 2 * 90; - else if (bWasHolding && !bIsHolding) - amount = 1 * 90; - - bWasHolding = (g_pUserCmd->buttons & IN_ATTACK) || - (g_pUserCmd->buttons & IN_ATTACK2); - } - else if (!cloak) - { - if (shoot) - { - if (not g_pLocalPlayer->holding_sniper_rifle) - { - if (CanShoot() && bIsHolding && !bWasHolding && - classid != CL_CLASS(CTFFlareGun)) - amount = 1 * 90; - else if (CanShoot() && bIsHolding && !bWasHolding && - classid == CL_CLASS(CTFFlareGun)) - amount = 2 * 90; - else if (bWasHolding && !bIsHolding) - amount = 1 * 90; - bWasHolding = (g_pUserCmd->buttons & IN_ATTACK) || - (g_pUserCmd->buttons & IN_ATTACK2); - } - else - { - bIsHolding = (g_pUserCmd->buttons & IN_ATTACK); - if (CanShoot() && bIsHolding && !bWasHolding) - amount = 1 * 90; - else if (bWasHolding && !bIsHolding) - amount = 1 * 90; - bWasHolding = (g_pUserCmd->buttons & IN_ATTACK); - } - } - } - else if (!shoot) - { - if (cloak && CE_INT(LOCAL_E, netvar.iClass) != tf_class::tf_spy) - { - if ((g_pUserCmd->buttons & IN_ATTACK2) && !bWasHolding && - !HasCondition(LOCAL_E)) - { - amount = 1 * 90; - } - - if ((g_pUserCmd->buttons & IN_ATTACK) && !bWasHolding && - HasCondition(LOCAL_E)) - { - g_pUserCmd->buttons &= ~IN_ATTACK; - g_pUserCmd->buttons |= IN_ATTACK2; - amount = 2 * 90; - } - bWasHolding = (g_pUserCmd->buttons & IN_ATTACK) || - (g_pUserCmd->buttons & IN_ATTACK2); - } - } - - if (key.KeyDown() || exticks || toggle) - amount = int(value); - - // Thanks Wheaties For help! - if (stickyspam) - { - if (classid == (CL_CLASS(CTFCannon)) || - classid == (CL_CLASS(CTFPipebombLauncher))) - { - static bool bSwitch = false; - bSwitch = !bSwitch; - if ((g_pUserCmd->buttons & IN_ATTACK) && bSwitch) - { - amount = 1 * 50; - g_pUserCmd->buttons &= ~IN_ATTACK; - } - } - } - static int charge = 0; - if (g_pLocalPlayer->bAttackLastTick && infinitecharge && - classid == (CL_CLASS(CTFPipebombLauncher)) && - (g_pUserCmd->buttons & IN_ATTACK) && - CE_BYTE(LOCAL_W, netvar.m_flChargeLevel)) - { - charge++; - if (charge > 5) - amount = (int) value; - } - else if (!(g_pUserCmd->buttons & IN_ATTACK)) - charge = 0; - if (instant_weapon_switch && not HasCondition(LOCAL_E)) - { - if (lastwep != classid) - { - amount = 4 * 66; - lastwep = classid; - } - } - // SHOUTOUTS TO BLACKFIRE - if (doom || razorback) - { - // Variablse to store Primary and secondary nextfire times - static float i = 0.0; - static float i2 = 0.0; - // Servertime to predict the next Primary and secondary times in seconds - servertime = - (float) (CE_INT(g_pLocalPlayer->entity, netvar.nTickBase)) * - g_GlobalVars->interval_per_tick; - // If not the holding the same weapon as last tick or i(2) is smaller - // than 0.1f - // Get a new nextattack(2) - if (!nextattack || i < 0.1f || classid != lastwep) - nextattack = - CE_FLOAT(g_pLocalPlayer->weapon(), netvar.flNextPrimaryAttack); - if (!nextattack2 || i2 < 0.1f || classid != lastwep) - nextattack2 = CE_FLOAT(g_pLocalPlayer->weapon(), - netvar.flNextSecondaryAttack); - // If the next attack (2) time would exceed 75 seconds, set it to 75 to - // prevent - // The server disconnecting you for lagging too much - if (servertime - nextattack > 75.0f) - nextattack = servertime - 75.0f; - if (servertime - nextattack2 > 75.0f) - nextattack2 = servertime - 75.0f; - // If doom is active and nextattack is positive (not reloading/holding - // m1 since a while) - // and you are holding m1 run the Doom code - if (doom && servertime - nextattack > 0.0f && - (g_pUserCmd->buttons & IN_ATTACK || - g_pUserCmd->buttons & IN_ATTACK2)) - { - // Incase i ever goes below 0.1 recalculate it (or if it's just - // inited) - if (i < 0.1f) - i = servertime - (int) nextattack; - // Set amount to i * 66 (which lags for i seconds) - amount = i * 66; - // Don't attack if the clip is empty so you also instantly reload - if (!CE_BYTE(g_pLocalPlayer->weapon(), netvar.m_iClip1)) - { - g_pUserCmd->buttons &= ~IN_ATTACK; - g_pUserCmd->buttons &= ~IN_ATTACK2; - } - } - // if anti-razorback is active and you can stab through the shieled - if (razorback && servertime - nextattack > 3.0f && - (g_pUserCmd->buttons & IN_ATTACK)) - { - CachedEntity *snoiper = nullptr; - for (int ii = 0; ii < g_IEngine->GetMaxClients(); ii++) - { - CachedEntity *snooiper = ENTITY(ii); - // nullptr and dormant check - if (CE_BAD(snooiper)) - continue; - // Alive check - if (!snooiper->m_bAlivePlayer()) - continue; - // Vischeck - if (!VisCheckEntFromEnt(LOCAL_E, snooiper)) - continue; - // Range should be more than high enough - if (!snooiper->m_flDistance() < 200.0f) - continue; - int clazz = CE_INT(snooiper, netvar.iClass); - if (clazz != tf_sniper) - continue; - // found entity - snoiper = snooiper; - // Break if you found an Entity, no need to go on further - // checking - break; - } - // Return if no snipers were found - if (CE_BAD(snoiper)) - return; - // Only works with knife out obviously - if (classid == CL_CLASS(CTFKnife)) - { - if (!i) - i = 3; - amount = i * 66; - g_pUserCmd->buttons |= IN_ATTACK; - } - } - // If i is not below 0.1f then substract one from it to slowly decrease - // lag amount - if (i > 0.1f) - i -= 1.0f; - // Set last weapon classid - lastwep = classid; - } - // if Jarate spam active - if (piss) - { - // Get Servertime - servertime = - (float) (CE_INT(g_pLocalPlayer->entity, netvar.nTickBase)) * - g_GlobalVars->interval_per_tick; - // Get nextattack when it's invalid or the player selected another - // weapon (which is a tick, not a time like 1 second, but servertime + 1 - // second) - if (!nextattack || classid != lastwep) - nextattack = - CE_FLOAT(g_pLocalPlayer->weapon(), netvar.flNextPrimaryAttack); - // Set last weapon since it's not needed anymore this cycle - lastwep = classid; - // Check if holding JARAAATE - if (CE_INT(g_pLocalPlayer->weapon(), netvar.iItemDefinitionIndex) == 58) - { - // Setup Switch variable to not constantly spam jarate, since else - // the jarate may vanish - static int bSwitch = 0; - // Only play Piss.wav once every second - if ((g_pUserCmd->command_number % 66) == 0 && - (g_pUserCmd->buttons & IN_ATTACK)) - announcer::playsound("piss.wav"); - // If in attack and bSwitch is 0 do not attack but increment bSwitch - if ((g_pUserCmd->buttons & IN_ATTACK) && !bSwitch) - { - bSwitch++; - g_pUserCmd->buttons &= ~IN_ATTACK; - } - // Else attack and set bSwitch to 0 once it's over 20 - else if (bSwitch) - { - amount = 21 * 66; - bSwitch++; - if (bSwitch > 20) - bSwitch = 0; - } - } - } - if (!amount) - return; - active = true; - /*g_pUserCmd->command_number += amount; - g_pUserCmd->hasbeenpredicted = true; - *(int *) ((unsigned) g_IBaseClientState + offsets::lastoutgoingcommand()) += - amount;*/ - INetChannel *ch = (INetChannel *) g_IEngine->GetNetChannelInfo(); - int &m_nOutSequenceNr = - *(int *) ((unsigned) ch + offsets::m_nOutSequenceNr()); - m_nOutSequenceNr += amount; - //*bSendPackets = true; -} -void Draw() -{ -#if ENABLE_VISUALS - if (!master_switch) - return; - if (doom && (servertime - nextattack > 0.0f)) - { - auto amount = servertime - nextattack; - if (amount > 0.0f) - AddCenterString(format("Fireable amount: ", (int) amount), - colors::orange); - } - if (razorback) - { - if (servertime - nextattack > 3.0f) - { - AddCenterString(format("Can Stab through Razorback"), - colors::green); - } - else if (servertime - nextattack < 3.0f) - AddCenterString(format("Can't Stab through Razorback"), - colors::red); - } - if (piss) - { - if (servertime - nextattack > 21.0f) - { - AddCenterString(format("Can Spam piss"), colors::green); - } - else if (servertime - nextattack < 21.0f) - AddCenterString(format("Can't spam piss, ", - (int) ((servertime - nextattack) * 100 / 21), - "% charge"), - colors::red); - } -#endif -} -} diff --git a/src/hacks/Noisemaker.cpp b/src/hacks/Noisemaker.cpp index 786a4cd1..7a5e8fa1 100755 --- a/src/hacks/Noisemaker.cpp +++ b/src/hacks/Noisemaker.cpp @@ -5,18 +5,17 @@ * Author: nullifiedcat */ +#include #include "common.hpp" +static settings::Bool enable{ "noisemaker-spam.enable", "false" }; + namespace hacks::tf2::noisemaker { -static CatVar - enabled(CV_SWITCH, "noisemaker", "0", "Noisemaker spam", - "Spams noisemakers Infinitly\nWorks with limited use noisemakers"); - void CreateMove() { - if (enabled) + if (enable) { if (g_GlobalVars->framecount % 100 == 0) { @@ -26,6 +25,5 @@ void CreateMove() g_IEngine->ServerCmdKeyValues(kv2); } } - return; } } diff --git a/src/hacks/ac/aimbot.cpp b/src/hacks/ac/aimbot.cpp index 9226a513..ee633329 100644 --- a/src/hacks/ac/aimbot.cpp +++ b/src/hacks/ac/aimbot.cpp @@ -7,17 +7,16 @@ #include #include +#include #include "common.hpp" +static settings::Bool enable{ "find-cheaters.aimbot.enable", "true" }; +static settings::Float detect_angle{ "find-cheaters.aimbot.angle", "30" }; +static settings::Int detections_warning{ "find-cheaters.aimbot.detections", "3" }; + namespace ac::aimbot { -static CatVar enabled(CV_SWITCH, "ac_aimbot", "1", "Detect Aimbot", - "Is not recommended"); -static CatVar detect_angle(CV_FLOAT, "ac_aimbot_angle", "30", "Aimbot Angle"); -static CatVar detections_warning(CV_INT, "ac_aimbot_detections", "3", - "Min detections to warn"); - ac_data data_table[32]; int amount[32]; diff --git a/src/hacks/ac/antiaim.cpp b/src/hacks/ac/antiaim.cpp index 1312097c..bedbc173 100644 --- a/src/hacks/ac/antiaim.cpp +++ b/src/hacks/ac/antiaim.cpp @@ -6,12 +6,14 @@ */ #include +#include #include "common.hpp" +static settings::Bool enable{ "find-cheaters.antiaim.enable", "true" }; + namespace ac::antiaim { -static CatVar enabled(CV_SWITCH, "ac_antiaim", "1", "Detect Antiaim"); unsigned long last_accusation[32]{ 0 }; void ResetEverything() diff --git a/src/hacks/ac/bhop.cpp b/src/hacks/ac/bhop.cpp index 73f6ec0a..e3367a1e 100755 --- a/src/hacks/ac/bhop.cpp +++ b/src/hacks/ac/bhop.cpp @@ -6,14 +6,14 @@ */ #include +#include #include "common.hpp" +static settings::Int bhop_detect_count{ "find-cheaters.bunnyhop.detections", "4" }; + namespace ac::bhop { -static CatVar bhop_detect_count(CV_INT, "ac_bhop_count", "4", - "BHop Detections"); - ac_data data_table[32]{}; void ResetEverything() diff --git a/src/hooks/DispatchUserMessage.cpp b/src/hooks/DispatchUserMessage.cpp index 4d71ad2a..ff64cbeb 100644 --- a/src/hooks/DispatchUserMessage.cpp +++ b/src/hooks/DispatchUserMessage.cpp @@ -8,20 +8,18 @@ #include #include #include +#include #include "HookedMethods.hpp" +static settings::Bool clean_chat{ "misc.clean-chat", "false" }; +static settings::Bool dispatch_log{ "debug.log-dispatch-user-msg", "false" }; +static settings::String chat_filter{ "misc.chat-censor.filter", "" }; +static settings::Bool chat_filter_enable{ "misc.chat-censor.enable", "false" }; + static bool retrun = false; static Timer sendmsg{}; static Timer gitgud{}; -static CatVar clean_chat(CV_SWITCH, "clean_chat", "0", "Clean chat", - "Removes newlines from chat"); -static CatVar dispatch_log(CV_SWITCH, "debug_log_usermessages", "0", - "Log dispatched user messages"); -static CatVar chat_filter(CV_STRING, "chat_censor", "", "Censor words", - "Spam Chat with newlines if the chosen words are " - "said, seperate with commas"); -static CatVar chat_filter_enabled(CV_SWITCH, "chat_censor_enabled", "0", - "Enable censor", "Censor Words in chat"); + const 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" diff --git a/src/hooks/GetFriendPersonaName.cpp b/src/hooks/GetFriendPersonaName.cpp index ef4fb06e..bd687ba2 100644 --- a/src/hooks/GetFriendPersonaName.cpp +++ b/src/hooks/GetFriendPersonaName.cpp @@ -3,17 +3,11 @@ Copyright (c) 2018 nullworks. All rights reserved. */ +#include #include "HookedMethods.hpp" -static CatVar ipc_name(CV_STRING, "name_ipc", "", "IPC Name"); - -static CatEnum namesteal_enum({ "OFF", "PASSIVE", "ACTIVE" }); -static 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 settings::String ipc_name{ "name.ipc", "" }; +static settings::Int namesteal{ "name.namesteal", "0" }; static std::string stolen_name; diff --git a/src/hooks/LevelInit.cpp b/src/hooks/LevelInit.cpp index 0144d155..1ff9abb6 100644 --- a/src/hooks/LevelInit.cpp +++ b/src/hooks/LevelInit.cpp @@ -4,12 +4,16 @@ */ #include +#include #include "HookedMethods.hpp" #include "MiscTemporary.hpp" #if not LAGBOT_MODE #include "hacks/Backtrack.hpp" #endif +static settings::Bool halloween_mode{ "misc.force-halloween", "false" }; +static settings::Int skybox_changer{ "misc.skybox-override", "0" }; + const char *skynum[] = { "sky_tf2_04", "sky_upward", "sky_dustbowl_01", @@ -72,12 +76,6 @@ static CatEnum skys({ "sky_tf2_04", "sky_pyroland_01", "sky_pyroland_02", "sky_pyroland_03" }); -static CatVar - skybox_changer(skys, "skybox_changer", "0", "Change Skybox to this skybox", - "Change Skybox to this skybox, only changes on map load"); -static CatVar halloween_mode(CV_SWITCH, "halloween_mode", "0", - "Forced Halloween mode", - "forced tf_forced_holiday 2"); namespace hooked_methods { diff --git a/src/hooks/Paint.cpp b/src/hooks/Paint.cpp index 5fd4d6cb..faa9334b 100644 --- a/src/hooks/Paint.cpp +++ b/src/hooks/Paint.cpp @@ -7,12 +7,12 @@ #include #include +#include #include "common.hpp" #include "hitrate.hpp" #include "hack.hpp" -static CatVar cursor_fix_experimental(CV_SWITCH, "experimental_cursor_fix", "1", - "Cursor fix"); +static settings::Bool cursor_fix_experimental{ "debug.cursor-fix", "false" }; namespace hooked_methods { diff --git a/src/hooks/SendNetMsg.cpp b/src/hooks/SendNetMsg.cpp index 32bd17f0..663330a6 100644 --- a/src/hooks/SendNetMsg.cpp +++ b/src/hooks/SendNetMsg.cpp @@ -5,13 +5,11 @@ #include #include +#include #include "HookedMethods.hpp" -static CatVar newlines_msg(CV_INT, "chat_newlines", "0", "Prefix newlines", - "Add # newlines before each your message", 0, 24); - -static CatVar log_sent(CV_SWITCH, "debug_log_sent_messages", "0", - "Log sent messages"); +static settings::Int newlines_msg{ "chat.prefix-newlines", "0" }; +static settings::Bool log_sent{ "debug.log-sent-chat", "false" }; namespace hooked_methods { diff --git a/src/hooks/Shutdown.cpp b/src/hooks/Shutdown.cpp index 3cf44853..638a62e0 100644 --- a/src/hooks/Shutdown.cpp +++ b/src/hooks/Shutdown.cpp @@ -4,10 +4,12 @@ */ #include +#include #include "HookedMethods.hpp" -static CatVar die_if_vac(CV_SWITCH, "die_if_vac", "0", "Die if VAC banned"); -static CatVar autoabandon(CV_SWITCH, "cbu_abandon", "0", "Auto abandon"); +static settings::Bool die_if_vac{ "misc.die-if-vac", "false" }; +static settings::Bool autoabandon{ "misc.auto-abandon", "false" }; + namespace hooked_methods { Timer t{}; diff --git a/src/hooks/others.cpp b/src/hooks/others.cpp index 871ae088..06deb09a 100644 --- a/src/hooks/others.cpp +++ b/src/hooks/others.cpp @@ -70,4 +70,3 @@ static CatCommand minus_use_action_slot_item_server( // static CatVar queue_messages(CV_SWITCH, "chat_queue", "0", "Queue messages", // "Use this if you want to use spam/killsay and still be able to chat normally // (without having your msgs eaten by valve cooldown)"); -static CatVar airstuck(CV_KEY, "airstuck", "0", "Airstuck", ""); diff --git a/src/online/Online.cpp b/src/online/Online.cpp index c15de102..80130bdb 100644 --- a/src/online/Online.cpp +++ b/src/online/Online.cpp @@ -16,6 +16,9 @@ #include #include #include +#include + +static settings::Bool enable{ "online.enable", "false" }; namespace online { @@ -30,7 +33,6 @@ static Timer identify_timer{}; static bool identify_stale{ false }; static std::string api_key{}; -static CatVar enable(CV_SWITCH, "online", "1", "Enable online features"); static CatCommand login("online_login", "Login", [](const CCommand &args) { if (args.ArgC() != 3) {