Running & Debugging

← Back to all categories
My script hit an error. How do I view the error message?All

MacroAI's log panel shows all information generated during a run:

  • Windows version: the log area at the bottom of the main window. Errors are shown in red.
  • Android version: tap the πŸ“‹ button on the run bubble to open the log page.

Common errors and what they mean:

  • "Image xxx.png not found" β†’ the template image isn't within the search range, or the threshold is too high
  • "Execution timed out" β†’ wait-for-image / wait-for-change exceeded the configured timeout
  • "Lua syntax error" β†’ there's a code error in a custom code node
  • "Variable xxx is undefined" β†’ you used a variable that isn't defined in the Variables tab

If the log isn't detailed enough, switch the log level to "Debug" to see more internal information.

What's the difference between the "Concise / Trace / Debug" log levels?All

The log level on the toolbar controls how much information is shown:

  • Concise (default) β€” shows only the content of "Log Output" nodes and error messages. The cleanest option, suited for normal runs.
  • Trace β€” additionally shows each node's execution progress (e.g. "[Find Image] found xxx at position=(500,300)"). Suited for troubleshooting "which step is the script on" or "did a certain node run".
  • Debug β€” additionally shows engine internals (screenshot dimensions, scaling ratios, match scores, etc.). Suited for diagnosing deep technical issues.

Recommendation: use "Concise" for normal runs; switch to "Trace" when troubleshooting; use "Debug" and capture a log screenshot when reporting bugs to the developers.

What do the buttons on the floating panel (bubble) do while running?All

After the script starts, a floating control panel appears in the top-right of the screen (on Android it's a floating bubble):

  • Status label (β–Ά Running / ⏸ Paused / ⏹ Finished / ⚠ Error) β€” shows the current state
  • ⏸ Pause / β–Ά Resume β€” pauses or resumes script execution
  • β–  Stop β€” fully terminates the script
  • Custom action buttons (if defined) β€” trigger extra operations with one tap (e.g. "Emergency Stop", "Switch Target")
  • βœ• Close β€” closes the panel and stops all running tasks

Windows version: the panel can be dragged around. When the script finishes and there are no custom actions, the panel disappears automatically after 3 seconds.

Android version: the bubble can be dragged; tap it to expand the menu. It auto-expands for 3 seconds when it first appears.

What are "background running" and "foreground running"? What's the difference?Windows

This is a concept specific to the Windows version, controlling how mouse and keyboard actions are simulated:

  • πŸ”„ Background running (default) β€” sends clicks/keystrokes via the Windows message mechanism, without moving the real mouse or stealing focus. You can keep using your computer for other things while the script runs.
  • Foreground running β€” directly controls the physical mouse/keyboard. The mouse actually moves while running, and you can't operate the computer at the same time. But it has better compatibility.

How to choose?

  • In most cases, background (the default) is fine
  • If in background mode the target program "doesn't receive" the clicks (some games, remote desktop) β†’ switch to foreground
  • While running in foreground, don't touch the mouse or keyboard, or you'll interfere with the script

Switch it via the "πŸ”„ Background" button on the toolbar.

Why can't I use my mouse/keyboard while the script is running?Windows

If you're currently in foreground running mode, the script directly controls the physical mouse and keyboard, so you can't operate them at the same time.

Solution: switch to background running mode (click the "πŸ”„ Background" button on the toolbar). Then the script sends actions via the message mechanism and won't occupy your mouse and keyboard.

Note: some programs (such as certain games and remote desktop software) don't support background messages and require foreground mode. In that case, you'll have to wait for the script to finish before operating, or use another computer/phone to control things.

What is "Click Visualization" (the red dots)? What's it for?Windows

Click Visualization is a debugging aid in the Windows version. When enabled, every time the script performs a mouse click, a red dot is shown at the click position (disappearing after 0.5 seconds).

Uses:

  • Confirm whether the script is clicking the right position
  • Troubleshoot "found the image but clicked the wrong spot" issues
  • In background mode you can't see the mouse move β€” the red dot shows you "where it clicked"

Toggle it with the "πŸ”΄" button on the toolbar. We recommend turning it off during normal runs (to avoid visual distraction) and turning it on while debugging.

How do I pause/resume/stop a running script?All
  • Pause: click the "⏸ Pause" button on the floating panel. The script pauses after the current node finishes.
  • Resume: click "β–Ά Resume" to continue execution.
  • Stop: click "β–  Stop" or press Shift+F5. Fully terminates and cannot be resumed.

Notes:

  • If a "Wait" node is timing when you pause, it resumes from where it paused
  • Stopping is irreversible β€” you'll need to click "β–Ά Run" again to run it once more
  • Android version: expand the bubble menu to operate
What are custom actions? How do I trigger extra operations while running?All

Custom actions are "shortcut buttons" bound to the floating panel. They let you independently trigger a sequence of operations while the main script is running.

Typical scenarios:

  • The main script is auto-farming, and you want to press a button at any time to "return to town" β†’ create a "Return to Town" custom action
  • The main script is looping, and you need to temporarily "pause and take a screenshot"
  • You have several helper operations that need to be triggered manually at any time (e.g. switching targets, using a special skill)

How to set up:

  1. Create an action in the "Custom Actions" tab (Ctrl+6)
  2. Build the action's node flow (edited the same way as the main flow)
  3. After running the script, the corresponding button appears on the floating panel
  4. Tap the button at any time to trigger the action, without affecting the main script