Macro Handler offers 800+ API methods on the default launch Lua runtime. Each category addresses a different automation need. The native Lua 5.4.8 runtime is experimental and not the default yet.
Detection
Region, Asset, Color, Snap
Image, color, and template scanning on screen. Asset matching, multi-result finding, and similarity settings. Snap the screen with Snap.screenRefresh(), define scan area with Region, and search for targets with Asset.image().
Snap.screenRefresh()
local r = Region()
local hit = r:find(Asset.image("btn"))Go to Docs →Automation
Touch, Point, click, quickTap, swipe
Taps, clicks, swipes, and multi-finger gestures. Use quickTap() for a single tap, swipe() for swiping, Touch.pinch() and Touch.rotate() for two-finger gestures, and MultiGestureBuilder for finger paths sent at the same time.
quickTap(Point(540, 960))
swipe({GesturePoint(Point(100, 500), 0, 0), GesturePoint(Point(900, 500), 0, 300)})
Touch.pinch(Point(540, 960), 600, 200, 400)Go to Docs →UI
Hud, Setting, Dialog
On-screen HUD panels, user settings dialogs, and notification messages. Show info on screen with Hud, collect user input with Setting.builder(), and display short messages with toast().
local hud = Hud(10, 10, 260, 50, false)
hud:setText("Running...")
hud:show()Go to Docs →System
System, File, Clipboard
File read/write, clipboard access, device info, and system commands. Get timestamp with System.currentTime(), handle files with File, and read/write clipboard with Clipboard.
local t = System.currentTime()
File.write("log.txt", "data")
Clipboard.copy("copied")Go to Docs →Network
Request
Connect to external APIs and exchange data over HTTPS GET/POST requests. Read the response status with getResponseCode() and its body with getData(); send webhooks or integrate with external services.
local res = Request.get("https://api.example.com/data")
local ok = res:getResponseCode() == 200
local req = Request("https://api.example.com/webhook")
req:setBody("{\"ok\":true}")
local posted = req:post()Go to Docs →Time
DateTime, TimeSpan, Stopwatch
Date formatting, duration measurement, timer management, and delay handling. Measure operation times with Stopwatch, get date/time info with DateTime, and add delays with wait().
local sw = Stopwatch()
sw:start()
wait(1000)
local ms = sw:elapsed()
Go to Docs →Data
Str, Num, Map, KV
Text and number handling, key-value structures, and persistent data. Process text with Str and convert numbers with Num; a Map lives in memory for the current run, so use KV for values that must survive between runs.
local parts = Str.split("a,b,c", ",")
local n = Num.toInt("42")
local session = Map()
session:set("score", 100)
KV.set("bestScore", 100)Go to Docs →Parameters
FindParam, ClickParam, SwipeParam, PlayParam
Fine-tune template, find, color, swipe, and region parameters in detail. Override default behaviors to adjust search sensitivity, swipe speed, and color tolerance. mScore is a threshold between 0 and 1.
local fp = FindParam.mScore(0.85):timeout(3000)
local hit = Region():find(Asset.image("btn"), fp)
if hit then click(hit, { repeatCount = 2 }) endGo to Docs →License
License, Version
Read the app’s license state and version info. License.isActive() reports the Macro Handler premium entitlement on the running device; check the app version your macro needs with Version.current().
if not Version.current():isAtLeast("1.0.50") then
toast("Please update Macro Handler")
return
end
local premium = License.isActive()Go to Docs →