Updated smooth aim to make it working
This commit is contained in:
parent
eafa459ada
commit
6f4163748f
@ -243,10 +243,9 @@ static const std::string list_tf2 = R"(
|
|||||||
"aimbot_hitboxmode"
|
"aimbot_hitboxmode"
|
||||||
"aimbot_fov"
|
"aimbot_fov"
|
||||||
"aimbot_prioritymode"
|
"aimbot_prioritymode"
|
||||||
|
"aimbot_charge"
|
||||||
"aimbot_slow"
|
"aimbot_slow"
|
||||||
"aimbot_slow_intensity"
|
"aimbot_slow_intensity"
|
||||||
"aimbot_slow_threshhold"
|
|
||||||
"aimbot_charge"
|
|
||||||
"Ignore" [
|
"Ignore" [
|
||||||
"Ignore/Respect Menu"
|
"Ignore/Respect Menu"
|
||||||
"aimbot_respect_vaccinator"
|
"aimbot_respect_vaccinator"
|
||||||
@ -544,6 +543,7 @@ static const std::string list_tf2 = R"(
|
|||||||
"debug_sl_2"
|
"debug_sl_2"
|
||||||
"debug_sl_3"
|
"debug_sl_3"
|
||||||
"debug_sl_4"
|
"debug_sl_4"
|
||||||
|
"debug_sl_5"
|
||||||
)";
|
)";
|
||||||
|
|
||||||
List& MainList() {
|
List& MainList() {
|
||||||
|
@ -304,10 +304,14 @@ float origx;
|
|||||||
float origy;
|
float origy;
|
||||||
float angiex;
|
float angiex;
|
||||||
float angiey;
|
float angiey;
|
||||||
static CatVar meme1(CV_FLOAT, "debug_sl_1", "0", "origx", "kill", 1000);
|
int slowfliptype;
|
||||||
static CatVar meme2(CV_FLOAT, "debug_sl_2", "0", "angix", "kill", 1000);
|
int slowdiry1;
|
||||||
static CatVar meme3(CV_FLOAT, "debug_sl_3", "0", "changex", "kill", 1000);
|
|
||||||
static CatVar meme4(CV_FLOAT, "debug_sl_4", "0", "sai", "kill", 1000);
|
static CatVar meme1(CV_FLOAT, "debug_sl_1", "0", "origy", "kill", 1000);
|
||||||
|
static CatVar meme2(CV_FLOAT, "debug_sl_2", "0", "angiy", "kill", 1000);
|
||||||
|
static CatVar meme3(CV_FLOAT, "debug_sl_3", "0", "changey", "kill", 1000);
|
||||||
|
static CatVar meme4(CV_FLOAT, "debug_sl_4", "0", "showfliptype", "kill", 1000);
|
||||||
|
static CatVar meme5(CV_FLOAT, "debug_sl_5", "0", "slowdiry", "kill", 1000);
|
||||||
bool Aim(CachedEntity* entity, CUserCmd* cmd) {
|
bool Aim(CachedEntity* entity, CUserCmd* cmd) {
|
||||||
//logging::Info("Aiming!");
|
//logging::Info("Aiming!");
|
||||||
Vector hit;
|
Vector hit;
|
||||||
@ -332,47 +336,121 @@ bool Aim(CachedEntity* entity, CUserCmd* cmd) {
|
|||||||
fVectorAngles(tr, angles);
|
fVectorAngles(tr, angles);
|
||||||
bool smoothed = false;
|
bool smoothed = false;
|
||||||
if ( (slowaim == 1) && (silent == false) ) {
|
if ( (slowaim == 1) && (silent == false) ) {
|
||||||
|
//Some of cats original code that I dont dare to touch.
|
||||||
Vector da = (angles - g_pLocalPlayer->v_OrigViewangles);
|
Vector da = (angles - g_pLocalPlayer->v_OrigViewangles);
|
||||||
fClampAngle(da);
|
fClampAngle(da);
|
||||||
smoothed = true;
|
smoothed = true;
|
||||||
if (da.IsZero(slowaim_threshhold)) smoothed = false;
|
if (da.IsZero(slowaim_threshhold)) smoothed = false;
|
||||||
|
|
||||||
|
//Save info to vars that are easy to work with
|
||||||
sai = slowaim_intensity;
|
sai = slowaim_intensity;
|
||||||
origx = cmd->viewangles.x;
|
origx = cmd->viewangles.x;
|
||||||
origy = cmd->viewangles.y;
|
origy = cmd->viewangles.y;
|
||||||
angiex = angles.x;
|
angiex = angles.x;
|
||||||
angiey = angles.y;
|
angiey = angles.y;
|
||||||
|
|
||||||
/*if ( origy != angiey ) {
|
//Angle clamping for when the aimbot chooses a too high of value
|
||||||
if ( origy > angiey ) {
|
if (angiey > 180) angiey = angiey - 360;
|
||||||
changey = ( origy + angiey ) / (sai*sai) ;
|
if (angiey < -180) angiey = angiey + 360;
|
||||||
angles.y = origy + changey;
|
|
||||||
} else {
|
//Determine whether to move the mouse at all for the yaw
|
||||||
changey = ( origy + angiey ) / (sai*sai) ;
|
if ( origy != angiey ) {
|
||||||
angles.y = origy - changey;
|
|
||||||
|
//Fliping The main axis to prevent 180s 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;
|
||||||
|
meme4 = 1;
|
||||||
|
logging::Info("Flip 1");
|
||||||
}
|
}
|
||||||
}*/
|
if ( ((angiey > 90) && (origy < -90)) && (slowfliptype == 0) ) {
|
||||||
if ( origx != angiex ) {
|
slowfliptype = 2;
|
||||||
if ( origx > angiex ) {
|
angiey = angiey - 90;
|
||||||
changex = ( std::abs(origx - angiex ) ) / (sai) ;
|
origy = origy + 90;
|
||||||
angles.x = origx - changex;
|
meme4 = 2;
|
||||||
|
logging::Info("Flip 2");
|
||||||
}
|
}
|
||||||
if ( origx < angiex ) {
|
/*
|
||||||
changex = ( std::abs(origx - angiex ) ) / (sai) ;
|
if ( ((angiey > 90) && (origy > 90)) && (slowfliptype == 0) ) {
|
||||||
angles.x = origx + changex;
|
slowfliptype = 3;
|
||||||
logging::Info("Adding");
|
angiey = angiey - 90;
|
||||||
|
origy = origy - 90;
|
||||||
|
logging::Info("Flip 3");
|
||||||
}
|
}
|
||||||
meme1 = origx;
|
if ( ((angiey < -90) && (origy < -90)) && (slowfliptype == 0) ) {
|
||||||
meme2 = angiex;
|
slowfliptype = 4;
|
||||||
meme3 = changex;
|
angiey = angiey + 90;
|
||||||
meme4 = sai;
|
origy = origy + 90;
|
||||||
|
logging::Info("Flip 4");
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
//Math to calculate how much to move the mouse
|
||||||
|
changey = ( std::abs(origy - angiey) ) / (sai) ;
|
||||||
|
|
||||||
|
//Determine the direction to move in before reseting the flipped angles
|
||||||
|
slowdiry1 = 0;
|
||||||
|
if ( (origy > angiey) && (slowdiry1 == 0) ) slowdiry1 = 1;
|
||||||
|
if ( (origy < angiey) && (slowdiry1 == 0) ) slowdiry1 = 2;
|
||||||
|
meme1 = origy;
|
||||||
|
meme2 = angiey;
|
||||||
|
meme3 = changey;
|
||||||
|
meme4 = slowfliptype;
|
||||||
|
|
||||||
|
//Reset Flipped angles
|
||||||
|
if (slowfliptype == 1) {
|
||||||
|
slowfliptype = 0;
|
||||||
|
angiey = angiey - 90;
|
||||||
|
origy = origy + 90;
|
||||||
|
slowdiry1 = 2;
|
||||||
|
logging::Info("Fix Flip 1");
|
||||||
|
}
|
||||||
|
if (slowfliptype == 2) {
|
||||||
|
slowfliptype = 0;
|
||||||
|
angiey = angiey + 90;
|
||||||
|
origy = origy - 90;
|
||||||
|
slowdiry1 = 1;
|
||||||
|
logging::Info("Fix Flip 2");
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
if (slowfliptype == 3) {
|
||||||
|
slowfliptype = 0;
|
||||||
|
angiey = angiey + 90;
|
||||||
|
origy = origy + 90;
|
||||||
|
logging::Info("Fix Flip 3");
|
||||||
|
}
|
||||||
|
if (slowfliptype == 4) {
|
||||||
|
slowfliptype = 0;
|
||||||
|
angiey = angiey - 90;
|
||||||
|
origy = origy - 90;
|
||||||
|
logging::Info("Fix Flip 4");
|
||||||
|
}*/
|
||||||
|
|
||||||
|
//Move in the direction determined before the fliped angles
|
||||||
|
meme5 = slowdiry1;
|
||||||
|
if ( slowdiry1 == 1 ) angles.y = origy - changey;
|
||||||
|
if ( slowdiry1 == 2 ) angles.y = origy + changey;
|
||||||
|
|
||||||
}
|
}
|
||||||
//logging::Info("ayyming!");
|
|
||||||
|
//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.x = angles.x;
|
cmd->viewangles = angles;
|
||||||
//fClampAngle(angles);
|
|
||||||
//cmd->viewangles = angles;
|
|
||||||
} else {
|
} else {
|
||||||
|
//When slow aim is off, use the default angles.
|
||||||
fClampAngle(angles);
|
fClampAngle(angles);
|
||||||
cmd->viewangles = angles;
|
cmd->viewangles = angles;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user