Skip to content

02. Instructions Overview

ThisTestUser edited this page Jun 5, 2022 · 8 revisions

CursorMacro has six instructions for the player to run.

Delay

This instruction makes the player wait a certain time in milliseconds. The wait time is benchmarked against System.currentTimeMillis(), so if an instruction takes 20MS to run and the delay instruction after it is a delay of 100MS, the actual wait time will be 80MS. If the previous instruction took longer to run than the delay specified this instruction is skipped over.

Format: DELAY <ms> <offset>, where <ms> is the wait time in milliseconds and <offset> is the offset to the wait time applied at runtime. The randomizer will generate the offset value if used. The offset parameter is optional, and its objective is to allow the randomizer to generate and remove offsets easily without tampering with the base values.

KeyType

This instruction presses or releases a keyboard key.

Format: KEY <action> <keycode>, where <action> is either 0 (press) or 1 (release), and <keycode> is the key code. The recorder can be used to find the key code.

MouseMove

This instruction moves the mouse to the specified location. It uses the C++ SetCursorPos method, making it very accurate and fast.

Format: MOUSEMOVE <x> <y> <xtol> <ytol> <offsetx> <offsety>, where (<x>, <y>) is the new mouse location. <xtol> and <ytol> are the tolerance values for x and y. The tolerance is a nonnegative number which represents the maximum deviation away from the expected value allowed. <offsetx> and <offsety> are added to x and y at runtime. The randomizer will generate the offset value if "Randomize Location" is checked. Only <x> and <y> are mandatory arguments, but MOUSEMOVE is only allowed to have 2, 4, or 6 arguments.

MousePress

This instruction presses or releases a mouse button.

Format: MOUSEPRESS <action> <button>, where <action> is either 0 (press) or 1 (release), and <button> is the button code. Left click has a button code of 1, middle click has a button code of 2, and right click has a button code of 3. Other mouse buttons are also supported, and the recorder can be used to find the button code.

MouseWheel

This instruction scrolls the mouse wheel.

Format: MOUSEWHEEL <amount>, where <amount> is the amount to scroll. Negative values represent scrolling up and positive values represent scrolling down.

Custom

This instruction is for custom instructions implemented directly in code (more on this later).

Format: CUSTOM <instrname> <args> Where <instrname> is the custom instruction name used, and <args> is the arguments after it (the number of arguments is set by the implementation of that custom instruction).

Clone this wiki locally