Solved Aimbot using Screen Coordinates & SendInput

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,101
78,998
2,374
Hey there fellas, I haven't found a way to write view angles yet in OpenArena so I'm trying this ghetto way of using screen coordinates & SendInput to move my mouse. I can only get it to work in 1 quadrant, I followed the same logic for the other quadrants but it doesn't want to work. It doesn't appear to be broken because of monitor coordinates vs window coordinates because if I go fullscreen I have the same exact problem.



C++:
void moveMouse2(vec2 target)
{
	float interval = 4;
	vec2 crosshair = { WINDOWWIDTH / 2, WINDOWHEIGHT / 2 };

	if (target.x > crosshair.x)//bad
	{
		target.x = target.x - crosshair.x;
		target.x /= interval;
	}

	if (target.x < crosshair.x)//good
	{
		target.x = -(crosshair.x - target.x);
		target.x /= interval;
	}

	if (target.y > crosshair.y)//bad
	{
		target.y = target.y - crosshair.y;
		target.y /= interval;
	}

	if (target.y < crosshair.y)//good
	{
		target.y = -(crosshair.y - target.y);
		target.y /= interval;
	}

	INPUT  setAngle = { 0 };
	setAngle.type = INPUT_MOUSE;
	setAngle.mi.dwFlags = MOUSEEVENTF_MOVE;
	setAngle.mi.dx = target.x;
	setAngle.mi.dy = target.y;
	SendInput(1, &setAngle, sizeof(INPUT));
}
I know this method is odd, but if it works, it works. Looking for suggestions
 

c5

Kim Kong Trasher
Dank Tier VIP
Dank Tier Donator
Jul 19, 2012
1,187
12,638
76
really simple

C++:
void AimAt(vec3* point)
{
	float aX, aY;

	vec2 screen[2];
	if (!WorldToScreen(pRefdef, point, &screen))
		return;

	float centerX = pRefdef->width / 2.f;
	float centerY = pRefdef->height / 2.f;

	float enemyX = screen.x;
	float enemyY = screen.y;

	aX = enemyX - centerX;
	aY = enemyY - centerY;

	if (bSmoothAim)
	{
		aX /= fSmoothAmount;
		aY /= fSmoothAmount;
	}

	mouse_event(MOUSEEVENTF_MOVE, aX, aY, 0, 0);
}
 
  • Like
Reactions: MaddyOff and Rake

Broihon

edgy 12 y/o
Escobar Tier VIP
Fleep Tier Donator
Dec 22, 2013
1,745
40,528
316
C++:
void MoveMouse(float X, float Y, float Interval)
{
	POINT CurrPos;
	GetCursorPos(&CurrPos);
	X = (X - CurrPos.x) / Interval + CurrPos.x;
	Y = (Y - CurrPos.y) / Interval + CurrPos.y;
	mouse_event(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE, static_cast<DWORD>(X) * 65535 / ScreenWidth, static_cast<DWORD>(Y) * 65535 / ScreenHeight, 0, 0);
}
Use it like dis:
C++:
for (UINT i = 30; i; --i) //Stepcount
{
	MoveMouse(x, y, i);
	Sleep(SomeAimDelay);
}
This is just linear mouse movement. Some hyperbolic curves would be cooler ofc.
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,101
78,998
2,374
Вroihon;40811 said:
C++:
void MoveMouse(float X, float Y, float Interval)
{
	POINT CurrPos;
	GetCursorPos(&CurrPos);
	X = (X - CurrPos.x) / Interval + CurrPos.x;
	Y = (Y - CurrPos.y) / Interval + CurrPos.y;
	mouse_event(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE, static_cast<DWORD>(X) * 65535 / ScreenWidth, static_cast<DWORD>(Y) * 65535 / ScreenHeight, 0, 0);
}
Use it like dis:
C++:
for (UINT i = 30; i; --i) //Stepcount
{
	MoveMouse(x, y, i);
	Sleep(SomeAimDelay);
}
Hmmmm thank you but I can't seem to make this work, I will keep trying
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,101
78,998
2,374
really simple

C++:
void AimAt(vec3* point)
{
	float aX, aY;

	vec2 screen[2];
	if (!WorldToScreen(pRefdef, point, &screen))
		return;

	float centerX = pRefdef->width / 2.f;
	float centerY = pRefdef->height / 2.f;

	float enemyX = screen.x;
	float enemyY = screen.y;

	aX = enemyX - centerX;
	aY = enemyY - centerY;

	if (bSmoothAim)
	{
		aX /= fSmoothAmount;
		aY /= fSmoothAmount;
	}

	mouse_event(MOUSEEVENTF_MOVE, aX, aY, 0, 0);
}
+300 rep, thank you! Can't believe it was that simple :facepalm:
 

JewsusChrist

Newbie
Full Member
Feb 14, 2016
27
403
2
Another way of going about it utilizing the games XYZ Acceleration coordinates, at least that's what I call it, to dictate the movement of entities. With this you can do a aim prediction of enemies within your XY Screen easily, with the added benefit of movement speed prediction as well, so killing 2 birds with one stone.
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods