Jump to content
Sign in to follow this  
IDoNotKnowIt

@error

Recommended Posts

IDoNotKnowIt

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

Share this post


Link to post
Share on other sites
Nahuel

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.

Share this post


Link to post
Share on other sites
IDoNotKnowIt

I ment "... to use it as a condition in ..."

Edited by IDoNotKnowIt

Share this post


Link to post
Share on other sites
weaponx

Just store it in a temp variable:

PixelSearch...

$ERROR1 = @ERROR

PixelSearch

$ERROR2 = @ERROR

Share this post


Link to post
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
Sign in to follow this  

×