Sign in to follow this  
Followers 0
rylorg

Trigger Bot Help

14 posts in this topic

I'm working on a trigger bot but im not shure how to go about it, im still fairly new to AI and dont wont all the work done for me. Ok what i want is when a certin pixle turns red AI should send a mouse click, I know what type of comands and all the info i need but i just can figure out how to do it, and i have looked at a few scripts but its just so overwelming. Any help?

Share this post


Link to post
Share on other sites



Search through the helpfile and the forums for PixelChecksum.

This is from the help file:

; Wait until something changes in the region 0,0 to 50,50

; Get initial checksum
$checksum = PixelChecksum(0,0, 50,50)

; Wait for the region to change, the region is checked every 100ms to reduce CPU load
While $checksum = PixelChecksum(0,0, 50, 50)
  Sleep(100)
WEnd

MsgBox(0, "", "Something in the region has changed!")

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

yea but what it says under that is:

A checksum only allows you to see if "something" has changed in a region - it does not tell you exactly what has changed.
can i still make that work for what i want? I need to see if a exact pixle changed.

Edited by rylorg

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

You dont want to use pixelchecksum.

Use pixelsearch if you dont know the coordinates of the pixel in question.

Use pixelgetcolor if you know where it is.

Edited by Simucal

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

If it is an exact pixel you want it means you know where the pixel is.

Therefore make a checksum in that exact coordinate.

Another way might be (off the top of my mind) something with a while loop. For example:

(in text since you said you wanted to figure it out on your own :think:)

While the pixel color stays the same, keep on PixelGetColor-ing. If new color =/= (I think this is <> in autoit) old then do whatever you want.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

If it is an exact pixel you want it means you know where the pixel is.

Therefore make a checksum in that exact coordinate.

Another way might be (off the top of my mind) something with a while loop. For example:

(in text since you said you wanted to figure it out on your own :think:)

While the pixel color stays the same, keep on PixelGetColor-ing. If new color =/= (I think this is <> in autoit) old then do whatever you want.

Why would you do a pixelchecksum of a particular pixel when you could just use pixelgetcolor? Pixelchecksum wouldnt tell you anything other than the fact that the pixel changed. (and its new checksum, which COULD be used to tell if it was the color... but why do that?)

There are more posts on pixel searching on this forum than anything else.. Do a search on the forum there are plenty of examples on how to do what you want to do.

Edited by Simucal

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

I was only proposing the idea of pixelchecksum.

I also said, in the latter part of my reply, to use pixelgetcolor.

Those are just 2 methods I proposed and as you stated they could work, I wasn't saying one was better than the other :think:

Share this post


Link to post
Share on other sites

Ok, I'm still having trouble with this I have what I think should work but it does not.

While 1
    $px = PixelGetColor( 512 , 383 );the center of the redicle (i think)
    if $px = 2097665 then; the color red the game uses (i think)
         MouseClick("left"); fires
         MsgBox(64, "ok", "it works"); just to see if it works
    EndIf
WEnd

so am I compleatly wrong or did I just screw up the pixle pos or color?

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

I'm not sure but I think you should put the pixel color in hex.

Other than that it looks fine to me (im no pro, however :think:)

Edited by Roman9

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Ok, I'm still having trouble with this I have what I think should work but it does not.

While 1
    $px = PixelGetColor( 512 , 383 );the center of the redicle (i think)
    if $px = 2097665 then; the color red the game uses (i think)
         MouseClick("left"); fires
         MsgBox(64, "ok", "it works"); just to see if it works
    EndIf
WEnd

so am I compleatly wrong or did I just screw up the pixle pos or color?

You have got to put the coords in the mouse click

While 1
    $px = PixelGetColor(0, 0, 512 , 383, "*Hex Code for Color*" )
        If NOT @Error then
        Mouseclick("left", $px[0], $px[1],1,0)
         MsgBox(0, "ok", "it works"); just to see if it works
        EndIf
Wend

Other than that it looks fine to me (im no pro, however)

not quite, quite a few errors, make sure you check the help file for pixelSearch Edited by Paulie

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

You have got to put the coords in the mouse click

While 1
    $px = PixelGetColor(0, 0, 512 , 383, "*Hex Code for Color*" )
        If NOT @Error then
        Mouseclick("left", $px[0], $px[1],1,0)
         MsgBox(0, "ok", "it works"); just to see if it works
        EndIf
Wend

not quite, quite a few errors, make sure you check the help file for pixelSearch

That is not correct syntax for PixelGetColor()

Edit:

Let's assume you mean PixelSearch()

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Thanks that did it, it works well, a little slow thow is there a way to make it scan faster or optimize it? (or it could just be the lag)

Edited by rylorg

Share this post


Link to post
Share on other sites

That is not correct syntax for PixelGetColor()

Edit:

Let's assume you mean PixelSearch()

:think: Sorry wasn't paying attention

That was my bad :">

But yes i did mean pixelsearch,

Share this post


Link to post
Share on other sites

Yea, do an initial pixelsearch to find what you are attempting to click on, then reduce your search area to a square-area around the last sighting of the pixel by about 10x10 pixels.

For an example of this, look at my aimbot example script in my signature. The "autofind/lockon" setting of the script does what I described exactly.


AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
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
Sign in to follow this  
Followers 0