# Macros #

A Macro is a user-defined command which sends text and/or runs [/commands](SlashCommands) to a world. They are defined in the Macro Window, which can be opened from the [Options...](OptionsMenu) menu, either for the current world or globally.

Macros are executed using the `/runmacro` [/command](SlashCommands). They can be used anywhere that /commands are parsed (for instance, from an [Auto-Send](ConfigureWorldsAutoSends)).

Below is an example of a `logroll` macro, which automatically starts logging to a file named `log_<world>-<year>-<month>-<day>.txt`, and changes to a new logfile at midnight.

  * **Name**: `logroll`
  * **Commands:**
```
    /log -stop
    /log -append 1 -leave 1 -buffer _none -- C:/Logs/log_[/get _w]-[/time %Y-%m-%d].txt
    /at tomorrow 00:00:01=/run logroll
```