I have been experiencing unreliable fast color change detection problems and have come up with the following suggestion:
The following is the normal code:
43 | 877 | 52 | 300 | Keypress enter 44 | IF | PIXEL COLOR | At Location [X:782 Y:450] | CHANGES::2::15::200 | WAIT MILLISECONDS | 1 | ELSE | 2 | RUN ACTION | GOTO MACRO LINE | 32 The following is the newly suggested Control Switch:
previous macroline delay execution is true
previous macroline delay execution is false (default)
43 | 877 | 52 | 300 | Keypress enter 44 | IF | PIXEL COLOR | At Location [X:782 Y:450] | CHANGES::2::15::200::1 | WAIT MILLISECONDS | 1 | ELSE | 2 | RUN ACTION | GOTO MACRO LINE | 32 When "delay execution" is true here, the execution of line 43 will be delayed until line 44 is finished with setting up and looking for PIXEL COLOR change.
This will allow enough time for PIXEL COLOR to set up itself before any fast color changes are going to occur, as a result of the execution of the previous macroline 43. This "delay execution" switch should be helpful when the color is going to change so fast resulting from the execution of line 43 that PIXEL COLOR in line 44 does not have enough time to capture the color change, resulting in an unreliable color change detection.
Interesting John. I see your logic. You want line 44 to detect the change made my line 43 after line 43 occurs. It's almost like line 43 needs a delay control not line 44. If line 43 was delayed then line 44 would detect the change. This is a tricky one john i'm not going suger coat it. Half the problem is writing the code for the GUI; how this would like as an option when you add the macro line. The actual code to delay the line wouldnt be that complicated. How this looks for the user - thats tough.
I am thinking out loud here Steve. Please bear with my ignorance and let me know if the following scheme would work.
Actually I was thinking when the switch is set, run line 43 and 44 in reverse order.
step 0) run line ...39,40,41,42 and then... it somehow sees that line 44 contains a pixel color command with a "delay option" set. step 1) skip 43 completely and run 44 first to set things up and start looking for color change. step 2) then fire a background task to execute line 43. (Note the delay of line 43 is self-timed. User input not needed.) step 3) hopefully line 44 would detect the change or wait till time-out.
I understand it may be difficult for a sequential machine to fire off a background (concurrent) task but it is worth dreaming about LOL!