Added some new stuff owo

This commit is contained in:
julianacat 2017-06-17 22:30:43 -05:00
parent 090b47b4de
commit 1cafa2b505
12 changed files with 95 additions and 6 deletions

View File

@ -249,6 +249,20 @@ void draw::OutlineRect(int x, int y, int w, int h, int color) {
g_ISurface->DrawOutlinedRect(x, y, x + w, y + h);
}
//Potentially broken circle draw
void draw::DrawCircle(float x, float y, float r, int num_segments, int color) {
if (num_segments < 3 || r == 0 ) return;
g_ISurface->DrawSetColor(*reinterpret_cast<Color*>(&color));
float Step = PI * 2.0 / num_segments;
for (float a = 0; a < (PI*2.0); a += Step) {
float x1 = r * cos(a) + x;
float y1 = r * sin(a) + y;
float x2 = r * cos(a + Step) + x;
float y2 = r * sin(a + Step) + y;
g_ISurface->DrawLine(x1, y1, x2, y2);
}
}
void draw::GetStringLength(unsigned long font, char* string, int& length, int& height) {
wchar_t buf[512];
memset(buf, 0, sizeof(wchar_t) * 512);

View File

@ -100,6 +100,7 @@ void DrawLine(int x, int y, int dx, int dy, int color);
bool WorldToScreen(Vector &origin, Vector &screen);
bool EntityCenterToScreen(CachedEntity* entity, Vector& out);
void OutlineRect(int x, int y, int w, int h, int color);
void DrawCircle(float cx, float cy, float r, int num_segments, int color);
void GetStringLength(unsigned long font, char* string, int& length, int& height);
std::pair<int, int> GetStringLength(unsigned long font, std::string string);
//void DrawString(unsigned font_handle, int x, int y, Color color, const char* text, ...);

View File

@ -625,6 +625,9 @@ static const std::string list_tf2 = R"(
"log"
]
]
"deboog1"
"deboog2"
"deboog3"
)";
List& MainList() {

View File

@ -105,6 +105,11 @@ static CatVar slowaim(CV_SWITCH, "aimbot_slow", "0", "Slow Aim", "Slowly moves y
static CatVar slowaim_smoothing(CV_INT, "aimbot_slow_smooth", "10", "Slow Aim Smooth", "How slow the slow aim's aiming should be", 50);
static CatVar slowaim_autoshoot(CV_INT, "aimbot_slow_autoshoot", "10", "Slow Aim Threshhold", "Distance to autoshoot while smooth aiming", 25);
static CatVar aimbot_debug(CV_SWITCH, "aimbot_debug", "0", "Aimbot Debug", "Print some internal state info for aimbot");
bool slowCanShoot = false;
/*//Salting vars that need to be saved due to them being time based
@ -278,6 +283,7 @@ void CreateMove() {
minigun_fix_ticks && (local_state == EAimbotLocalState::GOOD)) {
Aim(ENTITY(last_target));
}
if (silent) g_pLocalPlayer->bUseSilentAngles = true;
return;
}
@ -294,7 +300,7 @@ const Vector& PredictEntity(CachedEntity* entity) {
if (cd.predict_tick == tickcount) return result;
if ((entity->m_Type == ENTITY_PLAYER)) {
if (projectile_mode) {
result = ProjectilePrediction(entity, cd.hitbox, cur_proj_speed, cur_proj_grav, PlayerGravityMod(entity));
result = ProjectilePrediction(entity, cd.hitbox, cur_proj_speed, cur_proj_grav, PlayerGravityMod(entity));
} else {
if (lerp)
result = SimpleLatencyPrediction(entity, cd.hitbox);
@ -758,6 +764,28 @@ int BestHitbox(CachedEntity* target) {
}
return -1;
}
void Draw() {
//Fov ring to represent when a target will be shot
//Not perfect but does a good job of representing where its supposed to be
if (fov_draw) {
//It cant use fovs greater than 180, so we check for that
if ((int)fov < 180 && fov) {
//Dont show ring while player is dead
if (!LOCAL_E->m_bAlivePlayer) {
//Grab the screen resolution and save to some vars
int width, height;
g_IEngine->GetScreenSize(width, height);
//Grab the cvar for fov_desired and attach to another var
static ConVar *realFov = g_ICvar->FindVar("fov_desired");
//Some math to find radius of the fov circle
float radius = tanf(DEG2RAD((float)fov) / 2) / tanf(DEG2RAD((int)realFov)/ 2) * width;
//Draw a circle with our newfound circle
draw::DrawCircle( width / 2 ,height / 2, radius, 35, GUIColor());
}
}
}
}
}}}

View File

@ -92,6 +92,7 @@ bool VischeckPredictedEntity(CachedEntity* entity);
void CreateMove();
void PaintTraverse();
void Reset();
void Draw();
extern EAimbotState state;
extern int target_eid;

View File

@ -244,6 +244,7 @@ void DrawBones(CachedEntity* ent, int clr) {
draw::WorldToScreen(boneStart, scnSrt);
draw::WorldToScreen(boneEnd, scnEnd);
draw::DrawLine(scnSrt.x, scnSrt.y, scnEnd.x - scnSrt.x, scnEnd.y - scnSrt.y, clr);
}
}

View File

@ -497,6 +497,34 @@ void DoWalking() {
}
}
}
/*static CatVar crumbDraw(CV_SWITCH, "fb_crumb_draw", "1", "Draw Crumbs", "Draws the path made for the followbot");
void DrawCrumbs() {
Vector scnSrt, scnEnd;
int tmpCrumb;
for (int i = 0; i < crumbArrayLength; i++) {
tmpCrumb = crumbBottom + i;
if (tmpCrumb >= 55)
tmpCrumb - 55;
draw::WorldToScreen(breadcrumbs[tmpCrumb], scnSrt);
if (tmpCrumb >= 54)
draw::WorldToScreen(breadcrumbs[tmpCrumb - 54], scnEnd);
else
draw::WorldToScreen(breadcrumbs[tmpCrumb + 1], scnEnd);
draw::DrawLine(scnSrt.x, scnSrt.y, scnEnd.x - scnSrt.x, scnEnd.y - scnSrt.y, colors::white);
logging::Info("draw");
}
}
void Draw() {
//if (!bot) return;
if (crumbDraw) {
if (crumbArrayLength >= 2)
void DrawCrumbs();
}
}*/
}}}

View File

@ -31,6 +31,7 @@ void DoWalking();
void PrintDebug();
void AddMessageHandlers(ipc::peer_t* peer);
void AfterCreateMove();
//void Draw();
}}}

View File

@ -133,6 +133,8 @@ int StartSceneEvent_hooked(IClientEntity* _this, int sceneInfo, int choreoScene,
float last_bucket = 0;
static CatVar tauntslide_moveable(CV_SWITCH, "tauntslide_moveable", "0", "Taunt Slide", "Allows free movement while taunting with movable taunts\nOnly works in tf2");
void CreateMove() {
static bool flswitch = false;
static IClientEntity *localplayer, *weapon, *last_weapon = nullptr;
@ -143,7 +145,17 @@ void CreateMove() {
static bool changed = false;
static ConVar *pNoPush = g_ICvar->FindVar("tf_avoidteammates_pushaway");
//Only work if the catvar enables it
if (tauntslide_moveable) {
//If the local player is taunting
if (HasCondition<TFCond_Taunting>(LOCAL_E)) {
//Set actual angles = the third person cameras angle
g_pUserCmd->viewangles.y = g_pLocalPlayer->v_OrigViewangles.y;
//Use silent since we dont want to prevent the player from looking around
g_pLocalPlayer->bUseSilentAngles = true;
}
}
if (no_taunt_ticks && CE_GOOD(LOCAL_E)) {
RemoveCondition<TFCond_Taunting>(LOCAL_E);
no_taunt_ticks--;

View File

@ -705,7 +705,8 @@ bool IsEntityVisiblePenetration(CachedEntity* entity, int hb) {
void RunEnginePrediction(IClientEntity* ent, CUserCmd *ucmd) {
if (!ent) return;
//if (CE_BAD( ENTITY(ent->entindex()) )) return;
typedef void(*SetupMoveFn)(IPrediction*, IClientEntity *, CUserCmd *, class IMoveHelper *, CMoveData *);
typedef void(*FinishMoveFn)(IPrediction*, IClientEntity *, CUserCmd*, CMoveData*);
@ -727,7 +728,7 @@ void RunEnginePrediction(IClientEntity* ent, CUserCmd *ucmd) {
g_GlobalVars->curtime = g_GlobalVars->interval_per_tick * NET_INT(ent, netvar.nTickBase);
g_GlobalVars->frametime = g_GlobalVars->interval_per_tick;
*g_PredictionRandomSeed = MD5_PseudoRandom(g_pUserCmd->command_number) & 0x7FFFFFFF;
g_IGameMovement->StartTrackPredictionErrors(reinterpret_cast<CBasePlayer*>(ent));
oSetupMove(g_IPrediction, ent, ucmd, NULL, pMoveData);

View File

@ -198,6 +198,7 @@ void PaintTraverse_hook(void* _this, unsigned int vp, bool fr, bool ar) {
}
{
SAFE_CALL(hacks::shared::aimbot::PaintTraverse());
SAFE_CALL(hacks::shared::aimbot::Draw());
}
}

View File

@ -130,8 +130,6 @@ void CreateInterfaces() {
g_ISteamUserStats = g_ISteamClient->GetISteamUserStats(su, sp, "STEAMUSERSTATS_INTERFACE_VERSION011");
if (!g_PredictionRandomSeed) {
uintptr_t sig = gSignatures.GetClientSignature("89 1C 24 D9 5D D4 FF 90 3C 01 00 00 89 C7 8B 06 89 34 24 C1 E7 08 FF 90 3C 01 00 00 09 C7 33 3D ? ? ? ? 39 BB 34 0B 00 00 74 0E 89 BB 34 0B 00 00 89 3C 24 E8 ? ? ? ? C7 44 24 04 0F 27 00 00");
logging::Info("Random Seed: 0x%08x", sig + 32);
logging::Info("Random Seed: 0x%08x", *(int**)(sig + 32));
g_PredictionRandomSeed = *reinterpret_cast<int**>(sig + (uintptr_t)32);
}
}