Jump to content

PixelSearch help


Recommended Posts

I have read the help file on pixelsearch but it doesnt do anything? i opened the example script and it doesnt do anything. what exactly does it do? does it move youre mouse in a certain radious till it finds a certain pixel if so then i cant get it to work :P

Link to comment
Share on other sites

I have read the help file on pixelsearch but it doesnt do anything? i opened the example script and it doesnt do anything. what exactly does it do? does it move youre mouse in a certain radious till it finds a certain pixel if so then i cant get it to work :nuke:

PixelSearch() does not move the mouse. It silently reads the pixels with calls in the background to Windows APIs, and returns the coordinates of a match programaticly in an array, not by moving anything.

What you do with the coordinates afterwards is up to you. To change the example from the help file link above to move the mouse:

; Find a pure red pixel in the range 0,0-20,300
$coord = PixelSearch( 0, 0, 100, 100, 0xFF0000 )
If @error Then
    MsgBox(16, "Error", "First color not found.")
Else
    MouseMove($coord[0], $coord[1])
EndIf
Sleep(2000) ; 2sec delay

; Find a pure red pixel or a red pixel within 10 shades variations of pure red
$coord = PixelSearch( 100, 100, 200, 200, 0xFF0000, 10 )
If @error Then
    MsgBox(16, "Error", "Second color not found.")
Else
    MouseMove($coord[0], $coord[1])
EndIf
Sleep(2000) ; 2sec delay

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...