Another example of "triggering" events with our Macro Recorder software using its "IF" statement. Below is a macro-script that makes Macro Recorder wait until a pixel at the given coordinates becomes white. Since Macro Recorder does not have a "wait for pixel" command, we have to use the IF statement:
LABEL : start
IF PIXEL COLOR EQUALS : 351 : 535 : 16777215
GOTO : end
ENDIF
DELAY : 2000
GOTO : start
LABEL : end
MESSAGE BOX : Woohoo, the pixel is white. Exiting...
This macro checks every 2 seconds, and if the pixel at the coordinates "351:535" becomes white, the macro exits. Simply save the above text as a plain-text file with a ".mcr" extension and load it into the Macro Recorder to test how it works (or simply select and copy-paste the text above straight into the Macro Recorder).
Macro Recorder: another trigger example - wait for pixel
Aug 28, 2009
Like this post? Subscribe to my RSS, follow me on Twitter or check the about page
Labels:
best practices,
macro recorder


3 comments:
Thanks for the answer. This would be very useful in the documentation, even more if you add an ELSE statement.
*Exciting
A little late on the response but the if statement followed by the goto start makes a loop, it doesnt really do anything other than loop through to tell you when the pixel is white. Technically anything after the if statement is an else by virtue of it does not meet the criteria of the if statement and continues on its merry little way.
Post a Comment