No-Code Workspace — Block Reference

TouchBlock usage recipe

Touch (TOUCH)

Advanced touch (hold, multi-finger)

Documented for app version 1.0.50Updated:

Block Preview

Captured from the in-app Visual Builder block card in the English UI.

English UI
Touch (TOUCH) block card

What Does It Do?

Performs low-level touch operations: hold, swipe and hold, step-by-step down/move/up and multi-finger. Used for complex scenarios where CLICK and SWIPE are insufficient. Duration 0 keeps the finger down until a Touch Break block.

Pro note: use background hold intentionally

TOUCH can let the rest of the builder flow continue while the hold remains active. This matters in joystick, hold-while-scan, and controlled-release recipes.

When to Use?

1

When CLICK and SWIPE are not enough:

2

Joystick control (swipe while holding)

3

Multi-finger operations (pinch zoom)

4

Holding for specific duration

5

Swipe while holding

6

Indefinite hold (release with Touch Break)

How to Use?

1

"Add Block" → "Touch (TOUCH)"

2

ADD ACTIONS ("+ Add Action"):

3

"Hold": Hold finger at point

4

"Swipe Hold": Swipe from point to point and keep the end pressed

5

"Down" / "Move" / "Up": Control the finger step by step

6

For each action: coordinates, Finger / Pointer (0 = first) and Wait After

7

TOUCH FLOW: "Wait until release" or "Continue while holding" (the finger stays down while later blocks run)

8

DURATION:

9

0 = Hold until Touch Break

10

>0 = Hold for specified ms then release

11

When TOUCH sits on a search block TRUE branch, actions can use the found match instead of coordinates

12

IMPORTANT: If duration = 0, don't forget to add Touch Break!

Parameters

Actions

Hold, Swipe Hold, Down, Move, Up. Multiple can be added

Coordinates

x, y start and toX, toY target (for swipe)

Finger / Pointer

0 = 1st finger, 1 = 2nd, 2 = 3rd...

Duration

0 = needs Touch Break, >0 = duration in ms

Coordinate Binding (lightbulb)

Instead of fixed numbers, bind the x/y (and toX/toY) coordinates to a VARIABLE or DIALOG value with {x} from the lightbulb (e.g. {matchX}, {matchY}). Build hold/swipe gestures that start from a position a search found, working wherever the target appears.

In-Match Jitter (Advanced)

When the gesture start is bound to a match position, drops the touch on a random point inside the match box instead of the dead centre. An edge margin (px) keeps it away from the border. Use it to validate different valid start points in repeated touch-interface tests.

Motion and match actionsComing soonv1.0.51

Continuous Swipe and Back-and-Forth Swipe actions (Repeat: Endless/Counted); Hold on the match, Fallback point and Release when the match is lost (ms). Details below

Example Usage

1

Scenario 1: Joystick control (2 sec right)

2

TOUCH → Duration: 2000ms

3

Action: Swipe Hold

4

Start: [300, 800], End: [400, 800]

5

Finger: 0

6

Scenario 2: Indefinite hold (conditional release)

7

TOUCH → Duration: 0, Touch Flow: Continue while holding

8

Action: Hold → [540, 960]

9

IMAGE check (retry mode)

10

When found: Touch Break

11

Scenario 3: Pinch zoom

12

TOUCH → Duration: 1000ms

13

Action 1: Swipe Hold [400,960]→[200,960], finger=0

14

Action 2: Swipe Hold [680,960]→[880,960], finger=1

Combinations / Used With

1

COMBINATIONS:

2

TOUCH + TOUCH_BREAK: Hold indefinitely, release on condition

3

TOUCH + IMAGE: Visual check while holding

4

TOUCH + WAIT: Hold, wait, release

5

GROUP + TOUCH: Repeated touch in loop

Tip

Advanced touch (hold, multi-finger)

Warnings / Cautions

1

WARNING:

2

Duration 0 without Touch Break means finger stays pressed FOREVER

3

Finger / Pointer values: 0 = first finger, 1 = second. Two actions held at the same time on one pointer conflict

4

Coordinates must match screen resolution

Step-by-Step Mastery: Basic → Advanced → Pro

The same block at three levels: a quick start, the real options, and professional techniques.

Basic

TOUCH is for low-level touch beyond CLICK and SWIPE: holding a point, or swiping while holding. The simplest use is adding one "Hold" action and giving a duration in ms (e.g. 2000ms = hold two seconds then release).

Advanced

touchDuration = 0 is special: the finger stays held INDEFINITELY until TOUCH_BREAK; use it to build conditional release. The touchActions list can hold several actions: "hold" (Hold: press and hold a point), "swipe_hold" (Swipe Hold: drag from x/y to toX/toY and keep the end pressed) and "down" / "move" / "up" (Down / Move / Up) to drive a finger step by step. Each action gets its own pointer id (0 = first finger, 1 = second, 2 = third...). SIMULTANEOUS MULTI-FINGER RULE: two actions that stay held at the same time MUST use DISTINCT pointers — reusing one pointer in two concurrent actions conflicts (the second down drops the first). So a valid two-finger hold = a hold on pointer 0 + a hold/swipe_hold on pointer 1. For a joystick a single swipe_hold (centre toward a direction) is ideal. Each action has its own offset/targetOffset (offsetEnabled/targetOffsetEnabled) and waitAfter. {x} from the field's lightbulb ties x/y and toX/toY to variables like {matchX},{matchY}; a legacy action with useMatchCenter on and Start from match off targets the centre of the last image match (_lastMatch) instead of the typed coordinate (falling back to the picked x/y if there is no match).

Pro

touchContinueWhileHolding = true is a powerful but subtle flag: the hold DURATION elapses in the background while later blocks keep running (non-blocking hold). This lets you hold a joystick with TOUCH while simultaneously scanning the screen with IMAGE and releasing on a conditional TOUCH_BREAK — just like real game input. For multi-finger choreography give each action a distinct pointer to build simultaneous pinch/hold; if you need true concurrency at that level, consider MULTI_GESTURE. Safety matters most in indefinite holds: guarantee a TOUCH_BREAK path for every touchDuration=0, otherwise the finger stays stuck when the macro ends and can stretch to the OEM accessibility ceiling.

Real-World Scenarios — Step-by-Step Recipes

Small, reproducible examples that combine several blocks — build them straight into your own macro.

Walk right for 2 seconds with a joystick
  1. 1Add TOUCH, duration 2000ms
  2. 2Action: Swipe + Hold
  3. 3Start [300,800] (joystick centre), target [400,800] (right)
  4. 4Pointer: 0
  5. 5The finger auto-releases after 2 seconds
Hold indefinitely until target appears
  1. 1Add TOUCH, duration 0 (indefinite), action Hold [540,960]
  2. 2Turn on touchContinueWhileHolding so blocks keep running
  3. 3Add IMAGE, scan the target in retry mode
  4. 4Add TOUCH_BREAK on its TRUE branch (release when found)
  5. 5The next steps continue normally
Hold with two fingers at once (valid pointer layout)
  1. 1Add TOUCH, duration 1500ms
  2. 2Action 1: Hold [300,1000], pointer = 0 (left)
  3. 3Action 2: Hold [780,1000], pointer = 1 (right)
  4. 4Make sure the pointers are DIFFERENT (0 and 1) — same id conflicts
  5. 5Both fingers press at once and release together after 1.5s
Hold locked onto a match (useMatchCenter)
  1. 1Search the item to hold with IMAGE/TEXT
  2. 2Add TOUCH on its TRUE branch
  3. 3Turn on the action's match option (match centre instead of typed coordinate)
  4. 4Give a duration (e.g. 1000ms) or 0 + TOUCH_BREAK
  5. 5It holds wherever the item is; only legacy useMatchCenter with Start from match off falls back to the picked x/y
Hold the joystick, swipe back and forth, keep tappingComing soonv1.0.51
  1. 1Add TOUCH; Touch Flow: Continue while holding, duration 0
  2. 2Action 1: Swipe Hold (from the joystick centre toward a direction)
  3. 3+ Add Action → Back-and-Forth Swipe; Repeat: ∞ Endless, Move duration 600 ms
  4. 4Later CLICK blocks keep running; on each tap the held fingers lift for a moment and press again
  5. 5Add Touch Break to release

Which Blocks to Pair With — Pro Combinations

This block is useful on its own — but it shines when paired with the right partners.

+ TOUCH_BREAK

The only way to release an indefinite (duration=0) TOUCH on a condition; every indefinite hold must be paired with a TOUCH_BREAK.

+ IMAGE / TEXT / COLOR

To scan the screen while holding and release at the right moment; with touchContinueWhileHolding it behaves like real game input.

+ WAIT

Hold, WAIT for a set time, then release with TOUCH_BREAK — a fixed-duration hold choreography.

+ MULTI_GESTURE

When you need true simultaneous pinch/rotate, MULTI_GESTURE is cleaner and more robust than hand-rolled pointer choreography.

Common Mistakes and Fixes

Leaving duration=0 without a TOUCH_BREAK keeps the finger pressed FOREVER. Guarantee a TOUCH_BREAK path for every indefinite TOUCH.

Giving two actions the same pointer id conflicts. Use distinct pointers like 0, 1, 2... for simultaneous multi-finger.

With touchContinueWhileHolding off, an indefinite hold blocks later blocks; turn the flag on if you want to scan and release.

Hard-coding coordinates for one device shifts on a different resolution. Lock to a match with {x} binding or useMatchCenter.

Coming soonv1.0.51While background fingers are held, Down, Move and Up actions are refused. Use Hold, Swipe Hold or the motion actions for fingers that run together, or add Touch Break first.

Pro Tips

Coming soonv1.0.51Touch Flow = Continue while holding lets later blocks run. Release when the match is lost (ms; 0 = off, 300–60000) works only with background fingers: while the match stays visible the finger stays down and follows it, and it lifts this long after the match was last seen. Touch Break releases the held gestures.

Coming soonv1.0.51On a search block's TRUE branch each action offers its match option: Hold on the match (Hold), Tap the match (Down), Swipe to the match (Move) or Start from match / End on match (swipe kinds). Start from match needs a current match; otherwise the action is skipped with one warning. The Fallback point is used when there is no match.

Coming soonv1.0.51Bind Move duration and Number of moves with their lightbulbs. Random values are sampled when the motion starts or restarts.

Non-blocking hold (touchContinueWhileHolding) lets scanning and decision blocks continue in the same macro while the joystick remains pressed.

Bind a swipe_hold action's start to {matchX},{matchY} to build a hold gesture that begins from a position a search found.

For safety, always wrap indefinite holds in a GROUP/ERROR_HANDLER and ensure TOUCH_BREAK fires on every exit path.

Golden rule for a valid simultaneous multi-finger sequence: give every action that stays held an INCREASING, UNIQUE pointer (0,1,2...). To release a finger early and add a new one, finish that action's duration first or use a fresh pointer; reusing the same id drops the first finger.

Treat touchDuration=0 (indefinite) + TOUCH_BREAK as a contract; if you give a duration>0 the finger releases on its own and TOUCH_BREAK is not needed. Mixing the two leads to either an early release or a stuck finger.

Coming soonv1.0.51Continuous Swipe goes A→B, lifts and starts again; Back-and-Forth Swipe goes A→B→A without lifting. Both actions always use their own finger, so the Finger / Pointer row is hidden.

Coming soonv1.0.51In a Back-and-Forth Swipe the forward and back times are separate: Speed → Forward and Back (Fast, Normal, Slow or Custom). With a Return distance below 100% the finger swings between the return point and the end after the first move; Advanced adds a wait at either end.

This Block's Code (Editor View)

Lua

The Lua below is what the Code Editor generates for this block with sample settings. Adding cases, branches, actions or loops, or changing settings, extends the generated code accordingly. Study it to see what the block does under the hood, to learn Lua, or to copy and adapt it. Use the Copy button (top-right) to paste it into the Code Editor, or “Try in Editor →” to run it in the live editor.

do
 do
  local _lt3 = "touch:00000000-0000-4000-8000-000000000001:g0"
  local _ls3 = Touch.laneStatus(_lt3)
  if _ls3 == "idle" or _ls3 == "completed" or _ls3 == "stopped" or _ls3 == "failed" then
   local _la3_0 = Point(540, 960)
   Touch.laneAdd(_la3_0, _la3_0, 0, 0, "reverse", "hold")
   local _lok3 = Touch.laneStart(_lt3, true, 0)
   if not _lok3 then
    error("TOUCH laneStart failed (" .. tostring(Touch.laneError()) .. ")")
   end
  end
 end
end

Note: generated code can evolve across versions; helper names (e.g. _reg1, m1) and internal optimizations may change. The logic and the called APIs reflect the block’s behavior.

Block ↔ Lua Mapping →

Shared Controls for This Block Family

The guidance below is not identical for every block. It summarizes the professional controls that most often repeat in the selected block family.

👆Finger Identity

TOUCH and MULTI_GESTURE flows should make it explicit when each finger goes down and when it releases.

🎯Center and Path

Center point, waypoints, and duration determine how the gesture is perceived.

⏳Background Hold

Letting the builder continue while a hold is active is powerful but risky; plan the release step deliberately.

📱Device Variance

The same gesture can feel different across DPI and aspect ratios; explicit gesture recipes are often more durable than replaying raw captures.

Builder vs Lua Boundary

Raw touch pointer lifecycle stays code-first

TOUCH and TOUCH_BREAK cover recipe-style touch flows. Raw pointer choreography such as Touch.down, Touch.move, Touch.up, Touch.dispatch, Touch.reset, Touch.breakAll, and Touch.releaseAfter is not exposed as a first-class builder block.

Touch.downTouch.moveTouch.upTouch.dispatchTouch.resetTouch.breakAllTouch.releaseAfter
Bounded dialog design is builder-backed; freer composition stays code-first

The DIALOG block and dialog designer cover a bounded field set in the builder: Info Text, Text Input, Checkbox, Description, Radio Group, Dropdown, Multi Select, Tab Group, Date Time, Number Range, Slider, Image Picker, Color Picker, File Picker, Recorder Picker, Tag, Signature, and Spacer. The buttons are designed too: the Positive button and Negative button tabs set each button’s text, background, and border color, corner radius, and minimum height next to a preview. Freer Setting.builder composition, multi-step wizard flows, and mixed HUD/dialog choreography still do not map 1:1 into the builder.

Coming soonv1.0.51Two more fields: Agent Detect references (agent_detect_editor) lets the user pick a saved reference set or add and edit references, and Save confirms the selection; Navigation setup editor (navigation_editor) edits a saved map, marker and route from the Dialog and returns the setup and route selection without moving the character.

Setting.builderDialogHudTextViewAgentDetectEditorNavigationEditor
Advanced HTTP request chaining stays code-first

HTTP_GET, HTTP_POST, and HTTP_PUT cover common fixed-method flows; HTTP_REQUEST covers one bounded request with method, header lines, body, content type, query parameters (GET and DELETE), timeout, and a bounded retry. These blocks never throw; they write the status code (-1 on a network failure). Cookie handling, chained request objects, and lower-level client flows still need the code editor.

Request()Request.setCookieRequest.getCookiesCUSTOM_CODE
General programming surfaces stay code-first

The MAP, LIST, JSON_PARSE, REGEX_MATCH, and METRICS blocks cover the everyday cases: map actions, a static list, reading a value from a JSON path, regex match, find, replace, and split, and metrics actions. The rest of the Map, Array, JSON, Regex, and Metrics APIs (for example Array sort, filter, and map) is broader than the builder recipe model and stays on the CUSTOM_CODE and code editor side.

MapArrayJSONRegexMetrics
Low-level runtime and Lua composition stays code-first

Runtime helpers, raw Request objects, Lua built-ins such as print/pcall/xpcall, and free-form object chaining patterns are represented through CUSTOM_CODE or the code editor.

RuntimeRequestprintpcallxpcallCUSTOM_CODE

Debug Mode and Breakpoints

Each block card now exposes an independent breakpoint toggle. When enabled, the breakpoint preference is stored with the block.

Breakpoints are only emitted into runtime code when Debug Mode is enabled from Visual Builder settings. When Debug Mode is off, breakpoints stay saved but do not pause execution.

Use ASSERT for fail-fast validation, and use breakpoints for step-by-step tracing and controlled pauses in the same flow.

Variable Scope

1

Variables defined with SET_VARIABLE are accessible throughout the macro (global scope). All blocks can read/write the same variable.

2

However, a variable defined inside a GROUP will be 'nil' (undefined) until the GROUP executes. Blocks outside the GROUP using this variable may produce unexpected results.

3

FOR_EACH loop variables (item and index) only carry valid values inside the loop body. Outside the loop they are outside local scope and should not be used.

4

TRY_CATCH error variable is only valid within the catch block. If the try block succeeds, the catch branch is not entered and the error variable remains undefined.

5

TIP: Before using a variable inside a GROUP, assign a default value with SET_VARIABLE outside the GROUP. This way the variable won't be nil even if the GROUP has not run.

Inline Expressions

You can embed variable values and calculations into text fields using {{ expression }} syntax. Expressions inside double curly braces are evaluated as Lua code and the result is inserted into the text.

Syntax
{{ expression }}
Examples
Skor: {{ score + 1 }} → "Skor: " .. tostring(score + 1)
{{ name }} kazandı! → tostring(name) .. " kazandı!"
X:{{ x }} Y:{{ y }} → "X:" .. tostring(x) .. " Y:" .. tostring(y)
Supported Blocks
SET_VARIABLELOGCOMPARECLIPBOARD_WRITENOTIFY_TOASTKV_SET
Security Note

Expressions are checked by the sandbox policy. Security-sensitive calls like loadstring, require, debug are automatically blocked.

General Tips

1

Keep scan regions as small as possible — improves speed, reduces false matches.

2

Always add an exit condition when using infinite loops (BREAK, timeout, or conditional exit).

3

Use network operations and error-prone steps inside TRY_CATCH.

4

If you need global error handling, use the Error Handler (ERROR_HANDLER) block as a singleton in the project.

5

Small coordinate offsets (CLICK/SWIPE) improve tap accuracy across different DPI and screen scales.

6

Customize macros with Dialog block — different parameters each run.

7

Define repeating steps once with GROUP_CALL, call from many places.

Cross-macro local library

Local Shared Macro Area

The Local Shared Macro Area moves blocks, variables, dialog fields, gallery assets, and imported media dependencies between macros on the same device. It is device-local, not cloud sync, not Firebase sharing, and not a replacement for public macro sharing.

Professional usage model: put a reusable login flow, common scan region, shared dialog form, variable group, template image, color profile, replay recording, or imported PLAY_SOUND media file into the shared area from one macro, then import it from the relevant + menu in another macro.

VISUAL_BLOCKSVARIABLESDIALOG_FIELDSTEMPLATE_IMAGECOLOR_SWATCHREPLAY_RECORDMEDIA_FILE
1

Send to the shared area

When one item or a multi-selection is active, the shared-area button can copy the selected part from the workspace, group, true/false action branch, dialog, and variables surfaces into the device-local library.

2

Import into another macro

The shared-area entry under the + menu imports the selected item into the surface that opened it. Main workspace, group, action branch, dialog, and variables each receive the compatible item type.

3

Share gallery assets

Gallery items include template images, color swatches, replay records, and imported audio/media files. They can move between macros on the same device so repeated templates, colors, recordings, and PLAY_SOUND media assets do not need to be captured again.

4

Keep it clean

The shared area is not a permanent dumping ground. Delete stale shared items from the shared-library panel; imports create a copy in the target macro and do not rewrite the source macro flow.

Checkpoint: after importing, review block names, linked template/image/color/record/media assets, and variable names in the target macro. The shared area creates a copy; delete stale shared items from the shared-library panel to keep the library clean.

AI assistant

Build a block chain with MH AI in natural language

Tell MH AI what you want in plain language; it proposes the right block sequence and lands it in the workspace after you approve. In the current release it works with cloud providers such as Gemini, Claude, and OpenAI; on-device local models are on the roadmap.

Learn more →