Macro Handler API Guide

All API objects, methods, and global functions available in Macro Handler scripts. Browse categories from the left panel or use the search.

Lua note: Prefer ":" for instance method calls (example: region:find(Asset.image("target"), FindParam()), match:click()).

Language and OCR scope

14 languages are selectable on both the website and the Android app settings. The website and Android app start in English on first open, and users can switch to their preferred language at any time.

70+ official OCR language codes are supported on-device through Latin, Chinese, Japanese, Korean, Devanagari, Arabic, and Cyrillic OCR families. For scripts outside the official OCR coverage or rapidly changing glyph shapes, prefer template or image flows.

Trigger and Event scope

Macros can start manually from the dashboard, shortcuts, quick settings tile, and widget surfaces; they can also run from daily time, repeating interval, app launch, and allowlisted notification triggers. On the script side, the Event object exposes source, kind, mode, macroId, packageName, appName, title, body, and at fields.

Total APIs

589

Global Functions

20

Global Objects

40

Object Methods

529

Dashboard

Macro list

No-Code Flow

No-code block flow

Lua Editor

Lua code editor

Global Functions

UI and Dialogs

Creates an on/off checkbox for dialogs.

lua
Checkbox(true, "Show notifications")
Touch and Actions

Performs tap action on a target coordinate.

lua
click(540, 960)
Other

ColorPicker - Macro Handler scripting API function.

lua
ColorPicker(value?)
UI and Dialogs

Creates a dialog object with title and description for Setting.builder().

lua
Dialog("Settings", "Enter parameters")
UI and Dialogs

Creates a text input field for dialogs.

lua
EditText("500", 1, "Delay (ms)")
Touch and Actions

Defines start and end points for a swipe gesture.

lua
local sp = GesturePoint(Point(540, 1500), 0, 300)
UI and Dialogs

Creates an image picker component for dialogs.

lua
ImagePicker("target", "Select target image")
Touch and Actions

Creates a builder for constructing multi-swipe gestures.

lua
local msb = MultiGestureBuilder()
-- Add swipe points
Core Flow

Shows in-app runtime messages on screen.

lua
notifyPro("Status", "Step completed")
Core Flow

print - Macro Handler scripting API function.

lua
print("Log line")
Touch and Actions

Performs tap action on a target coordinate.

lua
local p = Point(540, 960)
quickTap(p)
UI and Dialogs

Creates a single-selection option group for dialogs.

lua
RadioGroup({"Slow", "Fast"}, 0)
Touch and Actions

Starts a touch gesture recorder.

lua
Recorder("record", "Record")
Core Flow

Requests a graceful stop for the current macro.

lua
if not License.isValid() then
  requestStop()
end
Core Flow

sleep - Macro Handler scripting API function.

lua
sleep(0.5)
Touch and Actions

Executes swipe movement between two coordinates.

lua
swipe({GesturePoint(Point(540, 1500), 0, 0), GesturePoint(Point(540, 500), 0, 300)})
UI and Dialogs

Defines a tabbed panel layout for dialogs.

lua
TabLayout({"General", "Advanced"})
UI and Dialogs

Creates a read-only text label for dialogs.

lua
TextView("Header Text")
Core Flow

Shows in-app runtime messages on screen.

lua
toast("Macro started")
Core Flow

Creates a millisecond delay in script execution flow.

lua
wait(500)
wait(1000)

Other

Methods: 1

AI is part of the Macro Handler API surface.

Foundation Example

lua
-- AI:ask
local result = AI:ask("value")
-- Use the result in your script flow

Data and Files

Methods: 8

Array is part of the Macro Handler API surface.

Foundation Example

lua
-- Array:sort
local result = Array:sort("value")
-- Use the result in your script flow

Scanning and Detection

Methods: 11

Asset manages screen scanning, image matching, and detection flow.

Foundation Example

lua
local tpl = Asset.image("play_btn")
local reg = Region()
reg:find(tpl)

Scanning and Detection

Methods: 4

Capture manages screen scanning, image matching, and detection flow.

Foundation Example

lua
-- Capture:stop
local result = Capture:stop()
-- Use the result in your script flow

Parameter Objects

Methods: 5

ClickParam configures detailed search/action parameters.

Foundation Example

lua
-- ClickParam:repeat
local result = ClickParam:repeat("value")
-- Use the result in your script flow

Data and Files

Methods: 4

Clipboard is part of the Macro Handler API surface.

Foundation Example

lua
-- Clipboard:clear
local result = Clipboard:clear()
-- Use the result in your script flow

Scanning and Detection

Methods: 19

Color manages screen scanning, image matching, and detection flow.

Foundation Example

lua
-- Color:pixel
local result = Color:pixel("value")
-- Use the result in your script flow

UI and Dialogs

Methods: 3

Console is used to build dialogs, settings, or HUD overlays.

Foundation Example

lua
-- Console:out
local result = Console:out("value")
-- Use the result in your script flow

Date and Time

Methods: 26

DateTime is used for date, duration, and timing operations.

Foundation Example

lua
local now = DateTime.now()
toast(DateTime.format(now, "yyyy-MM-dd HH:mm"))

Other

Methods: 11

Event is part of the Macro Handler API surface.

Foundation Example

lua
-- Event:exists
local result = Event:exists()
-- Use the result in your script flow

Data and Files

Methods: 16

File is part of the Macro Handler API surface.

Foundation Example

lua
File.write("run.log", "Started")
local txt = File.read("run.log")

Parameter Objects

Methods: 10

FindParam configures detailed search/action parameters.

Foundation Example

lua
-- FindParam:timeout
local result = FindParam:timeout("value")
-- Use the result in your script flow

UI and Dialogs

Methods: 37

Hud is used to build dialogs, settings, or HUD overlays.

Foundation Example

lua
local hud = Hud(10, 10, 200, 50, true)
hud:setText("Running")
hud:setTextColor("#FFFFFF")
hud:setBackgroundColor("#80000000")
hud:show()

Data and Files

Methods: 2

JSON is part of the Macro Handler API surface.

Foundation Example

lua
-- JSON:parse
local result = JSON:parse("sample text", "%d+")
-- Use the result in your script flow

Data and Files

Methods: 5

KV is part of the Macro Handler API surface.

Foundation Example

lua
-- KV:set
local result = KV:set("value")
-- Use the result in your script flow

License and Security

Methods: 9

License is used in license and access validation flows.

Foundation Example

lua
if License.isActive() then
  toast("License active")
end

Data and Files

Methods: 17

Map is part of the Macro Handler API surface.

Foundation Example

lua
-- Map:get
local result = Map:get()
-- Use the result in your script flow

Data and Files

Methods: 9

Math is part of the Macro Handler API surface.

Foundation Example

lua
-- Math:randomRange
local result = Math:randomRange("value")
-- Use the result in your script flow

System Control

Methods: 4

Metrics provides system/device level helper methods.

Foundation Example

lua
-- Metrics:enable
local result = Metrics:enable("value")
-- Use the result in your script flow

Touch and Actions

Methods: 2

MultiGesture handles tap, swipe, and action execution flow.

Foundation Example

lua
-- MultiGesture:builder
local result = MultiGesture:builder("value")
-- Use the result in your script flow

Data and Files

Methods: 13

Num is part of the Macro Handler API surface.

Foundation Example

lua
-- Num:parse
local result = Num:parse("sample text", "%d+")
-- Use the result in your script flow

Touch and Actions

Methods: 9

Panel handles tap, swipe, and action execution flow.

Foundation Example

lua
-- Panel:show
local result = Panel:show()
-- Use the result in your script flow

Parameter Objects

Methods: 4

PlayParam configures detailed search/action parameters.

Foundation Example

lua
-- PlayParam:repeat
local result = PlayParam:repeat("value")
-- Use the result in your script flow

Touch and Actions

Methods: 9

Point handles tap, swipe, and action execution flow.

Foundation Example

lua
-- Point:x
local result = Point:x("value")
-- Use the result in your script flow

Data and Files

Methods: 5

Regex is part of the Macro Handler API surface.

Foundation Example

lua
-- Regex:match
local result = Regex:match("value")
-- Use the result in your script flow

Scanning and Detection

Methods: 73

Region manages screen scanning, image matching, and detection flow.

Foundation Example

lua
local area = Region()
local hit = area:find(Asset.image("ok_btn"))
if hit then quickTap(hit) end

Touch and Actions

Methods: 4

Replay handles tap, swipe, and action execution flow.

Foundation Example

lua
-- Replay:start
local result = Replay:start({})
-- Use the result in your script flow

Network and Integration

Methods: 10

Request is used for external service communication.

Foundation Example

lua
local res = Request.get("https://example.com")
toast("HTTP: " .. tostring(res:getResponseCode()))

Scanning and Detection

Methods: 7

Result manages screen scanning, image matching, and detection flow.

Foundation Example

lua
-- Result:getPoint
local result = Result:getPoint()
-- Use the result in your script flow

System Control

Methods: 25

Runtime provides system/device level helper methods.

Foundation Example

lua
-- Runtime:get
local result = Runtime:get()
-- Use the result in your script flow

UI and Dialogs

Methods: 10

Setting is used to build dialogs, settings, or HUD overlays.

Foundation Example

lua
local cfg = Setting.builder()
cfg:add("delay", EditText("500", 1, "Delay"))
Setting.setDialog(cfg:build())
Setting.show()

UI and Dialogs

Methods: 7

SettingBuilder is used to build dialogs, settings, or HUD overlays.

Foundation Example

lua
-- SettingBuilder:setTitle
local result = SettingBuilder:setTitle("value")
-- Use the result in your script flow

Scanning and Detection

Methods: 11

Snap manages screen scanning, image matching, and detection flow.

Foundation Example

lua
Snap.screenRefresh()
local r = Region()
local found = r:find(Asset.image("start_btn"))

Date and Time

Methods: 8

Stopwatch is used for date, duration, and timing operations.

Foundation Example

lua
-- Stopwatch:start
local result = Stopwatch:start({})
-- Use the result in your script flow

Data and Files

Methods: 23

Str is part of the Macro Handler API surface.

Foundation Example

lua
-- Str:contains
local result = Str:contains("value")
-- Use the result in your script flow

Parameter Objects

Methods: 4

SwipeParam configures detailed search/action parameters.

Foundation Example

lua
-- SwipeParam:repeat
local result = SwipeParam:repeat("value")
-- Use the result in your script flow

System Control

Methods: 56

System provides system/device level helper methods.

Foundation Example

lua
-- System:currentTime
local result = System:currentTime("value")
-- Use the result in your script flow

Date and Time

Methods: 27

TimeSpan is used for date, duration, and timing operations.

Foundation Example

lua
-- TimeSpan:fromMs
local result = TimeSpan:fromMs("value")
-- Use the result in your script flow

Touch and Actions

Methods: 11

Touch handles tap, swipe, and action execution flow.

Foundation Example

lua
Touch.down(Point(500, 1200), 0)
wait(80)
Touch.up(0)

System Control

Methods: 10

Version provides system/device level helper methods.

Foundation Example

lua
-- Version:code
local result = Version:code("value")
-- Use the result in your script flow

Detailed Usage Examples

Ready-to-use examples you can paste directly into the code editor and run. Each example includes detailed descriptions and parameters.

15 examples