Jump to content

Recommended Posts

Posted

I'm trying to do this...

$k = 1

Do

MouseMove(500,800,0)

Sleep(100)

If Pixel Search is TRUE Then

$k = 2

EndIf

Until $k =2

Heres my question...how can I tell it if the PixelSearch was true or not?

I could swap it around and say "If pixel search not true Then...." But kinda lost here.

Posted

Pixel search simply records coordinates...

BUT

If you want to know whether it found the pixel or not, do this:

Pixelsearch(x1,y1,x2,y2,pixel)
if @error = 1 THEN;If script recieves an error (pixel not found) execut code here:
;code
endif

Basically, you use @error, to check if there was an error, 0 for none, 1 for an error

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Guest Zeliard2000
Posted

Also the @error variable is reset after any other function is called. So its probably better if you saved the @error value in a different variable right after calling the PixelSearch function.

i.e.

PixelSearch(14, 20, 50, 100, color)

$error = @error

You probably already know this, but it took me forever to figure out that the @error variable kept reseting.

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
×
×
  • Create New...