Results 1 to 13 of 13
  1. #1
    Jabberwock's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    1,735
    Reputation
    191
    Thanks
    15,692
    My Mood
    Relaxed

    Making an aimbot and calculating coordinates

    Hi guys, it's me again.

    I need help in the calculations of an aimbot.(A memory aimbot)

    I have all the addresses I just have trouble calculating the hack itself. So here are the types:

    The player coordinates x, y and z are float type.
    The cursor coordinates x and y are WORD type.

    I have tried following the tutorial - <link censored>

    But for some reason the cursor jumps all over and behaves weirdly.
    Some help appreciated. Thanks in advance.
    Last edited by master131; 10-06-2012 at 08:54 PM.
    Even familiar landscapes will
    reveal a different kind of beauty
    if you change your viewpoint.
    Where these new encounters
    and new bonds will lead you...
    Such dazzling golden days.
    I, too, look forward to
    what I might behold.

  2. #2
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,669
    My Mood
    Breezy
    Link is censored, I've removed it.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  3. The Following User Says Thank You to master131 For This Useful Post:

    Jabberwock (10-06-2012)

  4. #3
    Jabberwock's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    1,735
    Reputation
    191
    Thanks
    15,692
    My Mood
    Relaxed
    Hmm I saw it already got censored with "***"...

    Anyway should I post a code what I'm trying to do?

    EDIT: Here some of the codes:

    float PI = 3.14159265F;
    float RAD = 57.29578F;
    float halfCircle = 0xFFFF / 2;

    struct player_info
    {
    float x;
    float y;
    float z;
    };

    inline float Get3dDistance(player_info him, player_info me)
    {
    float D_x = him.x - me.x;
    float D_y = him.y - me.y;
    float D_z = him.z - me.z;

    return sqrt( D_x * D_x + D_y * D_y + D_z * D_z );
    }

    /*Sec 1*/
    if (enemy.x > user.x && enemy.y <= user.y)
    {
    D_x = enemy.x - user.x;
    D_y = user.y - enemy.y;
    yaw = 0xFFFF - (0xFFFF * (short)atan(D_y / D_x) * RAD / 360);
    }

    /*Sec 2*/
    if (enemy.x <= user.x && enemy.y < user.y)
    {
    D_x = user.x - enemy.x;
    D_y = user.y - enemy.y;

    yaw = halfCircle + 0xFFFF * (short)atan( D_y / D_x ) * RAD / 360;
    }

    /*Sec 3*/
    if (enemy.x < user.x && enemy.y >= user.y)
    {
    D_x = user.x - enemy.x;
    D_y = enemy.y - user.y;

    yaw = halfCircle - 0xFFFF * (short)atan( D_y / D_x ) * RAD / 360;
    }

    /*Sec 4*/
    if (enemy.x >= user.x && enemy.y > user.y)
    {
    D_x = enemy.x - user.x;
    D_y = enemy.y - user.y;

    yaw = 0xFFFF * (short)atan( D_y / D_x ) * RAD / 360;
    }

    float flatDist = sqrt( ( D_x * D_x ) + ( D_y * D_y ) ); // Get the level distance between us and the enemy, using pythagoras

    if (enemy.z == user.z)
    {
    pitch = 0;

    } else if (enemy.z > user.z)
    {
    pitch = 0xFFFF * (short)atan( (enemy.z - user.z) / flatDist ) * RAD / 360;

    } else if (enemy.z < user.z)
    {
    pitch = 0xFFFF - 0xFFFF * (short)atan( (user.z - enemy.z) / flatDist ) * RAD / 360;
    }
    Last edited by Jabberwock; 10-06-2012 at 09:01 PM.
    Even familiar landscapes will
    reveal a different kind of beauty
    if you change your viewpoint.
    Where these new encounters
    and new bonds will lead you...
    Such dazzling golden days.
    I, too, look forward to
    what I might behold.

  5. #4
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    You get the rotation in degrees/radians, not screen coordinates for your cursor
    Easiest is using trigonometry to obtain the angles and writing those to your local players' angles. If you want to use screen coordinates you'll have to apply Pythagoras and more trig to calculate the screen coordinates(more work and slower)
    Ah we-a blaze the fyah, make it bun dem!

  6. The Following User Says Thank You to Hell_Demon For This Useful Post:

    Jabberwock (10-07-2012)

  7. #5
    Jabberwock's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    1,735
    Reputation
    191
    Thanks
    15,692
    My Mood
    Relaxed
    You mean like this:

    Code:
    float PI = 3.14159265F;
    float RAD = 57.29578F;
    
    struct player_info
    {
    	float x;
    	float y;
    	float z;
    };
    
    inline float Get3dDistance(player_info him, player_info me)
    {
    	float D_x = him.x - me.x;
    	float D_y = him.y - me.y;
    	float D_z = him.z - me.z;
    
    	return sqrt( D_x * D_x + D_y * D_y + D_z * D_z );
    }
    
    inline void aim(player_info him, player_info me, float &yaw, float &pitch)//0-180 pitch, 0-360 yaw
    {
    	float D_x = him.x - me.x;
    	float D_y = him.y - me.y;
    	float D_z = him.z - me.z;
    	
    	pitch	= sin( D_z / sqrt(D_x * D_x + D_y * D_y + D_z * D_z ) ) * 180 / PI;
    	yaw		= -atan2( D_x, D_y ) / PI * 180 + 180;
    }
    
    aim(enemy, user, yaw, pitch);
    
    *(WORD*)address = abs((short)pitch);
    address += 4;
    *(WORD*)address = abs((short)yaw);
    It doesn't work too...
    Even familiar landscapes will
    reveal a different kind of beauty
    if you change your viewpoint.
    Where these new encounters
    and new bonds will lead you...
    Such dazzling golden days.
    I, too, look forward to
    what I might behold.

  8. #6
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    It would be useful if you'd specify what is broken about it. Does it snap onto something? Does it spin? Does it crash? etc.
    Ah we-a blaze the fyah, make it bun dem!

  9. #7
    Jabberwock's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    1,735
    Reputation
    191
    Thanks
    15,692
    My Mood
    Relaxed
    It's just looking at something else and when I move the player it doesn't move too, so something is broken... With the algorithm I think.

    OK just now I got told that this algorithm work only with cube engine.
    Last edited by Jabberwock; 10-08-2012 at 05:16 PM.
    Even familiar landscapes will
    reveal a different kind of beauty
    if you change your viewpoint.
    Where these new encounters
    and new bonds will lead you...
    Such dazzling golden days.
    I, too, look forward to
    what I might behold.

  10. #8
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    The 'not moving' part could mean that your game uses degrees instead of radians, multiply the rotation values by 57.296f(which is 180 / Pi) to get degrees out of radians.
    Ah we-a blaze the fyah, make it bun dem!

  11. #9
    Jabberwock's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    1,735
    Reputation
    191
    Thanks
    15,692
    My Mood
    Relaxed
    Yes but the problem is that the mouse X and Y aren't in degrees nor radians.

    First I need to know; When going up a ladder in the game, which one Y or Z will increase?

    Here is the info about the X and Y of the mouse position:

    The mouse Y:
    straight = 0.
    down = 50535.
    up = 15000

    The mouse X:

    When setting to 0 and going to that direction the x coordinate get higher.
    When setting to 32768 and going to that direction the x coordinate get lower.
    When setting to 16384 and going to that direction the y coordinate get higher.
    When setting to 49152 and going to that direction the y coordinate get lower.

    I assume the Z coordinate is the one that gets increased.
    Even familiar landscapes will
    reveal a different kind of beauty
    if you change your viewpoint.
    Where these new encounters
    and new bonds will lead you...
    Such dazzling golden days.
    I, too, look forward to
    what I might behold.

  12. #10
          ( ° ͜ʖ͡°)╭∩╮
    Former Staff
    MarkHC's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    127.0.0.1
    Posts
    2,750
    Reputation
    66
    Thanks
    14,529
    My Mood
    Angelic
    Quote Originally Posted by Jabberwo0ck View Post
    Yes but the problem is that the mouse X and Y aren't in degrees nor radians.

    First I need to know; When going up a ladder in the game, which one Y or Z will increase?

    Here is the info about the X and Y of the mouse position:

    The mouse Y:
    straight = 0.
    down = 50535.
    up = 15000

    The mouse X:

    When setting to 0 and going to that direction the x coordinate get higher.
    When setting to 32768 and going to that direction the x coordinate get lower.
    When setting to 16384 and going to that direction the y coordinate get higher.
    When setting to 49152 and going to that direction the y coordinate get lower.

    I assume the Z coordinate is the one that gets increased.
    Print the values on the screen.. "assuming" things isn't a good idea for this. But probably the Z increases when you get higher


    CoD Minion from 09/19/2012 to 01/10/2013

  13. #11
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    would be like this i assume

    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  14. #12
    giniyat101's Avatar
    Join Date
    Sep 2011
    Gender
    male
    Location
    Not telling.
    Posts
    1,935
    Reputation
    130
    Thanks
    1,380
    My Mood
    Dead
    that would be easy as long as you have target position, camera position and writable camera rotation offsets, and ofc some trigonometry knowledge...


     



    [img]https://i43.photobucke*****m/albums/e367/DeteSting/Steam-update.gif[/img]

  15. #13
    CALauncher's Avatar
    Join Date
    Aug 2011
    Gender
    male
    Posts
    27
    Reputation
    10
    Thanks
    5
    If you know what vectors are, then there's an easier way to do it than trigonometry (and definitely cleaner).

Similar Threads

  1. Making A cham and aimbot
    By Dallas013 in forum Piercing Blow Discussions
    Replies: 11
    Last Post: 09-04-2012, 09:19 PM
  2. how to make aimbot and how to use aimbot
    By icones3 in forum CrossFire Discussions
    Replies: 5
    Last Post: 03-23-2010, 10:40 AM
  3. Could You Make Aimbot and Chams Together?
    By Scythe. in forum Combat Arms Discussions
    Replies: 18
    Last Post: 10-25-2009, 02:29 AM
  4. Please post : how to make combat arms hack with aimbot and bypass video please!
    By zerro1995 in forum Programming Tutorial Requests
    Replies: 1
    Last Post: 06-02-2009, 10:10 AM