back to Jitbit Blog home About this blog

Macro Recorder: another trigger example - wait for pixel

by Alex Yumashev · Aug 28 2009
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).