Jump to content

Recommended Posts

Posted

Hey, i've been testing the search pixel function etc, but i can't find out if you find a pixel how to click it, how to do that?

Thanks alot

  • Moderators
Posted

Hey, i've been testing the search pixel function etc, but i can't find out if you find a pixel how to click it, how to do that?

Thanks alot

PixelSearch returns the x and y coords of the color found in an Array (if found at all, be sure to check @error). You then use MouseClick with those x and y coords.

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.

Posted

This doesn't work, how should it be

$coord = PixelSearch( 0, 0, 0, 0, 0XB28599, 2, 2 )
If Not @error Then
    MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])
EndIf
MouseClick("left", $coord)
Posted (edited)

$coord = PixelSearch(0, 0, 0, 0, 0xB28599, 2, 2); should be a rectangle, this is zero pixels so maybe try with 0, 0, 1, 1
If Not @error Then
    MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]); useless, we already knew this...
    MouseClick("left", $coord[0], $coord[1]); if it's outside the IF and $coord = false we will get a error because $coord[X] doesn't exist
EndIf

Edited by Pain
Posted

Im trying to let my mouse click the ball, but it doesn't work

Curveball

Sleep(5000)
$coord = PixelSearch(275, 580, 750, 275, 0xC8FF, 2, 2); should be a rectangle, this is zero pixels so maybe try with 0, 0, 1, 1
If Not @error Then
;   MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]); useless, we already knew this...
    Mousemove($coord[0], $coord[1]); if it's outside the IF and $coord = false we will get a error because $coord[X] doesn't exist
EndIf
Posted

No I didn't. I have no intention of writing it for you. Also please don't bump your threads more than once every 24 hours.

Try some debugging. Use mouse move to move your mouse to each corner of the rectangle. That will give you a visual example of where the rectangle is. Debug. Get AutoIt to tell you the return value/@error/@extended- debug it in other words.

Cheers,

Brett

Posted

$coord = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0xB28599, 2, 2); changed to search entire screen instead of only 4 pixels
If Not @error Then
    MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]); useless, we already knew this...
    MouseClick("left", $coord[0], $coord[1]); if it's outside the IF and $coord = false we will get a error because $coord[X] doesn't exist
EndIf

There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

Posted

$coord = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0xB28599, 2, 2); changed to search entire screen instead of only 4 pixels
If Not @error Then
    MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]); useless, we already knew this...
    MouseClick("left", $coord[0], $coord[1]); if it's outside the IF and $coord = false we will get a error because $coord[X] doesn't exist
EndIf

Does that work at your place? Here that doesnt work either

Posted

Thanks, but it says error while opening FF.au3

and gamebot builder isnt really pro is it, i want to learn it, not to use a bot...

  • 2 weeks later...

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
  • Recently Browsing   0 members

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