Mmucl is maintained by Mark Patton, mpatton@jhu.edu.
The current development version of Mmucl, with which this manual was distributed, is 1.1.1.
You can find the latest news at the Mmucl homepage, http://idt.net/~tmtr01/mmucl/
Mmucl is "free"; this means that everyone is free to use it and free to redistribute it on a free basis. Mmucl is not in the public domain; it is copyrighted and there are restrictions on its distribution, but these restrictions are designed to permit everything that a good cooperating citizen would want to do. What is not allowed is to try to prevent others from further sharing any version of Mmucl that they might get from you.
Specifically, I want to make sure that you have the right to give away copies of Mmucl, that you receive source code or else can get it if you want it, that you can change Mmucl or use pieces of it in new free programs, and that you know you can do these things.
To make sure that everyone has such rights, we have to forbid you to deprive anyone else of these rights. For example, if you distribute copies of Mmucl, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights.
Also, for my own protection, I must make certain that everyone finds out that there is no warranty for Mmucl. If Mmucl is modified by someone else and passed on, I want their recipients to know that what they have is not what I distributed, so that any problems introduced by others will no reflect on my reputation.
The precise conditions of the licenses for Mmucl are found in the General Public License that accompanies it.
Mmucl is a MUD (Multi-User Dungeon) client. A MUD is a multi-player role-playing game that runs as a server on a remote host. The server accepts connections, receives input from users, decides what to do, and sends information back.
Most muds are text based. You can connect to and play on them with a simple telnet client, but that tends to be painful. Mud clients make mudding much more pleasant. They let you do all sorts of useful things such as automatically responding to certain patterns of mud output and making shortcuts for often used MUD commands.
Mmucl provides the features found in most mud clients such as support for ANSI color, triggers, command line editing, aliases, and macros to name a few. Mmucl's most powerful feature is its extensibility through Tcl scripts. See section Scripts, for more info.
Platforms:
Resource files:
The shell script mmucl
starts Mmucl.
Usage: `mmucl [interface] [option]'
Interfaces:
The default, if interface isn't given, is `tk'.
Options:
Use start_mmucl.tcl
to start Mmucl.
If `~/.mmucl/mmucl.rc' exists, it is sourced on startup.
It should be used to define generic procedures and aliases. For some ideas, look at the example `mmucl.rc' distributed with Mmucl. Scripts specific to a character should be stored in that character's init file. See section char.
If `~/.mmucl/Tk.conf' exists, it is loaded on startup. Mmucl loads its `Tk.conf' and then checks to see if the use defined one.
This is a .Xdefaults style resource file for modifying the look and feel of the `xterm' and `tk' interfaces.
You may want to use the `Tk.conf' Mmucl loads as a template. It explains the syntax of the file and changes that our often needed.
This chapter will walk you through some Mmucl basics to help you get started quickly. You may not necesarrily understand the alias and action examples below, but you can use them as templates and later read through section Scripts.
Whenever you type input into Mmucl it undergoes special interpretation. You might have run in to this if you noticed that `e;e' is equivalent to typing in `e' twice. To send a literal `;' to the mud prefix the string you want to send with `\'. For a more detailed description of how Mmucl handles input see section parse.
Make an alias name `h' to send the command `cast cure critical wounds me' to the mud.
alias set h { write "cast cure critical wounds me" }
Even better, bind the command to a key. We'll bind it to F1.
key set <Key-F1> { write "cast cure critical wounds me" }
Suppose we want to heal someone else? We'll make an h alias that heals someone else if given an argument and heals us if given no arguments.
The command %
returns a list of all the arguments
given to the alias. The `llength' procedure returns
the length of the list given to it as an argument. In this
case it checks to see if any arguments were given to the alias.
To retrieve its first argument the alias uses % 1
.
alias set h { if {[llength [%]]} { write "cast cure critical wounds [% 1]" } else { write "cast cure critical wounds me" } }
Maybe we should heal ourselves automatically whenever we get `Bob CRUSHES you to the ground' send from the mud.
action set {Bob CRUSHES you to the ground} { write "cast cure critical wounds me" }
How about generalizing the action so we get healed when any monster crushes us? We can use `%w' in the pattern to match the monsters name. (If the monster's name has spaces in it, use `%s' instead.)
action set {%w CRUSHES you to the ground} { write "cast cure critical wounds me" }
One problem with the action is that someone could give us a tell, `bear CRUSHES you to the ground' and trigger the action. To prevent that we want to have the action only be triggered when `%w CRUSHES you to the ground' is at the beginning of a line. We can do that with `%^' which matches the beginning of a line.
action set {%^%w CRUSHES you to the ground} { write "cast cure critical wounds me" }
Now suppose we want to automatically heal our friends when they tell us "heal me".
The `@' command in an action works like the `%' command in an alias except that `@' retrieves action matches.
action set {%^%w tells you: heal me} { write "cast cure critical wounds [@ 2]" }
The following rules define the syntax and semantics of the Tcl language and were taken directly from the man page Tcl(n).
These are procedure (actually they are aliases, see interp(n)) that Mmucl makes available to the user.
An action consists of a pattern and a script. When the pattern matches output from the mud, the script is evaluated.
Usage: action option ?args ...?
Options:
Special characters in a pattern denote a "match". A "match" matches a type of string such as a number sent from the mud. Any other characters in a pattern must exactly match text from the mud.
Pattern matches:
To disable the special interpretation of a match prepend `%' to it. For example if you want to match `%d' being sent from the mud, your pattern would be `%%d'.
Another special character is `*'. It matches anything. A literal `*' can be included with `**'.
Return an action match.
Usage: action ?index?
If index is `0' then @
returns
the entire string the action matched.
Otherwise @
returns the match corresponding
to index. The index of a match is, moving from
left to right, the nth match.
An alias consists of a name and a script. When the first "word" of input matches an alias name, the script is evaluated
Usage: action option ?args ...?
Options:
Retrieve arguments given to an alias. Note that the `%' is only meaningful when called from within an alias.
Usage: % ?index?
If index, which should be a number, is given, return that argument to the alias. If index isn't given return a list of all the arguments given to the alias.
A char stores information about a character on a mud. Mmucl saves the information on exit and restores it on startup.
Usage: char option ?args ...?
Options:
Modify the current command line.
Usage: cline option ?args ...?
Options:
Return a string with ansi text attributes.
Usage: color string colors ...
colors should be a list of the text attributes to apply to the string.
Change and inspect Mmucl config options.
Usage: config option ?args ...?
Options:
Connect to a mud.
Usage: connect host port ?login?
Connect to host at port. If login, which must be a list, is given, each element of the list is written to the mud on a successful connection. The config option timeout determines how long connect waits for a response.
Disconnect ends a connection to a mud.
Usage: disconnect
Write to the display.
Usage echo str ?str ...?
Echo writes every argument, with a space added at the end, to the display.
Log on to that strange place known as rl.
Usage: exit
Start an info browser to read Mmucl's info file.
Usage: help ?subject?
If subject is given go to node subject. Otherwise go to the Top node.
A key consists of an event and a script. When a sequence of keys matches an event, the script is evaluated. See bind(n).
Usage: key option ?args ...?
Options:
Interpret a string just as if you'd typed it in.
Usage: parse str
If str begins with the config option `verbatim_char', by default `\', send str, minus `verbatim_char', to the mud.
If str begines with the config option `script_char', by default `/', str, minus `script_char', is evaluated as a Tcl script.
Barring the first two cases, str is split up into a sequence of substringss delimited by `;'. If the first "word" of a substring matches an alias, the alias is executed. Otherwise the substring is sent to the mud.
Attempt to resume the last connection.
Usage: reconnect
Save Mmucl's state to a file.
Usage: save file
A sub consists of a pattenn and a subspec (see regsub(n)). The sub replaces every occurence of its pattern in mud output with subspec.
Usage: `sub option ?args ...?'
Options:
Send a file to the mud.
Usage: textin file
Send strings to the mud.
Usage: write cmd ?cmd ...?
Each cmd is written to the mud.
If you have comments, ideas, or suggestions, I'd be interested in hearing them. Bear in mind that I'm only interested in adding features that cannot be implemented in the user interp.
For bug reports I need to know your Mmucl version, Tcl version, operating system, and, if relevant, the address of the mud you are having a problem on
Mail feedback to mpatton@jhu.edu and please put "Mmucl" somewhere on the subject line.
This document was generated on 16 July 1998 using the texi2html translator version 1.52.