IAMK Posted April 24, 2018 Share Posted April 24, 2018 (edited) I observed 2 misbehaviours. Is the issue my understanding or AutoIT itself? My script is supposed to sleep until 1 of 2 desired colours is seen. While(PixelGetColor(260, 975) <> 39922 Or PixelGetColor(260, 975) <> 41714) Sleep(500) WEnd The above should sleep if colour1 is true and colour2 is false? Mine didn't sleep. (I guess Or moves left->right until first pass is seen) While(PixelGetColor(260, 975) <> 39922 And PixelGetColor(260, 975) <> 41714) Sleep(500) WEnd The above should sleep if both colours are false? Mine didn't sleep if colour2 was true. (Note this is the code I currently use but don't understand why it's failing). Edited April 24, 2018 by IAMK Link to comment Share on other sites More sharing options...
Subz Posted April 24, 2018 Share Posted April 24, 2018 Can't tell you what the limitations of While Expressions are, but it appears that it only likes a single expression, for example: While PixelGetColor(260, 975) <> 39922 Sleep(500) WEnd However you can use multiple expressions within the loop for example: While 1 If PixelGetColor(260, 975) = 39922 Or PixelGetColor(260, 975) = 41714 Then ExitLoop Sleep(500) WEnd Link to comment Share on other sites More sharing options...
IAMK Posted April 24, 2018 Author Share Posted April 24, 2018 This issue is resolved. The issue was not the logic, but the file being used. Link to comment Share on other sites More sharing options...
Subz Posted April 24, 2018 Share Posted April 24, 2018 Your first snippet didn't work for me, unless I used the If statement, I'm not really sure "the file being used" is referring to. Link to comment Share on other sites More sharing options...
IAMK Posted April 26, 2018 Author Share Posted April 26, 2018 @Subz, I was editing the script on machine1, but testing the exe on machine2, of which the IP is different by 1 number... 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