Skip to content
Permalink
Browse files

Custom teamspam

  • Loading branch information
BenCat07 committed Jan 7, 2020
1 parent d23bd99 commit 3ab45b182d8ad6bbf6d04ed7476b3c3ab434bc44
Showing with 42 additions and 11 deletions.
  1. +2 −0 config_data/teamspam.txt
  2. +38 −9 src/hacks/Spam.cpp
  3. +1 −1 src/helpers.cpp
  4. +1 −1 src/hooks/CreateMove.cpp
@@ -0,0 +1,2 @@
CAT
HOOK
@@ -7,8 +7,10 @@

#include <hacks/Spam.hpp>
#include <settings/Bool.hpp>
#include <settings/String.hpp>
#include "common.hpp"
#include "MiscTemporary.hpp"
#include <boost/algorithm/string.hpp>

namespace hacks::shared::spam
{
@@ -18,6 +20,7 @@ static settings::String filename{ "spam.filename", "spam.txt" };
static settings::Int spam_delay{ "spam.delay", "800" };
static settings::Int voicecommand_spam{ "spam.voicecommand", "0" };
static settings::Boolean teamname_spam{ "spam.teamname", "0" };
static settings::String teamname_file{ "spam.teamname.file", "teamspam.txt" };
static settings::Boolean team_only{ "spam.teamchat", "false" };

static int last_index;
@@ -234,6 +237,11 @@ bool FormatSpamMessage(std::string &message)
return SubstituteQueries(message);
}

// What to spam
static std::vector<std::string> teamspam_text = { "CAT", "HOOK" };
// Current spam index
static int current_teamspam_idx = 0;

void createMove()
{
IF_GAME(IsTF2())
@@ -243,16 +251,13 @@ void createMove()
{
if (!(g_GlobalVars->tickcount % 10))
{
static bool teamname_swap = false;
if (teamname_swap)
{
teamname_swap = false;
g_IEngine->ServerCmd("tournament_teamname Cat");
}
else
if (teamspam_text.size())
{
teamname_swap = true;
g_IEngine->ServerCmd("tournament_teamname Hook");
g_IEngine->ServerCmd(format("tournament_teamname ", teamspam_text.at(current_teamspam_idx)).c_str());
current_teamspam_idx++;
// We've hit the end of the vector
if (current_teamspam_idx == teamspam_text.size())
current_teamspam_idx = 0;
}
}
}
@@ -391,10 +396,34 @@ const std::vector<std::string> builtin_nonecore = { "NULL CORE - REDUCE YOUR RIS
const std::vector<std::string> builtin_lmaobox = { "GET GOOD, GET LMAOBOX!", "LMAOBOX - WAY TO THE TOP", "WWW.LMAOBOX.NET - BEST FREE TF2 HACK!" };
const std::vector<std::string> builtin_lithium = { "CHECK OUT www.YouTube.com/c/DurRud FOR MORE INFORMATION!", "PWNING AIMBOTS WITH OP ANTI-AIMS SINCE 2015 - LITHIUMCHEAT", "STOP GETTING MAD AND STABILIZE YOUR MOOD WITH LITHIUMCHEAT!", "SAVE YOUR MONEY AND GET LITHIUMCHEAT! IT IS FREE!", "GOT ROLLED BY LITHIUM? HEY, THAT MEANS IT'S TIME TO GET LITHIUMCHEAT!!" };

void teamspam_reload(std::string after)
{
// Clear sp am vector
teamspam_text.clear();
// Reset Spam idx
current_teamspam_idx = 0;
if (after != "")
{
static TextFile teamspam;
if (teamspam.TryLoad(after))
{
teamspam_text = teamspam.lines;
for (auto &text : teamspam_text)
ReplaceSpecials(text);
}
}
}
void teamspam_reload_command()
{
teamspam_reload(*teamname_file);
}
static InitRoutine EC([]() {
teamname_file.installChangeCallback([](settings::VariableBase<std::string> &, std::string after) { teamspam_reload(after); });
EC::Register(EC::CreateMove, createMove, "spam", EC::average);
init();
});

static CatCommand reload_ts("teamspam_reload", "Relaod teamspam file", teamspam_reload_command);

static CatCommand reload_cc("spam_reload", "Reload spam file", hacks::shared::spam::reloadSpamFile);
} // namespace hacks::shared::spam
@@ -518,7 +518,7 @@ void ReplaceString(std::string &input, const std::string &what, const std::strin

void ReplaceSpecials(std::string &str)
{
int val, i;
int val;
size_t c = 0, len = str.size();
for (int i = 0; i + c < len; ++i)
{
@@ -289,7 +289,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, CUs
if (current_user_cmd->buttons & IN_ATTACK)
if (attackticks % *fullauto + 1 < *fullauto)
current_user_cmd->buttons &= ~IN_ATTACK;
static int fakelag_queue = 0;
static int fakelag_queue = 0;
g_pLocalPlayer->isFakeAngleCM = false;
if (CE_GOOD(LOCAL_E))
if (fakelag_amount || (hacks::shared::antiaim::force_fakelag && hacks::shared::antiaim::isEnabled()))

0 comments on commit 3ab45b1

Please sign in to comment.
You can’t perform that action at this time.