even less catvars

This commit is contained in:
nullifiedcat 2018-07-28 22:14:29 +03:00
parent 14c83b96ba
commit b3faff98d9
11 changed files with 58 additions and 260 deletions

View File

@ -25,7 +25,6 @@ target_sources(cathook PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/CatBot.hpp"
"${CMAKE_CURRENT_LIST_DIR}/FollowBot.hpp"
"${CMAKE_CURRENT_LIST_DIR}/hacklist.hpp"
"${CMAKE_CURRENT_LIST_DIR}/HealArrows.hpp"
"${CMAKE_CURRENT_LIST_DIR}/KillSay.hpp"
"${CMAKE_CURRENT_LIST_DIR}/Killstreak.hpp"
"${CMAKE_CURRENT_LIST_DIR}/LightESP.hpp"

View File

@ -1,16 +0,0 @@
/*
* HealArrows.hpp
*
* Created on: Jun 1, 2017
* Author: nullifiedcat
*/
#pragma once
namespace hacks::tf2::healarrow
{
void CreateMove();
void Draw();
void Init();
}

View File

@ -105,7 +105,7 @@ public:
if (flag & SDL_BUTTON(value.mouse))
return true;
}
else
else if (value.scan)
{
auto keys = SDL_GetKeyboardState(nullptr);
if (keys[value.scan])

View File

@ -23,7 +23,6 @@ if(NOT LagbotMode)
"${CMAKE_CURRENT_LIST_DIR}/Bunnyhop.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Backtrack.cpp"
"${CMAKE_CURRENT_LIST_DIR}/FollowBot.cpp"
"${CMAKE_CURRENT_LIST_DIR}/HealArrows.cpp"
"${CMAKE_CURRENT_LIST_DIR}/KillSay.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Killstreak.cpp"
"${CMAKE_CURRENT_LIST_DIR}/LightESP.cpp"

View File

@ -9,23 +9,25 @@
#include "common.hpp"
#include <hacks/FollowBot.hpp>
#include <glez/draw.hpp>
#include <settings/Bool.hpp>
static settings::Bool followbot{ "follow-bot.enable", "false" };
static settings::Bool roambot{ "follow-bot.roaming", "false" };
static settings::Bool draw_crumb{ "follow-bot.draw-crumbs", "false" };
static settings::Bool follow_distance{ "follow-bot.distance", "175" };
static settings::Bool follow_activation{ "follow-bot.max-range", "1000" };
static settings::Bool mimic_slot{ "follow-bot.mimic-slot", "false" };
static settings::Bool always_medigun{ "follow-bot.always-medigun", "false" };
static settings::Bool sync_taunt{ "follow-bot.taunt-sync", "false" };
static settings::Bool change{ "follow-bot.change-roaming-target", "false" };
static settings::Bool autojump{ "follow-bot.jump-if-stuck", "true" };
static settings::Bool afk{ "follow-bot.switch-afk", "true" };
static settings::Bool afktime{ "follow-bot.afk-time", "15000" };
static settings::Bool corneractivate{ "follow-bot.corners", "true" };
namespace hacks::shared::followbot
{
CatVar followbot(CV_SWITCH, "fb", "0", "Followbot Switch",
"Set to 1 in followbots' configs");
bool followcart = false;
CatVar roambot(CV_SWITCH, "fb_roaming", "1", "Roambot",
"Followbot will roam free, finding targets it can");
static CatVar draw_crumb(CV_SWITCH, "fb_draw", "1", "Draw crumbs",
"Self explanitory");
static CatVar follow_distance(CV_INT, "fb_distance", "175", "Follow Distance",
"How close the bots should stay to the target");
static CatVar follow_activation(CV_INT, "fb_activation", "1000",
"Activation Distance",
"How close a player should be until the "
"followbot will pick them as a target");
unsigned steamid = 0x0;
CatCommand follow_steam("fb_steam", "Follow Steam Id",
[](const CCommand &args) {
@ -37,24 +39,6 @@ CatCommand follow_steam("fb_steam", "Follow Steam Id",
steamid = atol(args.Arg(1));
});
static CatVar mimic_slot(CV_SWITCH, "fb_mimic_slot", "0", "Mimic weapon slot",
"Mimic follow target's weapon slot");
static CatVar always_medigun(CV_SWITCH, "fb_always_medigun", "0",
"Always Medigun", "Always use medigun");
static CatVar sync_taunt(CV_SWITCH, "fb_sync_taunt", "0", "Synced taunt",
"Taunt when follow target does");
static CatVar change(CV_SWITCH, "fb_switch", "0", "Change followbot target",
"Always change roaming target when possible");
static CatVar autojump(CV_SWITCH, "fb_autojump", "1", "Autojump",
"Automatically jump if stuck");
static CatVar afk(CV_SWITCH, "fb_afk", "1", "Switch target if AFK",
"Automatically switch target if the target is afk");
static CatVar afktime(
CV_INT, "fb_afk_time", "15000", "Max AFK Time",
"Max time in ms spent standing still before player gets declared afk");
static CatVar corneractivate(
CV_SWITCH, "fb_activation_corners", "1", "Activate around corners",
"Try to find an activation path to an entity behind a corner.");
// Something to store breadcrumbs created by followed players
static std::vector<Vector> breadcrumbs;

View File

@ -1,146 +0,0 @@
/*
* HealArrows.cpp
*
* Created on: Jun 1, 2017
* Author: nullifiedcat
*/
#include "common.hpp"
namespace hacks::tf2::healarrow
{
static CatVar healarrow_charge(CV_FLOAT, "healarrow_charge", "0.25",
"Healarrow Charge");
static CatVar healarrow_timeout(CV_FLOAT, "healarrow_timeout", "2",
"Healarrow Timeout");
static CatVar healarrow(CV_SWITCH, "healarrow", "0", "Heal Arrow");
static CatVar healarrow_callout(
CV_SWITCH, "healarrow_callout", "0", "Call Out",
"Send a message to chat when you heal someone with an arrow");
static CatVar healarrow_callout_message(
CV_STRING, "healarrow_callout_text",
"Hey %%, I've just healed you for $$ HP! Your health is now ##.",
"Call Out Text",
"Formatting:\n%% - player name\n$$ - healing amount\n## - new health\n@@ - "
"old health");
float healarrow_time = 0.0f;
class HealArrowListener : public IGameEventListener
{
public:
virtual void FireGameEvent(KeyValues *event)
{
if (!healarrow)
return;
if (!healarrow_callout)
return;
if (CE_BAD(LOCAL_W))
return;
if (LOCAL_W->m_iClassID() != CL_CLASS(CTFCompoundBow))
return;
std::string name(event->GetName());
if (name == "player_hurt")
{
int attacker = event->GetInt("attacker");
int victim = event->GetInt("userid");
int eid = g_IEngine->GetPlayerForUserID(attacker);
int vid = g_IEngine->GetPlayerForUserID(victim);
if (eid == g_IEngine->GetLocalPlayer())
{
int damageamount = event->GetInt("damageamount");
if (damageamount < 0)
{
player_info_s pinfo;
if (g_IEngine->GetPlayerInfo(vid, &pinfo))
{
std::string msg(healarrow_callout_message.GetString());
ReplaceString(msg, "$$", std::to_string(-damageamount));
int health = event->GetInt("health");
ReplaceString(msg, "##", std::to_string(health));
ReplaceString(msg, "@@",
std::to_string(health + damageamount));
ReplaceString(msg, "%%", pinfo.name);
chat_stack::Say(msg, false);
}
}
}
}
}
};
HealArrowListener listener;
void Init()
{
g_IGameEventManager->AddListener(&listener, false);
}
void CreateMove()
{
#if ENABLE_VISUALS
#if not ENABLE_VISUALS
if (CE_BAD(LOCAL_W))
return;
if (healarrow)
{
if (g_pLocalPlayer->weapon()->m_iClassID() == CL_CLASS(CTFCompoundBow))
{
if (healarrow_time > g_GlobalVars->curtime)
healarrow_time = 0.0f;
float begincharge =
CE_FLOAT(g_pLocalPlayer->weapon(), netvar.flChargeBeginTime);
float charge = 0;
if (begincharge != 0)
{
charge = g_GlobalVars->curtime - begincharge;
if (charge > 1.0f)
charge = 1.0f;
}
if (g_pUserCmd->command_number &&
((g_GlobalVars->curtime - healarrow_time) >
float(healarrow_timeout)) &&
(charge > (float) healarrow_charge) &&
(g_pUserCmd->buttons & IN_ATTACK))
{
command_number_mod[g_pUserCmd->command_number] =
g_pUserCmd->command_number + 450;
g_pUserCmd->buttons &= ~IN_ATTACK;
healarrow_time = g_GlobalVars->curtime;
logging::Info("healarrow");
}
}
}
#endif
#endif
}
void Draw()
{
#if ENABLE_VISUALS
#if not ENABLE_VISUALS
if (healarrow)
{
if ((g_GlobalVars->curtime - healarrow_time) < float(healarrow_timeout))
{
AddCenterString(
format("Heal arrow charge: ",
int(std::min(100.0f,
(g_GlobalVars->curtime - healarrow_time) /
float(healarrow_timeout)) *
100.0f),
'%'),
colors::yellow);
// AddCenterString(format("Heal arrow time: ",
// healarrow_time));
}
else
{
AddCenterString("Heal arrow ready", colors::green);
}
}
#endif
#endif
}
}

View File

@ -6,20 +6,15 @@
*/
#include <hacks/KillSay.hpp>
#include <settings/Int.hpp>
#include "common.hpp"
static settings::Int killsay_mode{ "killsay.mode", "0" };
static settings::String filename{ "killsay.file", "killsays.txt" };
namespace hacks::shared::killsay
{
static CatEnum killsay_enum({ "NONE", "CUSTOM", "DEFAULT", "NCC - OFFENSIVE",
"NCC - MLG" });
static CatVar killsay_mode(killsay_enum, "killsay", "0", "Killsay",
"Defines source of killsay lines. CUSTOM killsay "
"file must be set in cat_killsay_file and loaded "
"with cat_killsay_reload (Use console!)");
static CatVar
filename(CV_STRING, "killsay_file", "killsays.txt", "Killsay file",
"Killsay file name. Should be located in cathook data folder");
static CatCommand reload("killsay_reload", "Reload killsays", Reload);
const std::string tf_classes_killsay[] = { "class", "scout", "sniper",

View File

@ -5,15 +5,15 @@
* Author: nullifiedcat
*/
#include <settings/Bool.hpp>
#include "common.hpp"
#include "hooks.hpp"
static settings::Bool enable{ "killstreak.enable", "false" };
namespace hacks::tf2::killstreak
{
static CatVar enabled(CV_SWITCH, "killstreak", "0",
"Enable killstreaks on all weapons");
int killstreak{ 0 };
void reset()
@ -28,7 +28,7 @@ int current_streak()
void apply_killstreaks()
{
if (!enabled)
if (!enable)
return;
IClientEntity *ent =
@ -101,7 +101,7 @@ void on_spawn(IGameEvent *event)
void fire_event(IGameEvent *event)
{
if (enabled)
if (enable)
{
if (0 == strcmp(event->GetName(), "player_death"))
on_kill(event);

View File

@ -1,11 +1,12 @@
#include <glez/draw.hpp>
#include <settings/Bool.hpp>
#include "hacks/LightESP.hpp"
static settings::Bool enable{ "lightesp.enable", "false" };
namespace hacks::shared::lightesp
{
static CatVar enable(CV_SWITCH, "lightesp_enabled", "0", "Enable LightESP",
"Lightweight ESP. Only shows head.");
Vector hitp[32];
Vector minp[32];
Vector maxp[32];

View File

@ -6,40 +6,29 @@
*/
#include <glez/draw.hpp>
#include <settings/Int.hpp>
#include "common.hpp"
#include "hacks/Radar.hpp"
#ifndef FEATURE_RADAR_DISABLED
#if ENABLE_VISUALS
static settings::Bool radar_enabled{ "radar.enable", "false" };
static settings::Int size{ "radar.size", "300" };
static settings::Float zoom{ "radar.zoom", "20" };
static settings::Bool healthbar{ "radar.healthbar", "true" };
static settings::Bool enemis_over_teammates{ "radar.enemies-over-teammates", "true" };
static settings::Int icon_size{ "radar.icon-size", "20" };
static settings::Int radar_x{ "radar.x", "100" };
static settings::Int radar_y{ "radar.y", "100" };
static settings::Bool use_icons{ "radar.use-icons", "true" };
static settings::Bool show_teammates{ "radar.show.teammates", "true" };
static settings::Bool show_healthpacks{ "radar.show.health", "true" };
static settings::Bool show_ammopacks{ "radar.show.ammo", "true" };
namespace hacks::tf::radar
{
static CatVar size(CV_INT, "radar_size", "300", "Radar size",
"Defines radar size in pixels");
static CatVar zoom(CV_FLOAT, "radar_zoom", "20", "Radar zoom",
"Defines radar zoom (1px = Xhu)");
static CatVar healthbar(CV_SWITCH, "radar_health", "1", "Radar healthbar",
"Show radar healthbar");
static CatVar enemies_over_teammates(
CV_SWITCH, "radar_enemies_top", "1", "Show enemies on top",
"If true, radar will render enemies on top of teammates");
static CatVar icon_size(CV_INT, "radar_icon_size", "20", "Icon size",
"Defines radar icon size");
static CatVar radar_enabled(CV_SWITCH, "radar", "0", "Enable", "Enable Radar");
static CatVar radar_x(CV_INT, "radar_x", "100", "Radar X",
"Defines radar position (X)");
static CatVar radar_y(CV_INT, "radar_y", "100", "Radar Y",
"Defines radar position (Y)");
static CatVar
use_icons(CV_SWITCH, "radar_icons", "1", "Use Icons",
"Radar will use class icons instead of class portraits");
static CatVar show_teammates(CV_SWITCH, "radar_teammates", "1",
"Show Teammates");
static CatVar show_healthpacks(CV_SWITCH, "radar_healthpacks", "1",
"Show Healthpacks");
static CatVar show_ammopacks(CV_SWITCH, "radar_ammopacks", "1",
"Show Ammopacks");
Timer invalid{};
std::pair<int, int> WorldToRadar(int x, int y)

View File

@ -13,6 +13,22 @@
#include <sys/stat.h>
#include <hacks/hacklist.hpp>
#include <glez/draw.hpp>
#include <settings/Bool.hpp>
static settings::Button recording_key{ "walkbot.recording-key", "<null>" };
static settings::Bool draw_info{ "walkbot.draw.info", "true" };
static settings::Bool draw_path{ "walkbot.draw.path", "true" };
static settings::Bool draw_nodes{ "walkbot.draw.nodes", "true" };
static settings::Bool draw_indices{ "walkbot.draw.indices", "false" };
static settings::Bool draw_connection_flags{ "walkbot.draw.connection-flags", "true" };
static settings::Bool free_move{ "walkbot.free-move", "true" };
static settings::Bool spawn_distance{ "walkbot.edit.node-spawn-distance", "54" };
static settings::Bool max_distance{ "walkbot.node-max-distance", "100" };
static settings::Bool reach_distance{ "walkbot.node-reach-distance", "32" };
static settings::Bool force_slot{ "walkbot.force-slot", "0" };
static settings::Bool leave_if_empty{ "walkbot.leave-if-empty", "false" };
namespace hacks::shared::walkbot
{
@ -447,29 +463,6 @@ index_t CreateNode(const Vector &xyz)
return node;
}
static CatVar active_recording(CV_SWITCH, "wb_recording", "0", "Do recording",
"Use BindToggle with this");
static CatVar draw_info(CV_SWITCH, "wb_info", "1", "Walkbot info");
static CatVar draw_path(CV_SWITCH, "wb_path", "1", "Walkbot path");
static CatVar draw_nodes(CV_SWITCH, "wb_nodes", "1", "Walkbot nodes");
static CatVar draw_indices(CV_SWITCH, "wb_indices", "0", "Node indices");
static CatVar free_move(CV_SWITCH, "wb_freemove", "1", "Allow free movement",
"Allow free movement while pressing movement keys");
static CatVar spawn_distance(CV_FLOAT, "wb_node_spawn_distance", "54",
"Node spawn distance");
static CatVar max_distance(CV_FLOAT, "wb_replay_max_distance", "100",
"Max distance to node when replaying");
static CatVar reach_distance(
CV_FLOAT, "wb_replay_reach_distance", "32",
"Distance where bot can be considered 'stepping' on the node");
static CatVar draw_connection_flags(CV_SWITCH, "wb_connection_flags", "1",
"Connection flags");
static CatVar force_slot(CV_INT, "wb_force_slot", "1", "Force slot",
"Walkbot will always select weapon in this slot");
static CatVar leave_if_empty(CV_SWITCH, "wb_leave_if_empty", "0",
"Leave if no walkbot",
"Leave game if there is no walkbot map");
CatCommand c_start_recording("wb_record", "Start recording",
[]() { state::state = WB_RECORDING; });
CatCommand c_start_editing("wb_edit", "Start editing",