Can a 3rd Time-out condition be added to PIXEL COLOR? Nov 26, 2018 15:09:23 GMT
Post by Johnc on Nov 26, 2018 15:09:23 GMT
On the manual right now:
Consider the PIXEL example statement below taken from a macro condition:
1 | IF | PIXEL COLOR | At Location [X:784 Y:602] | CHANGES::2::30::200 | MESSAGE PROMPT | Pixel changed 2 times in 30 seconds::Pixel Change::0
This reads - IF the PIXEL COLOR at mouse location X:784 and Y:602 CHANGES 2 times within 30 seconds, with a 200 milliseconds delay between changes, then run a MESSAGE PROMPT.
CHANGES can take three values (CHANGES::1::2::3):
The amount of changes to detect.
A timeout value in seconds - The total time to wait for the changes. If the time expires the statement will evaluate to FALSE and continue. A value of 0 will wait until all changes have occurred.
A change delay value in milliseconds - The delay value forces a delay between detecting pixel changes. This is useful to control sensitivity of pixel changes. A value of 0 will skip a delay.
1) Right now, if the time expires the statement will evaluate to FALSE and continue. This is not very helpful in most cases I think.
Evaluated FALSE and TIME-OUT are in many cases 2 very different conditions and they need to be handled differently.
I would suggest a 3rd condition (TIMEOUT) be added to allow the macro to go back to some previous lines to redo some work to make the PIXEL COLOR Evaluated TRUE like the following:
33 | IF | PIXEL COLOR | At Location [X:784 Y:602] | CHANGES::2::30::200 | CONTINUE | TIMEOUT | GOTO MACRO LINE | 25
i.e. if pixel color times out, goto line 25
2) I understand that CONTINUE cannot be used with ELSE but the command CONTINUE is the most simple and useful action for PIXEL COLOR, IMHO. Most of the time you want to wait for a color change rather than to execute the "ELSE" condition immediately, I think. Therefore I think the IF ELSE structure is not very useful for PIXEL COLOR CHANGES detection anyway. However, the CONTINUE & TIMEOUT combo would seem very useful.