Jump to content

Recommended Posts

Posted (edited)

Do consecutive PixelSearch() functions overwrite "@error?" For example If PixelSearch №1 is succesful and givies @error a value of "1," will an unsuccesful PixelSearch №2 overwrite the value of @error? If yes, how can I get arround this, as I want to use it as a contition it loop (while) funciton.

Edited by IDoNotKnowIt
Posted

Well.. yes, it does.

Take a look at this example I made:

While 1
Sleep(500);This is just to give you some time.
$coord = PixelSearch( 0, 0, @DesktopWidth,  @DesktopHeight, 0xFF0000)
If Not @error Then
    MsgBox(0, "Color red was found at:", $coord[0] & "," & $coord[1])
EndIf
WEnd

This will search the entire screen over and over to find color red. When it does, it tells you the coordinates of the pixel. Notice how it works using @error.

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