Jump to content

pixels


Zompy
 Share

Recommended Posts

  • Moderators

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.

Link to comment
Share on other sites

Link to comment
Share on other sites

$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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

$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

Link to comment
Share on other sites

$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

Link to comment
Share on other sites

  • 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
 Share

  • Recently Browsing   0 members

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