Jump to content

AutoAim program for games


Recommended Posts

I have the following script that I have tried to modify from a sample script that was posted here in the past. What I have so far is not working properly. Because of the game it tends to aim up and down. From what I read there was a way to get it to get the x and y coordinates relative to the mouse pointer. However, i believe the original script was written with a different version of Autoit, because the command doesn't seem to be available in the newest version. I am pasting what I have so far below. I think I have reached the end of my rope as far as figuring out how to correct everything. Any help that you guys can provide would be greatly appreciated. Thanks.

; +--------------------------------------------------------------------------------------------------------------+
; | Aimbot: Proof of Concept                                                                                     |
; | "A pixel searching aimbot that utilizes several lockon/autoshoot/search methods. It requires the AutoIt BETA |
; | and the Shockwave browser plugin."                                                                         |
; | By: Simucal                                                                                               |
; +--------------------------------------------------------------------------------------------------------------+


#include <GUIConstants.au3>
Global $Aimbot = 0, $found = "no"

Opt("MouseCoordMode", 0)
Opt("PixelCoordMode", 0)
Opt("MouseClickDelay", 0)
Opt("MouseClickDownDelay", 0)


While 1
    $SelectionForm = GUICreate("Aimbot - Proof of Concept", 298, 83, 350, 400)
    GUICtrlCreateLabel("Choose a game:", 32, 8, 81, 17)
    $flybutton = GUICtrlCreateButton("Crysis", 32, 40, 105, 25)
    $csbutton = GUICtrlCreateButton("Crysis 2", 168, 40, 105, 25)
    
    GUISetState()
    
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $flybutton
                $gamename = "Crysis"
                GUIDelete($SelectionForm)
                ExitLoop
            Case $msg = $csbutton
                $gamename = "Crysis 2"
                GUIDelete($SelectionForm)
                ExitLoop
            Case $msg = $GUI_EVENT_CLOSE
                Exit
        EndSelect
    WEnd
    
    HotKeySet("{insert}", "ToggleAimbot")
    HotKeySet("{End}", "TurnoffAimbot")
    
    $oGame = ObjCreate ("")
    $GameForm = GUICreate($gamename & ": Aimbot Proof of Concept", 820, 660, -1, -1)
    $GUIActiveX = GUICtrlCreateObj ($oGame, 10, 10, 800, 580)
    $exitbutton = GUICtrlCreateButton("Exit", 704, 624, 89, 25)
    $changebutton = GUICtrlCreateButton("Change Game", 610, 624, 89, 25)
    GUICtrlCreateLabel("Hit [Insert] to toggle the aimbot, [End] to turn it off.", 16, 608, 300, 17)
    $status = GUICtrlCreateLabel("Aimbot Status: Off", 16, 624, 500, 33)
    GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
    
    
        $headshot = 0x54595A
        $bodyshot = 0x25313D
        $searchcolor = 0x54595A
        $headradio = GUICtrlCreateRadio("ARadio1", 425, 608, 17, 17)
        GUICtrlSetState(-1, $GUI_CHECKED)
        $bodyradio = GUICtrlCreateRadio("ARadio2", 505, 608, 17, 17)
        GUICtrlCreateLabel("Headshot", 443, 608, 50, 17)
        GUICtrlCreateLabel("Bodyshot", 523, 608, 48, 17)
        GUICtrlCreateLabel("Aimbot Options:", 340, 608, 78, 17)
    
    
    GUISetState()
    
    While 1
        If $Aimbot = 1 Then; Normal Auto-Aim
            $coord = PixelSearch(10, 10, 800, 580, $searchcolor)
            If IsArray($coord) = 1 Then
                MouseMove($coord[0], $coord[1], 0)
            EndIf
        EndIf
        If $Aimbot = 2 Then; Auto-Aim + Autoshoot
            $coord = PixelSearch(10, 10, 800, 580, $searchcolor)
            If IsArray($coord) = 1 Then
                MouseClick('left', $coord[0], $coord[1], 1, 0)
                If $gamename = "Camper Strike" Then Send("r")
            EndIf
        EndIf
        If $Aimbot = 3 Then; Snap-to
            If $found = "no" Then
                $pos = MouseGetPos()
                $coord = PixelSearch(($pos[0] - 50) , ($pos[1] - 50) , ($pos[0] + 50) , ($pos[1] + 50), $searchcolor); initial search area 50sq'pixels
                If IsArray($coord) = 1 Then
                    MouseMove($coord[0], $coord[1], 0)
                    $found = "yes"
                EndIf
            EndIf
            If $found = "yes" Then
                $pos = MouseGetPos()
                $coord = PixelSearch(($pos[0] - 10) , ($pos[1] - 10) , ($pos[0] + 10) , ($pos[1] + 10), $searchcolor); locked on search area 10sq'pixels
                If IsArray($coord) = 1 Then
                    MouseMove($coord[0], $coord[1], 0)
                Else
                    $found = "no"
                EndIf
            EndIf
        EndIf
        If $Aimbot = 4 Then; Snap-to + Autoshoot
            $pos = MouseGetPos()
            $coord = PixelSearch(($pos[0] - 50) , ($pos[1] - 50) , ($pos[0] + 50) , ($pos[1] + 50), $searchcolor)
            If IsArray($coord) = 1 Then
                MouseClick('left', $coord[0], $coord[1], 1, 0)
                If $gamename = "Camper Strike" Then Send("r")
            EndIf
        EndIf
        If $Aimbot = 5 Then; Auto Lock-On the first available target on screen
            If $found = "no" Then
                $coord = PixelSearch(10, 10, 800, 580, $searchcolor)
                If IsArray($coord) = 1 Then
                    MouseMove($coord[0], $coord[1], 0)
                    $found = "yes"
                EndIf
            Else
                $pos = MouseGetPos()
                $coord = PixelSearch(($pos[0] - 10) , ($pos[1] - 10) , ($pos[0] + 10) , ($pos[1] + 10), $searchcolor); refined locked on search area of 10sq'pixels
                If IsArray($coord) = 1 Then
                    MouseMove($coord[0], $coord[1], 0)
                Else
                    $found = "no"
                EndIf
            EndIf
        EndIf
        If $Aimbot = 6 Then; Auto Lock-On the first available target + Autoshoot
            If $found = "no" Then
                $coord = PixelSearch(10, 10, 800, 580, $searchcolor)
                If IsArray($coord) = 1 Then
                    MouseMove($coord[0], $coord[1], 0)
                    $found = "yes"
                EndIf
            Else
                $pos = MouseGetPos()
                $coord = PixelSearch(($pos[0] - 10) , ($pos[1] - 10) , ($pos[0] + 10) , ($pos[1] + 10), $searchcolor)
                If IsArray($coord) = 1 Then
                    MouseClick('left', $coord[0], $coord[1], 1, 0)
                    If $gamename = "Camper Strike" Then
                        Send("r")
                    EndIf
                Else
                    $found = "no"
                EndIf
            EndIf
        EndIf
        $msg = GUIGetMsg()
        If $gamename = "Shoot the fly" Then
            Select
                Case $msg = $exitbutton
                    ExitLoop 2
                Case $msg = $changebutton
                    GUIDelete($GameForm)
                    ExitLoop 1
                Case $msg = $GUI_EVENT_CLOSE
                    ExitLoop 2
            EndSelect
        EndIf
        If $gamename = "Camper Strike" Then
            Select
                Case $msg = $exitbutton
                    ExitLoop 2
                Case $msg = $changebutton
                    $oGame.Stop
                    GUIDelete($GameForm)
                    ExitLoop 1
                Case $msg = $bodyradio
                    $searchcolor = $bodyshot
                Case $msg = $headradio
                    $searchcolor = $headshot
                Case $msg = $GUI_EVENT_CLOSE
                    ExitLoop 2
            EndSelect
        EndIf
        
    WEnd
    $oGame = 0
    GUIDelete()
WEnd
Exit

Func ToggleAimbot()
    If $Aimbot < 6 Then
        $Aimbot = $Aimbot + 1
    Else
        $Aimbot = 0
    EndIf
    Select
        Case $Aimbot = 0
            GUICtrlSetData($status, "Aimbot Status: Off")
        Case $Aimbot = 1
            GUICtrlSetData($status, "Aimbot Status: AutoFind")
        Case $Aimbot = 2
            GUICtrlSetData($status, "Aimbot Status: AutoFind + AutoShoot")
        Case $Aimbot = 3
            GUICtrlSetData($status, "Aimbot Status: Snap-To")
        Case $Aimbot = 4
            GUICtrlSetData($status, "Aimbot Status: Snap-To + AutoShoot")
        Case $Aimbot = 5
            GUICtrlSetData($status, "Aimbot Status: AutoFind/Lock-On")
        Case $Aimbot = 6
            GUICtrlSetData($status, "Aimbot Status: AutoFind/Lock-On + AutoShoot")
    EndSelect
EndFunc  ;==>ToggleAimbot

Func _MouseMoveRelative ($iX, $iY)
    Local Const $MOUSEEVENTF_MOVE = 0x01
    DllCall ("user32.dll", "int", "mouse_event", _
                                "long", $MOUSEEVENTF_MOVE, _
                                "int", $iX, _
                                "int", $iY, _
                                "int", 0, _
                                "int", 0)
EndFunc

Func TurnoffAimbot()
    $Aimbot = 0
    GUICtrlSetData($status, "Aimbot Status: Off")
EndFunc  ;==>TurnoffAimbot
Link to comment
Share on other sites

bump

The normal waiting time before bumping a thread up is about 24 hrs.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Cool thanks i will keep that in mind.

Ok i tried to edit that last post but couldn't... here is what I wanted to add:

Additionally, I just noticed that I failed to mention in the original post was that I gathered from the previous script (the script listed above, is a modified version, i searched the forums here for it) Another person had the same issue as I did, and the fix had something to do with the following code:

Func _MouseMoveRelative ($iX, $iY)
    Local Const $MOUSEEVENTF_MOVE = 0x01
    DllCall ("user32.dll", "int", "mouse_event", _
                                "long", $MOUSEEVENTF_MOVE, _
                                "int", $iX, _
                                "int", $iY, _
                                "int", 0, _
                                "int", 0)

When I attempted to use this code in my script I didn't gain anything from it. Or I should say I couldnt determine that i was actually affecting the outcome of the script. I reviewed the script again and noticed that in scite this code "_MouseMoveRelative" is not like the rest. In other words every other command is a bold blue, whereas this one was non bold type... leading me to believe that Autoit was recognizing it. At this stage I am lost because I am not sure what command should be substituted for this and even if there is a command would it actually enable the script to work as described. In closing any assistance in solving this issue would be appreciated. Thanks again.

Edited by Eclipse366
Link to comment
Share on other sites

Ok i tried to edit that last post but couldn't... here is what I wanted to add:

Additionally, I just noticed that I failed to mention in the original post was that I gathered from the previous script (the script listed above, is a modified version, i searched the forums here for it) Another person had the same issue as I did, and the fix had something to do with the following code:

Func _MouseMoveRelative ($iX, $iY)
      Local Const $MOUSEEVENTF_MOVE = 0x01
      DllCall ("user32.dll", "int", "mouse_event", _
                                  "long", $MOUSEEVENTF_MOVE, _
                                  "int", $iX, _
                                  "int", $iY, _
                                  "int", 0, _
                                  "int", 0)

When I attempted to use this code in my script I didn't gain anything from it. Or I should say I couldnt determine that i was actually affecting the outcome of the script. I reviewed the script again and noticed that in scite this code "_MouseMoveRelative" is not like the rest. In other words every other command is a bold blue, whereas this one was non bold type... leading me to believe that Autoit was recognizing it. At this stage I am lost because I am not sure what command should be substituted for this and even if there is a command would it actually enable the script to work as described. In closing any assistance in solving this issue would be appreciated. Thanks again.

Local functions (functions you write in AutoIt) don't get colored blue by SciTE, but that doesn't matter at all, as it will work if you have the function code inside the code.

Can you post the error message that appears when you try to run your program?

[quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"][/font]

Link to comment
Share on other sites

From what i can gather, you're aiming after a dark gray color(assumingly the suit of enemies), problem is, that this pixel color is guaranteed to exist in lots of other places in the game, which would make the pixel aimbot aim at the wrong things.

Always with pixel aimbots, you have to use colored models, which is just one bright color(unless it's something simple as a flash game).

Other than that, I see no real error in the aim-code you have. :)

Link to comment
Share on other sites

You won't get much help on this one, I couldn't get much help when I posted a similar topic! Good luck!

Now that's real positive...

I have nothing against helping him if he needs it, it's probably just that everyone might not be looking through the forum all the time. :)

I got a PM from him asking for help, as I posted something related a long time ago.

Edited by FreeFry
Link to comment
Share on other sites

What do you mean with that it would be used for advertising? :P

I'm sorry that you didn't get the help you where expecting with whatever you where trying to do, but I have nothing against helping out as best as I can, BUT I do not scan the forum all the time for people in need of help. :)

Edit:

I now realise what you're thinking, but what he's doing is not a bot for AIM. It's an AutoAim bot for a game called Crysis. Did you not read the thread at all?

Edited by FreeFry
Link to comment
Share on other sites

From what i can gather, you're aiming after a dark gray color(assumingly the suit of enemies), problem is, that this pixel color is guaranteed to exist in lots of other places in the game, which would make the pixel aimbot aim at the wrong things.

Always with pixel aimbots, you have to use colored models, which is just one bright color(unless it's something simple as a flash game).

Other than that, I see no real error in the aim-code you have. :)

Well when i tried the script while playing in single player mode, it would just aim for the sky or the ground even though I was using what you suggested "colored" models. I changed the color to a color that is very different from everything in the background. The color is like a florescent green, very bright, but it still aims at the sky. However, as soon as the mouse gets near the color/pixel to use the "snapto" function it aims for the sky. What i assumed the problem to be was the fact that it is 3d and the original code was based on the basic x and y axis, so whenever the script finds the pixel at said x and y point, when it sends the command to move the mouse there it just goes to the sky. I saw later in that same post that the seperate code this one:

Func _MouseMoveRelative ($iX, $iY)
      Local Const $MOUSEEVENTF_MOVE = 0x01
      DllCall ("user32.dll", "int", "mouse_event", _
                                  "long", $MOUSEEVENTF_MOVE, _
                                  "int", $iX, _
                                  "int", $iY, _
                                  "int", 0, _
                                  "int", 0)

was the fix. However when I tried to implement it, it did not work for me.

CoePSX, I am not receiving an error, it just does what I described above.

Link to comment
Share on other sites

I'd say if you have nothing to contribute to the thread, keep it to yourself.

And in any case, this can (probably) only be used in singleplayer, which makes it make no difference at all if someone makes a bot for it or not.

Edit:

I've managed to change the color of the head of the friendly teammates, but whenever it tries to aim at them, it aims too much at the direction of the target, and misses it completely...

Well when i tried the script while playing in single player mode, it would just aim for the sky or the ground even though I was using what you suggested "colored" models. I changed the color to a color that is very different from everything in the background. The color is like a florescent green, very bright, but it still aims at the sky. However, as soon as the mouse gets near the color/pixel to use the "snapto" function it aims for the sky. What i assumed the problem to be was the fact that it is 3d and the original code was based on the basic x and y axis, so whenever the script finds the pixel at said x and y point, when it sends the command to move the mouse there it just goes to the sky. I saw later in that same post that the seperate code this one:

Func _MouseMoveRelative ($iX, $iY)
      Local Const $MOUSEEVENTF_MOVE = 0x01
      DllCall ("user32.dll", "int", "mouse_event", _
                                  "long", $MOUSEEVENTF_MOVE, _
                                  "int", $iX, _
                                  "int", $iY, _
                                  "int", 0, _
                                  "int", 0)

was the fix. However when I tried to implement it, it did not work for me.

CoePSX, I am not receiving an error, it just does what I described above.

Well, when you use the MouseMove() function in autoit, it just tells the operating system that you have moved your mouse to X and Y on the screen.

In 3D games, the mouse is centered in the middle of the screen(at the crosshair, or very near it).

For example: if X: 150, and Y: 125, and autoit finds the color at position X: 100, Y: 50, then it would move the mouse pointer to that position, which would (in this example) cause the crosshair in the game to go towards the upper left of the screen(this aint dead on on first loop, though), though on the next iteration in the loop, it would do the same thing again, but this time, it would be more accurate, as the distance it moves the mouse would be shorter, and becaues of that, more accurate. Atleast that's how I think it works...

Problem with this method of aiming, is that the fps in the game and mouse sensitivity in the game does play a role in how accurate(and jerky) the bot would be.

Edited by FreeFry
Link to comment
Share on other sites

I'd say if you have nothing to contribute to the thread, keep it to yourself.

And in any case, this can (probably) only be used in singleplayer, which makes it make no difference at all if someone makes a bot for it or not.

Edit:

I've managed to change the color of the head of the friendly teammates, but whenever it tries to aim at them, it aims too much at the direction of the target, and misses it completely...

Well, when you use the MouseMove() function in autoit, it just tells the operating system that you have moved your mouse to X and Y on the screen.

In 3D games, the mouse is centered in the middle of the screen(at the crosshair, or very near it).

For example: if X: 150, and Y: 125, and autoit finds the color at position X: 100, Y: 50, then it would move the mouse pointer to that position, which would (in this example) cause the crosshair in the game to go towards the upper left of the screen(this aint dead on on first loop, though), though on the next iteration in the loop, it would do the same thing again, but this time, it would be more accurate, as the distance it moves the mouse would be shorter, and becaues of that, more accurate. Atleast that's how I think it works...

Problem with this method of aiming, is that the fps in the game and mouse sensitivity in the game does play a role in how accurate(and jerky) the bot would be.

Makes sense. i am not to overly worried about it though. It was just something that I was attempting for personal singleplayers. Unlike what the person mentioned earlier in the thread about playing the game the way it was meant to be played... well that is what I do especially online... I hate aimbotters online cause they always get an overwhelming lead oh well what can you do... boycott the game... nah it's still fun! Thanks for the assistance free!

Link to comment
Share on other sites

No problemo, I'm just trying to shine some light on the subject. :}

I'm still not totally sure about why it does the jumping, as it did the same with me when I messed around with it.

I know for a fact that there is not an error in the code(in my attempts that is), because the same aimbot works in flash games, and other games.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...