Sign in to follow this  
Followers 0
powertool

Kind of simple, but can't find in help file?

6 posts in this topic

How would you do something like:

:) If PixelGetColor(x,y) <isn't> 0xXXXXXX AND PixelGetColor(x,y) = 0xXXXXXX Then

I tried:

:) If X Not Y Then

, but it doesn't work and there doesn't seem to be an operator that works for it.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I think you would need this:

$variable= PixelSearch ( left, top, right, bottom, color [, shade-variation] [, step]] )
If @error then
MsgBox (0, "Pixel Not Found", "Error, PixelColor was not found")
EndIf

:)

EDIT: It searches for the pixel color provided for the certain area given, and if it is found, it doesn nothing (You can make it do anything you want, this is just an example...), but if it doesn't find the pixel color provided, a MessageBox appears and states that the color was not found...Thats what you wanted right?

EDIT2: Here:

$variable= PixelSearch ( left, top, right, bottom, color [, shade-variation] [, step]] )
If @error then
MsgBox (0, "Pixel Not Found", "Error, PixelColor was not found")
If not @error then
 MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])
EndIf

Now that will tell you if the pixels were found, it will tell you the coordinates where they were at. :)

EndIf

Edited by layer

FootbaG

Share this post


Link to post
Share on other sites

I think you would need this:

$variable= PixelSearch ( left, top, right, bottom, color [, shade-variation] [, step]] )
If @error then
MsgBox (0, "Pixel Not Found", "Error, PixelColor was not found")
EndIf

:)

<{POST_SNAPBACK}>

Thanks, so

:) $variable= PixelSearch ( left, top, right, bottom, color [, shade-variation] [, step]] )

;) If $varible = @error AND PixelGetColor(x,y) = 0xXXXXXX Then

would work?

Share this post


Link to post
Share on other sites

No, you don't need the = @error, you only need if @error then

MsgBox (0, "Error", "Pixel not found")


FootbaG

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

If you're just asking what the not equals operator is, it's "<>"

I can't really tell by the way you worded it.

Edited by db26

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

This is how I would do it:

If @error Then
  ;...
EndIf

or

If NOT @error Then
  ;...
EndIf
Edited by SlimShady

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