LightbulbExternal Auto Strafer

Posts 1–15 of 16 · Page 1 of 2
External Auto Strafer
So I had an idea last night so I thought I may as well put it into use as it's half term and I have nothing better to do. I thought up a way, not sure if it has been done before, on making an external auto strafer. It will write the player to move left or right when the previous view angles is greater or less than the current view angles.

Code:
DWORD dwMoveLeft = 0x2EDF694;
DWORD dwMoveRight = 0x2EDF6A0;

void Strafe() {
	static Vector prevViewAngle;

	DWORD LocalPlayer = Mem.Read<DWORD>(Client + dwLocal);// Gets local player
	DWORD EngineState = Mem.Read<DWORD>(Engine + ClientState);// Gets engine + client state for view angles
	int m_Flags = Mem.Read<int>(LocalPlayer + 0x100);// Gets flags

	Vector currentViewAngles = Mem.Read<Vector>(EngineState + viewAngles);// Gets current view angles
	 if (GetAsyncKeyState(VK_SPACE)) {
		 if (m_Flags != FL_ONGROUND) {
			 if (currentViewAngles .y > prevViewAngle.y) {// if the current angels are greater move left
                                 Mem.Write<int>(Client + dwMoveLeft, 6);
                                 Mem.Write<int>(Client + dwMoveLeft, 1);
				 Sleep(5);
				 Mem.Write<int>(Client + dwMoveLeft, 0);
			 }
			 else if (currentViewAngles .y < prevViewAngle.y) {// if the current angels are less than move right
                                 Mem.Write<int>(Client + dwMoveRight, 6);
				 Mem.Write<int>(Client + dwMoveRight, 1);
				 Sleep(5);
				 Mem.Write<int>(Client + dwMoveRight, 0);
			 }
			 prevViewAngle= currentViewAngles ;// Set the previous angles
		 }
	}
}
I found dwMoveLeft and dwMoveRight by scanning (in CE) for 1 when +move[direction] is on and 0 for when -move[direction] is on.

This is crude and buggy but it's something I thought up.
Thank you for sharing
No problemo mate! Wanna do something for the community
You probably can just write 6, instead of 1, sleep, 0.
Wow! That is brilliant! I wish I knew this when I was testing it out as my main problem was releasing the move Do you mind me asking what is the significance of the 6?
Quote Originally Posted by ActualCheats View Post
Wow! That is brilliant! I wish I knew this when I was testing it out as my main problem was releasing the move Do you mind me asking what is the significance of the 6?
A value of 6 is used when you bind a certain action to your mousewheel, for instance +attack or +jump.
You can hold a key, which is why it gets set to 5 when you hold a key and back to 4 when you release it, but you can't hold mousewheeldown or mousewheelup.
If you bind any action to your mousewheel, the variable will get set to 6, which executes the action once and resets the variable to 4 afterwards.
So, if you want to hold the variable, set it to 5, if you want to "press" it once, for instance jump once, set it to 6.
Thank's for explaining that.
Thanks for sharing .
Thanks for this

edit, you might want to check for velocity and strafe accordingly, also, if you wanna get speed quickly, forward move as well
also, if you wanna get speed quickly, forward move as well
np, and do you mean as I hit the ground I write 6 to forward?
Quote Originally Posted by ActualCheats View Post
np, and do you mean as I hit the ground I write 6 to forward?
Code:
void cMisc::AutoStrafer ( cUserCmd * pCmd , ValveSDK::cBaseEntity * pLocal ) {

	if ( pLocal->GetFlags( ) & ( 1 << 0 ) && !( pLocal->GetMoveType( ) & MOVETYPE_NOCLIP || pLocal->GetMoveType( ) & MOVETYPE_LADDER ) )
		return;

	if ( pCmd->MousedX > 1 || pCmd->MousedX < -1 ) {
		pCmd->SideMove = pCmd->MousedX < 0.f ? -400.f : 400.f;
	} 
	else {
		pCmd->ForwardMove = 5850.f / pLocal->GetVelocity( ).Length( );
		pCmd->SideMove = ( pCmd->CommandNumber % 2 ) == 0 ? -400.f : 400.f;
	}

}
This ^ wasnt hard to replicate externally, just get the forward move offset which is easy[ just write 6 to it], and then get your velocity ( vector ).

edit : you probably don't have to worry about velocity, but you could get some speed by writing + forward and all that jazz
Offset's - dwMoveLeft = 0x2E897D0; dwMoveRight = 0x2E897DC;
if you guys want to keep updating your offsets for this, zat's dumper gives left and right offsets i think
Thanks Whacky, that'll save me some time!
Code:
moveleft 0x02E8A888
moveright 0x02E8A8C4
Posts 1–15 of 16 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

Need help?