LightbulbAimbot (mouse movement)

Posts 1–11 of 11 · Page 1 of 1
Aimbot (mouse movement)
Hi all,

I was trying to wrap my head around how an Aimbot works, and I didn't understand the mouse movement. When making an Aimbot, is it possible to move my players YAW, or mouse coordinates without host? Or do I need to move the mouse for instance with C#?

Please help!

Thanks!

- Sullydude
Not sure I understand you but this is how an aimbot works:

The client (you) stores the location of every enemy in the game to the memory. How it works is the aimbot reads the positions of every player and compares it to your location. If an entity (as it's called) is close enough to you (in the case of a distance aimbot) or if your bullets are able to reach them (using game functions like BulletPenetration aka Auto-Wall) or they are within your view (Using CG_Trace which finds their location in respect to yours) then it changes your view angles of your game to the location calculated at which the enemy lies. Then if you have Auto Shoot or Auto Zoom to on then it writes a byte to the location that enables these things. Voila an aimbot.
Quote Originally Posted by Kenshin13 View Post
Not sure I understand you but this is how an aimbot works:

The client (you) stores the location of every enemy in the game to the memory. How it works is the aimbot reads the positions of every player and compares it to your location. If an entity (as it's called) is close enough to you (in the case of a distance aimbot) or if your bullets are able to reach them (using game functions like BulletPenetration aka Auto-Wall) or they are within your view (Using CG_Trace which finds their location in respect to yours) then it changes your view angles of your game to the location calculated at which the enemy lies. Then if you have Auto Shoot or Auto Zoom to on then it writes a byte to the location that enables these things. Voila an aimbot.
Thanks Kenshin. That Explains it in good detail but what im wondering is how you set your crosshairs over the player? also How do you translate player coordinates to mouse movement over head?
Quote Originally Posted by sullydude View Post
Thanks Kenshin. That Explains it in good detail but what im wondering is how you set your crosshairs over the player? also How do you translate player coordinates to mouse movement over head?
That depends. I assume you're talking about an External Aimbot, am I right? If so, you need a WorldToScreen Function that is gonna be responsible to translates a 3D Vector (The enemy position on the world) to a 2D Vector (the screen coordinates) then you basically do some math to find out the distance from the center of the screen and use function such as SendInput to move the mouse.

If you meant Injected Aimbots, the game holds information about basically everything about you, your position, health and even to where you're looking. So, you just have to set the View Angles to the 2D vector returned by W2S and Voilà
Quote Originally Posted by sullydude View Post
Thanks Kenshin. That Explains it in good detail but what im wondering is how you set your crosshairs over the player? also How do you translate player coordinates to mouse movement over head?
The ViewMatrix is used for this. It's a structure (much like RefDef structure but this just stores your Viewangles.)

Here's how it looks:
Code:
typedef struct tViewMatrix
{
	float AngleOfImpactX; //X Angle Of Impact
	float AngleOfImpactY; //Y Angle Of Impact
	float PlayerVelocity; //Speed Of Player
	vec3_t WeaponPunchAngles[3]; //Angles at which the weapon moves as it fires
	float weaponViewAngleY; //The View Angle Of Your Weapon In Terms Of The X-Axis
	float weaponViewAngleX; //Same as the above but in terms of the Y-Axis
	vec3_t weaponSway; //Vector Holding the Sway Movement of the weapon
	vec3_t viewAxis[3]; //The 3D Location Of the View
	vec3_t weaponOrigin;  //3D Origin Of the weapon
}ViewMatrix_t;
I believe what you're asking is how do you translate a 3D (Y, X & Z) Co-Ordinate to a 2D (Y & X)?
If I could only find the post @MarkHC did describing it...

But I'll try to explain it....
Lets say we have a vector containing the enemies head location.

Vector3 EnemyHeadLoc;

To Transform it to 2D:
Code:
VectorSubtract ( EnemyHeadLoc, RefDef->CurrentOrigin, CalculatedPos ); //Subtract RefDef's Origin From The Bone's (Head) Location
VectorAngles ( CalculatedPos, VectorAngle ); //Convert the Vector To Angles and store it in VectorAngle (Now Z Angle isn't needed anymore)
* ( float* ) 0x1063898 += ( VectorAngle[ 0 ] -= RefDef->ViewAngles[ 0 ] ) ; //Add the difference of the calculated vector angle minus the current view angle to the ViewAngleX
* ( float* ) 0x106389C += ( VectorAngle[ 1 ] -= RefDef->ViewAngles[ 1 ] ) ; //Same as above but for Y
Here's those function for you:
Code:
void VectorSubtract ( float* v1, float* v2, float* out ) {
	out[0] = v1[0] - v2[0];
	out[1] = v1[1] - v2[1];
	out[2] = v1[2] - v2[2];
}

void VectorAngles ( const float value1[3], float angles[3] ) {
	float   forward;
	float   yaw, pitch;

	if ( value1[1] == 0 && value1[0] == 0 ) {
		yaw = 0;
		if ( value1[2] > 0 ) {
			pitch = 90;
		} else {
			pitch = 270;
		}
	} else {
		if ( value1[0] ) {
			yaw = (float)( atan2 ( value1[1], value1[0] ) * 180 / M_PI );
		} else if ( value1[1] > 0 ) {
			yaw = 90;
		} else {
			yaw = 270;
		}
		if ( yaw < 0 ) {
			yaw += 360;
		}

		forward = sqrt ( value1[0] * value1[0] + value1[1] * value1[1] );
		pitch = (float)( atan2 ( value1[2], forward ) * 180 / M_PI );
		if ( pitch < 0 ) {
			pitch += 360;
		}
	}
Quote Originally Posted by MarkHC View Post
If you meant Injected Aimbots, the game holds information about basically everything about you, your position, health and even to where you're looking. So, you just have to set the View Angles to the 2D vector returned by W2S and Voilà
Ok this was the route I was headed to lol. Now I'm really sorry but I'm new to this, could you explain this a little more:

"you just have to set the View Angles to the 2D vector returned by W2S"

Im guessing this is world to screen? Now how would I achieve a method like this? Can you guide me in the right pathway?

I really appreciate the help you 2.

- Sullydude

---------- Post added at 07:44 PM ---------- Previous post was at 07:41 PM ----------

Quote Originally Posted by Kenshin13 View Post
The ViewMatrix is used for this. It's a structure (much like RefDef structure but this just stores your Viewangles.)

Here's how it looks:
Code:
typedef struct tViewMatrix
{
	float AngleOfImpactX; //X Angle Of Impact
	float AngleOfImpactY; //Y Angle Of Impact
	float PlayerVelocity; //Speed Of Player
	vec3_t WeaponPunchAngles[3]; //Angles at which the weapon moves as it fires
	float weaponViewAngleY; //The View Angle Of Your Weapon In Terms Of The X-Axis
	float weaponViewAngleX; //Same as the above but in terms of the Y-Axis
	vec3_t weaponSway; //Vector Holding the Sway Movement of the weapon
	vec3_t viewAxis[3]; //The 3D Location Of the View
	vec3_t weaponOrigin;  //3D Origin Of the weapon
}ViewMatrix_t;
I believe what you're asking is how do you translate a 3D (Y, X & Z) Co-Ordinate to a 2D (Y & X)?
If I could only find the post @MarkHC did describing it...

But I'll try to explain it....
Lets say we have a vector containing the enemies head location.

Vector3 EnemyHeadLoc;

To Transform it to 2D:
Code:
VectorSubtract ( EnemyHeadLoc, RefDef->CurrentOrigin, CalculatedPos ); //Subtract RefDef's Origin From The Bone's (Head) Location
VectorAngles ( CalculatedPos, VectorAngle ); //Convert the Vector To Angles and store it in VectorAngle (Now Z Angle isn't needed anymore)
* ( float* ) 0x1063898 += ( VectorAngle[ 0 ] -= RefDef->ViewAngles[ 0 ] ) ; //Add the difference of the calculated vector angle minus the current view angle to the ViewAngleX
* ( float* ) 0x106389C += ( VectorAngle[ 1 ] -= RefDef->ViewAngles[ 1 ] ) ; //Same as above but for Y
Here's those function for you:
Code:
void VectorSubtract ( float* v1, float* v2, float* out ) {
	out[0] = v1[0] - v2[0];
	out[1] = v1[1] - v2[1];
	out[2] = v1[2] - v2[2];
}

void VectorAngles ( const float value1[3], float angles[3] ) {
	float   forward;
	float   yaw, pitch;

	if ( value1[1] == 0 && value1[0] == 0 ) {
		yaw = 0;
		if ( value1[2] > 0 ) {
			pitch = 90;
		} else {
			pitch = 270;
		}
	} else {
		if ( value1[0] ) {
			yaw = (float)( atan2 ( value1[1], value1[0] ) * 180 / M_PI );
		} else if ( value1[1] > 0 ) {
			yaw = 90;
		} else {
			yaw = 270;
		}
		if ( yaw < 0 ) {
			yaw += 360;
		}

		forward = sqrt ( value1[0] * value1[0] + value1[1] * value1[1] );
		pitch = (float)( atan2 ( value1[2], forward ) * 180 / M_PI );
		if ( pitch < 0 ) {
			pitch += 360;
		}
	}
Wow Thanks very much Kenshin! now I have a question... How old are you 2 cause I feel old and retired from this crap and I'm 19 XD. Anyways really appreciate the help guys.
Quote Originally Posted by sullydude View Post
Wow Thanks very much Kenshin! now I have a question... How old are you 2 cause I feel old and retired from this crap and I'm 19 XD. Anyways really appreciate the help guys.
I'm 19 too xD

Quote Originally Posted by sullydude View Post
Ok this was the route I was headed to lol. Now I'm really sorry but I'm new to this, could you explain this a little more:

"you just have to set the View Angles to the 2D vector returned by W2S"

Im guessing this is world to screen? Now how would I achieve a method like this? Can you guide me in the right pathway?
I made a mistake :P On a injected aimbot you don't need to use WorldToScreen. You just gotta do what kenshin said.
[/COLOR]
Quote Originally Posted by MarkHC View Post
I'm 19 too xD

I made a mistake :P On a injected aimbot you don't need to use WorldToScreen. You just gotta do what kenshin said.
[/COLOR]
Do you have Skype, I could still use some serious help. I'd be liening if I said I know what im doing lol.

- Sullydude
Quote Originally Posted by sullydude View Post
Do you have Skype, I could still use some serious help. I'd be liening if I said I know what im doing lol.

- Sullydude
Im 17 :P
Skype: zachary.attong

And yes you can use W2S as well.
Quote Originally Posted by Kenshin13 View Post
Im 17 :P
Skype: zachary.attong

And yes you can use W2S as well.
Ok added. I'll explain my idea and show you my code in a second :P

thanks again!

- Sullydude
Quote Originally Posted by sullydude View Post
Ok added. I'll explain my idea and show you my code in a second :P

thanks again!

- Sullydude
OMG U MEAN I GOTTA GO ON SKYPE NOW? fine.
Posts 1–11 of 11 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us