Mmucl is maintained by Mark Patton, @email{mpatton@jhu.edu}.
The current development version of Mmucl, with which this manual was distributed, is 1.1.5.
You can find the latest news at the Mmucl home page, @url{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.
This is a brief introduction to the basics of using Mmucl.
Most of your interaction with Mmucl will be through the command line.
To connect to a mud, type `/connect host port'.
Mmucl will try to connect to the mud running on host at port port.
The character `/' at the beginning of input
indicates that the rest of the string is a command to the client
in the form of a Tcl script, see section Scripts.
In this case a procedure,
connect
, is executed with host and port as arguments.
The input `e;e' is equivalent to typing in `e' twice.
If input begins with `\', then input minus the beginning `\' is sent to the mud. You might use this to avoid the special interpretation of `;'. For example `\alias x equip;hide' would send `alias x equip;hide' to the mud.
If the first word of input matches an alias name, the alias is executed. For example if you had an alias `k' and typed `k blob' then the alias would be evaluated with an argument of blob. For more information on aliases, see section alias.
For a more exact description of command line interpretation, see section parse.
Here are some examples of useful things Mmucl can do. You may not necessarily understand all the examples, but you should be able to use them as templates and figure out how they work later.
Note that the examples are Tcl scripts. You can use them by typing `/' followed by the script in the client. Alternately, and much recommended, use a real editor, save them to a file, and load them with `/source file'.
Make an alias named `h' to send the command
`cast cure critical wounds me' to the mud.
The write
procedure sends each of its arguments
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. See section key for more about binding keys.
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 variable $0
is the argument string given to the
alias. The variable $1
is the first word, a sequence
of non-space characters, in 0
.
The string length
procedure returns the length of a string.
In this case the alias uses it to check if there was at least one word
in the argument string.
alias set h { if {[string length $1]} { 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' sent from the mud. Actions execute commands whenever their pattern matches output from the mud. See section action for more information.
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 monster's name. (If the monster's name has spaces in it, use `%s' instead.) See section Format for a detailed description of the pattern syntax.
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, `Jerk tells you: 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 variable $2
is the second match in the
pattern counting from left to right.
action set {%^%w tells you: heal me} { write "cast cure critical wounds $2" }
Mmucl is written in the scripting language Tcl and is extendable through that same language. Mmucl makes a great deal of its functionality available to the user through commands it defines. See section Procedures.
To execute a Tcl command in Mmucl prepend the command with whatever the character config option `script_char' is set to, probably `/'.
Most of the time you will want to use a real editor and write the scripts to a file. Then you can load them into Mmucl with `/source file'.
Taken directly from the Tcl docs:
The following rules define the syntax and semantics of the Tcl language.
$name
$name(index)
${name}
This section gives you a crash course in using Tcl. Bear in mind that it sins by simplification. For a precise definition of Tcl's syntax see section Syntax. For information on the various Tcl commands that are mentioned, consult the documentation that came with your Tcl installation.
A Tcl script consists of one or more Tcl commands. A Tcl command has the syntax:
cmd arg...
Commands are broken up into tokens. A token is simply a string. White space (spaces or tabs) seperates the tokens of a command. A command terminates with a newline or semi-colon.
The first token, cmd identifies the command to be executed. Zero or more arg tokens follow cmd. They are the arguments to that command. The command determines what the actual meanings of the arguments are.
echo hello, world
The command echo
executes with two arguments, `hello,' and
`world'.
If a token begins with `"' or `{', the token contains all the characters up to the next `"' or `}' respectively. This allows a token to include white space. Braces can nest, double quotes cannot.
echo "hello, world"
The command echo
executes with one argument, `hello, world'.
Before a command executes, Tcl performs variable, command, and backslash substitution on the tokens making up the command. Braces, `{}', prevent the substitutions from being done to the string they enclose.
Variables are created with the set
command.
set foo bar set n 32
This creates variables, foo
, and n
whose
values are `bar', and `32' respectively.
If a token contains a `$' then the token undergoes variable
substitution. Every occurence of $name
in a token is replaced
with the variable name's value.
echo $foo ab$n
After substitution the command becomes echo bar ab32
.
If a token contains a `[' then the token undergoes command substitution. The string beginning with `[' and and ending at the next `]' is evaluated as a Tcl script and becomes the value returned by the last command in the script.
if {[string length $str]} { echo "$str is not empty, length [string length $str]" }
If the length of $str
is not zero, report its length.
Note that the two arguments to if
are enclosed by braces.
That means no substitutions are preformed on them. The arguments
are simply strings. The command if
chooses to evaluate the second
as a script and the first as an expression as per the Tcl
command expr
.
The special interpretation of characters like `[', `$' can be escaped with `\'.
echo "\[string length foo\]"
This prints `[string length foo]' to the screen.
Scripts stop executing when an error occurs. The global variable
errorInfo
is set to a stack trace of the commands leading
up to the error. Errors can be generated with the error
command.
Errors can be caught with the command catch
.
Example:
proc source2 {file} { global errorInfo if {[catch {source $file} ret]} { echo "Error: $ret" echo "Stack trace:" echo $errorInfo } return $ret }
The command source2
tries to source a file. If there
is an error in the file, the error along with a stack trace
is reported.
key set <Print> { echo [color "Stack Trace:" bold] echo $errorInfo }
This creates a key binding that prints out the stack trace of the last error.
alias set annoy { if {[string length $1] == 0} { error "no target given to annoy" } for {set i 0} {$i < 5} {incr i} { write "smack $1" "spit $1" "kick $1 in the groin" } }
Create an alias that uses annoying emotes on someone. If an argument isn't give, the alias aborts with a useful error message.
Arrays are variables that contain a set of strings. Those strings are indexed by strings. (Tcl arrays are implemented internally by hashtables).
Arrays can be created with the set
command just
like normal variables.
set arg(first) 3 set arg(2) one
This creates an array arg
which holds two values,
`3' and `one' which are indexed by the strings
`first' and `2' respectively.
To access the value of element el of array array
use $array(el)
.
echo "first: $arg(first)" echo "2: $arg(2)"
This prints out two indices of array arg
and the values associated
with them.
To print out an entire array, array
, you would do something like
the following:
foreach index [array names array] { echo "$index: $array($index)" }
A Tcl list is a string of tokens seperated by white-space. Every list is a string, but not every string is a list. The string `this is a string' is a list consisting of four elements. The string `this {' is not.
set digits {0 1 2 3 4 5 6 7 8 9} foreach n $digits { foo $n }
Starting from the first element of the list digits
, every element
of the list is assigned to n and the body of the loop evaluated.
Alternately:
for {set i 0} {$i < [llength $digits]} {incr i} { foo [lindex $digits $i] }
but the first example is more efficient.
New Tcl commands can be created with the command proc
.
proc foo {} { echo foo! }
This creates a command, foo
, that prints `foo!' to the
screen. The command doesn't take any arguments.
proc lastchar {str} { return [string index $str [expr [string length $str] - 1]] }
This creates a command lastchar
which returns the
last character of its argument.
Variables created in procedures have local scope. Variables
created outside procedures have global scope. To access
a global variable from a procedure, use the command global
.
set verbose 1 proc laverage {nums} { global verbose if {$verbose} { echo "procedure average called with [llength $nums] numbers" } set sum 0 foreach num $nums { set sum [expr {$sum + $num}] } return [expr {$sum / [llength $nums]}] }
The command laverage
prints out the number of arguments
given to it, if the global variable verbose
is true, and
returns returns the average of the numbers in the list passed
to it.
if {$foo == "bar"} { do something }use
string compare
like so:
if {[string compare $foo "bar"] == 0} { do something }Using
string compare
is faster and avoids some nasty
special cases.
string
commands to pick apart a string,
use regexp
instead.
Loop from 0 to 9 calling the command foo
with the number of the iteraton as an argument.
for {set i 0} {$i < 10} {incr i} { foo $i }
Alternately:
set i 0 while {$i < 10} { foo $i incr i }
Compute the factorial of a number.
proc fac {n} { for {set res 1} {$n > 1} {incr n -1} { set res [expr {$n * $res}] } return $res }
Return the unique elements of a list. The order of the elements is lost.
proc luniq {list} { foreach el $list { set x($l) "" } return [array names x] }
Many of the commands Mmucl provides take pattern arguments. The three types of patterns, format, regexp, and glob, used are described below.
Types of patterns:
More likely than not the text you'll be most interested in matching will be output from the mud.
Mmucl checks actions and subs against chunks of text sent
from the mud, not line by line. An action will
be triggered a maximum of one time for a given chunk of text.
A sub will replace its pattern many times in a chunk.
Actions matching occurs after the output is transformed by
the subs and, if the config option strip_ansi
is true,
after ANSI codes are stripped out.
Special characters in a pattern denote a match. A match corresponds to a type of string, such as a number. Any other characters in a pattern must be in the string being compared.
Pattern matches:
To disable the special interpretation of a match prepend `%' to it. For example, to match a literal `%d', use `%%d'.
Another special character is `*'. It matches anything or nothing. A literal `*' can be matched with `**'.
Finally a `|', breaks the pattern into two branches. Each branch is a pattern. If the first branch fails to match anything, the second will be tried. A literal `|' can be matched with `||'.
A pattern cannot be malformed. It may not match what you intend it to, but it will match something.
Examples:
`%w is here' will match `dog is here', but not `big dog is here'. To match the latter use `%s' instead of `%w'.
`%s is here|%s are here' will match `dog is here' or `two dogs are here'.
From the Tcl docs:
A regular expression is zero or more branches, separated by `|'. It matches anything that matches one of the branches.
A branch is zero or more pieces, concatenated. It matches a match for the first, followed by a match for the second, etc.
A piece is an atom possibly followed by `*', `+', or `?'. An atom followed by `*' matches a sequence of 0 or more matches of the atom. An atom followed by `+' matches a sequence of 1 or more matches of the atom. An atom followed by `?' matches a match of the atom, or the null string.
An atom is a regular expression in parentheses (matching a match for the regular expression), a range (see below), `.' (matching any single character), `^' (matching the null string at the beginning of the input string), `$' (matching the null string at the end of the input string), a `\' followed by a single character (matching that character), or a single character with no other significance (matching that character).
A range is a sequence of characters enclosed in `[]'. It normally matches any single character from the sequence. If the sequence begins with `^', it matches any single character not from the rest of the sequence. If two characters in the sequence are separated by `-', this is shorthand for the full list of ASCII characters between them (e.g. `[0-9]' matches any decimal digit). To include a literal `]' in the sequence, make it the first character (following a possible `^'). To include a literal `-', make it the first or last character.
Examples:
`[0-9]+' matches an unsigned integer.
`\-?[0-9]+' would match a signed integer.
`[][\*\(\)\$\^\+\.\?\|\\]' matches a special character in a regular expression.
Note that some of the special characters in a regexp like `[' or `$' need to be hidden from the Tcl parser. To avoid quoting hell, try to put your regexps in `{}'.
This is the same type of matching used by Tcl's string match
command.
From the Tcl docs:
For the two strings to match, their contents must be identical except that the following special sequences may appear in pattern:
Examples:
`test*' matches anything beginning with `test'.
`\*' matches `*'.
These are commands that Mmucl makes available to the user.
The following shorthand is used to describe the syntax of the commands. Each argument is one of:
name
[name]
[name value]
--
name...
Switches consist of zero or more arguments preceded by `-' and ending with `--' or an argument that doesn't begin with `-'.
Commands defined by Mmucl:
An action consists of a format pattern and a script. When the
pattern matches output from the mud, the script is evaluated.
The script has local scope. The command rxp_action
is identical to action
except that rxp_action
uses regular expressions. See section Patterns for information
on pattern matching.
Usage: action option arg...
Options:
set format [script]
names [glob *]
delete -- glob
print [glob *]
The script has these local variables available to it:
1-9
0
Examples:
action set {%^%w tells you:} { write "tell $2 I'm afk. brb" bell }
Whenever you get a tell, reply that you are afk and ring a bell.
action print *bob*
Print out all the actions with `bob' somewhere in their pattern.
action set {%^Hp: %d(%d)} { global status set status(hp) $2 set status(max_hp) $3 }
Keep hp and max_hp in the global array status updated for use in other scripts.
action set {%^%w grins|%^%w bows} { write "smack $2$4" }
Whenever someone grins or bows, smack them!
An alias consists of a name and a script. When the first word, a block of anything not whitespace, of input matches an alias name, the script is evaluated.
Usage: alias option arg...
Options:
set name [script]
names [glob *]
delete -- glob
print [glob *]
The script has these local variables available to it:
0
1-3
Examples:
alias set k {write "kill $0"}
Send `kill' followed by any arguments to the mud every time k is typed.
alias delete *
Delete all the defined aliases.
alias delete -exact *
Delete the alias `*'.
alias set sneak { set dirs {n e w s ne nw se sw} if {[string compare $1 "on"] == 0} { foreach dir $dirs { alias set $dir [list write "sneak $dir"] } } else { foreach dir $dirs { alias delete -exact -- $dir } } }
Set or delete aliases for directions that send "sneak direction" to the mud.
alias set r { regexp {^\ *(.*)\ *([0-9]+)$} $0 x str num for {set i 0} {$i < $num} {incr i} { write $str } }
Find a number at the end of the argument string. Write everthing up to that number, except buffering white-space, to the mud that number times.
Ring a bell.
Usage: bell
Examples:
key set <Control-g> bell
Ring the bell every time Control-g is pressed.
A char stores information about a character on a mud. Mmucl saves the information on exit and restores it on startup.
Usage: char option arg...
Options:
set name [info]
names [glob *]
delete -- glob
print [glob *]
load name
Examples:
char set Arithon {dracos.ptn.net 3000 {arithon passwd}}
On connection to the mud, `arithon' and then `passwd' will be sent. You may want to make sure `~/.mmucl' where the character information is stored readable only by you. The password is just stored as plain text.
char set Arithon {dracos.ptn.net 3000}
Just like the above except nothing in sent to the mud on connect.
Do argument handling for a procedure.
Usage: check -- name syntax arglist
If the switch `-opts' is given, then the command has options (subcommands) and syntax is a list of the form {(option spec)...}. Otherwise syntax is a list of the form {spec}.
Each spec indicates a type of argument the command takes and is a list of the form:
{+ name}
{? name}
{? name default}
{- name...}
The arguments are checked against syntax and an appropriate error message is returned if they do not match the syntax.
If the syntax of the arguments is correct, the
arguments are made available to the calling block
of code in the array arg
indexed by name.
Switches will be 1 if given, and 0 if not.
Examples:
proc rand {args} { set syntax { seed {{? seed}} get_int {{+ range} {? min 0} } get_float {{+ range} {? min 0}} } switch -exact -- [check -opts rand $syntax $args] { seed { if {[info exists arg(seed)]} { expr {srand($arg(seed))} } else { expr {srand([clock clicks])} } } get_int { return [expr {int(rand() * $arg(range)) + $arg(min)}] } get_float { return [expr {rand() * $arg(range) + $arg(min)}] } } return }
This creates a command rand
that has subcommands,
seed
, get_int
, and get_float
.
Modify the current command line.
Usage: cline option arg...
Options:
delete [index1 0] [index2 end]
get [index1 0] [index2 end]
insert index string
history
hist_keep
commands
typed.
Index:
Examples:
bind <Control-x> {cline delete}
Delete the current line when Control-x is hit.
Return a string with ansi text attributes.
Usage: color (str attribs)...
Colors: black, red, green, yellow, brown, blue, magenta, cyan, and white.
All of the text attributes below and the colors listed above may or may not be supported by whatever console the text is displayed in.
The argument attribs is a list made up of these text attributes:
The string returned will always end with the attributes
given by the config option end_color
.
Examples:
echo [color WARNING!! {bold red}]
Display "WARNING!!" in bold font with a red foreground.
color r red a green i yellow n blue b white o cyan w magenta
Return `rainbow' with ansi codes to set each character to a different color.
Change and inspect Mmucl config options.
Usage: config option arg...
Options:
set option [value]
names [glob *]
print [glob]
Options
actions
broken_eol
echo
echo_color
end_color
color
are always
terminated with these text attributes.
error_color
hist_keep
hist_min
keep_line
report_color
reconnect
script_char
strip_ansi
subs
timeout
verbatim_char
Examples:
config print *_color
Print out all the config options that set a color.
Connect to a mud.
Usage: connect host port [login {}]
Connect to host at port. Each element of the list
login is written to the mud on a successful connection. The config
option timeout
determines how long connect
waits for
a response. If the connection attempt times out, Mmucl will try
reconnecting the number of times the config option reconnect
is set to.
Examples:
connect mud.domain 2000 {name passwd 1}
Try to connect to the mud running at mud.domain on port 2000. If we connect write `name', `passwd', and then `1' to the mud.
connect dracos.ptn.net 3000
Try to connect to the mud running at dracos.ptn.net on port 3000.
Disconnect ends a connection to a mud and will also stop an attempted connection.
Usage: disconnect
Examples:
key set <Control-q> disconnect
Set up a key binding to disconnect.
The command dump
can save to a file the data created by the
commands action
, rxp_action
, alias
,
char
, config
, key
, sub
, and rxp_sub
.
The data can then be recreated by sourcing the file produced.
Syntax: dump -- file
Switches:
Examples:
dump -alias -- aliases
Write all the currently defined aliases to the file `aliases'.
proc exit_save {} { global env dump -all -- [file join $env(HOME) .mmucl save] exit }
Create a command save_exit
that saves everything to the
file `~/.mmucl/save' and then exits.
On startup you could load everything back in
with by putting source [file join $env(HOME) .mmucl save]
in your mmucl.rc.
Write to the display.
Usage echo str...
Echo joins all the str's into a single string with a space inbetween each str, appends a newline to the end, and writes the result to the display.
Examples:
echo "foo bar" echo foo bar
The result is the same for each echo
.
echo [color "It's Christmas!" {bold red bg_green}]
Print "It's Christmas" in bold red with a green background.
proc minfo {} { global env tcl_platform tcl_version tk_version echo "Host: [info hostname]" echo "OS: $tcl_platform(os) $tcl_platform(osVersion)" echo "Tcl version: $tcl_version" catch {echo "Tk version: $tk_version"} echo "Home directory: $env(HOME)" echo echo Aliases: [llength [alias names]] echo Actions: [llength [action names]] echo Subs: [llength [sub names]] echo Keys: [llength [key names]] echo Chars: [llength [char names]] }
Define a command minfo
that print out miscellaneous info about
the system Mmucl is running on and the user interp.
Log on to that strange place known as real life.
Usage: exit
Exit also saves any chars defined as well as all the config options so that they can be restored on startup.
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.
Examples:
help help
Go to this node.
A key consists of an event and a script. When a sequence of keys matches an event, the script is evaluated. The script has global scope.
Much of the information in this section was taken
from the Tcl documentation on the command bind
.
Usage: key option arg...
Options:
set key [script]
names [glob *]
delete -- [glob *]
print [glob *]
Key events:
Each event pattern may take one of two forms. In the simplest case it is a single printing ASCII character, such as `a' or `['. The character may not be a space character or the character `<'. This form of pattern matches a key press for the particular character.
The second form of pattern is longer but more general. It has the following syntax: `<modifier-modifier-type-detail>' The entire event pattern is surrounded by angle brackets. Inside the angle brackets are zero or more modifiers, an event type, and an extra piece of information (detail) identifying a particular keysym. Any of the fields may be omitted, as long as at least one of type and detail is present.
Modifiers:
Keysyms are textual specifications for particular keys on the keyboard; they include all the alphanumeric ASCII characters (e.g. `a' is the keysym for the ASCII character `a'), plus descriptions for non-alphanumeric characters (`comma' is the keysym for the comma character), plus descriptions for all the non-ASCII keys on the keyboard (`Shift_L' is the keysym for the left shift key, and `F1' is the keysym for the F1 function key, if it exists). The complete list of keysyms may vary from system to system. If necessary, you can use the %K notation described below to print out the keysym name for a particular key.
Every script bound to an event has these substitutions performed on it before it executes:
If a script terminates with the command break
, then no
further scripts that match the event are evaulated. This can
be used to ignore the builtin bindings which are checked after
user defined bindings.
Examples:
key set <Key> {echo %K}
Print out key events as they occur.
key set <Escape> {write flee} key set <Double-Escape> {write quit} key set <Triple-Escape> {exit}
Send "flee" to the mud when Escape is hit once. Hitting Escape twice sends "flee" and then "quit". Hitting Escape thrice sends "flee" and "quit" to the mud and then exits.
key set <Key-a> {}
Prevent the key a from causing `a' to be inserted in the input entry.
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.
Examples:
alias set . { parse [lindex [cline history] end] }
Reparse the last command added to history. This is too simplistic. If `.' was added to the history list, using it again would cause an infinite loop!
proc al {name cmd} { alias set $name [list parse $cmd] }
Define a new command al
that creates
an alias name
. When invoked name
acts
as if cmd
had been typed instead.
Attempt to resume the last connection.
Usage: reconnect
If a login was given on the last connect, it will be sent again.
Examples:
key set <Key-F12> reconnect
Try to reconnect every time F12 is pressed.
A sub consists of a format pattern and a subspec.
The sub replaces every occurence of its pattern in mud
output with its subspec. The command rxp_sub
is exactly the same except that it uses regular
expressions. See section Patterns for information on pattern matching.
Usage: sub option arg...
Options:
set format [subspec]
names [glob *]
delete -- glob
print [glob *]
While replacing a pattern with a subspec the following substitutions in subspec are done:
If the subsepc has backslashes, you'll like want to protect it from Tcl's interpretation of backslashes by putting is in braces, `{}'.
Examples:
sub set "%^%w tells you: %s" {"\3", says \2}
Change `Renir tells you: heheh' to `"heheh", says Renir'.
sub set Arithon [color & {bold magenta}]
Change `Arithon''s color to be bold magenta.
proc gag {name} { sub set %^%s$name%s "" } proc ungag {name} { sub delete -exact -- %^%s$name%s }
Define two commands, gag
and ungag
that
respectively set a gag on name
, deleting
every line with name
in it, or remove a
gag on name
. This isn't completely correct.
completely correct. To make sure you match name
,
you'd have to escape any format patterns in name
.
Send a file to the mud.
Usage: textin file
Textin writes file to the mud.
Examples:
alias set postfile { write "post file: $1" textin $1 write . }
Create an alias `postfile' that, on RoD anyway, posts a file to a message board.
Send strings to the mud.
Usage: write str...
Send each str to the mud.
Examples:
write "get all from corpses" write "bury all"
The above is the same as:
write "get all from corpses" "bury all"
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. Take a look through the manual to see if Mmucl already provides the functionality to implement what you want.
For bug reports I need to know your Mmucl version, Tcl/Tk version, operating system, and, if relevant, the address of the mud you are having a problem on.
Mail feedback to @email{mpatton@jhu.edu} and please put `Mmucl' somewhere on the subject line.
This document was generated on 23 May 1999 using the texi2html translator version 1.51.