Sign in to follow this  
Followers 0
IDoNotKnowIt

@error

4 posts in this topic

#1 ·  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

Share this post


Link to post
Share on other sites



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

#3 ·  Posted (edited)

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

Edited by IDoNotKnowIt

Share this post


Link to post
Share on other sites

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  
Followers 0