Jump to content

PixelGetColor or CheckSum


 Share

Recommended Posts

I was wonding if theres a way i can find the X, Y pos of a certain colour? i know the color, well wat is returned by PixelGetColor but i was wonding if i can use somethin to find X, Y of the pixel if it changes?

Look in the help file for PixelSearch, I believe that is the function you are looking for.

[u]My UDFs[/u]Coroutine Multithreading UDF LibraryStringRegExp GuideRandom EncryptorArrayToDisplayString"The Brain, expecting disaster, fails to find the obvious solution." -- neogia

Link to comment
Share on other sites

  • Moderators

$SearchPosition = PixelSearch(xtop, ytop, xbottom, ybottom, color)
If IsArray($SearchPosition) Then
    MouseClick('left', $SearchPosition[0], $SearchPosition[1], 1, 1)
EndIf

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

Smoke, yours will put the cursor over the color. Here's something from the helpfile (edited a little)-

$colour = "COLOR HERE"
$search = PixelSearch( @DesktopHeight, @DesktopWidth, @DesktopHeight, @DesktopWidth, $colour )
If Not @error Then
    MsgBox(0, "X and Y are:", $search[0] & "," & $search[1])
EndIf

It searches the whole screen for the color then tells you the xy of the color in a message box.

Link to comment
Share on other sites

  • Moderators

Smoke, yours will put the cursor over the color. Here's something from the helpfile (edited a little)-

$colour = "COLOR HERE"
$search = PixelSearch( @DesktopHeight, @DesktopWidth, @DesktopHeight, @DesktopWidth, $colour )
If Not @error Then
    MsgBox(0, "X and Y are:", $search[0] & "," & $search[1])
EndIf

It searches the whole screen for the color then tells you the xy of the color in a message box.

Um, I know it does, it was to demonstrate as you did, that the coords were found, I was ASSuming he wanted to do something than a MsgBox to pop up and interrupt his script.

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

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...