Better rollspeedhack

yes
This commit is contained in:
LightCat 2018-09-08 12:24:06 +02:00
parent 54b440d003
commit 6941019121
9 changed files with 59 additions and 32 deletions

View File

@ -2,6 +2,7 @@
<Box name="Autojoin and taunt" width="content" height="content" padding="12 6 6 6">
<List width="200">
<AutoVariable width="fill" target="autojoin.auto-queue" label="Auto Queue"/>
<AutoVariable width="fill" target="autojoin.auto-requeue" label="Auto requeue"/>
<AutoVariable width="fill" target="autoqueue.mode" label="Autoqueue Mode" min="0" max="12"/>
<AutoVariable width="fill" target="hack.requeue-on-kick" label="Requeue on kick"/>
<AutoVariable width="fill" target="autotaunt.enable" label="Autotaunt enabled"/>
@ -23,7 +24,7 @@
<AutoVariable width="fill" target="autojoin.team" label="Autojoin Team" min="0" max="1"/>
</List>
</Box>
<Box name="CBU" width="content" height="content" padding="12 6 6 6" y="130">
<Box name="CBU" width="content" height="content" padding="12 6 6 6" y="140">
<List width="200">
<AutoVariable width="fill" target="cat-bot.enable" label="Enable CBU"/>
<AutoVariable width="fill" target="cat-bot.abandon-if.bots-gte" label="Abandon if bots gte"/>
@ -36,6 +37,8 @@
<AutoVariable width="fill" target="cat-bot.micspam.interval-off" label="Micspam interval off"/>
<AutoVariable width="fill" target="cat-bot.micspam.interval-on" label="Micspam interval on"/>
<AutoVariable width="fill" target="cat-bot.votekicks" label="Random votekicks"/>
<AutoVariable width="fill" target="cat-bot.always-crouch" label="Always Crouch"/>
<AutoVariable width="fill" target="cat-bot.autoreport" label="Autoreport"/>
</List>
</Box>
<Box name="Followbot" width="content" height="content" padding="12 6 6 6" x="210">

View File

@ -21,7 +21,7 @@
</List>
</Box>
<Box name="Chat log" width="content" height="content" padding="12 6 6 6" y="135">
<List width="200">
<List width="150">
<AutoVariable width="fill" target="chat-log.enable" label="Enable chatlog"/>
<AutoVariable width="fill" target="chat-log.no-ipc" label="IPCless"/>
<AutoVariable width="fill" target="chat-log.no-spam" label="Anti spam"/>
@ -39,10 +39,12 @@
<AutoVariable width="fill" target="chat.crypto" label="Crypto Chat"/>
<AutoVariable width="fill" target="chat.prefix-newlines" label="Newlines" min="0" max="100"/>
<AutoVariable width="fill" target="chat.log-events" label="Log events"/>
<AutoVariable width="fill" target="chat.identify" label="Identify"/>
<AutoVariable width="fill" target="chat.identify.answer" label="Counter Identify"/>
</List>
</Box>
<Box name="Killsay and Chatspam" width="content" height="content" padding="12 6 6 6" y="135" x="220">
<List width="200">
<Box name="Killsay and Chatspam" width="content" height="content" padding="12 6 6 6" x="410">
<List width="150">
<AutoVariable width="fill" target="killsay.file" label="Killsay file"/>
<LabeledObject width="fill" label="Killsay Mode">
<Select target="killsay.mode">

View File

@ -16,6 +16,7 @@ bool is_a_catbot(unsigned steamID);
bool should_ignore_player(CachedEntity *player);
void update();
void init();
void CreateMove();
void level_init();
#if ENABLE_IPC

View File

@ -21,8 +21,8 @@ int *g_PredictionRandomSeed = nullptr;
namespace criticals
{
CatCommand test("crit_debug_print", "debug", []() {
bool test = (*((unsigned char *) RAW_ENT(LOCAL_E) + 9645) & 2) >> 1;
int test2 = (*((unsigned char *) RAW_ENT(LOCAL_E) + 9645) & 2);
bool test = (*((uint8_t *) RAW_ENT(LOCAL_E) + 9645) & 2) / 2;
int test2 = (*((uint8_t *) RAW_ENT(LOCAL_E) + 9645) & 2);
int test3 = (*((unsigned *) RAW_ENT(LOCAL_E) + 9645));
logging::Info("%d, %d, %d", test, test2, test3);
});
@ -35,7 +35,6 @@ int find_next_random_crit_for_weapon(IClientEntity *weapon)
state.Save(weapon);
seed_backup = *g_PredictionRandomSeed;
while (!found && tries < 4096)
{
seed_md5 = MD5_PseudoRandom(number) & 0x7FFFFFFF;

View File

@ -92,15 +92,15 @@ bool EntityHitboxCache::VisibilityCheck(int id)
if (!m_bInit)
Init();
if (id < 0 || id >= m_nNumHitboxes)
return 0;
return false;
if (!m_bSuccess)
return 0;
return false;
if (m_VisCheckValidationFlags[id])
return m_VisCheck[id];
// TODO corners
hitbox = GetHitbox(id);
if (!hitbox)
return 0;
return false;
m_VisCheck[id] = (IsEntityVectorVisible(parent_ref, hitbox->center));
m_VisCheckValidationFlags[id] = true;
return m_VisCheck[id];

View File

@ -27,6 +27,7 @@ static settings::Int micspam_on{ "cat-bot.micspam.interval-on", "3" };
static settings::Int micspam_off{ "cat-bot.micspam.interval-off", "60" };
static settings::Bool auto_crouch{ "cat-bot.auto-crouch", "true" };
static settings::Bool always_crouch{ "cat-bot.always-crouch", "false" };
static settings::Bool random_votekicks{ "cat-bot.votekicks", "false" };
static settings::Bool autoReport{ "cat-bot.autoreport", "true" };
@ -236,6 +237,11 @@ CatCommand report("report_debug", "debug", []() { reportall(); });
Timer crouchcdr{};
void smart_crouch()
{
if (*always_crouch)
{
current_user_cmd->buttons |= IN_DUCK;
return;
}
bool foundtar = false;
static bool crouch = false;
if (crouchcdr.test_and_set(2000))
@ -243,17 +249,14 @@ void smart_crouch()
for (int i = 0; i < g_IEngine->GetMaxClients(); i++)
{
auto ent = ENTITY(i);
if (CE_BAD(ent) || ent->m_iTeam() == LOCAL_E->m_iTeam() ||
if (CE_BAD(ent) || ent->m_Type() != ENTITY_PLAYER || ent->m_iTeam() == LOCAL_E->m_iTeam() ||
!(ent->hitboxes.GetHitbox(0)) || !(ent->m_bAlivePlayer()) ||
playerlist::AccessData(ent).state ==
playerlist::k_EState::FRIEND ||
playerlist::AccessData(ent).state ==
playerlist::k_EState::IPC ||
player_tools::shouldTargetSteamId(ent->player_info.friendsID) != player_tools::IgnoreReason::DO_NOT_IGNORE ||
should_ignore_player(ent))
continue;
bool failedvis = false;
for (int j = -1; j < 18; j++)
if (IsEntityVisible(ent, j))
for (int j = 0; j < 18; j++)
if (IsVectorVisible(g_pLocalPlayer->v_Eye, ent->hitboxes.GetHitbox(j)->center))
failedvis = true;
if (failedvis)
continue;
@ -261,6 +264,7 @@ void smart_crouch()
{
if (!LOCAL_E->hitboxes.GetHitbox(j))
continue;
// Check if they see my hitboxes
if (!IsVectorVisible(ent->hitboxes.GetHitbox(0)->center,
LOCAL_E->hitboxes.GetHitbox(j)->center) &&
!IsVectorVisible(ent->hitboxes.GetHitbox(0)->center,
@ -278,6 +282,14 @@ void smart_crouch()
if (crouch)
current_user_cmd->buttons |= IN_DUCK;
}
// TODO: add more stuffs
void CreateMove()
{
if (auto_crouch)
smart_crouch();
}
void update()
{
if (!enable)
@ -301,8 +313,6 @@ void update()
do_random_votekick();
if (timer_catbot_list.test_and_set(3000))
update_catbot_list();
if (auto_crouch)
smart_crouch();
if (timer_abandon.test_and_set(2000) && level_init_timer.check(13000))
{
count_bots = 0;

View File

@ -717,13 +717,9 @@ bool IsEntityVisible(CachedEntity *entity, int hb)
if (entity == g_pLocalPlayer->entity)
return true;
if (hb == -1)
{
return IsEntityVectorVisible(entity, entity->m_vecOrigin());
}
else
{
return entity->hitboxes.VisibilityCheck(hb);
}
}
std::mutex trace_lock;

View File

@ -271,6 +271,10 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
UpdateHoovyList();
}
g_pLocalPlayer->v_OrigViewangles = cmd->viewangles;
{
PROF_SECTION(CM_catbot)
hacks::shared::catbot::CreateMove();
}
#if ENABLE_VISUALS
{
PROF_SECTION(CM_esp);
@ -449,15 +453,27 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
if (roll_speedhack && cmd->buttons & IN_DUCK &&
!(cmd->buttons & IN_ATTACK))
{
speed = cmd->forwardmove;
speed = Vector{cmd->forwardmove, cmd->sidemove, 0.0f}.Length();
static float prevspeedang = 0.0f;
if (fabs(speed) > 0.0f)
{
cmd->forwardmove = -speed;
cmd->sidemove = 0.0f;
cmd->viewangles.y = g_pLocalPlayer->v_OrigViewangles.y;
cmd->viewangles.y -= 180.0f;
if (cmd->viewangles.y < -180.0f)
cmd->viewangles.y += 360.0f;
Vector vecMove( cmd->forwardmove, cmd->sidemove, 0.0f );
vecMove *= -1;
float flLength = vecMove.Length();
Vector angMoveReverse{};
VectorAngles( vecMove, angMoveReverse );
cmd->forwardmove = -flLength;
cmd->sidemove = 0.0f; // Move only backwards, no sidemove
float res = g_pLocalPlayer->v_OrigViewangles.y - angMoveReverse.y;
while (res > 180)
res -= 360;
while (res < -180)
res += 360;
if (res - prevspeedang > 90.0f)
res = (res + prevspeedang) / 2;
prevspeedang = res;
cmd->viewangles.y = res;
cmd->viewangles.z = 90.0f;
g_pLocalPlayer->bUseSilentAngles = true;
speedapplied = true;

View File

@ -65,7 +65,7 @@ void DrawCheatVisuals()
PROF_SECTION(PT_info_text);
if (info_text)
{
AddSideString("cathook by nullifiedcat", colors::RainbowCurrent());
AddSideString("cathook by nullworks", colors::RainbowCurrent());
if (!info_text_min)
{
AddSideString(hack::GetVersion(),
@ -73,7 +73,7 @@ void DrawCheatVisuals()
AddSideString(hack::GetType(), GUIColor()); // Compile type
#if ENABLE_GUI
AddSideString(
"Press 'INSERT' or 'F11' key to open/close cheat menu.",
"Press 'INSERT' key to open/close cheat menu.",
GUIColor());
AddSideString("Use mouse to navigate in menu.", GUIColor());
#endif