Merge pull request #78 from julianacan9999/master
Slow Aim Update + Remove broken code
This commit is contained in:
commit
d4ab73c7d7
@ -240,11 +240,11 @@ static const std::string list_tf2 = R"(
|
|||||||
"aimbot_aimkey"
|
"aimbot_aimkey"
|
||||||
"aimbot_aimkey_mode"
|
"aimbot_aimkey_mode"
|
||||||
"aimbot_autoshoot"
|
"aimbot_autoshoot"
|
||||||
"aimbot_autoshoot_delay"
|
|
||||||
"aimbot_hitboxmode"
|
"aimbot_hitboxmode"
|
||||||
"aimbot_fov"
|
"aimbot_fov"
|
||||||
"aimbot_prioritymode"
|
"aimbot_prioritymode"
|
||||||
"aimbot_charge"
|
"aimbot_charge"
|
||||||
|
"aimbot_slow"
|
||||||
"Ignore" [
|
"Ignore" [
|
||||||
"Ignore/Respect Menu"
|
"Ignore/Respect Menu"
|
||||||
"aimbot_respect_vaccinator"
|
"aimbot_respect_vaccinator"
|
||||||
@ -269,6 +269,7 @@ static const std::string list_tf2 = R"(
|
|||||||
"aimbot_zoomed"
|
"aimbot_zoomed"
|
||||||
"aimbot_only_when_can_shoot"
|
"aimbot_only_when_can_shoot"
|
||||||
"aimbot_enable_attack_only"
|
"aimbot_enable_attack_only"
|
||||||
|
"aimbot_slow_shunt"
|
||||||
"aimbot_maxrange"
|
"aimbot_maxrange"
|
||||||
"aimbot_interp"
|
"aimbot_interp"
|
||||||
"Projectile Aimbot" [
|
"Projectile Aimbot" [
|
||||||
|
@ -26,9 +26,6 @@ bool headonly { false };
|
|||||||
int last_target { -1 };
|
int last_target { -1 };
|
||||||
bool silent_huntsman { false };
|
bool silent_huntsman { false };
|
||||||
|
|
||||||
int iTickAutoshootDelay { 0 };
|
|
||||||
static CatVar autoshoot_delay(CV_FLOAT, "aimbot_autoshoot_delay", "0", "Autoshoot Delay", "Delays your shot to increase accuracy", 100.0);
|
|
||||||
|
|
||||||
static CatVar ignore_hoovy(CV_SWITCH, "aimbot_ignore_hoovy", "0", "Ignore Hoovies", "Aimbot won't attack hoovies");
|
static CatVar ignore_hoovy(CV_SWITCH, "aimbot_ignore_hoovy", "0", "Ignore Hoovies", "Aimbot won't attack hoovies");
|
||||||
|
|
||||||
int ClosestHitbox(CachedEntity* target) {
|
int ClosestHitbox(CachedEntity* target) {
|
||||||
@ -294,6 +291,19 @@ int ShouldTarget(CachedEntity* entity) {
|
|||||||
return 27;
|
return 27;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Initialize vars for slow aim
|
||||||
|
static CatVar slowaim(CV_SWITCH, "aimbot_slow", "0", "Slow Aim", "Slowly moves your crosshair onto the targets face\nUse with triggerbot.\nSilent breaks this");
|
||||||
|
static CatVar slowaim_shunting(CV_FLOAT, "aimbot_slow_shunt", "0", "Slow Aim Shunt", "How strongly to shunt the aiming.", 100);
|
||||||
|
float changey;
|
||||||
|
float changex;
|
||||||
|
float sai;
|
||||||
|
float origx;
|
||||||
|
float origy;
|
||||||
|
float angiex;
|
||||||
|
float angiey;
|
||||||
|
int slowfliptype;
|
||||||
|
int slowdir;
|
||||||
|
|
||||||
bool Aim(CachedEntity* entity, CUserCmd* cmd) {
|
bool Aim(CachedEntity* entity, CUserCmd* cmd) {
|
||||||
//logging::Info("Aiming!");
|
//logging::Info("Aiming!");
|
||||||
Vector hit;
|
Vector hit;
|
||||||
@ -316,17 +326,83 @@ bool Aim(CachedEntity* entity, CUserCmd* cmd) {
|
|||||||
//logging::Info("ayyming!");
|
//logging::Info("ayyming!");
|
||||||
Vector tr = (hit - g_pLocalPlayer->v_Eye);
|
Vector tr = (hit - g_pLocalPlayer->v_Eye);
|
||||||
fVectorAngles(tr, angles);
|
fVectorAngles(tr, angles);
|
||||||
bool smoothed = false;
|
|
||||||
/*if (this->v_bSmooth->GetBool()) {
|
//Needed for logic to determine whether to use slow aim. Without this, sai set to 0 will loop and freeze system
|
||||||
Vector da = (angles - g_pLocalPlayer->v_OrigViewangles);
|
sai = slowaim_shunting;
|
||||||
fClampAngle(da);
|
if ( (slowaim == 1) && (silent == false) && (sai > 0) ) {
|
||||||
smoothed = true;
|
//Save info to vars that are easy to work with
|
||||||
if (da.IsZero(v_fSmoothAutoshootTreshold->GetFloat())) smoothed = false;
|
origx = cmd->viewangles.x;
|
||||||
da *= this->v_fSmoothValue->GetFloat() * (((float)rand() / (float)RAND_MAX) * this->v_fSmoothRandomness->GetFloat());
|
origy = cmd->viewangles.y;
|
||||||
angles = g_pLocalPlayer->v_OrigViewangles + da;
|
angiex = angles.x;
|
||||||
}*/
|
angiey = angles.y;
|
||||||
|
|
||||||
|
//Angle clamping for when the aimbot chooses a too high of value
|
||||||
|
if (angiey > 180) angiey = angiey - 360;
|
||||||
|
if (angiey < -180) angiey = angiey + 360;
|
||||||
|
|
||||||
|
//Determine whether to move the mouse at all for the yaw
|
||||||
|
if (origy != angiey) {
|
||||||
|
|
||||||
|
//Fliping The main axis to prevent 360s from happening when the bot trys to cross -180y and 180y
|
||||||
|
slowfliptype = 0;
|
||||||
|
if ( ((angiey < -90) && (origy > 90)) && (slowfliptype == 0) ) {
|
||||||
|
slowfliptype = 1;
|
||||||
|
angiey = angiey - 90;
|
||||||
|
origy = origy + 90;
|
||||||
|
}
|
||||||
|
if ( ((angiey > 90) && (origy < -90)) && (slowfliptype == 0) ) {
|
||||||
|
slowfliptype = 2;
|
||||||
|
angiey = angiey + 90;
|
||||||
|
origy = origy - 90;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Math to calculate how much to move the mouse
|
||||||
|
changey = (std::abs(origy - angiey)) / (sai) ;
|
||||||
|
//Use stronger shunting due to the flip
|
||||||
|
if (slowfliptype != 0) changey = ((( std::abs(origy - angiey) ) / (sai * sai)) / sai) ;
|
||||||
|
|
||||||
|
//Determine the direction to move in before reseting the flipped angles
|
||||||
|
slowdir = 0;
|
||||||
|
if ((origy > angiey) && (slowdir == 0)) slowdir = 1;
|
||||||
|
if ((origy < angiey) && (slowdir == 0)) slowdir = 2;
|
||||||
|
|
||||||
|
//Reset Flipped angles and fix directions
|
||||||
|
if (slowfliptype == 1) {
|
||||||
|
angiey = angiey + 90;
|
||||||
|
origy = origy - 90;
|
||||||
|
slowdir = 2;
|
||||||
|
}
|
||||||
|
if (slowfliptype == 2) {
|
||||||
|
angiey = angiey - 90;
|
||||||
|
origy = origy + 90;
|
||||||
|
slowdir = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Move in the direction determined before the fliped angles
|
||||||
|
if (slowdir == 1) angles.y = origy - changey;
|
||||||
|
if (slowdir == 2) angles.y = origy + changey;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Angle clamping for when the aimbot chooses a too high of value, fixes for when players are above your player
|
||||||
|
if (angiex > 89) angiex = angiex - 360;
|
||||||
|
|
||||||
|
//Determine whether to move the mouse at all for the pitch
|
||||||
|
if (origx != angiex) {
|
||||||
|
changex = (std::abs(origx - angiex)) / (sai) ;
|
||||||
|
//Determine the direction to move in
|
||||||
|
if (origx > angiex) angles.x = origx - changex;
|
||||||
|
if (origx < angiex) angles.x = origx + changex;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Set the newly determined angles
|
||||||
fClampAngle(angles);
|
fClampAngle(angles);
|
||||||
cmd->viewangles = angles;
|
cmd->viewangles = angles;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
//When slow aim is off, use the default angles.
|
||||||
|
fClampAngle(angles);
|
||||||
|
cmd->viewangles = angles;
|
||||||
|
}
|
||||||
if (silent) {
|
if (silent) {
|
||||||
g_pLocalPlayer->bUseSilentAngles = true;
|
g_pLocalPlayer->bUseSilentAngles = true;
|
||||||
}
|
}
|
||||||
@ -346,29 +422,35 @@ bool Aim(CachedEntity* entity, CUserCmd* cmd) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool autoshoot_delay_bool = false;
|
//Autoshoot breaks Slow aimbot
|
||||||
if ( autoshoot_delay == 0 ) {
|
if (slowaim == true) attack = false;
|
||||||
bool autoshoot_delay_bool = false;
|
|
||||||
} else {
|
|
||||||
bool autoshoot_delay_bool = true;
|
|
||||||
}
|
|
||||||
int autoshootdelayvar = autoshoot_delay;
|
|
||||||
if ( attack == false ) {
|
|
||||||
iTickAutoshootDelay = 0;
|
|
||||||
}
|
|
||||||
if ( attack && autoshoot_delay_bool ) {
|
|
||||||
if ( (iTickAutoshootDelay++ / 200 ) >= autoshootdelayvar ) {
|
|
||||||
cmd->buttons |= IN_ATTACK;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ( attack ) {
|
if ( attack ) {
|
||||||
cmd->buttons |= IN_ATTACK;
|
cmd->buttons |= IN_ATTACK;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Broken Autoshoot delay code
|
||||||
|
//Ripped from AAAA timer
|
||||||
|
float autoshoot_timer_start = 0.0f;
|
||||||
|
float autoshoot_timer = 0.0f;
|
||||||
|
|
||||||
|
void UpdateAutoShootTimer() {
|
||||||
|
const float& curtime = g_GlobalVars->curtime;
|
||||||
|
if (autoshoot_timer_start > curtime) autoshoot_timer_start = 0.0f;
|
||||||
|
if (!autoshoot_timer || !autoshoot_timer_start) {
|
||||||
|
autoshoot_timer = autoshoot_delay;
|
||||||
|
autoshoot_timer_start = curtime;
|
||||||
|
} else {
|
||||||
|
if (curtime - autoshoot_timer_start > autoshoot_timer) {
|
||||||
|
cmd->buttons |= IN_ATTACK;
|
||||||
|
autoshoot_timer_start = curtime;
|
||||||
|
autoshoot_timer = autoshoot_delay;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}*/
|
||||||
bool ShouldAim(CUserCmd* cmd) {
|
bool ShouldAim(CUserCmd* cmd) {
|
||||||
if (aimkey && aimkey_mode) {
|
if (aimkey && aimkey_mode) {
|
||||||
bool key_down = g_IInputSystem->IsButtonDown((ButtonCode_t)(int)aimkey);
|
bool key_down = g_IInputSystem->IsButtonDown((ButtonCode_t)(int)aimkey);
|
||||||
@ -382,6 +464,8 @@ bool ShouldAim(CUserCmd* cmd) {
|
|||||||
case AimKeyMode_t::PRESS_TO_TOGGLE:
|
case AimKeyMode_t::PRESS_TO_TOGGLE:
|
||||||
aimkey_switch = !aimkey_switch;
|
aimkey_switch = !aimkey_switch;
|
||||||
if (!aimkey_switch) return false;
|
if (!aimkey_switch) return false;
|
||||||
|
//Dont autoshoot with slow aim on.
|
||||||
|
if (slowaim) return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (only_can_shoot) {
|
if (only_can_shoot) {
|
||||||
|
Reference in New Issue
Block a user