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.
No-Code Workspace — Block Reference
Plays a recording only while a visual anchor is on screen
Documented for app version 1.0.50Updated:
Block Preview
Captured from the in-app Visual Builder block card in the English UI.

Plays a recorded gesture sequence when the visual anchor you chose is on screen. The anchor is searched again before every repetition, and repetitions stop as soon as it disappears. Scan settings work as in the Image block.
Play a recording only in the right screen state
Keep playing while a button is visible and stop when it disappears
Choose the scan region and the anchor image; keep Match Confidence and search time tight
In the "MH Smart Replay - Replay" section pick the Replay Name; repeat, delay, radius and speed work as in Replay
The TRUE and FALSE branches follow the anchor search; without an anchor the recording does not play
Anchor image, scan region, Match Confidence and search time
Repeat 1–999, delay 0–60,000 ms, Random Radius 0–200 px, speed 0.25x–4x
| Parameter | Description |
|---|---|
| Anchor and scan | Anchor image, scan region, Match Confidence and search time |
| Replay Name and playback | Repeat 1–999, delay 0–60,000 ms, Random Radius 0–200 px, speed 0.25x–4x |
MH Smart Replay also refuses playback while a background swipe holds fingers; release them with Touch Break (TOUCH_BREAK) before the block.
Each anchor image can get a Condition from its lightbulb (same rules as IMAGE); an image whose condition is not met is not searched.
Anchor: claim_button with a tight region; Replay Name claimTap, Repeat 50, delay 500 ms
The button is searched before every repetition; when it is gone the repetitions end
SMART_REPLAY + LOG: record when the anchor was missing
SMART_REPLAY + PANEL_CONTROL: move the panel aside before playback
Plays a recording only while a visual anchor is on screen
An empty Replay Name, or a missing anchor image or scan region, is a validation error and the macro does not start
A wrong or outdated anchor can make the recording play on the wrong screen
The same block at three levels: a quick start, the real options, and professional techniques.
Instead of playing a recording directly, SMART_REPLAY first searches the screen for a visual anchor (a reference image). If the anchor is found, replay starts; if not, the flow stops safely and logs once. This way the recording only runs when the screen is in the right state, removing the risk of blindly tapping on the wrong screen.
For the anchor you define a template image and a scan Region; you cut down false positives by constraining the match score (mScore, e.g. 0.8) together with the region. When you give a repeat count, the anchor is re-checked on EVERY repetition: the moment the anchor disappears the loop breaks, so no wasted playback once the screen changes. The randomRadius and speedMultiplier settings behave just like in REPLAY. In practice SMART_REPLAY = an IMAGE search + REPLAY merged into one block, plus automatic re-validation each pass.
This is the key to cross-device robustness: a recorded route is resolution-bound, but because the anchor is a visual landmark it gates playback against screen/DPI differences. Pick an anchor from a stable, rarely-changing UI element (like a header icon), not from a large/variable region such as the whole scene. Constrain the scan region as tightly as possible: you gain speed and avoid mis-locking onto another similar-looking element. Design the no-anchor branch as a quiet fallback: LOG + safe exit or branching to an alternate group instead of throwing. This turns your macro from a brittle coordinate player into a state-aware automation.
Small, reproducible examples that combine several blocks — build them straight into your own macro.
This block is useful on its own — but it shines when paired with the right partners.
SMART_REPLAY gives anchor-gated playback; pair it with plain REPLAY where unconditional playback is needed.
Reuse the same template in a separate IMAGE check to add validation before/after the anchor.
To route the no-anchor branch into an explicit decision and steer to an alternate flow.
An outer loop lets you wait for the anchor to reappear and retry.
Picking the anchor from a large/variable region such as the whole screen: slower and more false positives. Choose a small, stable element and a tight region.
Leaving the no-anchor branch empty and assuming all is well: if the anchor is not found, replay is silently skipped. Handle that branch deliberately with LOG or an alternate flow.
Keeping mScore too low (e.g. 0.5): it locks onto another similar-looking element and plays on the wrong screen. 0.8-0.9 is usually a balanced range.
Because the anchor is re-checked on every repetition, a high repeat count is safe: the loop breaks itself the moment the screen changes, so there is no infinite-playback risk.
If your anchor element changes color between dark/light theme, pick a theme-robust icon or outline; otherwise the match drops when the theme switches.
If you will ship the same recording across many devices, make SMART_REPLAY your default choice: gating coordinate playback on visual state is the most robust approach against device diversity.
Coming soonv1.0.51Each anchor image can get a Condition from its lightbulb (same rules as IMAGE): an image whose condition is not met is not searched, and the condition is checked again on every repetition. If no image stays active, the anchor counts as not found and the recording does not play.
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.
local _smartMax1 = math.max(1, math.min(999, 1))
local _smartIter1 = 0
local _smartReplayRandomRadiusRef = math.max(0, math.min(200, 0))
local _smartReplayRandomRadius = math.max(0, math.min(200, math.floor((function() local _refLen = tonumber(_smartReplayRandomRadiusRef) or 0; if _refLen ~= _refLen or _refLen == math.huge or _refLen == -math.huge then _refLen = 0 end; _refLen = math.max(0, _refLen); if _refLen == 0 then return 0 end; local _origin = Point(2, 2); local _unitX = Point(3, 2); local _unitY = Point(2, 3); local function _unresolved(_point) return type(_point) == "table" and _point.__mh_point_unresolved == true end; if _origin == nil or _unitX == nil or _unitY == nil or _unresolved(_origin) or _unresolved(_unitX) or _unresolved(_unitY) then error("Reference length mapping failed") end; local _scaleX = math.abs(_unitX:getX() - _origin:getX()); local _scaleY = math.abs(_unitY:getY() - _origin:getY()); return _refLen * math.max(_scaleX, _scaleY) end)() + 0.5)))
while _smartIter1 < _smartMax1 do
Snap.screenRefresh()
local _reg3 = Region(0, 0, 100, 100)
local m2 = (function()
local _scanOk, _scanValue = pcall(function() return _reg3:find(Asset.image("btn_play"):mScore(0.8), {engine="balanced_image"}) end)
if not _scanOk then
_lastMatch = nil
error(_scanValue, 0)
end
return _scanValue
end)()
_lastMatch = m2
if _lastMatch == nil then
if _smartIter1 == 0 then System.log("SMART_REPLAY anchor not found: SMART_REPLAY") end
break
end
local _srp1 = { repeatCount = 1, waitNextMs = 0, randomRadius = _smartReplayRandomRadius, speedMultiplier = math.max(0.25, math.min(4.0, 1.0)) }
local _smart_replay_ok4 = Replay.play("route_1", _srp1)
if not _smart_replay_ok4 then
error("SMART_REPLAY action returned false: SMART_REPLAY")
end
_smartIter1 = _smartIter1 + 1
if _smartIter1 < _smartMax1 then wait(math.max(0, math.min(60000, 0))) end
endNote: 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.
The guidance below is not identical for every block. It summarizes the professional controls that most often repeat in the selected block family.
Choose clearly between a fixed coordinate, "act on match" (the position the previous search found), or an {x}-bound variable/dialog value to define where the action executes. Binding {matchX},{matchY} does not break across devices or resolutions.
Hold time, repeat count, and inter-action delay shape how aggressive or natural the action feels.
Random offsets or waypoints help validate fixed-coordinate tests across different screen layouts. "In-Match Jitter" randomizes the tap inside the match box and uses the configured margin to stay away from target boundaries. Keep repeated UI tests bounded and record a visible result.
Before-waits let UI settle before the action; after-waits let the next block see the updated screen state.
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.releaseAfterThe 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.builderDialogHudTextViewAgentDetectEditorNavigationEditorHTTP_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_CODEThe 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.
MapArrayJSONRegexMetricsRuntime 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_CODEEach 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.
Variables defined with SET_VARIABLE are accessible throughout the macro (global scope). All blocks can read/write the same variable.
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.
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.
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.
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.
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.
{{ expression }}Skor: {{ score + 1 }} → "Skor: " .. tostring(score + 1){{ name }} kazandı! → tostring(name) .. " kazandı!"X:{{ x }} Y:{{ y }} → "X:" .. tostring(x) .. " Y:" .. tostring(y)Expressions are checked by the sandbox policy. Security-sensitive calls like loadstring, require, debug are automatically blocked.
Keep scan regions as small as possible — improves speed, reduces false matches.
Always add an exit condition when using infinite loops (BREAK, timeout, or conditional exit).
Use network operations and error-prone steps inside TRY_CATCH.
If you need global error handling, use the Error Handler (ERROR_HANDLER) block as a singleton in the project.
Small coordinate offsets (CLICK/SWIPE) improve tap accuracy across different DPI and screen scales.
Customize macros with Dialog block — different parameters each run.
Define repeating steps once with GROUP_CALL, call from many places.
Cross-macro local library
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_FILEWhen 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.
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.
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.
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.
AI assistant
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.