> ## Documentation Index
> Fetch the complete documentation index at: https://luarmor.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Macros

Luarmor uses [Luraph™️](https://luraph.com) as the obfuscation provider, so their macros can also be used with Luarmor - along with Luarmor macros.

<Note>
  For more information on what a `constant function` is and is not, view [this](./optimisation#how-to-use-lph-no-virtualize).
</Note>

<AccordionGroup>
  <Accordion title="LRM_INIT_SCRIPT">
    This macro allows you to run a piece of code before your script is ran. It accepts a **constant** function.

    <Warning>
      You **must** yield *somewhere*, even if it's just a `task.wait()` at the end. Otherwise, `script_key` will read as `nil`.
    </Warning>

    <Accordion title="Good usage">
      ```lua theme={null}
      LRM_INIT_SCRIPT(function()
          print("Hello, world!")
          -- this wait is very important!!!
          task.wait()
      end)
      ```

      ```lua theme={null}
      LRM_INIT_SCRIPT(function()
          -- some code

          -- wait for the user to put the key in or something
          while HasUserCompleted == false do
              -- but this wait is needed!! 
              task.wait()
          end
      end)
      ```
    </Accordion>

    <Accordion title="Bad usage">
      ```lua theme={null}
      LRM_INIT_SCRIPT(print("Hello, world!"))
      ```

      ```lua theme={null}
      LRM_INIT_SCRIPT("print('Hello, world!')")
      ```

      ```lua theme={null}
      local function init()
          print("Hello, world!")
          task.wait()
      end
      LRM_INIT_SCRIPT(init)
      ```
    </Accordion>
  </Accordion>
</AccordionGroup>
