[Help] Princip of an Aimbot

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • ► You must register to download attachments!
Swift Games Accounts
Aug 20, 2013
Hello all :eek:

So can someone explain me the main princip of an aimbot ?

I've found the (x|y) coordinates of me and the enemy. And I have my cursor position. I want to make an Aimbot for a simple 2D game.
But how to combine the player-coordinates and the mouse coordinates ?
How to calculate it ?
I dont get , how I can set my mouse position on the enemy (x|y) :/

Please explain and help me a little :p

Thanks and sorry for my english :/
Mar 14, 2013
So if its a 2D game u see everything from top. Get your screen position by moving cursor on your char and caling GetCursorPos. Then do the same for one enemy. Count distance with pythagoran (i dont know english version :D but u knwo what i mean). Then count the distance with ingame coords and count proportion. Thats all, this is just a basic math, so you know the screen distance using ingame coords. Then get angle and ur done

Btw game name?
Aug 20, 2013
Game name is Counter Strike 2D. I dont want to ruin the game so I won't release it or play with it online...just btw.
Yea I know what you mean :D . I used the GetCursorPos in C++. I wrote down my Pos but how I do it with the enemy Pos ? I mean it changes everytime he moves and I cant read it from the client mhhh
Aug 20, 2013
Mh it's still not clear to me.
I can calculate the Ingame-distance with pytagoras. Okay
But even if i have the distance , I still dont know which direction he is ?

What I got is :

Mouse Position in client (got it with C++ GetCursorPos)
Player and Enemy (XY) Coordinates Ingame.

Maybe you can do an example or something. Im still new to this sorry :/
Aug 6, 2013
i cound distance between pixels and between world coords and divided it
Yeah i figured that 27 is the result of 135 divided by 5. I guess my real question is, where did you get the 5 from.

As looking at all 3 points, none of them are in fact 5 in distance.

Let me demonstrate:

// A +5
7 + 5 = 12
5 + 5 = 10

// B + 5
11 + 5 = 16
2 + 5 = 7

// C + 5
13 + 5 = 18
13 + 5 = 18

And tryed with your paint, you said 135 distance on screen, i can't see any of the points having 135 distance to each other either.

You gotta be more specific, I'm worried if it's just a typo of you that you actually ment 4 in game, as the distance between A & B seems to be 4, 7 + 4 = 11


Respected Hacker
Legacy Donator
Dank Tier VIP
Oct 14, 2012
I remember for Fruit Ninja (2D..) it was like ScreenWidth/2 +- (ScreenWidth/2)*(X/285) or sth similar for the X coord.. (I created an aimbot for the game once...)
Mar 14, 2013
yea! Thats it... its simple linear function. Get 2 points ingame with same X, count proprtion and same with Y, then u get function y=ax+b for both coords