commit
2516501eb3
5
TODO
5
TODO
@ -1,8 +1,3 @@
|
|||||||
// TODO - MUST do before merging into master (unless removed).
|
|
||||||
|
|
||||||
1. Re-add radar and emoji esp
|
|
||||||
2. Locate most of the crashes
|
|
||||||
|
|
||||||
//==================================================================================================//
|
//==================================================================================================//
|
||||||
//Big TODO list for cathook //
|
//Big TODO list for cathook //
|
||||||
//Organized by Julianacat //
|
//Organized by Julianacat //
|
||||||
|
@ -77,6 +77,7 @@ bool IsEntityVectorVisible(CachedEntity *entity, Vector endpos);
|
|||||||
bool VisCheckEntFromEnt(CachedEntity *startEnt, CachedEntity *endEnt);
|
bool VisCheckEntFromEnt(CachedEntity *startEnt, CachedEntity *endEnt);
|
||||||
bool VisCheckEntFromEntVector(Vector startVector, CachedEntity *startEnt,
|
bool VisCheckEntFromEntVector(Vector startVector, CachedEntity *startEnt,
|
||||||
CachedEntity *endEnt);
|
CachedEntity *endEnt);
|
||||||
|
Vector VischeckWall(CachedEntity *player, CachedEntity *target, float maxdist);
|
||||||
|
|
||||||
bool LineIntersectsBox(Vector &bmin, Vector &bmax, Vector &lmin, Vector &lmax);
|
bool LineIntersectsBox(Vector &bmin, Vector &bmax, Vector &lmin, Vector &lmax);
|
||||||
|
|
||||||
|
@ -108,13 +108,17 @@ void runcfg()
|
|||||||
logging::Info("Couldn't open the file!");
|
logging::Info("Couldn't open the file!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
file << "exec cat_defaults\n";
|
||||||
for (const auto &i : CatVarList())
|
for (const auto &i : CatVarList())
|
||||||
{
|
{
|
||||||
if (!i)
|
if (!i)
|
||||||
continue;
|
continue;
|
||||||
if (!i->GetString())
|
if (!i->GetString())
|
||||||
continue;
|
continue;
|
||||||
|
if (i->GetBase() != std::string(i->GetString()))
|
||||||
|
{
|
||||||
file << CON_PREFIX << i->name << " \"" << i->GetString() << "\"\n";
|
file << CON_PREFIX << i->name << " \"" << i->GetString() << "\"\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,8 @@ static CatVar afk(CV_SWITCH, "fb_afk", "1", "Switch target if AFK",
|
|||||||
static CatVar afktime(
|
static CatVar afktime(
|
||||||
CV_INT, "fb_afk_time", "15000", "Max AFK Time",
|
CV_INT, "fb_afk_time", "15000", "Max AFK Time",
|
||||||
"Max time in ms spent standing still before player gets declared afk");
|
"Max time in ms spent standing still before player gets declared afk");
|
||||||
|
static CatVar corneractivate(CV_SWITCH, "fb_activation_corners", "1", "Activate arround corners",
|
||||||
|
"Try to find an activation path to an entity behind a corner.");
|
||||||
|
|
||||||
// Something to store breadcrumbs created by followed players
|
// Something to store breadcrumbs created by followed players
|
||||||
static std::vector<Vector> breadcrumbs;
|
static std::vector<Vector> breadcrumbs;
|
||||||
@ -140,8 +142,19 @@ void WorldTick()
|
|||||||
|
|
||||||
if (!entity->m_bAlivePlayer()) // Dont follow dead players
|
if (!entity->m_bAlivePlayer()) // Dont follow dead players
|
||||||
continue;
|
continue;
|
||||||
if (!VisCheckEntFromEnt(LOCAL_E, entity))
|
if (corneractivate)
|
||||||
continue;
|
{
|
||||||
|
Vector indirectOrigin = VischeckWall(LOCAL_E, entity, 250); //get the corner location that the future target is visible from
|
||||||
|
if (!indirectOrigin.z) //if we couldn't find it, exit
|
||||||
|
continue;
|
||||||
|
breadcrumbs.clear(); //we need to ensure that the breadcrumbs std::vector is empty
|
||||||
|
breadcrumbs.push_back(indirectOrigin); //add the corner location to the breadcrumb list
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!VisCheckEntFromEnt(LOCAL_E, entity))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
follow_target = entity->m_IDX;
|
follow_target = entity->m_IDX;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -173,8 +186,6 @@ void WorldTick()
|
|||||||
if (follow_activation &&
|
if (follow_activation &&
|
||||||
entity->m_flDistance() > (float) follow_activation)
|
entity->m_flDistance() > (float) follow_activation)
|
||||||
continue;
|
continue;
|
||||||
if (!VisCheckEntFromEnt(LOCAL_E, entity))
|
|
||||||
continue;
|
|
||||||
const model_t *model =
|
const model_t *model =
|
||||||
ENTITY(follow_target)->InternalEntity()->GetModel();
|
ENTITY(follow_target)->InternalEntity()->GetModel();
|
||||||
if (followcart && model &&
|
if (followcart && model &&
|
||||||
@ -189,6 +200,19 @@ void WorldTick()
|
|||||||
follow_target = entity->m_IDX;
|
follow_target = entity->m_IDX;
|
||||||
if (entity->m_Type() != ENTITY_PLAYER)
|
if (entity->m_Type() != ENTITY_PLAYER)
|
||||||
continue;
|
continue;
|
||||||
|
if (corneractivate)
|
||||||
|
{
|
||||||
|
Vector indirectOrigin = VischeckWall(LOCAL_E, entity, 250); //get the corner location that the future target is visible from
|
||||||
|
if (!indirectOrigin.z) //if we couldn't find it, exit
|
||||||
|
continue;
|
||||||
|
breadcrumbs.clear(); //we need to ensure that the breadcrumbs std::vector is empty
|
||||||
|
breadcrumbs.push_back(indirectOrigin); //add the corner location to the breadcrumb list
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!VisCheckEntFromEnt(LOCAL_E, entity))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (follow_target &&
|
if (follow_target &&
|
||||||
ENTITY(follow_target)->m_flDistance() >
|
ENTITY(follow_target)->m_flDistance() >
|
||||||
entity->m_flDistance()) // favor closer entitys
|
entity->m_flDistance()) // favor closer entitys
|
||||||
@ -266,7 +290,7 @@ void WorldTick()
|
|||||||
if (dist_to_target > (float) follow_distance)
|
if (dist_to_target > (float) follow_distance)
|
||||||
{
|
{
|
||||||
// Check for idle
|
// Check for idle
|
||||||
if (autojump && idle_time.check(3000))
|
if (autojump && idle_time.check(2000))
|
||||||
g_pUserCmd->buttons |= IN_JUMP;
|
g_pUserCmd->buttons |= IN_JUMP;
|
||||||
if (idle_time.test_and_set(5000))
|
if (idle_time.test_and_set(5000))
|
||||||
{
|
{
|
||||||
|
@ -106,6 +106,51 @@ void WalkTo(const Vector &vector)
|
|||||||
g_pUserCmd->sidemove = result.second;
|
g_pUserCmd->sidemove = result.second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Function to get the corner location that a vischeck to an entity is possible
|
||||||
|
// from
|
||||||
|
Vector VischeckWall(CachedEntity *player, CachedEntity *target, float maxdist)
|
||||||
|
{
|
||||||
|
int maxiterations = maxdist / 40;
|
||||||
|
Vector origin = player->m_vecOrigin();
|
||||||
|
|
||||||
|
if (VisCheckEntFromEnt(player, target)) // if we can see an entity, we don't
|
||||||
|
// need to run calculations
|
||||||
|
return origin;
|
||||||
|
for (int i = 0; i < 4; i++) // for loop for all 4 directions
|
||||||
|
{
|
||||||
|
for (int j = 0; j < maxiterations;
|
||||||
|
j++) // 40 * maxiterations = range in HU
|
||||||
|
{
|
||||||
|
Vector virtualOrigin = origin;
|
||||||
|
switch (i) // what direction to go in
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
virtualOrigin.x = virtualOrigin.x + 40 * (j + 1);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
virtualOrigin.x = virtualOrigin.x - 40 * (j + 1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
virtualOrigin.y = virtualOrigin.y + 40 * (j + 1);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
virtualOrigin.y = virtualOrigin.y - 40 * (j + 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!IsVectorVisible(origin,
|
||||||
|
virtualOrigin)) // check if player can see the
|
||||||
|
// players virtualOrigin
|
||||||
|
continue;
|
||||||
|
if (VisCheckEntFromEntVector(
|
||||||
|
virtualOrigin, player,
|
||||||
|
target)) // check if the virtualOrigin can see the target
|
||||||
|
return virtualOrigin; // return the corner position that we know
|
||||||
|
// can see the target
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return { 0, 0, 0 };
|
||||||
|
}
|
||||||
|
|
||||||
std::string GetLevelName()
|
std::string GetLevelName()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -697,6 +697,8 @@ static const std::string list_tf2 = R"(
|
|||||||
"fb_always_medigun"
|
"fb_always_medigun"
|
||||||
"fb_roaming"
|
"fb_roaming"
|
||||||
"fb_draw"
|
"fb_draw"
|
||||||
|
"fb_afk"
|
||||||
|
"fb_afk_time"
|
||||||
]
|
]
|
||||||
"Catbot Utilities"[
|
"Catbot Utilities"[
|
||||||
"Catbot Utilities Menu"
|
"Catbot Utilities Menu"
|
||||||
|
Reference in New Issue
Block a user