| # Cantrip Help

- General Information
  - Cantrip "Worlds"
  - The Cantrip Connection Window
  - Getting Started/Setting up a World
  - Logging
  - Regular Expressions
  - Latest Features
- Menu Reference
- The Toolbar
- The Settings Dialog

## General Information on Cantrip

Cantrip is a client for connecting to MUDs, MUCKs, MUSHes, MUXes, and the like (abbreviated here as MU*). If you're unfamiliar with MUDs, a couple of spots to look for general information are the MUD Connector and the MacOS MUD Zone.

### Cantrip "Worlds"

Cantrip is built around connection documents, called Worlds. Each World combines the Connection information for talking to a particular MU*, along with settings for the text appearance (colors and font) in the main Cantrip window, and other General preferences. A world can also contain lists of Triggers and Macros.

Worlds can be saved from the File menu. Worlds placed inside the Worlds folder in the same folder as the Cantrip application are listed in the Cantrip menu and can be opened from there.

Return to Top

### The Cantrip Connection Window

Cantrip connection windows are split into three basic parts:

- The Toolbar: This holds various one-button shortcuts for Cantrip. You can show or hide it with the standard toolbar widget in the window's title bar, and customize it by control-clicking anywhere in the toolbar area.

- The Display Console: This is where the text from your MU* sessions appears; the Font and color settings in the Appearance pane of the Settings dialog apply to this area. The Display Console has a scrollback buffer, set to 1000 lines by default. (You can change this setting in the Fonts/Sizes tab of the Appearance pane. [Editor's note: I'd recommend moving this to the General pane, as it's really not related to the text appearance.])

- The Input Area: This is the area where you type commands and text to be passed along to the MU* when you hit `Return`. If you have the Clear input after send checkbox checked in the General pane of the Settings dialog, this area will be cleared every time you hit `Return`; otherwise, the text you last sent will remain in the Input area. You can enlarge the Input area by dragging on the bar seperating it from the Display Console. Typing any key will switch the cursor to the Input area.

At the top of the right-hand scroll bar for the Display Console is a small 'split' box. Clicking this box will split the Display Console into two segments. This lets you review your scrollback buffer in the top half while current activity still displays in the bottom half.

Return to Top

### Getting Started/Setting up a World

Basic set-up for a World is pretty easy:

- Select New > New World from the File menu.
- Click on the Settings button in the toolbar.
- Click on the Connection pane.
- Enter the Address (such as `muck.netro.com.au`) and Port Number (this can vary from server to server; the default one is `23`) for the MU* you're connecting to. If you want Cantrip to connect you automatically when you open this World, check the Connect on open checkbox.
- Click OK.

This basic set-up should work well with most MU*'s. A couple of default settings that you might need to change (located under the General pane of the Settings dialog):

- Local Echo: This setting (checked by default) Echos a copy of the text you just sent to the Display Console. If the MU* you're using already sends back a copy of what you've typed, this setting will result in two copies of your typing showing up in the Display Console. However, the Local Echo can be helpful if you're experiencing severe lag, as at least you'll know your text has been sent to the MU* server...

- Return style: By default, Cantrip sends both a CR (Carriage Return character) and an LF (Line Feed character), in that order, at the end of every line of text it sends. However, this may cause some MU* servers to choke. (The main symptom is if you type a command and hit `Return`, and the MU* doesn't recognize your typing; a good way to check this is to turn Local Echo on, so you can see when you send something.) The Return pop-up menu lets you have Cantrip send just a CR, LF, or LFCR instead; if the default setting doesn't work, try one of these instead.

You're now ready to go! Click on the Connect button in the Toolbar, and you're off and running.

Return to Top

### Logging

If you want to capture a record of your online session, Cantrip has a built-in logging feature. Cantrip captures a straight copy of the text that appears in the Display Console and saves it to a plain vanilla text file.

To make a session log:

- Select Begin Logging from the World menu.
- Cantrip brings up a Save dialog, allowing you to name and save the logfile.
- When you're finished, go back to the World menu and choose Stop Logging.

Return to Top

### Regular Expressions

Regular expressions is a fancy way of saying "wildcard matching." In other words, instead of trying to match a literal string of text, you can enter a pattern - a "regular expression" - that can match several variants of a basic sequence of text. If you have heard of grep or grep searching or grep syntax, you're talking about the same basic thing - `grep` is a Unix command-line utility that performs searches using regular expressions.

Cantrip uses the regular expression library built into OS X. A full tour of regular expressions is way beyond the scope of this documentation (and when writing this, I was not able to find a reference of what OS X's library actually supports, even on Apple's Developer website), but I try to give some basic regular expression hints.

Return to Top

### Latest Features

The latest cool feature added to Cantrip (as of a14) is the ability to embed scripts in your Triggers, Macros, and Aliases. Currently, the only supported scripting languages are Perl and Applescript, but in the future this may be extended (through plugins) to include others such as Python or Basic.

The method for embeding scripting languages in your Trigger/Alias/Macro scripts is as follows:

    	@@scriptName
    	commands
    	@@end

This can be added anywhere in your script, and more than one can exist. For example, I've written a macro that will set the message bar to "Hello World!" and sends "say Hello World!" to the server:

    	say Hello World!
    	@@perl
    	WorldWindow::setMsgBar("Hello World!");
    	@@end

For a more extensive discussion on scripting, check the Cantrip Discussion Board.

Return to Top