Nirvana6 Posted April 30, 2008 Share Posted April 30, 2008 (edited) how i use the function "and" in if ($pixel1 = 0x44943) and $pixel2 = 0x44943 and $pixel3 = 0x44943 and $pixel4 = 0x44943 and ($pixel1b = 0x44943) and ($pixel2b = 0x44943) and ($pixel3b = 0x44943) and ($pixel4b = 0x44943) and ($pixel1c = 0x44943) and ($pixel2c = 0x44943) and ($pixel3c = 0x44943) and ($pixel4c = 0x44943) and ($pixel1d = 0x44943) and ($pixel2d = 0x44943) and ($pixel3d = 0x44943) and ($pixel4d = 0x44943) then when i compile i get this if ($pixel1 = 0x44943) and ????????????????????????????????????????????????????????????????????????and i want to know if i used correct if....then Edited April 30, 2008 by AlexStoian Link to comment Share on other sites More sharing options...
Nirvana6 Posted April 30, 2008 Author Share Posted April 30, 2008 ok i made it work by myself it should be if $pixel1=$pixel2=...... then endif Link to comment Share on other sites More sharing options...
Valuater Posted April 30, 2008 Share Posted April 30, 2008 (edited) Maybe try this way $X = StringSplit("22,44,15,27,55,33", ",") $Y = StringSplit("22,44,15,27,55,33", ",") $match = "" For $i = 1 To $X[0] If PixelGetColor($X[$i], $Y[$i]) = 0x44943 Then $match += 1 Next If $match = $X[0] Then ; do this ; because they all match that color EndIf 8) Edited April 30, 2008 by Valuater Link to comment Share on other sites More sharing options...
Developers Jos Posted April 30, 2008 Developers Share Posted April 30, 2008 For $i = 1 To $X[0] If PixelGetColor($X[$i], $Y[$i]) = 0x44943 Then $match = $i NextShouldn't that be changed to: If PixelGetColor($X[$i], $Y[$i]) = 0x44943 Then $match +=1 To count the number of matches? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Valuater Posted April 30, 2008 Share Posted April 30, 2008 (edited) Shouldn't that be changed to: If PixelGetColor($X[$i], $Y[$i]) = 0x44943 Then $match +=1 To count the number of matches? I did notice that when I wrote it, however he was using "and" throughout his OP, I figured if $match = $i then he would have goten all the colors correct, however if he wanted to check how many were a match your way would be better. Then there is the other thought of knowing the actual number of "whitch ones" did match... I was just to lazy to go that far... 8) Edited April 30, 2008 by Valuater Link to comment Share on other sites More sharing options...
Developers Jos Posted April 30, 2008 Developers Share Posted April 30, 2008 I did notice that when I wrote it, however he was using "and" throughout his OP, I figured if $match = $i then he would have gootn all the colors correct, however if he wanted to check how many were a match your way would be better. The there is the other tought of knowing the actual numbner of "witch ones" did match...I was just to lazy to go that far... 8)... but the current way is wrong since the final test will always be true when the Last PixelGetColor() is true ... right ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Valuater Posted April 30, 2008 Share Posted April 30, 2008 (edited) ... but the current way is wrong since the final test will always be true when the Last PixelGetColor() is true ... right ?Yes, you're right!... didn't see that will fixthx8) Edited April 30, 2008 by Valuater Link to comment Share on other sites More sharing options...
Developers Jos Posted April 30, 2008 Developers Share Posted April 30, 2008 Yes, you're right!... didn't see that will fixthx8)Sometimes its the simple things that go wrong ... just makes us human. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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