MauBotLUA DOCS
MauBot home
MAUBOT LUA

Start with a small macro.

Create your first macro, understand the essentials, then find the functions you need.

01

Create a Lua file

Create or open a Lua file in your macro configuration and paste the example below.

02

Save and reload

Save the file, reload your macros and find My first macro in the macro list.

03

Enable and check the log

Enable the macro. It writes a message to the macro info log every five seconds. Turn it off when finished.

Your first macro

LUA
macro(5000, "My first macro", function()
  info("MauBot macro is running.")
end)

5000 is the interval in milliseconds. The function contains the code that runs each time.

A few essentials

macro(...)
Runs your code repeatedly at the chosen interval.
storage
Keeps settings for the current character and configuration.
delay(...)
Pauses the current macro, hotkey or event callback.
nil
Means no value was returned. Check for it before using an optional result.

If a macro fails, read its error message and check the function signature, argument order and return value in the reference.