📄 readme.html
字号:
the #alias command, which works exactly like Alias in the configuratino file.If you use an non-alphanumeric character as alias name (e.g. one of .$!@%^&)you can use that alias without putting a space after it (I like to alias% to #eval for example, so I can do %2**42 to find out what 2 to the 42ndpower is...)</PRE><h3><a name="chap14">Additional variables that can be expanded</a></h3><PRE>Certain codes in the form of % followed by a letter have a special meaning.They can be used just about everywhere.Letter Functionh Hostname of the MUD you are currently connected top Remote port of current sessionP Local port of current sessionn Name of the current sessionf mudFTP port of current session (%p + 6)H Hour, 00-23m Minute, 00-59M Abbreviated month name (Jan, Feb)w Abbreviated weekday name (Mon, Sun)t Full date and timed Day of the monthy Year (two last digits)Y Year (all digits)o Month number (01 - 12)% % itself</PRE><h3><a name="chap15">Regular expression: triggers and substitutes</a></h3><PRE>Since 0.42, triggers and substitutes are possible using regular expressions.I will not tell you much about regular expressions here: any UNIX bookwill cover them in-depth. You must have Perl support enabled to use thisfeature - mcl will use Perl's excellent regexp library (see man perlre).The syntax is as follows:Action "regular expression" commandLike in aliases, you can use ; to execute multiple commands. In command,you can use $1 and up to paste in subexpressions matched, and $0 to paste inthe whole string. Note that the string that is checked against the regularexpression has all color stripped from it to make things easier.Trivial example:Action "^(.*) tells you '(.*)'" #print tells %m:%H $1: $2This will log tells you receive into the window 'tells' and then possiblyto a file.Substitutions much like this, except that the entire text matched isreplaced. E.g.:Subst "Drylock" Drylock (the maker of this great program!)Subst "fido" Bless (+hitroll/-ac)Like with Action, you can use $1..$9 to copy in subexpressions matched.Subst "^(.*) tells you '(.*)'" Telepathic message from $1: $2You can also specify a Perl function to be called, by using #run. E.g.Subst "Testing" #run TestOutputwill run TestOutput and assign the value of $_ after TestOutput runs tothe part of the string that was "Testing".To gag a line complete, replace the whole line with nothing. E.g.Subst ".*You feel hungry.*"See the <a href="Examples.html">doc/Examples</a> file for more examples.You can view the currently defined aliases/substitutes using Alt-I. Substituteshave star to the far left.Like aliases, you can define actions either outside any MUD definitions (inwhich case they are always active) or inside a MUD definitions.</PRE><h3><a name="chap16">#exec</a></h3><PRE>Since version 0.42, mcl allows non-interactive execution of programs usingthe #exec command. Simply typing #exec followed by the command (e.g.#exec uptime) will bring up the window with the results of that command.mcl does not wait until the command finishes: rather, as new input fromthe command arrives, it is shown. If no new input arrives for 10 seconds,the window is hidden.This feature is primarily intended for execution of the Java mudFTP client,but can be useful for other things, for example running a traceroute.The #exec command defaults to making a window of 80x10 characters at theposition 0,3. The window will be hidden 10 seconds after output arrives.The options -h, -w, -x, -y and -t control change of those options, e.g.:#exec -w80 -h40 -x0 -y0 -t10 fingerwould make a window that was almost covering the whole screen, and woulddisappear after 10 seconds.There are a number of options that can be used as arguments to the #exec test:%h Host of the remote MUD you are connected to%p Remote port%P Local port%n MUD name%f Remote ftp port (equals %p + 6)For the Java mudFTP client, it's probably most useful to use something like this:#exec -w40 -h6 -x39 -y3 -t5 java %h %f drylock qwerty edit.shWhere edit.sh contains:#!/bin/shopen -w -s $EDITOR $@chvt 1i.e. run the editor (make sure you set the EDITOR variable to something useful)with whatever parameters it will be called with, and when it's finished,switch to VT 1 (or whatever VT you usually use for MUD sessions).The 'open' command will find a free VT to run the $EDITOR on, switch to it (-s)and then wait (-w) for completion.Note that number in square brackets (e.g. [1]) in the title bar of the window:using the key combination alt-digit (e.g. alt-1) you can bring the windowto the foreground when it is hidden.</PRE><h3><a name="chap17">#window</a></h3><PRE>#window is another new feature introduced in mcl 0.42. It allows you tocreate a named window that pops up on the screen. This window can thenbe written to using the #print command. Like the #exec window, the #windowdisappears after a certain amount of inactivity, and reappears once new inputto it arrives.#window takes many of the parameters that #exec takes: -w, -h, -x, -y controlwidth, height and placement. -t controls timeout. -L allows attachment of alog file to the window. -H is a switch taking no parameters which will makethe window stay hidden (and only appear when you explicitly use alt-digitto bring it up). -B removes border from the window. -c controls backgroundcolor (see section "Color Values").After the parameters, the name of the window should appear. E.g.:#window -H -w80 -x0 -y4 -h25 -L/home/root/mud/logs/%n-tells tellsWill create a 80x25 window (assuming you have a 80x50 screen), placed at 0,4.The window will use /home/root/mud/logs/%n-tells as a log file - the %nwill be replaced by the name of the current session. The window will becalled "tells" and will stay hidden.Then, you can print to the window using #print:#print tells Joe told me this and that!See file <a href="Examples.html">doc/Examples</a> for examples.You can also clear the contents of one of those windows using #clear.</PRE><h3><a name="chap18">Macros</a></h3><PRE>You can define keyboard macros by using the line:Macro <keyname> <string>anywhere in the mclrc configuration file. This string is executed as ifyou typed an alias that resulted in this command, i.e. ; seperates multiplecommands and aliases in the macro are also expanded.Macros are expanded after the windowing system has had a shot on the key, soyou cannot override keys that have meaning like 'alt_q'.Example:Macro alt_b boaWill send 'boa\n' to the MUD each time you press Alt-B.Here is some useful macros I use (which set the keypad keys to sendN/S/E/W/U/D and the middle key, to execute the "Exits" command):Macro kp_8 nMacro kp_2 sMacro kp_4 wMacro kp_6 eMacro kp_9 uMacro kp_3 dMacro kp_5 exitsHere is a (perhaps incomplete) list of keys. Look in tty.c for an updatedlist:alt_<any letter> alt_slash alt_<digit>ctrl_<any letter>page_up page_down end home insert delete pause escapekp_<any number> (keypad keys) kp_numlock kp_divide kp_multi kp_minuskp_plus kp_minus kp_deletef<1 to 12>Note that some control keys may not be available (e.g. Control-H cannot beoverridden since it does the same thing as backspace).Like actions and aliases, macros can (since 0.52.01) be specified eitherinside a MUD definition, making them work on that MUD only, or outside,making them global.</PRE><h3><a name="chap19">Speedwalk</a></h3><PRE>Standard tintin speedwalk is supported. It can be used both on the commandline as well as inside aliases. A speedwalk command is define as one thatcontains nothing but letters nsewud and digits. E.g. "nseeew" will expand ton <return>, s <return>, e <return> etc. n14es will expand to n, then 14times e followed by a return each, then s followed by a return.You can disable speedwalk using the speedwalk configuration option, oronline using the #disable speedwalk/#enable speedwalk commands.If you start a command with . and follow it immediately afterwards witha set of extended speedwalk letters, it will also be considered a speedwalk.Extended speedwalk is normal speedwalk, but you can also use characters h for nw,j for ne, k for sw and l for se. This option is not enabled in default speedwalkso that it does not clash with any aliases you might have -- with it on,something like "kn" would be considered a speedwalk.Note that the . notation works even if you turn off speedwalk. You can changethe . character by using the speedwalk_character option in the configuration file.</PRE><h3><a name="chap20">Changing the 'Command Character'</a></h3><PRE>Mcl's internal commands are prefixed with the # character by default, forexample '#open', '#quit', etc. If you wish to use another character as thecommand character then add/edit the following line in the .mclrc file. commandcharacter=#Replace the '#' with the character you want the internal commands prefixedwith. For example: commandcharacter=*The '#quit' command will now be '*quit' and the same for the other internalcommands.</PRE><h3><a name="chap21">MUD Inheritance</a></h3><PRE>Since 0.52.01, MUDs can inherit other MUDs' alias, action, macro andhostname/port settings. You could for example, set up a MUD thatcontains aliases common to all your characters on this MUD:MUD AbandonedReality { Host abandoned.org 4444 Alias td tell drylock %0}Then each of your characters would inherit these aliases and the hostname:MUD bob { Inherit AbandonedReality Commands bob;bobpassword}Say that you have 10 such characters; now if the hostname of AbandonedReality were to change, you need to change it only in one place. If youwant to add a new alias, action or macro that is only relevant for allyour character on Abandoned Reality, you need to add it only in thisone place.There is no limit for how many levels of inheritances can be done, so onecould imagine that AbandonedReality could inherit from a "Diku" MUDwhich contains aliases common to DikuMUDs, and that you perhaps have another"MOO" MUD which is a basic alias setup for everything MOO.</PRE><h3><a name="chap22">The Chat subsystem</a></h3><PRE>Since 0.52.02, mcl has a chat system compatible with that of MudMaster andzChat. See the file <a href="Chat.html">doc/Chat</a> for more information such as commands andconfiguration options.</PRE><h3><a name="chap23">More commands</a></h3><PRE>The document covers only the built-in commands of mcl. Through the embeddedPerl support, it's possible to achieve incredible customization of mcl.Commands and features that are available through those means are described inthe file <a href="Modules.html">doc/Modules</a>.</PRE><h3><a name="chap24">License</a></h3><PRE>mcl is under GPL. Read the file COPYING. Mail me if you use it, have ideas,discover features etc.Perl is under the Artistic license. You might have received a binary ofmcl with the Perl library statically linked in. Perl is the product ofLarry Wall and many others.</PRE><h3><a name="chap25">Thanks</a></h3><PRE>Thanks to Oliver 'Nemon@AR' Jowett <icecub@ihug.co.nz> fordebugging and enhancing the C version.To Rodrigo Parra Novo for packaging up RPMs and creating the autoconf script.To Patrick Horner for contributed the Python embedded code.</PRE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -