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.timeout(3000)), 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 mapped on-device across 7 OCR families: Latin, Chinese, Japanese, Korean, Devanagari, Arabic, and Cyrillic. 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

652

Global Functions

27

Global Objects

46

Object Methods

579

Documentation learning map: macro list

Users first learn saved macros, the new macro flow, and run state from this main screen.

Clean macro list documentation map
1MacrosSaved macros, status, and last-run context are tracked here.
2NewCreating a new macro is the entry point for coded or no-code development.
3StatusRun, permission, and error states are read to evaluate macro reliability.

Documentation learning map: no-code workspace

No-code users learn the block card, region/template fields, and step order through a clean real screenshot.

Clean no-code block flow
1BlockEach block represents one automation step and is configured from the card.
2RegionScreen region for image, color, and OCR scanning is selected from this area.
3OrderBlock order defines macro execution flow; API equivalents are read in the same order in the docs.

Documentation learning map: Lua editor

Coded users learn by matching API search, sample code, and error output to the editor surface.

Clean Lua code editor
1ScriptLua is written here; examples from the API docs are adapted directly into this area.
2APIAutocomplete and documentation examples make the correct function signature easier to choose.
3OutputRun result, logs, and errors are used to correct the macro.

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.

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

Performs tap action on a target coordinate.

click(540, 960)
Other

ColorPicker - Macro Handler scripting API function.

ColorPicker(value?)
Other

DateTimePicker - Macro Handler scripting API function.

DateTimePicker(value?)
UI and Dialogs

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

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

Creates a text input field for dialogs.

EditText("500", 1, "Delay (ms)")
Other

FilePicker - Macro Handler scripting API function.

FilePicker(value?)
Touch and Actions

Defines start and end points for a swipe gesture.

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

Creates an image picker component for dialogs.

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

Creates a builder for constructing multi-swipe gestures.

local msb = MultiGestureBuilder()
-- Add swipe points
Other

MultiSelect - Macro Handler scripting API function.

MultiSelect(value?)
Core Flow

Shows in-app runtime messages on screen.

notifyPro("Status", "Step completed")
Other

NumberRange - Macro Handler scripting API function.

NumberRange(value?)
Core Flow

print - Macro Handler scripting API function.

print("Log line")
Touch and Actions

Performs tap action on a target coordinate.

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

Creates a single-selection option group for dialogs.

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

Starts a touch gesture recorder.

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

Requests a graceful stop for the current macro.

if not License.isValid() then
  requestStop()
end
Other

SignaturePad - Macro Handler scripting API function.

SignaturePad(value?)
Core Flow

sleep - Macro Handler scripting API function.

sleep(0.5)
Other

Slider - Macro Handler scripting API function.

Slider(value?)
Touch and Actions

Executes swipe movement between two coordinates.

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

Defines a tabbed panel layout for dialogs.

TabLayout({"General", "Advanced"})
Other

TagInput - Macro Handler scripting API function.

TagInput(value?)
UI and Dialogs

Creates a read-only text label for dialogs.

TextView("Header Text")
Core Flow

Shows in-app runtime messages on screen.

toast("Macro started")
Core Flow

Creates a millisecond delay in script execution flow.

wait(500)
wait(1000)

Other

Methods: 1Singleton Global

AI is part of the Macro Handler API surface. It is exposed as a singleton global namespace.

Foundation Example

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

Data and Files

Methods: 8Singleton Global

Array is part of the Macro Handler API surface. It is exposed as a singleton global namespace.

Foundation Example

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

Scanning and Detection

Methods: 11Singleton Global

Asset manages screen scanning, image matching, and detection flow. It is exposed as a singleton global namespace.

Foundation Example

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

Other

Methods: 8Singleton Global

Async is part of the Macro Handler API surface. It is exposed as a singleton global namespace.

Foundation Example

-- Async:promise
local result = Async:promise("value")
-- Use the result in your script flow

Other

Methods: 7Singleton Global

AsyncPromise is part of the Macro Handler API surface.

Foundation Example

-- AsyncPromise:resolve
local result = AsyncPromise:resolve("value")
-- Use the result in your script flow

Scanning and Detection

Methods: 4Singleton Global

Capture manages screen scanning, image matching, and detection flow. It is exposed as a singleton global namespace.

Foundation Example

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

Parameter Objects

Methods: 5Singleton Global

ClickParam configures detailed search/action parameters. It is exposed as a singleton global namespace.

Foundation Example

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

Data and Files

Methods: 4Singleton Global

Clipboard is part of the Macro Handler API surface. It is exposed as a singleton global namespace.

Foundation Example

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

Other

Methods: 10Singleton Global

Collection is part of the Macro Handler API surface. It is exposed as a singleton global namespace.

Foundation Example

-- Collection:put
local result = Collection:put("value")
-- Use the result in your script flow

Scanning and Detection

Methods: 19Factory Global

Color manages screen scanning, image matching, and detection flow. It also behaves as a callable global factory.

Foundation Example

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

UI and Dialogs

Methods: 3Singleton Global

Console is used to build dialogs, settings, or HUD overlays. It is exposed as a singleton global namespace.

Foundation Example

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

Date and Time

Methods: 26Factory Global

DateTime is used for date, duration, and timing operations. It also behaves as a callable global factory.

Foundation Example

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

Other

Methods: 11Singleton Global

Event is part of the Macro Handler API surface. It is exposed as a singleton global namespace.

Foundation Example

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

Other

Methods: 6Singleton Global

Events is part of the Macro Handler API surface. It is exposed as a singleton global namespace.

Foundation Example

-- Events:on
local result = Events:on("value")
-- Use the result in your script flow

Data and Files

Methods: 16Singleton Global

File is part of the Macro Handler API surface. It is exposed as a singleton global namespace.

Foundation Example

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

Parameter Objects

Methods: 10Singleton Global

FindParam configures detailed search/action parameters. It is exposed as a singleton global namespace.

Foundation Example

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

UI and Dialogs

Methods: 37Factory Global

Hud is used to build dialogs, settings, or HUD overlays. It also behaves as a callable global factory.

Foundation Example

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

Data and Files

Methods: 2Singleton Global

JSON is part of the Macro Handler API surface. It is exposed as a singleton global namespace.

Foundation Example

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

Data and Files

Methods: 5Singleton Global

KV is part of the Macro Handler API surface. It is exposed as a singleton global namespace.

Foundation Example

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

License and Security

Methods: 9Singleton Global

License is used in license and access validation flows. It is exposed as a singleton global namespace.

Foundation Example

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

Data and Files

Methods: 17Factory Global

Map is part of the Macro Handler API surface. It also behaves as a callable global factory.

Foundation Example

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

Data and Files

Methods: 9Singleton Global

Math is part of the Macro Handler API surface. It is exposed as a singleton global namespace.

Foundation Example

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

System Control

Methods: 4Singleton Global

Metrics provides system/device level helper methods. It is exposed as a singleton global namespace.

Foundation Example

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

Touch and Actions

Methods: 2Singleton Global

MultiGesture handles tap, swipe, and action execution flow. It is exposed as a singleton global namespace.

Foundation Example

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

Data and Files

Methods: 13Singleton Global

Num is part of the Macro Handler API surface. It is exposed as a singleton global namespace.

Foundation Example

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

Touch and Actions

Methods: 9Singleton Global

Panel handles tap, swipe, and action execution flow. It is exposed as a singleton global namespace.

Foundation Example

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

Parameter Objects

Methods: 4Singleton Global

PlayParam configures detailed search/action parameters. It is exposed as a singleton global namespace.

Foundation Example

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

Touch and Actions

Methods: 9Factory Global

Point handles tap, swipe, and action execution flow. It also behaves as a callable global factory.

Foundation Example

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

Data and Files

Methods: 5Singleton Global

Regex is part of the Macro Handler API surface. It is exposed as a singleton global namespace.

Foundation Example

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

Scanning and Detection

Methods: 73Factory Global

Region manages screen scanning, image matching, and detection flow. It also behaves as a callable global factory.

Foundation Example

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

Touch and Actions

Methods: 4Singleton Global

Replay handles tap, swipe, and action execution flow. It is exposed as a singleton global namespace.

Foundation Example

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

Network and Integration

Methods: 13Factory Global

Request is used for external service communication. It also behaves as a callable global factory.

Foundation Example

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

Scanning and Detection

Methods: 7Singleton Global

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

Foundation Example

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

System Control

Methods: 25Singleton Global

Runtime provides system/device level helper methods. It is exposed as a singleton global namespace.

Foundation Example

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

UI and Dialogs

Methods: 10Singleton Global

Setting is used to build dialogs, settings, or HUD overlays. It is exposed as a singleton global namespace.

Foundation Example

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

UI and Dialogs

Methods: 7Singleton Global

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

Foundation Example

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

Scanning and Detection

Methods: 11Singleton Global

Snap manages screen scanning, image matching, and detection flow. It is exposed as a singleton global namespace.

Foundation Example

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

Other

Methods: 2Singleton Global

SSE is part of the Macro Handler API surface. It is exposed as a singleton global namespace.

Foundation Example

-- SSE:read
local result = SSE:read("macro.log")
-- Use the result in your script flow

Date and Time

Methods: 8Factory Global

Stopwatch is used for date, duration, and timing operations. It also behaves as a callable global factory.

Foundation Example

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

Data and Files

Methods: 23Singleton Global

Str is part of the Macro Handler API surface. It is exposed as a singleton global namespace.

Foundation Example

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

Parameter Objects

Methods: 4Singleton Global

SwipeParam configures detailed search/action parameters. It is exposed as a singleton global namespace.

Foundation Example

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

System Control

Methods: 60Singleton Global

System provides system/device level helper methods. It is exposed as a singleton global namespace.

Foundation Example

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

Date and Time

Methods: 27Factory Global

TimeSpan is used for date, duration, and timing operations. It also behaves as a callable global factory.

Foundation Example

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

Touch and Actions

Methods: 11Singleton Global

Touch handles tap, swipe, and action execution flow. It is exposed as a singleton global namespace.

Foundation Example

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

System Control

Methods: 10Singleton Global

Version provides system/device level helper methods. It is exposed as a singleton global namespace.

Foundation Example

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

Other

Methods: 10Singleton Global

WebSocket is part of the Macro Handler API surface. It is exposed as a singleton global namespace.

Foundation Example

-- WebSocket:exchange
local result = WebSocket:exchange("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