JMacro Readme
JMacro can be used to automate many tasks. It was designed to be used in conjunction with applications which require a lot of repetitious input (mainly games).
The macro syntax is described below. The delimiter between commands is any type of whitespace (spaces, tabs, newlines). All durations are entered in milliseconds. All commands are case sensitive. The syntax supports comments in the form of //comment and /*comment*/
Settings
All settings can be overridden within the macro script as detailed in the Commands section below
Loop
Check this option if the macro script should never stop executing
Event Delay
The default pause, in milliseconds, between each command
Initial Start Delay
The amount of time to pause between pressing the Start button and starting the macro
Commands
Input Commands
- Letters A-Z - must be capitalized
- Numbers 0-9
- mouseLeft - left mouse button
- mouseRight - right mouse button
- mouseMiddle - middle mouse button
- Function keys f1-f12 - must use lowercase 'f'
- enter
- space
- esc
- tab
- shift
- ctrl
- alt
- scrollLock
- break - some keyboards have this as the "Pause" key
- numLock
- capsLock
- backspace
- insert
- delete
- home
- end
- pageUp
- pageDown
- up - arrow key
- down - arrow key
- left - arrow key
- right - arrow key
command
command ( duration )
Hold input down for duration milliseconds
command ( duration , continue )
Hold input down for duration milliseconds and proceed with script without waiting for this command to complete
Looping Commands
loop ( count , command(s) )
Loop the specified command(s) count times
timedLoop ( duration , command(s) )
Loop over the specified command(s) until duration milliseconds has passed. The last looped iteration may exceed the duration
Pause Command
pause ( duration )
Pause for duration milliseconds. A pause command will override any default pause between events
Mouse Move Command
mouse( x , y )
Move the mouse to the specified coordinates. To measure coordinate location, the current mouse coordinates are always displayed in the lower-right corner of the JMacro window
Color Conditional Command
ifColor( x , y , #color , command(s) )
If the pixel at screen coordinate [x,y] is color, perform the specified command(s)
ifNotColor( x , y , #color , command(s) )
Opposite of ifColor command. If the pixel at screen coordinate [x,y] is not color, perform the specified command(s)
Setting Overrides
//override_loop (true|false)
//override_event_delay milliseconds
//override_initial_delay milliseconds
Examples
Press the left mouse button, then press W for ten seconds
mouseLeft
W(10000)
While holding down shift and the W key, click the left mouse button repeatedly for twenty seconds
shift(20000, continue)
W(20000, continue)
timedLoop(20000, mouseLeft)
If the pixel color at the specified location is red, click the left mouse button
ifColor( 525, 600, #FF0000,
mouseLeft
)