Merge remote-tracking branch 'origin/experimental' into experimental
This commit is contained in:
commit
72a1318299
@ -62,8 +62,10 @@
|
||||
<Select target="aimbot.priority-mode">
|
||||
<Option name="Smart" value="0"/>
|
||||
<Option name="FOV" value="1"/>
|
||||
<Option name="Distance" value="2"/>
|
||||
<Option name="Health" value="3"/>
|
||||
<Option name="Distance (Closest)" value="2"/>
|
||||
<Option name="Distance (Highest)" value="4"/>
|
||||
<Option name="Health (Lowest)" value="3"/>
|
||||
<Option name="Health (Highest)" value="5"/>
|
||||
</Select>
|
||||
</LabeledObject>
|
||||
<AutoVariable width="fill" target="aimbot.target.max-range" label="Max Range" min="0" max="4096"/>
|
||||
@ -78,7 +80,7 @@
|
||||
<AutoVariable width="fill" target="aimbot.slow" label="Slow Aimbot"/>
|
||||
</List>
|
||||
</Box>
|
||||
<Box padding="12 6 6 6" width="content" height="content" name="Target Options" x="380">
|
||||
<Box padding="12 6 6 6" width="content" height="content" name="Target Options" x="400">
|
||||
<List width="150">
|
||||
<AutoVariable width="fill" target="aimbot.target.sentry" label="Sentry guns"/>
|
||||
<AutoVariable width="fill" target="aimbot.target.stickybomb" label="Stickybombs"/>
|
||||
@ -96,7 +98,7 @@
|
||||
<AutoVariable width="fill" target="aimbot.target.other-buildings" label="Other buildings"/>
|
||||
</List>
|
||||
</Box>
|
||||
<Box padding="12 6 6 6" width="content" height="content" name="Backtrack" y="140" x="380">
|
||||
<Box padding="12 6 6 6" width="content" height="content" name="Backtrack" y="140" x="400">
|
||||
<List width="150">
|
||||
<AutoVariable width="fill" target="backtrack.enable" label="Enable Backtrack"/>
|
||||
<AutoVariable width="fill" target="backtrack.draw" label="Draw Backtrack"/>
|
||||
|
@ -64,12 +64,13 @@
|
||||
<List width="170">
|
||||
<AutoVariable width="fill" target="misc.pathing" label="Enable Pathing"/>
|
||||
<AutoVariable width="fill" target="misc.pathing.draw" label="Draw Path"/>
|
||||
<AutoVariable width="fill" target="navbot.enable" label="Enable NavBot"/>
|
||||
<AutoVariable width="fill" target="navbot.enable" label="Master Switch"/>
|
||||
<AutoVariable width="fill" target="navbot.sniper-mode" label="Enable Sniper Mode"/>
|
||||
<AutoVariable width="fill" target="navbot.scout-mode" label="Enable Scout Mode"/>
|
||||
<AutoVariable width="fill" target="navbot.spy-mode" label="Enable Spy Mode"/>
|
||||
<AutoVariable width="fill" target="navbot.heavy-mode" label="Enable Heavy Mode"/>
|
||||
<AutoVariable width="fill" target="navbot.engi-mode" label="Enable Engie Mode"/>
|
||||
<AutoVariable width="fill" target="navbot.primary-only" label="Best Weapon only"/>
|
||||
<AutoVariable width="fill" target="navbot.random-jumps" label="Randomly Jump"/>
|
||||
<AutoVariable width="fill" target="navbot.best-slot" label="Best Weapon only"/>
|
||||
<AutoVariable width="fill" target="navbot.jump-distance" label="Jump Distance"/>
|
||||
<AutoVariable width="fill" target="navbot.target-sentry" label="Try to target sentries"/>
|
||||
<AutoVariable width="fill" target="navbot.stay-near" label="Zone enemies (stay near)"/>
|
||||
|
@ -20,5 +20,6 @@ void Jump();
|
||||
// Path
|
||||
bool NavToSniperSpot(int priority);
|
||||
bool NavToNearestEnemy();
|
||||
bool NavToBacktrackTick(int priority);
|
||||
|
||||
} // namespace hacks::shared::NavBot
|
||||
|
@ -18,20 +18,27 @@ class EffectChams : public IScreenSpaceEffect
|
||||
{
|
||||
public:
|
||||
virtual void Init();
|
||||
inline virtual void Shutdown(){};
|
||||
inline virtual void Shutdown()
|
||||
{
|
||||
mat_unlit.Shutdown();
|
||||
mat_unlit_z.Shutdown();
|
||||
mat_lit.Shutdown();
|
||||
mat_lit_z.Shutdown();
|
||||
init = false;
|
||||
}
|
||||
|
||||
inline virtual void SetParameters(KeyValues *params){};
|
||||
inline virtual void SetParameters(KeyValues *params){}
|
||||
|
||||
virtual void Render(int x, int y, int w, int h);
|
||||
|
||||
inline virtual void Enable(bool bEnable)
|
||||
{
|
||||
enabled = bEnable;
|
||||
};
|
||||
}
|
||||
inline virtual bool IsEnabled()
|
||||
{
|
||||
return enabled;
|
||||
};
|
||||
}
|
||||
|
||||
void SetEntityColor(CachedEntity *ent, rgba_t color);
|
||||
rgba_t ChamsColor(IClientEntity *entity);
|
||||
|
@ -17,20 +17,28 @@ class EffectGlow : public IScreenSpaceEffect
|
||||
{
|
||||
public:
|
||||
virtual void Init();
|
||||
inline virtual void Shutdown(){};
|
||||
inline virtual void Shutdown(){
|
||||
mat_unlit.Shutdown();
|
||||
mat_unlit_z.Shutdown();
|
||||
mat_blit.Shutdown();
|
||||
mat_unlit.Shutdown();
|
||||
mat_unlit_z.Shutdown();
|
||||
mat_blur_x.Shutdown();
|
||||
mat_blur_y.Shutdown();
|
||||
}
|
||||
|
||||
inline virtual void SetParameters(KeyValues *params){};
|
||||
inline virtual void SetParameters(KeyValues *params){}
|
||||
|
||||
virtual void Render(int x, int y, int w, int h);
|
||||
|
||||
inline virtual void Enable(bool bEnable)
|
||||
{
|
||||
enabled = bEnable;
|
||||
};
|
||||
}
|
||||
inline virtual bool IsEnabled()
|
||||
{
|
||||
return enabled;
|
||||
};
|
||||
}
|
||||
|
||||
void StartStenciling();
|
||||
void EndStenciling();
|
||||
|
@ -118,7 +118,7 @@ void CreateMove()
|
||||
current_user_cmd->buttons |= IN_ATTACK2;
|
||||
|
||||
if (g_pLocalPlayer->weapon()->m_iClassID() == CL_CLASS(CTFMinigun))
|
||||
if (auto_spin_up && !zoomTime.check(3000))
|
||||
if (auto_spin_up && CE_INT(g_pLocalPlayer->weapon(), netvar.m_iClip1) != 0 && !zoomTime.check(1000))
|
||||
current_user_cmd->buttons |= IN_ATTACK2;
|
||||
|
||||
// We do this as we need to pass whether the aimkey allows aiming to both
|
||||
@ -401,9 +401,16 @@ CachedEntity *RetrieveBestTarget(bool aimkey_state)
|
||||
case 1: // Fov Priority
|
||||
scr = 360.0f - calculated_data_array[ent->m_IDX].fov;
|
||||
break;
|
||||
case 3: // Health Priority
|
||||
case 3: // Health Priority (Lowest)
|
||||
scr = 450.0f - ent->m_iHealth();
|
||||
break;
|
||||
case 4: // Distance Priority (Furthest Away)
|
||||
scr = calculated_data_array[i].aim_position.DistTo(
|
||||
g_pLocalPlayer->v_Eye);
|
||||
break;
|
||||
case 6: // Health Priority (Highest)
|
||||
scr = ent->m_iHealth();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -374,6 +374,8 @@ bool ShouldChargePlayer(int idx)
|
||||
const float damage_accum_duration =
|
||||
g_GlobalVars->curtime - data[idx].accum_damage_start;
|
||||
const int health = target->m_iHealth();
|
||||
if (health > g_pPlayerResource->GetMaxHealth(target))
|
||||
return false;
|
||||
if (!data[idx].accum_damage_start)
|
||||
return false;
|
||||
if (health > 30 && data[idx].accum_damage < 45)
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include <glez/draw.hpp>
|
||||
#endif
|
||||
#include <settings/Bool.hpp>
|
||||
#include "PlayerTools.hpp"
|
||||
#include <hacks/Backtrack.hpp>
|
||||
|
||||
static settings::Bool enable{ "backtrack.enable", "false" };
|
||||
@ -124,6 +125,8 @@ void Run()
|
||||
continue;
|
||||
if (!pEntity->hitboxes.GetHitbox(0))
|
||||
continue;
|
||||
if (HasCondition<TFCond_HalloweenGhostMode>(pEntity))
|
||||
continue;
|
||||
float _viewangles = CE_VECTOR(pEntity, netvar.m_angEyeAngles).y;
|
||||
float viewangles =
|
||||
(_viewangles > 180) ? _viewangles - 360 : _viewangles;
|
||||
|
@ -257,7 +257,7 @@ void smart_crouch()
|
||||
if (CE_BAD(ent) || ent->m_Type() != ENTITY_PLAYER ||
|
||||
ent->m_iTeam() == LOCAL_E->m_iTeam() ||
|
||||
!(ent->hitboxes.GetHitbox(0)) || !(ent->m_bAlivePlayer()) ||
|
||||
player_tools::shouldTargetSteamId(ent->player_info.friendsID) !=
|
||||
player_tools::shouldTarget(ent) !=
|
||||
player_tools::IgnoreReason::DO_NOT_IGNORE ||
|
||||
should_ignore_player(ent))
|
||||
continue;
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "common.hpp"
|
||||
#include "NavBot.hpp"
|
||||
#include "Backtrack.hpp"
|
||||
#include "PlayerTools.hpp"
|
||||
#include "navparser.hpp"
|
||||
#include "settings/Bool.hpp"
|
||||
@ -77,7 +78,7 @@ void Init(bool from_LevelInit)
|
||||
}
|
||||
|
||||
static HookedFunction
|
||||
CreateMove(HookedFunctions_types::HF_CreateMove, "NavBot", 10, []() {
|
||||
CreateMove(HookedFunctions_types::HF_CreateMove, "NavBot", 18, []() {
|
||||
// Master Switch
|
||||
|
||||
if (!*enable)
|
||||
@ -119,8 +120,9 @@ static HookedFunction
|
||||
// Stop pathing for ammo/Health if problem resolved
|
||||
if ((!HasLowAmmo() && nav::curr_priority == 6) || ( nav::curr_priority == 7 && !HasLowHealth()))
|
||||
nav::clearInstructions();
|
||||
|
||||
// If Zoning enabled then zone enemy
|
||||
if (stay_near && nav_to_nearest_enemy_cooldown.test_and_set(100))
|
||||
if (stay_near && nav_to_nearest_enemy_cooldown.test_and_set(100) && !*spy_mode)
|
||||
NavToNearestEnemy();
|
||||
|
||||
// Prevent path spam on sniper bots
|
||||
@ -129,8 +131,13 @@ static HookedFunction
|
||||
if (sniper_mode)
|
||||
NavToSniperSpot(5);
|
||||
else if ((*heavy_mode || scout_mode) && nav_to_nearest_enemy_cooldown.test_and_set(100))
|
||||
{
|
||||
if (!NavToNearestEnemy() && non_sniper_sniper_nav_cooldown.test_and_set(10000))
|
||||
NavToSniperSpot(5);
|
||||
}
|
||||
else if (*spy_mode && nav_to_nearest_enemy_cooldown.test_and_set(100))
|
||||
if (!NavToBacktrackTick(5) && non_sniper_sniper_nav_cooldown.test_and_set(10000))
|
||||
NavToSniperSpot(5);
|
||||
}
|
||||
if (*pick_optimal_slot)
|
||||
UpdateSlot();
|
||||
@ -326,6 +333,36 @@ Vector GetClosestValidByDist(CachedEntity *ent, float mindist, float maxdist, bo
|
||||
return cached_vector;
|
||||
}
|
||||
|
||||
void UpdateSlot()
|
||||
{
|
||||
if (!slot_timer.test_and_set(1000))
|
||||
return;
|
||||
if (CE_GOOD(LOCAL_E) && CE_GOOD(LOCAL_W) && !g_pLocalPlayer->life_state)
|
||||
{
|
||||
IClientEntity *weapon = RAW_ENT(LOCAL_W);
|
||||
// IsBaseCombatWeapon()
|
||||
if (re::C_BaseCombatWeapon::IsBaseCombatWeapon(weapon))
|
||||
{
|
||||
int slot = re::C_BaseCombatWeapon::GetSlot(weapon);
|
||||
int newslot = 1;
|
||||
if (*spy_mode)
|
||||
newslot = 3;
|
||||
if (slot != newslot - 1)
|
||||
g_IEngine->ClientCmd_Unrestricted(
|
||||
format("slot", newslot).c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Jump()
|
||||
{
|
||||
CachedEntity *ent = nearestEnemy();
|
||||
if (CE_BAD(ent))
|
||||
return;
|
||||
if (ent->m_flDistance() < *jump_trigger && jump_cooldown.test_and_set(200))
|
||||
current_user_cmd->buttons |= IN_JUMP;
|
||||
}
|
||||
|
||||
// Navigation
|
||||
bool NavToSniperSpot(int priority)
|
||||
{
|
||||
@ -430,34 +467,52 @@ bool NavToNearestEnemy()
|
||||
return false;
|
||||
}
|
||||
|
||||
void UpdateSlot()
|
||||
{
|
||||
if (!slot_timer.test_and_set(1000))
|
||||
return;
|
||||
if (CE_GOOD(LOCAL_E) && CE_GOOD(LOCAL_W) && !g_pLocalPlayer->life_state)
|
||||
{
|
||||
IClientEntity *weapon = RAW_ENT(LOCAL_W);
|
||||
// IsBaseCombatWeapon()
|
||||
if (re::C_BaseCombatWeapon::IsBaseCombatWeapon(weapon))
|
||||
{
|
||||
int slot = re::C_BaseCombatWeapon::GetSlot(weapon);
|
||||
int newslot = 1;
|
||||
if (*spy_mode)
|
||||
newslot = 3;
|
||||
if (slot != newslot - 1)
|
||||
g_IEngine->ClientCmd_Unrestricted(
|
||||
format("slot", newslot).c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Jump()
|
||||
bool NavToBacktrackTick(int priority)
|
||||
{
|
||||
CachedEntity *ent = nearestEnemy();
|
||||
if (CE_BAD(ent))
|
||||
return;
|
||||
if (ent->m_flDistance() < *jump_trigger && jump_cooldown.test_and_set(200))
|
||||
current_user_cmd->buttons |= IN_JUMP;
|
||||
return false;
|
||||
// Health and ammo are more important
|
||||
if (nav::curr_priority == 6 || nav::curr_priority == 7)
|
||||
return false;
|
||||
// Just backtrack data
|
||||
auto unsorted_ticks = hacks::shared::backtrack::
|
||||
headPositions[ent->m_IDX];
|
||||
// Vector needed for later
|
||||
std::vector<hacks::shared::backtrack::BacktrackData>
|
||||
sorted_ticks;
|
||||
|
||||
// Only use good ticks
|
||||
for (int i = 0; i < 66; i++)
|
||||
{
|
||||
if (hacks::shared::backtrack::ValidTick(
|
||||
unsorted_ticks[i], ent))
|
||||
sorted_ticks.push_back(unsorted_ticks[i]);
|
||||
}
|
||||
// Nav to Ent origin if everything falls flat
|
||||
if (sorted_ticks.empty())
|
||||
{
|
||||
if (nav::navTo(ent->m_vecOrigin(), 5, false, false))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
// Sort by tickcount
|
||||
std::sort(
|
||||
sorted_ticks.begin(), sorted_ticks.end(),
|
||||
[](const hacks::shared::backtrack::BacktrackData
|
||||
&a,
|
||||
const hacks::shared::backtrack::BacktrackData
|
||||
&b) {
|
||||
return a.tickcount > b.tickcount;
|
||||
});
|
||||
|
||||
// Get the 5th tick and path to it, better than pathing to the last tick since the bot may just lag behind and never reach it
|
||||
if (!sorted_ticks[5].tickcount ||
|
||||
!nav::navTo(sorted_ticks[5].entorigin, priority, false,
|
||||
false))
|
||||
if (!nav::navTo(ent->m_vecOrigin(), priority, false))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace hacks::shared::NavBot
|
||||
|
@ -32,7 +32,10 @@ static settings::Bool disco_chams{ "chams.disco", "false" };
|
||||
|
||||
namespace effect_chams
|
||||
{
|
||||
|
||||
CatCommand fix_black_chams("fix_black_chams", "Fix Black Chams", [](){
|
||||
effect_chams::g_EffectChams.Shutdown();
|
||||
effect_chams::g_EffectChams.Init();
|
||||
});
|
||||
void EffectChams::Init()
|
||||
{
|
||||
logging::Info("Init EffectChams...");
|
||||
@ -79,7 +82,7 @@ void EffectChams::EndRenderChams()
|
||||
CMatRenderContextPtr ptr(GET_RENDER_CONTEXT);
|
||||
g_IVModelRender->ForcedMaterialOverride(nullptr);
|
||||
}
|
||||
static rgba_t data[32] = {};
|
||||
static rgba_t data[32] = {colors::empty};
|
||||
void EffectChams::SetEntityColor(CachedEntity *ent, rgba_t color)
|
||||
{
|
||||
if (ent->m_IDX > 31 || ent->m_IDX < 0)
|
||||
@ -151,10 +154,11 @@ rgba_t EffectChams::ChamsColor(IClientEntity *entity)
|
||||
}
|
||||
return disco;
|
||||
}
|
||||
if (data[entity->entindex()])
|
||||
if (data[entity->entindex()] != colors::empty)
|
||||
{
|
||||
data[entity->entindex()] = {};
|
||||
return data[entity->entindex()];
|
||||
auto toret = data[entity->entindex()];
|
||||
data[entity->entindex()] = colors::empty;
|
||||
return toret;
|
||||
}
|
||||
if (CE_BAD(ent))
|
||||
return colors::white;
|
||||
@ -327,7 +331,6 @@ void EffectChams::RenderChams(IClientEntity *entity)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EffectChams::Render(int x, int y, int w, int h)
|
||||
{
|
||||
PROF_SECTION(DRAW_chams);
|
||||
@ -351,7 +354,6 @@ void EffectChams::Render(int x, int y, int w, int h)
|
||||
}
|
||||
EndRenderChams();
|
||||
}
|
||||
|
||||
EffectChams g_EffectChams;
|
||||
CScreenSpaceEffectRegistration *g_pEffectChams = nullptr;
|
||||
} // namespace effect_chams
|
||||
|
@ -138,6 +138,11 @@ static ShaderStencilState_t SS_SolidInvisible{};
|
||||
static ShaderStencilState_t SS_Null{};
|
||||
static ShaderStencilState_t SS_Drawing{};
|
||||
|
||||
CatCommand fix_black_glow("fix_black_glow", "Fix Black Glow", [](){
|
||||
effect_glow::g_EffectGlow.Shutdown();
|
||||
effect_glow::g_EffectGlow.Init();
|
||||
});
|
||||
|
||||
void EffectGlow::Init()
|
||||
{
|
||||
logging::Info("Init Glow...");
|
||||
|
Reference in New Issue
Block a user