HelpAimbot bone aim incorrect?

Posts 1–6 of 6 · Page 1 of 1
Aimbot bone aim incorrect?
Image : http : // prnt.sc / ex1ang

Problems:
1. aimbot aims at incorrect bone location
2. when 2 enemy players are close to each other, the aimbot cannot decide which one to aim :/

ToDo:
1. add visual check

The code i was using based on A5 External on github

Variables if it helps:
Code:
// Aimbot vars
Vector3 angle;
double Distance = 300;
int targets = 0;
int myTeam;
int Team;
int Health;
bool dormant;

Math math;
Aimbot function:
Code:
void Aimbot(DWORD myPlayer) {
	engineBase = mem.Read<DWORD>(engine + dwClientState);	// A.k.a enginepointer

	// Get targets
	for (int i = 0; i < 64; i++) {
		DWORD entity = mem.Read<DWORD>(client + dwEntityList + ((i - 1) * 0x10) );

		if (entity != NULL) {

			myTeam = mem.Read<int>(myPlayer + m_iTeamNum);
			Team = mem.Read<int>(entity + m_iTeamNum);
			Health = mem.Read<int>(entity + m_iHealth);
			dormant = mem.Read<bool>(entity + m_bDormant);

			if (dormant || Team == myTeam || Health == 0)
				continue;

			// My position
			Vector3 myPos = myPlayerEyePos(myPlayer);
			//std::cout << "myPos: " << myPos.x << "," << myPos.y << "," << myPos.z << std::endl;
			
			// Target head position
			int boneMatrix = mem.Read<int>(entity + m_dwBoneMatrix);
			Vector3 entityHeadPos = getBone(boneMatrix, 6);
			
			if (math.VecDist(myPos, entityHeadPos) < Distance) {
				Vector3 AimAngle;
				Vector3 dir = myPos - entityHeadPos;
				
				math.VectorNormalize(dir);
				math.VectorAngles(dir, AimAngle);
				
				math.ClampAngle(AimAngle);
				
				AimAngle -= (mem.Read<Vector3>(client + m_aimPunchAngle)) * 2.f;
				
				math.ClampAngle(AimAngle);

				math.SmoothAngle(mem.Read<Vector3>(engineBase + dwClientState_ViewAngles), AimAngle, 2.0f);
				//std::cout << "AimAngle: " << AimAngle.x << "," << AimAngle.y << "," << AimAngle.z << std::endl;
				mem.Write<Vector3>(engineBase + dwClientState_ViewAngles, AimAngle);

			}
		}
	}
}
Get player eye position:
Code:
Vector3 myPlayerEyePos(DWORD myPlayer) {
	return mem.Read<Vector3>(myPlayer + m_vecOrigin) + mem.Read<Vector3>(myPlayer + m_vecViewOffset);
}
Get bone for entity(enemy)
Code:
Vector3 getBone(int boneM, int iBone) {
	
	Vector3 boneReturn;
	
	boneReturn.x = mem.Read<float>(boneM + 0x30 * iBone + 0x0C);
	boneReturn.y = mem.Read<float>(boneM + 0x30 * iBone + 0x1C);
	boneReturn.z = mem.Read<float>(boneM + 0x30 * iBone + 0x2C);
	
	return boneReturn;
}
Read the bonematrix instead of reading the bones one by one.. Or at least read the coords of the bone as a struct. Reading the teamnumber and everything you need is stupid in a feature function as you have to read them in every feature again.
Quote Originally Posted by Don Coderleone View Post
Reading the teamnumber and everything you need is stupid in a feature function as you have to read in every feature.
totally agree with you, but since this is a test and learning purposes so... yeah..
thanks for info though

Quote Originally Posted by Don Coderleone View Post
Read the bonematrix instead of reading the bones one by one.. Or at least read the coords of the bone as a struct.
i will try your solution..
but what is the difference?
It won't do anything just making your code nicer and faster. Please provide your VectorAngle function.
Quote Originally Posted by Don Coderleone View Post
It won't do anything just making your code nicer and faster. Please provide your VectorAngle function.
epic solution, did you even read that code?

@op please stop using 2-3 year old sources, also, this question was literally answered a hundred times
all you had to do is googling "bone ids csgo"
head is 8 now, hf
Quote Originally Posted by Don Coderleone View Post
Please provide your VectorAngle function.
it is from the math.h
Code:
void VectorAngles( const Vector3& dir, Vector3 &angles )
	{
		float hyp = FastSQRT( ( dir.x * dir.x ) + ( dir.y * dir.y ) );
		angles.x = atanf( dir.z / hyp ) * M_RADPI;
		angles.y = atanf( dir.y / dir.x ) * M_RADPI;
		angles.z = 0.0f;
		if( dir.x >= 0.0 )
			angles.y += 180.0f;
	}

Quote Originally Posted by certmemer View Post
head is 8 now, hf
i tried this, still aims a little bit to the right

http: // prntscr.com / ex9wrf

- - - Updated - - -

somehow i fixed this problem

i noticed that when i get close to the enemy, the aiming position is correct however, as i gain some distance from enemy, aim gets inaccurate
so i thought it was the scaling problem and adjusted this code

Code:
AimAngle -= (mem.Read<Vector3>(client + m_aimPunchAngle) * 2.f)/ math.VecDist(myPos, entityHeadPos);
and it...worked?
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?