powertool Posted November 25, 2004 Posted November 25, 2004 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.
layer Posted November 25, 2004 Posted November 25, 2004 (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 November 25, 2004 by layer FootbaG
powertool Posted November 25, 2004 Author Posted November 25, 2004 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 Thenwould work?
layer Posted November 25, 2004 Posted November 25, 2004 No, you don't need the = @error, you only need if @error then MsgBox (0, "Error", "Pixel not found") FootbaG
db26 Posted November 25, 2004 Posted November 25, 2004 (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 November 25, 2004 by db26
SlimShady Posted November 25, 2004 Posted November 25, 2004 (edited) This is how I would do it: If @error Then ;... EndIf or If NOT @error Then ;... EndIf Edited November 25, 2004 by SlimShady
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now