Mmucl Frequently Asked Questions

1. The fonts are ugly. How do I fix them?
2. How do I access a global variable from an alias?
3. How do I get Mmucl working in Windows?
4. How do I highlight mud output?
5. Does Mmucl have speedwalk?
6. How do I move with the keypad?
7. How do I prevent keys I bind to events from doing other things?
8. How do I change attributes of the xterm used in the xterm interface?
9. How do I match the beginning of a line in a rxp_action?

1. The fonts are ugly. How do I fix them?
--------------------------------------

Use the tkconf dialog to change the fonts for the gui
interfaces. For the text interfaces you'll have to read
through the docs on whatever terminal you're using.

2. How do I access a global variable from an alias?
---------------------------------------------------
Aliases has local scope. Variables created
in an alias are local. To reference global variables you
must declare them as such with the command global.

set gvar test

alias set foo  {
    echo $gvar
}

The alias will return an error because
a local variable gvar cannot be found.

set gvar test

alias set foo {
    global gvar

    echo $gvar
}

The alias prints out test.

3. How do I get Mmucl working in Windows?
-----------------------------------------

Follow the directions in the file INSTALL.

4. How do I highlight mud output?
---------------------------------

You have to insert ansi codes to do the colors with a
sub. A string with ansi colors can be created with the
color command.

proc highlight {format colors} {
    sub set $format [color & $colors]
}

This highlight procedure will add a list of colors
a the format pattern. Read about the color command
to see what text attributes are supported.

5. Does Mmucl have speedwalk?
-----------------------------

Not builtin, but it can be added easily.
Look at the sample mmucl.rc for one implementation.

6. How do I move with the keypad?
---------------------------------

You have to use the key command to bind scripts
to the keypad. Look at the move command in the
sample mmucl.rc for an example.

7. How do I prevent keys I bind to events from doing other things?
------------------------------------------------------------------

Keys may do other things than just what you bind them to.
To prevent a key from doing anything but what its bound
to, have the script break.

key set a break

This prevents "a" from appearing in the input widget when
the key a is hit.

key set <KP_Add> {write up; break}

Send "up" to the mud when the plus in the keypad is hit and
don't print a plus on the input entry.

8. How do I change attributes of the xterm used in the xterm interface?
----------------------------------------------------------------------

Edit your ~/.Xdefaults to change the xterm. Look at the X man
page for more info.

9. How do I match the beginning of a line in a rxp_action?
---------------------------------------------------------

Remember you are matching a chunk of text. The beginning of
a line is either preceded by a newline or by nothing.

rxp_action set "(^|\n)Beg of a line" {echo Whee!}

If you are in action_by_line mode or enable newline sentive matching
using the regexp metasyntax then just "^Beg of a line" will work.

Alternately enable -line mode in the regexp with "(?n)^Beg of line".