How To Call It
Touch is a global table: call its functions with a dot (Touch.<method>(...)), not a colon. Requires Macro Handler 1.0.51 or later.
Returns the status of a lane group (idle, starting, running, holding, paused, recovering, cooldown, completed, stopped, failed or cleanup_failed).
Documented for app version 1.0.51 (not on Google Play yet)Updated:
Touch is a global table: call its functions with a dot (Touch.<method>(...)), not a colon. Requires Macro Handler 1.0.51 or later.
In automation flow, chain actions with short wait() intervals and use requestStop() or controlled retry on failure paths.
Required: tag. Returns a string.
Lane contract: laneAdd stages up to 10 lanes (more fail with lanes_full). from and to are Points; closer than 0.5 px they form a stationary finger whose finish must be "hold". A moving lane takes legMs 20-30000 ms, legs 0-1000 (0 is endless), turn "reverse" (A→B→A without lifting) or "restart" (A→B, lift, press A again) and finish "release" or "hold"; a counted lane may last at most 600000 ms. Optional returnMs (0 or 20-30000), returnPct (1-100) and holdAtForwardMs/holdAtReturnMs (0-10000) shape "reverse" lanes only. laneStart(tag, background, maxRunMs, order): tag matches ^[A-Za-z0-9:_#.-]{1,64}$ ("seq" is reserved), maxRunMs is 0-86400000 (0 is off), order is "together" (default) or "cycle". laneStatus returns idle, starting, running, holding, paused, recovering, cooldown, completed, stopped, failed or cleanup_failed. laneError returns "" or invalid_args, api_unsupported, lanes_full, lease_busy, service_unavailable, obstructed, touch_queue_pending, display_changed, cleanup_started, invalid_segment or lanes_busy. Lanes run on Android 8.0 (API 26) and later; laneStatus, laneError and sequenceStatus do not count against the Touch rate limit.
It works best together with wait(), Point, SwipeParam, ClickParam, and sometimes a Region result.
The snippet below is a starter pattern that can be applied directly in runtime flow.
Touch.laneAdd(Point(540, 1500), Point(540, 500), 400, 0, "reverse", "release")
Touch.laneStart("swipe:demo", true, 0)
local result = Touch.laneStatus("swipe:demo")From foundation to combined usage, each level is provided as a separate code block so you can copy the level you need and adapt it directly.
Touch.laneAdd(Point(540, 1500), Point(540, 500), 400, 0, "reverse", "release")
Touch.laneStart("swipe:demo", true, 0)
local result = Touch.laneStatus("swipe:demo")local stepOk = true
Touch.laneAdd(Point(540, 1500), Point(540, 500), 400, 0, "reverse", "release")
Touch.laneStart("swipe:demo", true, 0)
local result = Touch.laneStatus("swipe:demo")
if stepOk then
wait(200)
endlocal ok, err = pcall(function()
Touch.laneAdd(Point(540, 1500), Point(540, 500), 400, 0, "reverse", "release")
Touch.laneStart("swipe:demo", true, 0)
local result = Touch.laneStatus("swipe:demo")
end)
if not ok then
print("API step failed: Touch.laneStatus: " .. tostring(err))
requestStop()
end-- In automation flow, chain actions with short wait() intervals and use requestStop() or controlled retry on failure paths.
local function run_lanestatus_step()
Touch.laneAdd(Point(540, 1500), Point(540, 500), 400, 0, "reverse", "release")
Touch.laneStart("swipe:demo", true, 0)
local result = Touch.laneStatus("swipe:demo")
end
local ok, err = pcall(run_lanestatus_step)
if not ok then
toast("Step failed")
print(err)
end-- Endless back-and-forth background finger while the script keeps working (Macro Handler 1.0.51 or later)
Touch.laneAdd(Point(540, 1500), Point(540, 900), 400, 0, "reverse", "release")
if Touch.laneStart("swipe:joystick", true, 0) then
for step = 1, 10 do
quickTap(Point(900, 1700))
wait(500)
end
Touch.laneRelease("swipe:joystick", 0)
else
print("lane start failed: " .. Touch.laneError())
end