nkormanik Posted April 23, 2018 Report Share Posted April 23, 2018 Please see line that's below: <REPEAT UNTIL Variable="%N2%" Condition="\x00" Value="13563637"/> Is there a way to add an "or" and another value to look for? Like, for instance: Value="13563637" or Value="13563699" Thanks much! Nicholas Kormanik Quote Link to comment Share on other sites More sharing options...
acantor Posted April 23, 2018 Report Share Posted April 23, 2018 I don't think so. But that may be a blessing in disguise. I avoid "REPEAT UNTIL" because I've had too many experiences of freezes when the condition, for whatever reason, cannot be met. But you can test for two or more conditions using IF statements. My approach is to use a "failsafe" to exit the loop if the condition is not met within a reasonable number of iterations. For example, if I am checking pixel colours along a horizontal line, the failsafe value might be the width of the screen as measured in pixels. In pseudocode: // Check each pixel along (x, 100) for Colour = 11111 or Colour = 22222 Failsafe = 1200 x = 0 y = 100 Repeat Failsafe Times Colour = Pixel Color at (x, y) If Colour = 11111 OR If Colour = 22222 // Pixel has been found! ... Macro Stop Else x = x + 1 Repeat End // Pixel not found! Quote Link to comment Share on other sites More sharing options...
Cory Posted April 23, 2018 Report Share Posted April 23, 2018 That's what I would do. Use a condition to escape when the conditions are met and set it to a reasonable number of iterations just in case the value is never found. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.