no_messiah Posted February 20, 2005 Share Posted February 20, 2005 If Not PixelGetColor ( 801 , 49 ) = $color1 Then MouseClick("left", 576, 731, 1) EndIf i having problems getting this to work what am i doing wrong? in case its not clear what i want, i wont it to left click if the color at the given pixel does not match the varible Link to comment Share on other sites More sharing options...
SlimShady Posted February 20, 2005 Share Posted February 20, 2005 Your code says: If opposite-of-PixelGetcolor equals $color1 then... And you want: If PixelGetcolor does NOT equal $color1 then... There are two ways to do this. 1. If Not (PixelGetColor ( 801 , 49 ) = $color1) Then MouseClick("left", 576, 731, 1) EndIf 2.If PixelGetColor ( 801 , 49 ) <> $color1 Then MouseClick("left", 576, 731, 1) EndIf Link to comment Share on other sites More sharing options...
no_messiah Posted February 20, 2005 Author Share Posted February 20, 2005 Your code says: If opposite-of-PixelGetcolor equals $color1 then...And you want: If PixelGetcolor does NOT equal $color1 then...There are two ways to do this.1.If Not (PixelGetColor ( 801 , 49 ) = $color1) Then MouseClick("left", 576, 731, 1) EndIf2.If PixelGetColor ( 801 , 49 ) <> $color1 Then MouseClick("left", 576, 731, 1) EndIf<{POST_SNAPBACK}>seems to work i dont see the logic how ever, the NOT and other statements are not the good explained in help file Link to comment Share on other sites More sharing options...
SlimShady Posted February 20, 2005 Share Posted February 20, 2005 (edited) I'll show you some equations and their solutions.NOT 1 equals 0NOT 0 equals 1NOT 100 equals 0NOT NOT 1 equals 1NOT NOT 100 equals 1Edit: some more5 + 5 = 10 equals 1 (true)NOT (5 + 5 = 10) equals 0 (false)Let me take your code as an example.$Matched_color = PixelGetColor ( 801 , 49 ) If Not $Matched_color = $color1 Then MouseClick("left", 576, 731, 1) EndIf$Matched_color could be in this case 100 or 1 or 0.Like I said:Your code says: If opposite-of-PixelGetcolor equals $color1 then...And you want: If PixelGetcolor does NOT equal $color1 then...AutoIt handles the statement just like the equations above.The advantage of this way is:You can do: If FileExists() Then ...and: If NOT FileExists() Then ...When the function is successful, it returns true (number 1).Else it would return false (number 0). Edited February 20, 2005 by SlimShady Link to comment Share on other sites More sharing options...
Insolence Posted February 21, 2005 Share Posted February 21, 2005 Excellent post, Slim "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. Link to comment Share on other sites More sharing options...
Blue_Drache Posted February 21, 2005 Share Posted February 21, 2005 Excellent post, Slim <{POST_SNAPBACK}>NOT. :) Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
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