# Core Panels

Merlin’s main window is made of panels you can arrange to suit how you play.

This guide covers the panels and features common to every game. Panels added by a game’s module are described in that game’s guide in the **Help** menu.

## Arrange panels

### Open or close a panel

- To open a panel, choose it from the **Panels** menu. The panel opens floating in the middle of the window, and a checkmark appears next to its name. The **Auto-Mapper** panel is in the **Maps** menu.
- To close a panel, choose it again from the **Panels** menu, or hover over its tab and click the ×.

### Move a panel

Drag the panel’s tab. Drop it on another group of tabs to join that group, or at an edge of the window to give it its own space.

### Resize panels

Drag the line between two panels.

**Tip:** To give several panels the same custom size, hold Option (Alt on Windows) while you drag. Each panel shows its size in pixels: its width when you drag between columns and its height when you drag between rows.

### Float or dock a group of panels

Use the button at the right end of the group’s tab bar:

- To float a docked group, click **Pop out**.
- To dock a floating group, click **Dock back into the layout**.

To move a floating group, drag the bar above its tabs.

### Jump to the command line

Press Enter anywhere in the window.

## Save and switch layouts

A layout records which panels are open, where they are, and how big they are.

### Save your changes

Merlin keeps your changes as you go, but they don’t become part of the layout until you save them. If you quit Merlin with a panel floating, it’s still floating the next time you open Merlin.

A layout with unsaved changes shows a small dot after its name.

These commands are in the **Layout** menu, below **Manage Layouts**:

| Command | What it does |
|---|---|
| **Save layout changes** | Makes your changes part of the layout. |
| **Discard layout changes** | Restores the layout as you last saved it. Merlin asks you first. |
| **Save layout as…** | Saves what’s on screen as a new layout without changing the layout you started from. |

### Switch layouts

The **Layout** menu lists every layout for the game, with a checkmark next to the one showing. Choose another layout to switch to it. Merlin keeps your changes to the layout you leave.

### Manage layouts

Choose **Layout** > **Manage Layouts** to open the Layouts page in Settings. Click a layout to show it.

Each layout has three buttons:

- **Rename:** Gives the layout a new name.
- **Duplicate:** Copies the layout’s saved version under a new name and shows the copy. To copy what’s currently on screen instead, choose **Save layout as…** from the Layout menu.
- **Delete:** Removes the layout after asking you first. If you delete the layout you’re using, Merlin shows the next one in the list. You can’t delete the last layout.

To open the folder with the layout file selected, click **Show Layout Files**.

### Give each character a layout

Go to Settings > Profiles to give a character its own layout. Merlin shows that layout when the character enters the world.

If you choose another layout from the Layout menu, it remains until the character next logs in.

A character set to **Last used**, like a character without its own layout, keeps whichever layout was showing last.

### Share layouts

Each layout is a file named for the layout in the game’s `Layouts` folder. Share that file with another Merlin user; they can put it in their own Layouts folder, and it appears in the Layout menu.

The Layouts folder is inside the game folder in your Merlin folder:

| Platform | Location |
|---|---|
| macOS | `~/Library/Merlin` |
| Windows | `%APPDATA%\Merlin Files` |
| Linux | `~/Documents/Merlin` |

## Change themes

Merlin has two kinds of themes:

- **Panel theme:** Sets the colors and fonts of Merlin’s interface, along with its flourishes and animations.
- **Chat theme:** Sets the font, weight, and colors of game text. The game uses a set of 16 colors; the chat theme controls how each one appears on your screen.

A matching panel theme and chat theme make a complete look.

### Choose a theme

The **Themes** menu lists the built-in looks in groups. A panel theme and chat theme you create with the same name appear together under **My Themes**.

Hover over a look to preview it across the window. Click it to keep it. Move the pointer away to return to your current themes.

The Themes menu also has **Panel Theme** and **Chat Theme**, which open those pages in Settings.

### Make your own theme

1. Go to Settings > Panel Theme or Settings > Chat Theme.
2. Click the **New theme** button (+) next to the picker, enter a name, then click **Create**.

Merlin saves theme changes as you make them.

- **Rename or delete:** Click the **Rename theme** button (the pencil) or **Delete theme** button (the trash can) next to the picker.
- **Restore:** A built-in theme you’ve changed shows a **Theme defaults** button. Click it to restore the original settings.

The Panel Theme page has controls for the main color, background, and text, along with options such as a fill gradient behind panels and a glow behind your portrait.

The Chat Theme page has one color picker for each color slot, divided between the slots the game uses and those it doesn’t.

### Where themes apply

Merlin remembers the last theme you used and starts with it the next time you open the app. To start each character with its own theme, go to Settings > Profiles.

### Share themes

Each theme you create is a file in the `Themes` folder at the top level of your Merlin folder. The filename includes the theme name and kind, such as `Night Watch-Panel.json` or `Night Watch-Chat.json`. Built-in themes don’t have files.

Share that file with another Merlin user; they can put it in their own Themes folder, and it appears in the theme picker.

To open the folder with a theme file selected, click **Show Theme Files** next to the New theme button.

The Themes folder is at the top level of your Merlin folder:

| Platform | Location |
|---|---|
| macOS | `~/Library/Merlin` |
| Windows | `%APPDATA%\Merlin Files` |
| Linux | `~/Documents/Merlin` |

### Theme sets

Give a panel theme and chat theme the same name to make them a theme set. The set appears in the **Themes** menu, where you can switch both themes at once.

### Accessibility settings

Settings > Accessibility has settings that work with any theme:

- Font scale for larger text
- **Invert Colors**, which flips every color for dark text on a light background. The Scriptorium theme works especially well with it.
- An animation switch
- Color vision settings for red, green, or blue color blindness

## The Game panel and the command line

The **Game** panel shows everything the game sends, in the order it arrives. Highlights appear here, but gags and substitutes don’t.

To see text with gags removed and substitutes applied, open **Game (Filtered)**.

### Change the text size

Hover over the top-right corner of the panel, then click the **Text size** button (three dots). Choose Large, Medium, or Small.

The Game and Game (Filtered) panels remember their text sizes separately.

### Scrollback and scrolling

In Settings > General, **Scrollback** sets how many lines the panel keeps, from 500 to 20,000. **Smooth scrolling** is there too.

The panel normally follows the newest line. When you scroll up, it stops following and a **Scroll to latest** button appears. Click it to catch up.

### Use the command line

The command line is at the bottom of the window. Press Enter to send what you type. What you send appears in the Game panel with `>` in front, so you can find your commands among the game’s replies.

- Up Arrow and Down Arrow step through the last 100 things you sent. If Up Arrow is assigned to a macro, hold Shift while you press it.
- Esc clears the command line.
- Pressing Enter with the command line empty sends a blank line. Some game prompts need one.
- To keep what you sent in the command line, turn on **Sticky last command** in Settings > General. Press Enter to send it again, or start typing to replace it. To send a blank line instead, press Shift+Enter.

When the game asks for a password, the command line hides what you type. Passwords are never kept in command history or the log.

## Inventory

The **Inventory** panel has two tables: what you’re wearing and what you’re carrying.

- To wear an item or take it off, drag it from one table to the other.
- To put an item in a container, drag it onto the container. To take it out, drag it out.
- For more actions, such as dropping or selling an item, right-click it.

These actions send normal game commands, and the game’s replies appear in the Game panel. The commands Merlin sends and the information shown in the tables depend on the game; see the game’s own guide.

## Vitals and hands bars

The **vitals bar** runs along the bottom of the window. It shows health, fatigue, and how much you’re carrying, with bars that move as the values change.

Some games add a **hands bar** above it, showing what you’re holding and how long until you can act again. See the game’s own guide for what each bar shows.

## Notepad

The **Notepad** panel is a plain page for notes. It saves as you type.

Each game has its own notepad, stored as `Notepad.txt` in the game’s folder. You can also open the file in a text editor.

Your Merlin folder is here:

| Platform | Location |
|---|---|
| macOS | `~/Library/Merlin` |
| Windows | `%APPDATA%\Merlin Files` |
| Linux | `~/Documents/Merlin` |

## Scripts and Script Output

The **Scripts** panel lists your scripts. It shows the same list as Settings > Scripts.

### Create a script

1. Click the **New script** button (+).
2. Enter a one-word name and the script’s lines.
3. Click **Save**.

A new script is kept only when you click Save. If you close the editor first, nothing is saved.

### Edit a script

Click a script to open its editor. You can have several editors open at once. If its editor is already open, clicking the script brings it to the front.

If you leave the Scripts page or close Settings with unsaved changes, Merlin asks first. Click **Stay** to keep editing or **Leave** to close the editors without saving.

### Script names

- **Each name must be unique.** Capitalization doesn’t count, so `heal` and `Heal` are the same name.
- **Duplicate names are marked.** If another script already has the name you enter, the field turns red and you can’t save until you change it. Point to the field to see why.
- **Some characters aren’t allowed.** Names containing `\ / : * ? " < >` or `|` are marked the same way.

### Run and stop scripts

Each script has a **Run** button. While it runs, the button changes to **Stop** and **Pause**.

The **Scripts** menu also lists your scripts. Choose one there to run it.

The menu also has:

- **Pause All Scripts**
- **Abort All Scripts:** Stops everything that’s running at once, including lines being run by a trigger or timer.
- **Resume All Scripts**

### Organize scripts into groups

In a script’s editor, enter a name in **Assign to group**, such as `Combat`. The script appears under that group heading.

- To expand or collapse a group, click the arrow next to its heading.
- To rename a group, click the pencil on its heading.

Ungrouped scripts appear below the group headings. Merlin remembers which groups you collapse for each game.

### Script Output panel

The **Script Output** panel shows what your scripts say, with the time and script name. Every `echo` from a script appears here and in the Game panel.

At the top, each running script shows what it’s doing:

```
▶ Hunt    Fight 107  waiting for You hit   12 s
⏸ Train   Rest 41    paused
```

The word is the script section, the number is its line, and the time shows how long it has been there. A script appears here after it has run for one second.

Scripts can move through steps too quickly to be useful to watch. The top updates only after a script has been doing something new for a full second, so quick steps in between aren’t shown.

If the time is still counting, the script is still on that step. If the time has stopped, the script has moved on to something quick. Pause and Resume appear immediately.

### Script Output menu

Hover over the top-right corner of the panel, then click the three dots.

The menu has:

- **Show every step:** On by default.
- **Text size:** Large, Medium, or Small.
- **Clear all output**

With Show every step on, the panel also lists each line that did something: a command sent, a wait that ended, a section the script entered, or a variable that changed.

A loop shows its first pass, then one line that counts the rest. These steps are kept only in the Script Output panel and disappear when you quit Merlin.

### When a script stops with an error

The panel marks the script ✕ **stopped** and shows the last few lines it ran and the sections it passed through.

Click **Show the full trace** to see all 20 lines. Click **Hide the full trace** to close them again.

To learn how to write scripts, see the [Scripting Manual](MANUAL-SCRIPTING.md).

## Logs

Merlin keeps session logs in the game’s `Logs` folder inside your Merlin folder:

| Platform | Location |
|---|---|
| macOS | `~/Library/Merlin` |
| Windows | `%APPDATA%\Merlin Files` |
| Linux | `~/Documents/Merlin` |

The log settings are in Settings > General:

- **Log all gameplay:** On by default.
- **Capture raw logs:** Keeps a second file containing everything the game sent, with nothing removed.

See [Gags and Substitutes](MANUAL-GAGS-AND-SUBSTITUTES.md) for how the two logs differ.

## Settings

Choose **Settings** from the menu bar to open Settings. Its pages are:

**General**, **Profiles**, **Accessibility**, **Panel Theme**, **Chat Theme**, **Layouts**, **Sounds**, **Macros**, **Triggers**, **Timers**, **Scripts**, **Variables**, **Aliases**, **Gags**, **Substitutes**, and **Highlights**.

A page with its own manual shows a small mark next to its name. Click the mark to open the manual.

Triggers, Timers, Scripts, Aliases, Gags, Substitutes, and Highlights can organize their lists under group headings. Each guide explains how. Merlin remembers which groups you collapse for each game.

## Updates

Merlin checks for a new version each time it opens. To check now, choose **Check for Updates…** from the Help menu.

When a new version is ready, an **Update available…** button appears. Click it to choose what to do. Nothing downloads until you choose to.

## The map

See the [Mapper Manual](MANUAL-MAPPER.md).
