@/addworld

/addworld

  Usage: 

  /ADDWORLD [-T<type>] <name> [<char> <pass>] <host> <port> [<file>]
  /ADDWORLD [-T<type>] default <char> <pass> [<file>]
  /ADDWORLD [-T<type>] <name>
  ___________________________________________________________________________

  Adds a new world with the name <name>, or defines the default character and 
  password.  Any omitted fields will assume the values of the corresponding 
  fields of world "default", if there is one.  The third form, "/addworld 
  -T<type> <name>", can be used to change the type of an existing world.  

  The optional <type> is used in hooks and triggers, and for automatic login 
  and flag setting.  The library pre-defines WORLD and LOGIN hooks for these 
  types: 

  (none)  TinyMud login format.  

  tiny, tiny.* 
          TinyMud login format, lp=off.  

  lp, lp.* 
          LP/Diku login format, lp=on.  

  diku, diku.* 
  aber, aber.* 
          For any server that sends unterminated prompts.  

  lpp, lpp.* 
          LP/Diku login format, lp=off.  For muds that use GOAHEAD or EOR 
          prompt protocol.  

  telnet, telnet.* 
          telnet login format, lp=on, /localecho on.  For any line-by-line 
          telnet service.  

  You can define your own world types for use in other triggers or hooks.  If 
  you use names that match the glob patterns above, the standard library 
  hooks will still work.  For example, if you did: 

      /addworld -T"tiny.muck" Cave     <name> <pass> cave.tcp.com 2283
      /addworld -T"tiny.muck" QWest    <name> <pass> glia 9999
      /addworld -T"tiny.mush" DeepSeas <name> <pass> muds.okstate.edu 6250

  then tiny-style autologin would still work (using the library hooks), and 
  you could also define your own triggers and hooks specific to TinyMUCKs or 
  TinyMUSHes.  

  Any <type> is valid, but is only useful if it is matched by a "-T<type>" 
  option of a hook or trigger.  

  Redefining the default world is permitted.  Those worlds previously defined 
  without character, password or macro-file strings will then use the new 
  default.  

  If /addworld with a password is executed from a file that has permissions 
  making it readable by others, it will produce a warning.  You should change 
  the file permissions to prevent other people from reading your password.  

  If %{proxy_host} is defined, connections will go through a proxy server 
  (firewall).  See "proxy" for details.  

  See: worlds, /connect, /fg, /telnet 

@/addtiny
@/addlp
@/addlpp
@/adddiku
@/addtelnet

/add<worldtype>

  The comamnds /addtiny, /addlp, /addlpp, /adddiku, and /addtelnet take the 
  same arguments as /addworld, and also give that world a type.  A world's 
  type determines the format for automatic login and flag settings.  

  See: /addworld 

@/alias
@/unalias

/alias

  Usage: 

  /REQUIRE alias.tf

  /ALIAS [<name> [<command>]]
  /UNALIAS <name>
  ___________________________________________________________________________

  With no arguments, /alias lists all aliases.  With a <name> argument, 
  /alias lists the alias with names that match the glob pattern <name>.  
  Otherwise, /alias defines <name> as an alias for <command>.  

  /Unalias undefines an alias for <name> that was defined with /alias.  

  To use an alias, just type its name followed by any optional arguments.  
  Unlike macros defined with /def, you do not type '/' before <name> to 
  execute an alias.  Argument substitution in aliases works the same as in 
  macros.  

  As of 3.5 alpha 11, aliases can be called from other aliases or macros.  To 
  send a line of text to the server without alias calls, use /send.  If an 
  old alias that used to work now results in "Too many recursions", you need 
  to rewrite the alias to use /send.  

  Using /def instead of /alias is recommended.  

  See: /def, macros, substitution, tfrc 

@/at

/at

  Usage: 

  /REQUIRE at.tf

  /AT <when> <commands>
  ___________________________________________________________________________

  <Commands> will be executed at <when>, which must be of the form "hh:mm" or 
  "hh:mm:ss" ("hh" is between 0 and 23).  <When> is within the next 24 hours.  

  Example: /at 23:30 /echo Stop mudding, it's time for Letterman! 

  See: processes, /repeat, /quote 

@/bamf

/bamf

  Usage: 

  /BAMF [OFF|ON|OLD]
  ___________________________________________________________________________

  Sets the flag %{bamf}.  This flag controls whether TF will cooperate with 
  portals.  A portal allows a mud character to move from one server to 
  another transparently, by simply going through a seemingly normal mud exit.  

  How it works: A "portal" is text sent by a server of the form: 

  #### Please reconnect to <name>@<addr> (<host>) port <port> #### 

  For example: 

  #### Please reconnect to Islandia@128.100.102.51 
  (hawkwind.utcs.toronto.edu) port 2323 #### 

  If %{bamf} is off, lines in this format have no effect.  If %{bamf} is on, 
  Fugue will attempt to use the portal as an UnterMUD portal: it will 
  disconnect from the current world, and attempt to connect to the new world; 
  if the %{login} flag is also on, TF will try to log in to the new world 
  using the name and password from the current world.  If bamf is "old", 
  Fugue will connect to the new world without disconnecting from the current 
  world.  If %{login} is also on, and the new world has been defined with a 
  name and password in an /addworld command, Fugue will attempt to log in 
  automatically.  

  The flag %{bamf} defaults to 0 (off).  

  See: worlds, sockets, %bamf, %login 

@/beep

/beep

  Usage: 

  /BEEP [<number>|ON|OFF]
  ___________________________________________________________________________

  /beep causes Fugue to emit <number> beeps (ASCII 7).  /beep with no 
  arguments will emit three beeps.  /beep OFF causes Fugue to ignore further 
  calls to /beep until a /beep ON is performed.  

@/bind

/bind

  Usage: 

  /BIND <sequence> = <command>
  ___________________________________________________________________________

  Creates a macro that will be executed when <sequence> is typed at the 
  keyboard.  The <sequence> may use ^<key> notation for a control key, and 
  \<number> for an ascii character code in octal, hexadecimal, or decimal.  
  For example, the escape character can be given by any of these forms: ^[, 
  \033, \0x1B, or \27.  

  When the key sequence <sequence> is typed at the keyboard, <command> is 
  executed.  The command is actually a macro body, so all the substitutions 
  described under "evaluation" will be performed.  The most common command 
  used with a key binding is /dokey.  

  At startup, TF defines bindings for /dokey BSPC, BWORD, DLINE, REFRESH, 
  LNEXT, UP, DOWN, RIGHT, and LEFT based on your terminal settings.  Also, 
  the standard macro library defines a set of (invisible) default bindings, 
  one for each of the /dokey functions.  

  If /bind fails for any reason, it returns 0.  Otherwise, it returns the 
  number of the new macro (useful in /undefn and /edit).  

  As of version 3.5, the NUL character (^@) is allowed in keybindings.  

  The command
  /bind <sequence> = <command>
  is equivalent to
  /def -b"<sequence>" = <command>. 

  Examples: 

    /bind ^Xtw = :jumps to the left%;:steps to the right!
    /bind ^[q = /set more off
    /bind ~ky = /input Kyosuke

  See: keys, /dokey, /unbind, /input, utilities (bind-bash, bind-emacs, 
  completion), general 

@/break

/break

  Usage: 

  /BREAK [<n>]
  ___________________________________________________________________________

  During macro evaluation, /BREAK unconditionally terminates the nearest 
  enclosing /WHILE loop.  If <n> is specified, it will break out of <n> 
  enclosing /WHILE loops.  If used outside a /WHILE loop, the macro 
  evaluation is terminated.  

  See: /while, evaluation 

@/cat

/cat

  Usage: 

  /CAT [%]
  ___________________________________________________________________________

  Concatenates (puts together) all subsequent lines until a line containing a 
  single "." is typed.  If the argument "%" is given, a "%;" sequence is 
  appended to each intermediate line.  The concatenated result is then 
  executed as a single line.  

  The concatenated result is stored in the input history as a single line, so 
  intermediate lines can not be recalled seperately.  

  Example: 

    /cat %
    :foo
    :bar
    :baz
    . 

  This produces: 

    :foo%;:bar%;:baz

  If the %{sub} flag is set on, this will expand to three lines ":foo", 
  ":bar" and ":baz" and be sent to the socket.  

  See: general, history, /sub 

@/changes

/changes

  Usage: 

  /CHANGES [<version>]
  ___________________________________________________________________________

  List the changes in a <version> of TinyFugue; if omitted, <version> 
  defaults to the current version.  <Version> can be a full version name 
  (e.g., "3.5 beta 1") or just the major and minor numbers (e.g., "3.5").  
  The information is kept in the file %TFLIBDIR/CHANGES.  

  A list of changes in the latest version of tf can be found at 
  http://tf.tcp.com/~hawkeye/tf/CHANGES.  

  See: /version 

@/connect

/connect

  Usage: 

  /CONNECT [-lq] [<world>]
  /CONNECT <host> <port>
  ___________________________________________________________________________

  Attempts to open a socket connected to <world>.  <World> must be defined by 
  the /addworld command and not already connected.  If <world> is omitted, 
  the first defined world will be used.  "/connect <host> <port>" will define 
  a temporary world with the given address, and try to connect to it.  

  Options: 

  -l      No automatic login (i.e., don't call the LOGIN hook).  
  -q      Quiet login (overrides %{quiet} flag).  

  When successfully connected to a new socket, these events occur: 

    * If %{sockmload} is on and there is a file associated with the 
      world, the file will be loaded (and the LOAD hook will be called); 
    * The CONNECT hook is called.  
    * The new socket is brought into the foreground.  (This is actually 
      done by /fg in a CONNECT hook defined by the standard library.) 
    * If %{login} is on, and a character and password is defined, the 
      LOGIN hook is called.  

  When a hostname is given, TF must resolve it to an IP address.  If 
  %{gethostbyname} is "nonblocking", and this process takes too long, TF will 
  print "Hostname resolution for <world> in progress" (the PENDING hook) and 
  continue to work in the background, leaving you free to do other things.  
  If the resolution succeeds, TF will try to connect; if it fails, you will 
  be notified.  

  Nonblocking connect, on most platforms: If the connection takes too long, 
  TF will print "Connection to <world> in progress" (the PENDING hook) and 
  continue to try to connect in the background, leaving you free to do other 
  things.  If the connection eventually succeeds, you will be switched to 
  that socket (but see note below); if it fails, you will be notified.  

  When a pending /connect succeeds, the foregrounding is done by a CONNECT 
  hook defined by the standard library.  If you don't want to switch 
  automaticly, you can either delete the default hook (/unhook CONNECT) or 
  define your own (with a priority higher than 0).  If you define your own 
  but you still want the switch to occur, you must either make it a 
  fall-thru, or explicitly call "/fg %1" from your hook.  

  /connect returns 0 on error or failure, 1 on success, or 2 if the 
  connection is pending.  

  See: worlds, sockets, /world, /addworld, /fg, %login, %gethostbyname, hooks 

@disconnect
@close
@/dc

/dc

  Usage: 

  /DC [<world>|-ALL]
  ___________________________________________________________________________

  Disconnects from the named world, or the current world if no world is 
  given, or all worlds if "-all" is given.  If the flag %{quitdone} is on, 
  and /dc disconnects the last socket, TF will exit.  

  See: sockets, %quitdone, /quit 

@/def

/def

  Usage: 

  /DEF [<options>] [<name>] [= <body>]
  ___________________________________________________________________________

  Defines a macro with an optional keybinding, trigger and/or hook associated 
  with it.  The options and their meanings are: 

#-msimple
#-mglob
#-mregexp
#-m
  -m<matching> 
          Determines which matching style should be used for the -t, -h, and 
          -T options.  Valid values are "simple", "glob", and "regexp" (see 
          also: patterns).  If omitted, the value of %{matching} ("glob" by 
          default) is used, unless -P is also given, in which case "regexp" 
          is used.  

#-n
  -n<shots> 
          The macro is a multi-shot, that is, it will be deleted after it is 
          triggered or hooked <shots> times.  A value of 0 makes the macro 
          permanent.  Default: 0.  

#-t
  -t<pattern> 
          Defines a trigger pattern which will cause the macro to be called.  
          <Pattern> may be enclosed in quotes (", ', or `); if so, quotes 
          within the pattern must be preceeded with a '\'.  Default: no 
          trigger.  

#-h
  -h"<event>[ <pattern>]" 
          Specifies that the macro will be called automatically whenever 
          <event> occurs and its arguments match <pattern>.  <Event> may be a 
          single event name or a list separated by '|'.  If <pattern> is 
          omitted, it will match any arguments, and the quotes may also be 
          omitted.  Default: no hook.  

#-b
  -b<bind> 
          The macro will be called when the sequence <bind> is typed at the 
          keyboard.  Default: no binding.  The <bind> string may contain the 
          special codes described under "bind".  

#-p
  -p<pri> 
          Sets the priority of the macro's trigger or hook to <pri>.  
          Default: 0.  See also: fall-thru.  

#-c
  -c<chance> 
          Sets the percent probability of a trigger execution.  Default: 
          100%.  

#-w
  -w<world> 
          If the macro has a trigger or hook, it can be matched only by text 
          or events from <world>.  Default: any world.  

#-T
  -T<type> 
          If the macro has a trigger or hook, it can be matched only by text 
          or events from worlds of type <type>.  Default: any type.  (See: 
          /addworld).  

#-F
  -F      Fall-thru: on a trigger or hook, allows additional matches 
          of lower priority to be run.  Default: not fall-thru.  See: 
          priority 

#-a
  -a[ngGurfdBbhC] 
          Set attribute(s) (normal, gag, norecord, underline, reverse, flash, 
          dim, bold, bell, hilite, Color) used to display text matched by the 
          trigger or to display the default message of a hook.  Default: 
          normal.  See "attributes".  

#-P
  -P[<n>][nurfdBhC] 
          "Partial hilite": Set attribute(s) used to display text matched by 
          the <n>th parenthesized subexpression in a regexp trigger.  If <n> 
          is omitted it defaults to 0, i.e.  the text matched by the entire 
          regexp.  If there are multiple matches in the text, the attributes 
          will be applied to all of them.  Implies -mregexp.  Only one -P 
          option is allowed per macro.  

#-f
  -f      Same as -a, for backward compatibility.  

#-I
#-i
  -i 
  -I      Makes the macro "invisible".  Invisible macros are not 
          processed by /list, /save, or /purge unless forced.  Default: not 
          invisible.  

#-q
  -q      Makes the macro "quiet".  If called as a trigger, the macro 
          will not count toward the BACKGROUND hook or the return value of 
          /trigger.  If called as a SEND hook, the macro will not prevent the 
          sending of the original input.  If called as a PROMPT hook, the 
          macro will not remove the text from the data stream.  

#-1
  -1      Defines a one-shot.  Equivalent to "-n1".  

#
  <name>  The name of the macro.  Default: no name.  Names should 
          begin with a letter, and contain letters, numbers, or '_' 
          characters.  This is not enforced, but other characters (especially 
          '$', '/', and '%') may cause unwanted interpretations during 
          expansion.  

  = <body> 
          Text to be executed when macro is called.  Default: no body.  

  If /def could not create a new macro, it returns 0.  Otherwise, it returns 
  the number of the new macro (useful with /undefn and /edit).  

##follow
  Example: 

    /def follow = \
        /def -mregexp -p2 -t"^%{1} goes ([a-z]*)\\\\.$$" do_follow = \
            go %%P1

  This will create a macro named "follow".  When it is called like "/follow 
  Joe", it will execute the command 

    /def -mregexp -p2 -t"^Joe goes ([a-z]*)\\.$" do_follow = go %P1

  Note the substitutions that occured: "%{1}" was replaced with the first 
  (and only) argument; each "\\" was replaced with "\"; "$$" was replaced 
  with "$"; and "%%" was replaced with "%".  

  That command, in turn, defines another macro called "do_follow", with a 
  regexp trigger: 

    ^Joe goes ([a-z]*)\.$

  Thereafter, when a line like "Joe goes north." is received, it will match 
  the trigger, and cause this command to be executed: 

    go north

  Note how "%P1" was substituted with the text matched by the first set of 
  parentheses (in this case, "north").  

  When writing nested macros like this, it is usually easiest to think 
  backwards.  In this example, you would first figure out how /do_follow 
  should be defined, and then figure out how to define /follow in such a way 
  that it will define /do_follow.  
#

  /def is sufficient to perform all the functions of the /trig, /trigp, 
  /trigc, /trigpc, /gag, /hilite, /partial, /hook, and /bind commands.  

  See: macros, triggers, patterns, hooks, priority, evaluation, attributes, 
  /undef, /undefn, /purge, /list, /save, /load 

@builtins
@commands
@index

index

  Commands marked with '+' are new in the current version.  Commands marked 
  with '*' have changed in the current version.  

     ADDWORLD       EXPR           LIST           RECORDLINE     TRIGGER       
     BAMF           FG            *LISTSOCKETS    SAVE           UNBIND        
     BEEP           FOR            LISTWORLDS     SAVEWORLD      UNDEF         
    *BIND           GAG            LOAD           SEND           UNDEFN        
     BREAK          GETFILE       +LOCALECHO      SET            UNDEFT        
     CAT            GRAB           LOG            SETENV         UNHOOK        
     CHANGES        HELP           NOHILITE       SH             UNSET         
    *CONNECT        HILITE         PARTIAL        SHIFT          UNTRIG        
     DC             HISTSIZE       PASTE          SUB            UNWORLD       
    *DEF            HOOK          *PS             SUBSTITUTE     VERSION       
     DOKEY          IF             PURGE          SUSPEND        WATCHDOG      
     ECHO           INPUT          PURGEWORLD     TELNET         WATCHNAME     
     EDIT           KILL           PUTFILE        TEST           WHILE         
     ESCAPE         LCD            QUIT           TIME           WORLD         
    *EVAL/NOT       LET           *QUOTE          TOGGLE                       
     EXPORT         list commands  RECALL         TRIG                         

  See also: intro, topics 

@/dokey

/dokey

  Usage: 

  /DOKEY <name>
  ___________________________________________________________________________

  Executes the function of the edit key <name>.  Most of the edit key 
  functions are not meaningful when the /dokey command is executed from the 
  regular command line, but are intended to be called from a keybinding 
  created with /bind or /def -b.  


    Name          Default binding   Function
    ----          ---------------   --------
#bs
#backspace
#bspc
    BSPC          (stty), ^H, ^?    Backspace
#bword
    BWORD         (stty), ^W        Delete previous word
#dline
    DLINE         (stty), ^U        Delete entire line
#refresh
    REFRESH       (stty), ^R        Refresh line
#lnext
    LNEXT         (stty), ^V        Ignore any binding next key might have
#

#up
    UP            (termcap), ^[[A   Cursor up
#down
    DOWN          (termcap), ^[[B   Cursor down
#right
    RIGHT         (termcap), ^[[C   Cursor right
#left
    LEFT          (termcap), ^[[D   Cursor left
#

#return
#newline
    NEWLINE       ^J, ^M            Execute current line
#recallb</a
    RECALLB       ^P                Recall previous input line
#recallf
    RECALLF       ^N                Recall next input line
#recallbeg
    RECALLBEG     ^[<               Recall first input line
#recallend
    RECALLEND     ^[>               Recall last input line
#searchb
    SEARCHB       ^[p               Search backward in input history
#searchf
    SEARCHF       ^[n               Search forward in input history
#socketb
    SOCKETB       ^[b               Switch to previous socket
#socketf
    SOCKETF       ^[f               Switch to next socket
#dword
    DWORD         ^[d               Delete word
#del
#delete
#dch
    DCH           ^D                Delete character under cursor
#redraw
    REDRAW        ^L                Clear/redraw screen
#home
    HOME          ^A                Go to beginning of line
#end
    END           ^E                Go to end of line
#wleft
    WLEFT         ^B                Go left, to beginning of word
#wright
    WRIGHT        ^F                Go right, to end of word
#deol
    DEOL          ^K                Delete from cursor to end of line
#page
    PAGE          ^I                Scroll 1 page ("more")
#hpage
    HPAGE         ^[h               Scroll half page ("more")
#line
    LINE          ^[l               Scroll 1 line ("more")
#flush
    FLUSH         ^[j               Discard all queued lines. 
#selflush
    SELFLUSH      ^[J               Discard queued lines without attributes. 

#

  A default of "(stty)" means the key sequence is that used by your terminal 
  driver.  A default of "(termcap)" means the key sequence is that given in 
  the termcap entry for %TERM.  

  The return value of /dokey depends on the function.  The movement and 
  deletion functions return the new position of the cursor.  The return 
  values of other functions aren't very useful.  

  Warning: TF will become essentially useless if there is no key bound to 
  "/dokey NEWLINE".  

  See "keybindings" for a complete list of keybindings.  

  Example: 

    /bind ^? = /dokey BSPC
    /bind ^H = /dokey BSPC

  Both ^H and DEL could then be used to do backspacing (this is already done 
  by default).  

  See: keybindings, general, sockets, history, /bind, /more 

@/echo

/echo

  Usage: 

  /ECHO [-a<attrs>] [-e] [-w[<world>]] <text>
  ___________________________________________________________________________

  Displays <text> on the tfout stream (i.e., the screen, usually), unless 
  otherwise redirected by options.  

  Options: 

  -a<attrs> 
          Echo <text> with the attributes given by <attrs>.  
  -w<world> 
          Echo <text> to the <world> stream instead of the default tfout 
          stream (see tfio).  If "-w" is given with no <world>, the current 
          world is assumed.  
  -e      Echo <text> to the tferr stream, instead of the default 
          tfout stream (see tfio).  

  Remember that "-" by itself can be used to mark the end of options, in case 
  <text> begins with "-".  See: options.  

  See: attributes, worlds, echo(), tfio 

@/edit

/edit

  Usage: 

  /EDIT [<options>] [<name>] [= <body>]
  ___________________________________________________________________________

  Edits a currently existing macro or the trigger associated with a macro.  
  Options are described under "def".  The name of the macro must be specified 
  and cannot be changed, with the following two exceptions: 

  1.  The macro name can be specified as "#<num>" where <num> is the number 
  of the macro instead of the name.  A macro number can be determined by 
  listing the macro with /list.  

  2.  The macro name can be specified as "$<pattern>" where <pattern> is the 
  trigger pattern.  You may still change the pattern if this is used to 
  locate the macro.  

  In either case, the name cannot be changed.  It is possible to create a 
  macro which changes the name of a macro, if it does not have any options 
  other than a name and a body: 

  /def rename = /def %2 = $%1%; /undef %1 

  How this works is discussed in the help section "expansion".  

  The -i flag will be cleared from the macro if it is not explicitly given 
  with /edit.  It is not possible to clear the -F option.  The -t, -w, and -T 
  options also can not be cleared, but their arguments can be changed.  Any 
  options that are not specified with /edit will remain unchanged (with the 
  exception of -i).  

  Example: 

  /def -p2 -t"* has arrived." -ah greet = :greets %1
  /edit -c0 greet 

  The second command will change the probability of /greet's trigger from 
  100% to 0%, effectively turning it off without actually undefining it.  

  See: macros, triggers, patterns, evaluation, attributes, /def, /list 

@/escape

/escape

  Usage: 

  /ESCAPE <metacharacters> <string>
  ___________________________________________________________________________

  Echoes <string>, but any <metacharacters> contained in <string> will 
  preceeded by a '\' character.  

  Example: 

  /def blue = /def -aCblue -t"$(/escape " %*)"
  /blue * pages, "*" 

  When the second command executes, it will expand to: 

  /def -aCblue -t"* pages, \"*\"" 

  See: evaluation 

@/not
@/eval

/eval

  Usage: 

  /EVAL [-s<level>] <command>
  /NOT [-s<level>] <command>
  ___________________________________________________________________________

  Macro body expansion is performed on <command>, and <command> is executed.  
  The return value of /eval is that of <command>; the return value of /not is 
  the logical negation of the return value of <command>.  

  Positional parameters (%1, etc) are inherited from the caller.  

  Options: 

  -s<level> 
          Expands the <command> as if %{sub} were set to <level>.  By 
          default, /eval expands the <command> as if %{sub} were "full", and 
          echoes it if %{mecho} is not "off".  

  Note: calling /eval with arguments from a trigger could be dangerous.  If 
  not written carefully, such a trigger could allow anyone with access to the 
  server to gain access to your tf or shell account (if they have not been 
  /restricted).  

  Example:
  command: /def showvar = /eval /echo %{1} is %%{%{1}}. 
  command: /showvar borg
  output: borg is on. 

  "/Eval -s0" can be useful when the argument is generated by an expansion.  
  For example, if you defined "/def do = %{*}, and then called "/do /echo 
  test", it would send "/echo test" to the server instead of executing it as 
  a tf command.  But if you defined "/def do = /eval -s0 %{*}", then "/do 
  /echo test" would execute "/echo test" as a tf command.  

  Note: Instead of /not, you should normally use the "/!<command>" syntax to 
  execute "/<command>" and negate its result.  /not evaluates its arguments, 
  which may be undesirable.  

  See: evaluation 

@/export

/export

  Usage: 

  /EXPORT <variable>
  ___________________________________________________________________________

  If <variable> is a global variable, it becomes an environment variable.  
  This makes <variable> available to the environment for "/sh" and "/quote 
  !".  

  Local variables may not be exported.  

  See: environment, variables, /setenv 

@/expr

/expr

  Usage: 

  /EXPR <expression>
  ___________________________________________________________________________

  Evaluates <expression> and prints its value.  This is a shorthand for 
  "/eval /echo -- $$[<expression>]".  

  Example: 

  command: /set x=4
  command: /expr x * 2
  output: 8

  See: expressions 

@/bg
@/fg

/fg

  Usage: 

  /FG [-ns<>] [<world>]
  /BG
  ___________________________________________________________________________

  Bring the socket associated with <world> into the foreground.  The <world> 
  must already be connected with the /connect command.  

  Options: 

  -n      no socket: put all sockets in the background.  
  -s      silent: don't print error messages on failure.  
  -<      previous socket in cycle.  
  ->      next socket in cycle.  
  -l      ignored.  
  -q      ignored.  

  /fg returns 0 on failure, nonzero otherwise.  

  If successful, /fg invokes the WORLD hook, which by default echoes "---- 
  World <world> ----" or "---- No world ----".  

  /bg puts all sockets in the background, and is equivalent to /fg -n.  

  See: /connect, worlds, sockets 

@/for

/for

  Usage: 

  /FOR <variable> <start> <end> <commands>
  ___________________________________________________________________________

  The <variable> will take on all numeric values between <start> and <end>, 
  inclusive.  The <commands> will be executed once for each of the values.  
  If <end> is less then <start>, <commands> will not be executed.  

  Example: 

  "/for i 0 9 say $[10 - i]" would cause you to execute the commands "say 
  10", "say 9", ...  "say 1".  

  See: /while 

@/gag

/gag

  Usage: 

  /GAG [<pattern> [=<response>]]
  ___________________________________________________________________________

  Creates a macro which will trigger on text matching <pattern> and prevent 
  it from being displayed, optionally executing <response>.  

  With no arguments, /gag sets the flag %{gag} to 1 (on).  This flag enables 
  the gag attribute on triggers.  It is on by default.  

  The matching style of the gag pattern is determined by %{matching}.  The 
  priority of the gag is determined by %{gpri}.  These variables are examined 
  when the gag is defined, not when it is executed.  

  Gagged lines from background worlds will not set the activity indicator on 
  the status line or call the activity hook.  

  If /gag does not create a new macro, it returns 0.  Otherwise, it returns 
  the number of the new macro (useful in /undefn and /edit).  

  /gag <pattern> [= <response>]
  is equivalent to
  /def -ag -t"<pattern>" [= <response>]. 

  See: triggers, patterns, evaluation, %gag, /def, /nogag 

@download
@/getfile_MUCK
@/getfile_LP
@/getfile_UNIX
@/getfile

/getfile

  Usage: 

  /REQUIRE filexfer.tf

  /GETFILE_MUCK <file> [<remote-file>]
  /GETFILE_LP <file> [<remote-file>]
  /GETFILE_UNIX <file> [<remote-file>]
  ___________________________________________________________________________

  Downloads text <remote-file> from a MUCK, LP, or remote UNIX shell to 
  <file> on the local host.  If <remote-file> is omitted, <file> is used as 
  the name on both ends.  Do not use "wildcard" globbing characters in the 
  file names.  

  When using /getfile_UNIX, an extra line of garbage may appear at the 
  beginning of the downloaded file unless you first disable remote echo with 
  "stty -echo".  

  Bug: if there is a log open for the current world, it will be closed by 
  /getfile.  

  See: /putfile, /log 

@/grab

/grab

  Usage: 

  /GRAB <text>
  ___________________________________________________________________________

  This command puts <text> into the input buffer.  It is not really useful 
  from the normal command line, but is quite useful when called from a macro 
  to redefine macros, or perhaps when bound to a key to speed up part of a 
  line (macros allow you to largely do what this would allow, however).  Any 
  text already in the input buffer is discarded.  

  Example: 

    /def reedit = /grab /edit %1 = $%1

  If you had previously done "/def flail = :flails at his keyboard", the 
  command "/reedit flail" would place "/edit flail = :flails at his keyboard" 
  in the input buffer and allow you to edit it using the editing keys.  See 
  "evaluation" for details on how macros like this work.  

  See: /input, general 

@/man
@/help

/help

  Usage: 

  /HELP [<topic>]
  ___________________________________________________________________________

  Displays help on the topic specified, or displays a quick summary of 
  available topics if no topic is given.  

  The variable %TFHELP must contain the name of the helpfile.  It is set when 
  TF is installed, and should not normally be changed.  If the helpfile or 
  the help index is not found, /help will not function.  The help file is in 
  human-readable format, so can be read or printed offline.  

  Commands are described with the format "/COMMAND arguments".  Words in all 
  caps must be spelled exactly as shown.  Arguments in <italics> (html 
  format) or <angle brackets> (/help format) can be given any value.  
  Arguments in [square brackets] may be omitted.  The character | means "or".  
  For example, "[OFF|ON]" means you may type "off", "on", or nothing.  

#html
  The help document is also available in html form at 
  http://tf.tcp.com/~hawkeye/tf/help/.  
#

  See: index, intro, options 

@/highlight
@/hilite

/hilite

  Usage: 

  /HILITE [<pattern> [= <response>]]
  ___________________________________________________________________________

  Creates a macro which will trigger on text matching <pattern> and display 
  it with the hilite attribute, optionally executing <response>.  

  With no arguments, /hilite sets the flag %{hilite} to 1 (on).  This flag 
  enables hilite and other attributes on triggers.  It is on by default.  

  The attribute(s) for hilited text are determined by the %{hiliteattr} 
  variable.  The default is bold (hiliteattr=B).  Colors are also available 
  (e.g., hiliteattr=Cgreen); see "attributes" and "color" for more 
  information.  

  The matching style of the hilite pattern is determined by %{matching}.  The 
  priority of the hilite is determined by %{hpri}.  These variables are 
  examined when the hilite is defined, not when it is executed.  

  If /hilite does not create a new macro, it returns 0.  Otherwise, it 
  returns the number of the new macro (useful in /undefn and /edit).  

  The standard library also defines /hilite_page and /hilite_whisper which 
  hilite several different commonly used page and whisper formats.  

  /hilite <pattern> [=<response>]
  is equivalent to
  /def -ah -t"<pattern>" [=<response>]. 

  Example: 

    /hilite {*} tried to kill you!

  With the default settings, any line matching that pattern will appear bold.  

  See: triggers, patterns, attributes, /def, /nohilite, /partial 

@/histsize

/histsize

  Usage: 

  /HISTSIZE [-lig] [-w[<world>]] [<size>]
  ___________________________________________________________________________

  Options: 

  -l      local history 
  -i      input history 
  -g      global history (default) 
  -w<world> 
          world history 

  If <size> is not given, /histsize reports the maximum number of lines that 
  can be stored in the specified history.  

  If <size> is given, /histsize changes the maximum size of the specified 
  history to <size>.  If the new size is less than the old size, lines will 
  be lost.  If the new size is greater than the old size, then each 
  subsequent new line will be added to the history until the new size is 
  reached, instead of replacing existing lines.  

  /histsize returns 0 for failure, and the size of the history otherwise.  

  The %{histsize} variable can be used to set the default size of world 
  histories before they are created.  

  See: history, %histsize 

@/hook

/hook

  Usage: 

  /HOOK <event>[ <pattern>] [= <body>]
  /HOOK [OFF|ON]
  ___________________________________________________________________________

  Creates a macro which will execute <body> when <event> occurs and the 
  event's arguments match the optional <pattern>.  The <event> may be a 
  single event or a list of events separated by '|'.  If omitted, <pattern> 
  will default to "*".  

  /hook with no arguments displays the state of the %{hook} flag.  /hook with 
  an argument of ON or OFF sets the %{hook} flag, which determines if hooks 
  will execute their associated macros.  

  The matching style of the hook pattern is determined by %{matching}.  This 
  variable is examined when the hook is defined, not when it is executed.  

  Defining a hook will not replace an existing hook on the same event, but 
  rather creates an additional hook macro on the event.  The macro or macros 
  to be executed are chosen by the normal priority rules.  

  See the section "hooks" for details on hook operation, a list of event 
  names, and examples.  

  If /hook does not create a new macro, it returns 0.  Otherwise, it returns 
  the number of the new macro (useful in /undefn and /edit).  

  /hook <event>[ <pattern>] [=<response>]
  is equivalent to
  /def -h"<event>[ <pattern>]" [=<response>]. 

  Example: 

    /hook MAIL = /sh elm

  will automatically invoke "elm" to read mail when it arrives.  

  See: hooks, macros, evaluation, patterns, /def, /unhook 

@/if
@/then
@/elseif
@/else
@/endif
@/if

/if

  Usage: 

  /IF (expr) list [ /ELSEIF (expr) list ]...  [ /ELSE list ] /ENDIF
  /IF list /THEN list [ /ELSEIF list /THEN list ]...  [ /ELSE list ] /ENDIF
  ___________________________________________________________________________

  <List> is any list of commands.  The return value of a <list> is the return 
  value of the last command executed in the <list>.  Note that each <list> 
  must be terminated by "%;".  

  <expr> is any expression, and must be surrounded by parentheses.  

  The <list> or <expr> following the /IF is executed or evaluated.  If the 
  result is non-zero, the next <list> is executed.  Otherwise, this is 
  repeated for each /ELSEIF.  If none of the /IF or /ELSEIF <list>s or 
  <expr>s return non-zero, the /ELSE <list> is executed if there is one.  

  The return value of the /IF.../ENDIF statement is the return value of the 
  last <expr> evaluated or <list> executed.  

  /IF (expr) body%; /ENDIF 
  is equivalent to
  /IF /TEST expr%; /THEN body%; /ENDIF 

  When /IF is used on the command line, "%;" command separation is done even 
  if %sub=off.  Of course, full substitution will be done if %sub=full.  

  Example: 

    /if (TERM !~ "dumb") /visual on%; /endif

  will do "/visual on" if your %{TERM} is not "dumb".  

  See: evaluation, expressions, /test 

@builtins
@commands
@index

index

  Commands marked with '+' are new in the current version.  Commands marked 
  with '*' have changed in the current version.  

   ADDWORLD       EXPR           LIST           RECORDLINE     TRIGGER       
   BAMF           FG            *LISTSOCKETS    SAVE           UNBIND        
   BEEP           FOR            LISTWORLDS     SAVEWORLD      UNDEF         
  *BIND           GAG            LOAD           SEND           UNDEFN        
   BREAK          GETFILE       +LOCALECHO      SET            UNDEFT        
   CAT            GRAB           LOG            SETENV         UNHOOK        
   CHANGES        HELP           NOHILITE       SH             UNSET         
  *CONNECT        HILITE         PARTIAL        SHIFT          UNTRIG        
   DC             HISTSIZE       PASTE          SUB            UNWORLD       
  *DEF            HOOK          *PS             SUBSTITUTE     VERSION       
   DOKEY          IF             PURGE          SUSPEND        WATCHDOG      
  *ECHO           INPUT          PURGEWORLD     TELNET         WATCHNAME     
   EDIT           KILL           PUTFILE        TEST           WHILE         
   ESCAPE         LCD            QUIT           TIME           WORLD         
  *EVAL/NOT       LET           *QUOTE          TOGGLE                       
   EXPORT         list commands  RECALL         TRIG                         

  See also: intro, topics 

@/input

/input

  Usage: 

  /INPUT <text>
  ___________________________________________________________________________

  Enters <text> into the input buffer as if it had been typed at the 
  keyboard, without deleting the current contents of the input buffer.  

  /Input is perhaps most useful in combination with /bind, to create short 
  key sequences that expand to longer text.  For example, if you have this 
  binding: 

  /bind ^[oj = /input OliverJones 

  and then type "page ^[oj = snausages!" at the keyboard, it will appear in 
  the input window as "page OliverJones = snausages!".  

  See: /bind, /grab 

@/ismacro

/ismacro

  Usage: 

  /ISMACRO <macro-options>
  ___________________________________________________________________________

  If <macro-options> matches one or more existing macros, /ismacro returns 
  the number of the last matching macro; otherwise, /ismacro returns 0.  
  <Macro-options> may include any of the options accepted by /list.  If -m is 
  not specified, %{matching} is used.  

  Example: 

    /if /!ismacro -b"^X*"%; /then /bind ^X = /foobar%; /endif

  See: /list, macros 

@/kill

/kill

  Usage: 

  /KILL <pid>... 
  ___________________________________________________________________________

  For each <pid> given, /kill terminates the corresponding process (/quote or 
  /repeat command).  The pid of a process can be determined from the return 
  value of the /quote or /repeat, the /ps command, or a PROCESS hook.  

  See: processes, /quote, /repeat, /ps 

@/cd
@/pwd
@/lcd

/lcd

  Usage: 

  /LCD [<dir>]
  /CD [<dir>]
  /PWD
  ___________________________________________________________________________

  /lcd and /cd change to a new working directory.  If <dir> is omitted with 
  /lcd, the current directory is displayed (if supported on your system).  If 
  <dir> is omitted with /cd, %{HOME} is assumed.  

  The <dir> name is expanded as described under "filenames".  

  /pwd displays the current working directory (if supported on your system).  

@/let

/let

  Usage: 

  /LET <name>=<value>
  /LET <name> <value>
  ___________________________________________________________________________

  Assigns <value> to variable <name> in the current local level.  Can only be 
  used during macro expansion.  The variable will be destroyed when the scope 
  (expansion level) in which it was created exits.  

  Note to lisp users: this is nothing like lisp's let.  

  See: /set, variables 

@/listbind
@/listdef
@/listgag
@/listhilite
@/listhook
@/listtrig
@/list

/list

  Usage: 

  /LIST [-s] [<macro-options>] [<name>] [= <body>]
  ___________________________________________________________________________

  Lists macros having all the specified options.  Except for "-s", each 
  option is compared against a macro's option, and the macro selected only if 
  the options match.  Omitted options are "don't care", and will not be used 
  in the comparison.  Thus, with no arguments, /list will list all 
  non-invisible macros.  

#list options
  Options: 

  -s      List macros in short format.  Must be first option.  
  -m<matching> 
          Determines matching style used for comparison of string fields 
          (trigger, binding, hook, worldtype, name, and body).  This is NOT 
          compared against the -m options of other macros.  If omitted, the 
          style is determined by %{matching}.  
  -t<pattern> 
          Matches macros with triggers matching <pattern>.  "-t" with no 
          pattern matches all non-empty triggers; a "{}" glob pattern or "^$" 
          regexp can be used to match empty triggers (i.e., no trigger).  
  -b<pattern> 
          Matches macros with bindings matching <pattern>.  "-b" with no 
          pattern matches all non-empty bindings; a "{}" glob pattern or "^$" 
          regexp can be used to match empty bindings (i.e., no binding).  
  -h<pattern> 
          Matches macros with hooks matching <pattern>.  "-h" by itself 
          matches all non-empty hooks; "-h0" matches only macros without 
          hooks.  
  -a<attrs> 
          Matches macros having one or more of the display attributes in 
          <attrs>.  
  -i      Matches invisible macros as well as normal macros.  
  -I      Matches only invisible macros.  
  <name>  A pattern that macro names must match.  The glob pattern 
          "{}" or regexp "^$" will match only macros without names.  
  = <body> 
          <body> is a pattern that macro bodies must match.  The glob pattern 
          "{}", or the regexp "^$" or the simple pattern "" will match 
          bodyless macros only.  

#

  The -p, -c, -F, and -n options are strightforward comparisons.  

  The return value of /list is the number of the last macro listed, or 0 if 
  no macros were listed (because of error or none matched the specified 
  options).  

  The standard library also defines the macros /listbind, /listdef, /listgag, 
  /listhilite, /listfullhilite, /listpartial, /listhook, and /listtrig, which 
  list macros of the appropriate type.  

  Example: 

      /list -mregexp -n0 -t -aurfdh ^foo =

  will list all macros whose names begin with "foo"; have a trigger; are not 
  multi-shots; have any of the underline, reverse, flash, dim, or hilite 
  attributes; and have an empty body.  

  See: macros, triggers, patterns, attributes, library, /def 

@/car
@/cdr
@/cadr
@/cddr
@/caddr
@/cdddr
@/length
@/reverse
@/mapcar
@/maplist
@/remove
@/unique
@lisp
@lisp.tf
@list
@list commands

list commands

  Usage: 

  /REQUIRE lisp.tf
  ___________________________________________________________________________

  These commands operate on lists of words, and are similar to those in lisp.  
  They all give their results with /echo, and are intended to be used in 
  $(...) command substitution to capture the result.  

  /car <list> 
          Echo first word.  (Same as /first).  
  /cdr <list> 
          Echo all words after first.  (Same as /rest).  
  /cadr <list> 
          Echo second word.  
  /cddr <list> 
          Echo all words after second.  
  /caddr <list> 
          Echo third word.  
  /cdddr <list> 
          Echo all words after third.  

  /length <list> 
          Echo number of words in <list>.  

  /reverse <list> 
          Reverse the order of the words in <list>.  

  /mapcar <cmd> <list> 
          Execute "<cmd> <word>" for each word in <list>.  
  /maplist <cmd> <list> 
          Execute "<cmd> <list>" repeatedly, removing the first word from 
          <list> each time, until <list> is empty.  

  /remove <word> <list> 
          Echo <list> with all occurrances of <word> removed.  

  /unique <list> 
          Remove all duplicate words from <list>.  Note: /unique is very slow 
          on long lists.  

  See: /nth 

@/listsockets

/listsockets

  Usage: 

  /LISTSOCKETS
  ___________________________________________________________________________

  Options: 

  -s      short form, list only world names 

  Lists the sockets to which Fugue is connected.  The output will look 
  something like this (unless the -s option is given): 

       LINES IDLE TYPE      NAME            HOST                       PORT
          48  13h tiny.muck Cave            tcp.com                    2283
  *  foregnd   1m tiny.mush DeepSeas        muds.okstate.edu           6250
        none   7s telnet    whitehouse.gov, whitehouse.gov             smtp
  ?     none  15s tiny      SlowMUD         slow.machine.com           4201

  The columns and their meanings are: 

  unlabeled first column 
          "*" marks the current socket.  
  unlabeled second column 
          the state of the socket is "!" for dead, "?" for pending, "@" for 
          an established proxy connection, or blank for a normal established 
          connection.  
  LINES   for a background socket, the number of unseen lines; for a 
          foreground socket, "foregnd".  
  IDLE    how long since the last text was received on the socket.  
  TYPE    the type of the world (set with /addworld -T).  
  NAME    the name of the world associated with the socket.  
  HOST    the host to which the socket is connected.  
  PORT    the port to which the socket is connected.  

  The return value of /listsockets is the number of open sockets.  

  See: sockets, %background, /connect, /fg, idle() 

@/listworlds

/listworlds

  Usage: 

  /LISTWORLDS [-c] [<pattern>]
  ___________________________________________________________________________

  Lists the worlds Fugue knows about, and also displays the default character 
  name.  Passwords are not displayed unless the -c option is given.  The 
  matching style used by <pattern> is determined by %{matching}.  

  The return value of /listworlds is the number of worlds listed.  

  See: worlds, patterns 

@/loadbind
@/loaddef
@/loadgag
@/loadhilite
@/loadhook
@/loadtrig
@/require
@/load

/load

  Usage: 

  /LOAD <file>
  /REQUIRE <file>
  ___________________________________________________________________________

  Reads and executes commands from <file>.  /Load and /require are identical, 
  except that if <file> is a library file and has already been read once, 
  /require will not read it again.  

  The file may contain any legal TinyFugue commands.  Blank lines and lines 
  beginning with ';' are ignored.  Any leading whitespace on a line is 
  stripped.  Any line ending in '\' will have the following line joined to 
  it.  A '%' preceding a '\' eliminates its special meaning.  

  The <file> name is expanded as described under "filenames".  

  If the expanded filename is not an absolute path name, TF will search first 
  in the current directory (which can be changed with /lcd), and then in 
  %{TFLIBDIR}.  If the COMPRESS_SUFFIX and COMPRESS_READ macros are defined, 
  the file will be automatically uncompressed if needed.  

  Loaded files may be given any name, but names ending in ".tf" are 
  recommended.  

  The standard macro library also defines the commands /loaddef, /loadbind, 
  /loadhilite, /loadgag, /loadtrig, and /loadhook.  These macros will load 
  from a default file if no file is specified.  

  See: macros, library, /def, /save, /require, /lcd, filenames 

@%always_echo
@always_echo
@/localecho

/localecho

  Usage: 

  /LOCALECHO [ON|OFF]
  ___________________________________________________________________________

  /Localecho manipulates the state of the TELNET ECHO option.  With no 
  arguments, /localecho does nothing, and returns 0 if TF is not echoing its 
  input, or nonzero if tf is echoing input.  TF echoes its input by default, 
  unless the server has negotiated otherwise.  

  ON and OFF are ignored and /localecho returns 0 if the server is not known 
  to support TELNET protocol.  ON tells the server DONT ECHO; if the server 
  acknowledges (as it must according to TELNET protocol), tf will echo its 
  own input.  OFF tells the server to DO ECHO; if the server acknowledges, tf 
  will not echo its own input, expecting the server to do it.  Note that tf 
  does not transmit input until a newline is pressed, and the server can not 
  echo it until it is received.  

  Some mud servers use the ECHO option to disable local echo during password 
  entry.  Telnet servers, however, try to disable local echo for the entire 
  session, which would interfere with many useful tf features.  Hooks defined 
  in the standard library use /localecho to override the telnet server 
  automatically.  

  /Localecho is intended to be called by library macros, and should not need 
  to be called by the user.  /Localecho obsoletes %{always_echo}.  

  The TELNET ECHO option is defined in RFC 857.  

  See: prompts, %telopt, /telnet 

@/log

/log

  Usage: 

  /LOG [-ligw[<world>]] [OFF|ON|<file>]
  ___________________________________________________________________________

  Enables, disables, or lists log files.  An [-ligw] option specifies which 
  history is used; the [OFF|ON|<file>] argument specifies what action is 
  taken on that history.  

  Options: 

  -w<world> 
          Output from <world> only.  
  -w      Output from the foreground world.  
  -l      Local output (i.e., output generated by TF).  
  -i      Keyboard input.  
  -g      Global output (all worlds and local TF output).  

  Arguments: 

  OFF     Disable specified log, or all logs if unspecified.  
  ON      Log to ${LOGFILE}; -g is assumed if -ligw not given.  
  <file>  Log to <file>; -g is assumed if -ligw not given.  
  (none)  With no option, lists all open logs.  
  (none)  With an -ligw option, same as "ON".  

  It is possible to have multiple log files open simultaneously.  It is also 
  possible to have several types of output go to the same log file, by using 
  several /log commands.  For example, 

    /log -i tt.log
    /log -wTT tt.log
    /log -g on

  will send input from the keyboard and output from the world TT to the file 
  "tt.log", and also send all (global) output to the file named by the 
  LOGFILE macro.  

  The functions of the /logme command in older versions of TF can be 
  performed with /log -i.  

  Wrapping will be done in the log file only if the %{wraplog} variable is 
  "on".  

  Logging is disabled by default.  The default value of ${LOGFILE} is 
  "tiny.log".  

  See: %wraplog 

@/logme

/logme

  Obsolete.  See "log".  

@scroll
@pager
@/more

/more

  Usage: 

  /MORE [OFF|ON]
  ___________________________________________________________________________

  Sets the value of the %{more} flag.  If the %{more} flag is ON when the 
  screen or output window fills up, output will stop, and a --More-- prompt 
  will be displayed.  With the default keybindings, TAB will scroll one 
  screenfull, ^[h will scroll a Half screen, ^[l will scroll one Line, and 
  ^[j will Jump to the end of the text, skipping all text which has been 
  received but not yet displayed.  

  In visual mode, if there are more than 20 logical lines pending, the number 
  of lines is displayed with the More prompt.  To avoid "spamming", the 
  number is not updated for every new line, but only in increments of 20 or 
  when the screen is updated for some other reason.  If the number of pending 
  lines is 10000 or more, no number will be displayed and the prompt will 
  just say "MuchMore".  

  If your terminal can't scroll in visual mode, TF will start over at the top 
  of the output window instead.  

  See: /dokey, %more, moresize() 

@/nogag

/nogag

  Usage: 

  /NOGAG [<pattern>]
  ___________________________________________________________________________

  Eliminates a macro that is triggered by <pattern> and has the gag 
  attribute.  /nogag with no arguments turns off the flag %{gag}, disabling 
  all gag attributes.  <Pattern> is matched against exisiting patterns using 
  simple comparison.  

  The flag %{gag} defaults to 1 (on).  

  See: triggers, /gag, %gag 

@/nohilite

/nohilite

  Usage: 

  /NOHILITE [<pattern>]
  ___________________________________________________________________________

  Eliminates a macro that is triggered by <pattern> and has the hilite 
  attribute.  /nohilite with no arguments turns off the flag %{hilite}, 
  disabling all hilite attributes.  <Pattern> is matched against existing 
  patterns using simple comparison.  

  The flag %{hilite} defaults to 1 (on).  

  See: triggers, /hilite, %hilite 

@/first
@/last
@/nth

/nth

  Usage: 

  /FIRST <text>
  /LAST <text>
  /NTH <n> <text>
  ___________________________________________________________________________

  Echoes the first, last, or <n>th word from text.  `/first <text>' is 
  equivalent to `/nth 1 <text>'.  

  These commands can be useful in command substitutions.  For example, to 
  make `ESC 1' input the first word of the most recent mud output, you could 
  do this: 

  /bind ^[1 = /input $(/first $(/recall 1)) 

  See: parameters, command substitution 

@/partial

/partial

  Usage: 

  /PARTIAL <regexp>
  ___________________________________________________________________________

  Creates a macro which will hilite the part of a line containing text 
  matched by the regular expression <regexp>.  Remember that regular 
  expressions are case sensitive.  The new macro is a fall-thru, so multiple 
  /partials (and other triggers) can match the same text.  

  The attribute(s) for hilited text are determined by the %{hiliteattr} 
  variable.  The default is bold (hiliteattr=B).  Colors are also available.  

  For example, "/partial [Hh]awkeye" will hilite any occurrance of "Hawkeye" 
  or "hawkeye".  

  Unlike version 3.2, a partial hilite will be applied to every match on a 
  line, not just the first match.  

  /partial <regexp>
  is equivalent to
  /def -Ph -F -t<regexp>

  See: attributes, patterns, /hilite, /def 

@/endpaste
@/paste

/paste

  Usage: 

  /PASTE [<prefix>]
  /ENDPASTE
  ___________________________________________________________________________

  After executing /paste, every line of input (including lines that begin 
  with "/") will have <prefix> prepended to it and then get sent to the 
  current socket.  If <prefix> is omitted, it defaults to ":|".  Entering the 
  line "/endpaste" turns this off.  /Paste can be very useful when using the 
  cut-and-paste mechanism of many windowing systems.  

  Note that /endpaste is not actually a command, but a "magic cookie" 
  recognized by /paste.  "/Endpaste" and SIGINT (ctrl-c) are the only ways to 
  end /paste.  

  See: /quote 

@/prompt

/prompt

  Usage: 

  /PROMPT <text>
  ___________________________________________________________________________

  Sets the prompt for the current socket to <text>, replacing any existing 
  prompt.  /prompt is most useful when called from a PROMPT hook, like this: 

      /def -h"PROMPT *> " catch_prompt = /prompt %*

  Then, any text that ends in ">" without a newline will be made the prompt.  

  See: prompts, hooks (PROMPT) 

@/ps

/ps

  Usage: 

  /PS
  ___________________________________________________________________________

  Options: 

  -s      short form, lists only PIDs.  

  Lists information about currently running /quote and /repeat processes: 

  PID     unique process identification number.  
  NEXT    time remaining until next execution of process, or 
          "pending" if process is waiting for output from a shell command.  
  TYPE    /quote or /repeat.  
  DISP    disposition (echo, send, or exec) of /quote lines.  
  WORLD   world to which output is sent, if not the current world.  
  PTIME   delay between executions.  
  COUNT   number of /repeat executions remaining.  
  COMMAND 
          the command to be executed.  

  See: processes 

@/purgebind
@/purgedef
@/purgedeft
@/purgegag
@/purgehilite
@/purgehook
@/purgetrig
@/purge

/purge

  Usage: 

  /PURGE [<macro-options>] [<name>] [= <body>]
  ___________________________________________________________________________

  Removes all macros matching the specified restrictions.  The 
  <macro-options> are the same as those in the /list command; see "/list" for 
  details.  Invisible macros will not be purged unless "-i" is specified.  
  Remember that "macros" includes keybindings, hilites, gags, triggers, and 
  hooks.  

  The standard macro library also defines the commands /purgedef, /purgebind, 
  /purgehilite, /purgegag, /purgetrig, /purgedeft, and /purgehook, which 
  purge macros of the appropriate type.  These always use glob matching.  

  See: macros, triggers, patterns, attributes, library, /def, /list, 
  /purgeworld 

@/purgeworld

/purgeworld

  Usage: 

  /PURGEWORLD <pattern>
  ___________________________________________________________________________

  Purges all world entries matching <pattern>.  The pattern matching style is 
  determined by %{matching}.  

  See: worlds, patterns 

@upload
@/putfile_MUCK
@/putfile_UNIX
@/putfile_LP
@/putfile

/putfile

  Usage: 

  /REQUIRE filexfer.tf

  /PUTFILE_MUCK <file> [<remote-file>]
  /PUTFILE_LP <file> [<remote-file>]
  /PUTFILE_UNIX <file> [<remote-file>]
  ___________________________________________________________________________

  Uploads text <file> from the local system to <remote-file> on a MUCK, LP, 
  or UNIX server, using an editor on the remote system.  If <remote-file> is 
  omitted, <file> is used as the name of the remote file.  

  /Putfile_LP assumes the LPmud has an "ed" editor similar to that in UNIX.  

  For backward compatibility, /putfile is the same as /putfile_MUCK.  

  See: /getfile, /quote 

@/quit

/quit

  Usage: 

  /QUIT
  ___________________________________________________________________________

  Exits from TinyFugue.  All socket connections will be disconnected; all 
  logfiles will be closed; /quotes and /repeats will be killed; and all 
  history, unsaved macros, and variables will be lost.  

  See: /dc 

@/quote

/quote

  Usage: 

  /QUOTE [-d<disp>] [-w[<world>]] [-<time>] [<pre>] '"<file>"[<suf>]
  /QUOTE [-d<disp>] [-w[<world>]] [-<time>] [<pre>] !"<shell command>"[<suf>]
  /QUOTE [-d<disp>] [-w[<world>]] [-<time>] [<pre>] `"<TF command>"[<suf>]
  /QUOTE [-d<disp>] [-w[<world>]] [-<time>] [<pre>] #"<recall 
  command>"[<suf>]
  ___________________________________________________________________________

  /Quote generates lines of text, one for each line quoted from a file, shell 
  command, history, or TF command.  This will be done at a rate described in 
  the section "processes".  

  Options and arguments: 

  -d<disp> 
          disposition of generated text.  <Disp> is one of: "echo" (echo to 
          the screen), "send" (send directly to the socket), or "exec" 
          (execute text as a tf command).  The default <disp> is "send" if 
          there is no <pre>, and "exec" if there is a <pre>.  
  -w<world> 
          Commands will be executed with <world> as the current world.  If 
          <world> is blank, it uses the world that was current when the 
          /quote started.  If -w is omitted, the command's current world will 
          be whatever happens to be in the foreground when the command 
          occurs.  (See "sockets").  
  -<time> 
          The delay between each generated line.  It can have the format 
          "hh:mm:ss", "hh:mm", or "ss".  If -<time> is omitted, the variable 
          %{ptime} is used.  If <time> is given as the letter "S", the quote 
          will run synchronously with no delay (see "processes").  If a slow 
          shell command is used with /quote -S !, tf will hang until the 
          command produces some output or exits.  A synchronous /quote may be 
          used inside another /quote.  
  <pre>   <pre> is prefixed to each generated line.  If <pre> 
          contains any of the command characters ('!`#), they must be 
          preceded with '\' to remove their special meaning.  
  '<file> 
          Get text from <file>.  The <file> name is expanded as described 
          under /help filenames.  
  !<shell cmd> 
          Get text from the standard output and standard error of executing 
          <shell cmd> in the shell.  
  `<tf cmd> 
          Get text from the output of executing <tf cmd> in tf.  
  #<recall cmd> 
          Get text from executing a /recall command.  (See "recall" for the 
          exact syntax).  
  <suf>   <suf> is suffixed to each generated line.  If omitted, the 
          double quotes around the <file> or <command> may be omitted.  

  An asynchronous /quote returns the pid of the new process, or 0 if an error 
  occurred.  A synchronous shell or command quote returns the return value of 
  the command.  A synchronous file quote returns 0 on error, nonzero 
  otherwise.  

  The following is a list of some nearly equivilent pairs of commands: 

  /quote -S -dexec '<file> 
          /load <file> 
  /quote -S -decho #<args> 
          /recall <args> 
  /quote <opts> `/recall <args> 
          /quote <opts> #<args> 

  ___________________________________________________________________________

  Examples: 


    /quote -1 :reads about '"/usr/dict/words" in the dictionary. 

  This sends off lines like:
  :reads about aardvark in the dictionary. 
  :reads about aardvore in the dictionary. 
  with one-second delays between lines.  


    /quote -S /echo !ps -gux

  This displays the output of the system command "ps -gux" by echoing it 
  locally, immediately.  


    /quote -0 :heard: #-wCave /2 *pages*

  This sends off quickly: 

  :heard: [the last 2 lines from Cave that contain "pages"] 


    /quote :is using `/version

  will tell everybody in the room what version of TF you're running.  


    /quote -wlpmud -dsend 'prog.c

  will send the file "prog.c" to the world "lpmud" (without any 
  interpretation of leading spaces, lines like "/* comment */", etc.) 

  ___________________________________________________________________________

  See: processes, history, command subs, /load, /recall, /sh, /sys 

@/recall

/recall

  Usage: 

  /RECALL [-w<world>] [-ligt] [-a<attrs>] [-m<style>] [#]<range> [<pattern>]
  ___________________________________________________________________________

  Recalls lines from a history buffer.  

  Options: 

  -w      recall from current world's history (default) 
  -w<world> 
          recall from <world>'s history 
  -l      recall from local history (i.e., TF output) 
  -g      recall from global history (all worlds, and local) 
  -i      recall from input history 
  -t      display timestamps on each line, using %{time_format} 
  -v      recall lines that don't match the pattern 
  -a<attr> 
          suppress specified attributes (e.g., -ag shows gagged lines) 
  -m<style> 
          matching style (simple, glob, or regexp).  
  #       display line numbers (must be last option, before <range>) 

  <range> can have one of the formats below.  If <x> and <y> are plain 
  integers, they are interpreted as line numbers or counts.  If they have the 
  form "hh:mm" or "hh:mm:ss", they are interpreted as time values (either a 
  period of time, or a clock time within the last 24 hours).  

  /x      Recall the last <x> matching lines.  
  x       Recall from the last <x> lines, or lines within the last 
          time period <x>.  
  x-y     Recall lines starting with <x> and ending with <y>.  
  -y      If <y> is a line number, recall the <y>th previous line; if 
          <y> is a time, recall lines earlier than <y>.  Remember to use "--" 
          so "-<y>" isn't interpreted as an option.  
  x-      Recall lines after <x>.  

  If <range> is prefixed with "#", line numbers will be displayed.  

  If <pattern> is given, only lines in the given range that match <pattern> 
  will be recalled.  The matching style is determined by the -m option if 
  given, %{matching} otherwise.  

  If lines are received while tf is suspended (by ^Z or /suspend) or in a 
  subshell (by /sh), the timestamps on the lines will correspond to the time 
  tf resumed control, not the time they actually arrived.  

  The return value of /recall is the number of lines that were actually 
  recalled.  

  See: history, attributes, /quote, %time_format 

@/recordline

/recordline

  Usage: 

  /RECORDLINE [-lig] [-w<world>] [-t<time>] <text>
  ___________________________________________________________________________

  Records <text> into a history buffer.  The "-l" option selects local 
  history; "-i" selects input history; "-g" selects global history; and 
  "-w<world>" selects the history buffer for <world>.  If none of the -ligw 
  options are specified, -g is assumed.  The timestamp of the recorded line 
  will be the current time, unless overridden with "-t<time>"; <time> is 
  interpreted as a system time (e.g., seconds since 0:00:00 January 1 1970 
  GMT).  

  The <text> will not be echoed to the screen or saved in any log.  

  /Recordline can be combined with /quote to read a log file back into 
  history.  For example, if you had created a log with "/log -i input.log" in 
  an earlier tf session, you could start a new tf session and use 

  /quote -dexec /recordline -i 'input.log 

  to restore that input history.  That way, you could use the RECALLB, 
  RECALLF, RECALLBEG, RECALLEND, SEARCHB, and SEARCHF (^P, ^N, ^[<, ^[>, ^[P, 
  and ^[N) keys to recall lines you typed in the earlier session.  

  See: /recall, /quote, history 

@delay
@/repeat

/repeat

  Usage: 

  /REPEAT [-w[<world>] [-<time>] <count> <command>
  ___________________________________________________________________________

  Repeats <command>, <count> times.  <Command> may be any legal macro body.  
  This works through a process i.e.  it runs concurrently with normal input 
  and output.  

  If <time> is specified in the format "hh:mm:ss", "hh:mm", or "ss", it is 
  used as the delay between each line.  If <time> is given as the letter "S", 
  the repeat will run synchronously (see "processes").  Otherwise, the delay 
  between each line is determined by the variable %{ptime}.  

  Socket commands generated by /repeat will be sent to the foreground world 
  by default.  If -w<world> is given, commands will be sent to that world 
  instead.  If -w is given, commands will be sent to the world that was 
  current when the /repeat was started.  

  The body of the /repeat command undergoes macro body substitution when it 
  is executed.  

  An asynchronous /repeat returns the pid of the new process, or 0 if an 
  error occurred.  A synchronous /repeat returns the return value of the last 
  command.  

  Since the first run is not done until after the first interval (for an 
  asynchrounous /repeat), a useful trick is to use "/repeat -<time> 1 
  <command>" to delay the execution of a single command.  

  Example: Here's a technique to execute an infinite 30-minute repeat: 

      /def doodle_forever = /doodle%; /repeat -0:30 1 /doodle_forever

  See: processes, %ptime, /at 

@security
@/restrict

/restrict

  Usage: 

  /RESTRICT [SHELL|FILE|WORLD]
  ___________________________________________________________________________

  With no arguments, /restrict reports the current restriction level.  

  With an argument, /restrict sets the restriction level.  Once restriction 
  has been set to a particular level, it can not be lowered.  

  level 0: NONE 
          No restrictions.  
  level 1: SHELL 
          Prevents all access to shell or external commands.  Disables TF 
          builtins "/sh" and "/quote !", and uncompression during /load and 
          /help.  
  level 2: FILE 
          Prevents reading and writing of files.  Disables TF builtins 
          "/load", "/save", "/saveworld", "/log", and "/quote '", and 
          sockmload feature.  Implies /restrict shell.  
  level 3: WORLD 
          Disallows all new user-defined connections.  The TF builtins 
          /addworld and the "/connect <host> <port>" semantics are disabled.  
          Implies /restrict file.  

  /Restrict is typically placed in %{TFLIBDIR}/local.tf by an administrator 
  of a public copy of TF who wishes to restrict users' access.  

  Note that while I believe these options to be secure, I provide no warranty 
  to that effect.  

  See: warranty 

@mudwho
@/rwho

/rwho

  Usage: 

  /REQUIRE rwho.tf

  /RWHO
  /RWHO name=<player>
  /RWHO mud=<mud>
  ___________________________________________________________________________

  Gets a remote WHO list from a mudwho server.  The first form gives a 
  complete list, the other forms give partial lists.  Due to the short 
  timeout of the mudwho server, sometimes the complete list is sent even if 
  the second or third format is used (send complaints to the author or 
  maintainer of the mudwho server, not to me).  

  Make sure you /load rwho.tf _after_ you define your worlds, or rwho will be 
  the default world.  

@/savebind
@/savedef
@/savegag
@/savehilite
@/savehook
@/savetrig
@/save

/save

  Usage: 

  /SAVE [-a] <file> [<macro-options>] [<name>] [= <body>]
  ___________________________________________________________________________

  Saves specified macros to <file>.  The <macro-options> are the same as 
  those in /list command; see "/list" for details.  Invisible macros will not 
  be saved unless "-i" is specified.  

  If "-a" is specified, macros will be appended to <file>.  Otherwise, the 
  macros will overwrite any existing contents of <file>.  

  The return value of /save is the number of the last macro listed, or 0 if 
  no macros were listed (because of error or none matched the specified 
  options).  

  The standard macro library also defines the commands /savedef, /savebind, 
  /savehilite, /savegag, /savetrig, and /savehook.  These macros will save 
  macros of the appropriate type to a file.  If no file name is specified, a 
  default file name will be used.  

  I personally find it easier to write my macros with an editor and then 
  /load them in tf, instead of writing them in tf and /save'ing them to a 
  file.  Use whatever works best for you.  

  Note that when tf starts, it does not automatically read files created with 
  any of the /save commands.  To make it do so, add the corresponding /load 
  command to your .tfrc file.  

  See: macros, patterns, attributes, library, /def, /list, /load, /saveworld 

@/saveworld

/saveworld

  Usage: 

  /SAVEWORLD [-a] [<file>]
  ___________________________________________________________________________

  Saves world definitions to <file> if specified, otherwise from the file 
  named in the body of the WORLDFILE macro.  

  If "-a" is given, world definitions will be appended to <file>; otherwise, 
  the world definitions will replace any original contents of <file>.  

  Note that when tf starts, it does not automatically read files created with 
  /saveworld.  To make it do so, add the /loadworld command to your .tfrc 
  file.  

  See: worlds, library, /addworld, /load 

@/send

/send

  Usage: 

  /SEND [-W] [-w[<world>]] [-n] <text>
  ___________________________________________________________________________

  Sends <text> to <world>.  If "-W" is given, <text> is sent to all connected 
  worlds.  If "-W" and "-w" are omitted, <text> is sent to the current world.  

  If "-n" is given, the text will be transmitted without an end-of-line 
  marker (CR LF).  

  The /send command never executes a SEND hook.  

@/set

/set

  Usage: 

  /SET <name>=<value>
  /SET [<name> [<value>]]
  ___________________________________________________________________________

  In the first form, or with two arguments, /set will set the value of 
  variable <name> to <value>.  With one argument, /set will display the value 
  of variable <name>.  With no arguments, /set will display the value of all 
  internal variables.  If the first form is used, there should be no spaces 
  on either side of the '='.  

  Variable <name> will be an internal variable unless it has already been 
  defined as an environment variable.  

  Note: The variables 'L' and 'R' are reserved.  You should not assign values 
  to them.  

  See: variables, /setenv, /export, /let, /unset 

@/setenv

/setenv

  Usage: 

  /SETENV [<name> [<value>]]
  /SETENV <name>=<value>

  With two arguments, /setenv will set the value of <name> to <value> in the 
  environment.  With one argument, /setenv will display the value of <name>.  
  With no arguments, /setenv will display the value of all environment 
  variables.  If the second form is used, spaces around the '=' will not be 
  stripped.  

  If <name> was already defined as an internal variable, it will become an 
  environment variable.  

  See: variables, /set, /export 

@/sh

/sh

  Usage: 

  /SH [<command>]
  ___________________________________________________________________________

  If no command is given, /sh executes an interactive shell named by 
  %{SHELL}, or /bin/sh.  With a command, /sh will execute <command> in a 
  /bin/sh subshell.  The command is executed with a tty, so it may accept 
  input and may produce any output.  

  In visual mode, /sh will fix the screen first, and restore it after 
  executing the shell.  /Sys does not.  

  If the %{shpause} flag is on, Fugue will wait for a keypress before 
  returning.  

  Note: calling /sh with arguments from a trigger is very dangerous.  If not 
  written carefully, such a trigger could allow anyone with access to the 
  server to gain access to your shell account.  

  The return value of /sh is the exit status of the shell if it exited 
  normally, -1 otherwise.  Note that UNIX shell commands usually return 0 for 
  success and nonzero for failure.  

  See: /quote, /sys, utilities (/psh) 

@/shift

/shift

  Usage: 

  /SHIFT [n]
  ___________________________________________________________________________

  Shifts the positional parameters left by <n>.  That is, the positional 
  parameters %(n+1) ...  %# are renamed to %1 ...  %(#-n).  If <n> is 
  omitted, 1 is assumed.  

  /shift is useful only during macro expansion.  

  Example: 

    /def worlds = /while ({#}) /world %1%; /shift%; /done

  Then, the command "/worlds foo bar baz" would execute the commands "/world 
  foo", "/world bar", and "/world baz".  

  See: variables, evaluation, list commands 

@/signal

/signal

  Usage: 

  /SIGNAL [<sig>]
  ___________________________________________________________________________

  Sends signal <sig> to the tf process, or with no arguments, /signal lists 
  all valid signal names.  Valid signals usually include: HUP, INT, QUIT, 
  KILL, SEGV, TERM, USR1, USR2, and TSTP.  The complete list varies from 
  system to system.  

  INT (usually generated by typing ^C) will terminate any /WHILE loop and the 
  user will be prompted for the next action.  

  See: /suspend, getpid(), hooks (SIGHUP, SIGTERM, SIGUSR1, SIGUSR2) 

@/split

/split

  Usage: 

  /split <args>
  ___________________________________________________________________________

  Sets %{P1} to the substring of <args> before the first '=', and sets %{P2} 
  to the substring of <args> after the first '='.  If there is no '=' in 
  <args>, %{P1} will contain the entire string and %{P2} will be empty.  
  %{P0} will contain the entire string.  

  Spaces surrounding the '=' are stripped.  

  See: getopts() 

@/sub

/sub

  Usage: 

  /SUB [OFF|ON|FULL]
  ___________________________________________________________________________

  Sets the flag %{sub}.  

  If the flag %{sub} is OFF (0), all lines except for history substitutions 
  (line beginning with '^') and commands (/) are sent as-is to the socket.  

  If the flag %{sub} is ON (1), the sequences "%;" and "%\" are substituted 
  with newlines, and the sequence "%%" is substituted with "%", and the 
  sequence "\n" is substituted with the character with decimal ASCII code 
  <nn>.  

  If the flag %{sub} is FULL, text is processed just as if it were the body 
  of a macro (see "evaluation") called without any arguments.  This allows 
  you to have in-line macros in regular input.  

  The flag %{sub} defaults to 0 (off).  

  See: general, evaluation 

@/substitute

/substitute

  Usage: 

  /SUBSTITUTE <text>
  ___________________________________________________________________________

  When called from a trigger (directly or indirectly), the triggering text is 
  replaced with <text>.  After a /substitute, it will appear as if <text> 
  came from the socket; the original text is lost.  In particular, this means 
  when /substitute is called from a fall-thru trigger, triggers of lower 
  priority will be compared against <text> instead of the original text.  

  Example: 

  On a mud that uses MUFpage, you could set your #prepend string to 
  "##page>", and define a trigger like: 

    /def -ah -t"##page> *" hilite_mufpage = /substitute %-1

  This will match no matter what page format the sender uses, and strip off 
  the "##page>" so you never see it.  

  See: triggers 

@/suspend

/suspend

  Usage: 

  /SUSPEND
  ___________________________________________________________________________

  Suspends TF, if your system and shell support job control.  This has the 
  same effect as typing ^Z on most UNIX systems.  

  See: /signal 

@/sys

/sys

  Usage: 

  /SYS <shell-command>
  ___________________________________________________________________________

  Executes <shell-command>.  The command is executed without a tty, so it 
  should have no input, and its output, if any, should be plain text.  The 
  command's stdout and stderr are echoed to tf's output window.  /sys differs 
  from /sh in that /sys can not do an interactive shell command, but does not 
  redraw the screen or produce any extra messages.  

  Note: calling /sys with arguments from a trigger is dangerous.  If not 
  written carefully, such a trigger could allow anyone with access to the 
  server to gain access to your shell account.  

  The return value of /sys is the exit status of the shell if it exited 
  normally, -1 otherwise.  Note that UNIX shell commands usually return 0 for 
  success and nonzero for failure.  

  See: /sh, /quote 

@/telnet

/telnet

  Usage: 

  /TELNET <host> [<port>]
  ___________________________________________________________________________

  Connect to a line-based telnet host.  The telnet login port is used if 
  <port> is omitted.  

  Note that TF operates strictly in line-by-line mode, but telnetd (the 
  server running on the telnet login port) expects character-by- character 
  mode.  So, simple shell operations and anything else which is basically 
  line-by-line should work without much difficulty, but anything that tries 
  to control the screen or expects single keystroke input will not work.  
  /Telnet is somewhat useful, but not useful enough to alter the fundamental 
  line-by-line nature of TF.  If you want a general telnet client, you know 
  where to find it.  

  TF supports most of the TELNET protocol and the options ECHO (lets server 
  control echoing of input), SGA (suppress GOAHEAD), EOR (allows use of 
  END-OF-RECORD in prompts), and NAWS (allows TF to send window size 
  information to the server).  For information on TELNET protocol, see RFC 
  854 and 1123.  See also: prompts.  

  See: /addtelnet, /connect, %telopt 

@/test

/test

  Usage: 

  /TEST <expression>
  ___________________________________________________________________________

  /test evaluates the expression and returns its integer value (also setting 
  the special variable "%?").  A new variable scope is NOT created.  

  Named variables may be accessed by simply using their name (with no leading 
  '%').  This is called a variable reference.  

  Variable substitutions of the form "{var}" and "{var-default}" (with no 
  leading '%') may be used to access any variable (named or positional).  

  Variable substitutions beginning with '%' may also be used, but are not 
  recommended, as they can quickly get confusing if the /test is in a nested 
  macro evaluation.  The two methods described above are easier to use.  

  Before version 3.5, /test was frequently used as the condition of an /IF or 
  /WHILE statement.  This is no longer needed, since /IF and /WHILE can now 
  take an expression as a condition.  

  /test can also be useful for evaluating an expression for its side effects, 
  ignoring the return value.  For example, the command "/test kbdel(kbpoint() 
  - 1)" will perform a backspace, and "/test regmatch('foo(.*)', 'foobar')" 
  will assign "bar" to %P1.  

  Another use for /test is to set the return value of a macro, since a 
  macro's return value is that of the last command executed.  For example: 

       /def isalnum =  /test {*} =/ "[a-z0-9]"

  Side note: If this were written using a %-variable-substitution, like: 

       /def isalnum = /test "%*">%{*}" =/ "[a-z0-9]"

  and then /isalnum were called with a quote (") as an argument, the body 
  would expand to this: 

       /test """ =/ "[a-z0-9]"

  which would cause an expression error.  On the other hand, the 
  {}-variable-reference is not evaluated by the macro expansion, but by the 
  expression itself, so it does what is expected.  

  See: /if, /while, expressions, evaluation, variables 

@/time

/time

  Usage: 

  /TIME [<format>]
  ___________________________________________________________________________

  Displays the current time.  <Format> can be either "@" or a strftime() 
  format, as described under "ftime()".  If <format> is omitted, 
  %{time_format} is used.  

  See the strftime(3) man page for a description of <format>.  

  See: time(), ftime(), %TZ, %time_format, %clock, idle() 

@/toggle

/toggle

  Usage: 

  /TOGGLE <variable>
  ___________________________________________________________________________

  If <variable> has a value of 0, its value will be set to "1".  If 
  <variable> has a non-zero value, its value will be set to "0".  

  See: variables 

@/act
@/trigpc
@/trigp
@/trigc
@/trig

/trig

  Usage: 

  /TRIG <pattern> = <body>
  /TRIGP <pri> <pattern> = <body>
  /TRIGC <chance> <pattern> = <body>
  /TRIGPC <pri> <chance> <pattern> = <body>
  ___________________________________________________________________________

  Creates an unnamed macro that will trigger on <pattern> and execute <body>.  
  If <chance> is given with /trigc or /trigpc, it will be the percentage 
  probability of the trigger going off; default is 100%.  If <pri> is given 
  with /trigp or /trigpc, it will be the priority of the trigger; default is 
  0.  The matching style of the trigger is determined by the global variable 
  %{matching}.  

  If the command does not create a new macro, it returns 0.  Otherwise, it 
  returns the number of the new macro (useful in /undefn and /edit).  

  /trig is equivalent to: /def -t<pattern> = <body>. 
  /trigp is equivalent to: /def -p<pri> -t<pattern> = <body>. 
  /trigc is equivalent to: /def -c<chance> -t<pattern> = <body>. 
  /trigpc is equivalent to: /def -p<pri> -c<chance> -t<pattern> = <body>. 

  See: triggers, evaluation, patterns, /def, /untrig 

@/trigger

/trigger

  Usage: 

  /TRIGGER [-g] [-w[<world>]] <text>
  ___________________________________________________________________________

  Searches for and executes macros with triggers that match <text>, just as 
  if <text> had come from a socket.  The return value of /trigger is the 
  number of (non-quiet) macros that were executed.  

  Options: 

  -g      Match triggers that were not defined with /def -w ("global" 
          triggers).  
  -w<world> 
          Match triggers for <world>, or the current world if <world> is 
          omitted.  

  If no options are given, both -g and -w are assumed.  That is, <text> is 
  matched against global triggers and triggers for the current world.  

  See: triggers, /trig 

@/false
@/:
@/true

/true

  Usage: 

  /TRUE
  /FALSE
  ___________________________________________________________________________

  /True does nothing, and returns nonzero.  

  /False does nothing, and returns zero.  

  /: is the same as /true.  

@/unbind

/unbind

  Usage: 

  /UNBIND <sequence>
  ___________________________________________________________________________

  Removes a macro with the keybinding <sequence>.  

  See: general, /bind, /purge 

@/undef

/undef

  Usage: 

  /UNDEF <name>
  ___________________________________________________________________________

  Removes a macro with the name <name>.  

  See: macros, /def, /purge, /undefn, /undeft, /untrig, /unhook 

@/undefn

/undefn

  Usage: 

  /UNDEFN <number> ... 
  ___________________________________________________________________________

  Removes macros with the numbers specified in the arguments.  Macro numbers 
  can be determined with /list, or from the return value of the command used 
  to create the macro.  

  See: macros, /def, /list, /purge, /undef 

@/undeft

/undeft

  Usage: 

  /UNDEFT <trigger>
  ___________________________________________________________________________

  Removes a macro with a trigger associated with it that is triggered by the 
  pattern <trigger>.  <Trigger> is matched against existing triggers using 
  simple comparison.  

  See: macros, triggers, /def, /purge, /undef 

@/unhook

/unhook

  Usage: 

  /UNHOOK <event> [<pattern>]
  ___________________________________________________________________________

  Removes a macro with an associated hook on <event> <pattern>.  

  See: hooks, /hook, /purge, /undef 

@/unset

/unset

  Usage: 

  /UNSET <name>
  ___________________________________________________________________________

  /Unset removes the value of variable <name>.  

  /Unset returns 0 if an error occured, nonzero otherwise.  

  See: variables, /set, /setenv, /let 

@/untrig

/untrig

  Usage: 

  /UNTRIG [-a<attrs>] <trigger>
  ___________________________________________________________________________

  Removes a macro with an associated trigger that is triggered by the pattern 
  <trigger> and has attributes <attrs>.  If -a<attrs> is omitted, -an is 
  assumed.  <Trigger> is matched against existing triggers using simple 
  comparison.  

  See: triggers, /trig, /purge, /undef 

@/unworld

/unworld

  Usage: 

  /UNWORLD <name>
  ___________________________________________________________________________

  Removes a world with the name <name>.  The history for world <name> will be 
  deleted, but some or all of the lines may still exist in the global 
  history.  

  See: worlds, /addworld 

@/ver
@/version

/version

  Usage: 

  /VERSION
  /VER
  ___________________________________________________________________________

  /Version displays the TinyFugue version you're running and the operating 
  system for which it was compiled (if known).  

  /Ver displays an abbreviated version number.  

  The latest version of TF should be available for anonymous ftp from 
  ftp.tcp.com in pub/mud/Clients/tf.  

  Also see http://tf.tcp.com/~hawkeye/tf/ for the latest info on TF.  

  See: /changes 

@/watchdog

/watchdog

  Usage: 

  /WATCHDOG [OFF|ON]
  /WATCHDOG <n1> [<n2>]
  ___________________________________________________________________________

  Sets the flag %{watchdog}.  This flag determines whether Fugue will watch 
  for identical lines and suppress them.  Fugue looks for lines which have 
  occurred <n1> times out of <n2> (<n1> defaults to 2 and <n2> to 5) and 
  suppress them, so with the default settings Fugue will suppress any lines 
  that have occurred 2 times out of the last 5.  

  The <n1> and <n2> settings for /watchdog are distinct from the <n1> and 
  <n2> settings for /watchname.  

  The flag %{watchdog} defaults to 0 (off).  

  See: %watchdog, /watchname 

@/watchname

/watchname

  Usage: 

  /WATCHNAME [OFF|ON]
  /WATCHNAME <n1> [<n2>]
  ___________________________________________________________________________

  Sets the flag %{watchname}.  This flag determines whether Fugue will watch 
  for players displaying lots of output.  Fugue looks for names which have 
  begun the line <n1> times out of <n2> (<n1> defaults to 4 and <n2> to 5) 
  and gag that person (with a message), so with the default settings Fugue 
  will gag any person whose name has begun 4 of the last 5 lines.  

  The <n1> and <n2> settings for /watchname are distinct from the <n1> and 
  <n2> settings for /watchdog.  

  The flag %{watchname} defaults to 0 (off).  

  See: %watchname, /watchdog 

@/while
@/do
@/done
@/while

/while

  Usage: 

  /WHILE (expr) list /DONE
  /WHILE list /DO list /DONE
  ___________________________________________________________________________

  The <list>s may be any list of commands.  The return value of a <list> is 
  the return value of the last command executed in the <list>.  Each <list> 
  must be terminated by "%;".  

  The <list> or <expr> following the /WHILE is called the condition.  The 
  condition is executed or evaluated, and if its result is non-zero, the next 
  <list> is executed.  This sequence is repeated until the condition returns 
  zero.  

  The /BREAK command can be used within the loop to terminate the loop early.  
  The loop can also be terminated early by catching a SIGINT (usually 
  generated by typing ^C).  If the variable %{max_iter} is non-zero, the loop 
  will terminate automatically if the number of iterations reaches that 
  number.  

  When /WHILE is used on the command line, "%;" command separation will be 
  done even if %sub=off.  Of course, full substitution will be done if 
  %sub=full.  

  Example: 


    /def count = \
        /let i=1%; \
        /while (i <= {1}) \
            say %{i}%; \
            /let i=$[i + 1]%; \
        /done

  The command "/count 10" will execute the commands "say 1", "say 2", ...  
  "say 10".  

  See: evaluation, /test, /break, /for 

@/world

/world

  Usage: 

  /WORLD [-lqn] [<world>]
  /WORLD <host> <port>
  ___________________________________________________________________________

  If <world> is already connected, "/world <world>" is equivalent to "/fg 
  <world>", and brings <world> into the foreground.  If <world> is not 
  connected, "/world <world>" is equivalent to "/connect <world>", and 
  attempts to open a connection to that world.  

  The second form is equivalent to "/connect <host> <port>".  

  The -lqn options are the same as those for /fg and /connect.  

  See: /connect, /fg 

@
@hilites
@gags
@underline
@reverse
@flash
@dim
@bell
@bold
@attributes
@attribute

attributes

  Many TF commands take an attribute argument containing one or more of the 
  letters "ngGurfdBbhC", which stand for: normal, gag, norecord, underline, 
  reverse, flash, dim, Bold, bell, hilite, and Color.  These attributes are 
  used to display text associated with the command.  

  It is also possible to apply attributes to a part of a line, using /partial 
  or the -P option of /def.  

  Norecord ("G") prevents the line from being recorded in history (however, 
  if logging is enabled, the line will be logged).  

  Color ("C<name>") allows you to specify black, red, green, yellow, blue, 
  magenta, cyan, white, 8 thru 15, bgblack, bgred, bggreen, bgyellow, bgblue, 
  bgmagenta, bgcyan, or bgwhite.  "C" must be the last option in the 
  attribute string, and is followed by the <name> of the color.  See: color.  

  The hilite ('h') attribute is special.  If specified, the attributes listed 
  in the %{hiliteattr} variable will be combined with the other attributes 
  listed.  For example, the commands 

        /set hiliteattr=r
        /echo -ahu foobar

  will display the word "foobar" with reverse and underline attributes.  

  All attributes except 'n' may be combined usefully.  (Even gags can be 
  combined with other attributes: combining 'g' and 'B', for example, will 
  gag the text initially, but will display it as bold if is is recalled with 
  /recall -ag.) 

  Ansi attribute codes sent by the server will be interpreted by tf if 
  %{emulation} is set to "ansi_attr".  See: %emulation.  

  Attributes not supported by your terminal type will be ignored.  

@%catch_ctrls

%catch_ctrls

  See: %emulation 
@color
@colors

colors

  The color attribute ("C<name>") allows you to specify any one of: black, 
  red, green, yellow, blue, magenta, cyan, white, 8 thru 15, bgblack, bgred, 
  bggreen, bgyellow, bgblue, bgmagenta, bgcyan, or bgwhite.  The first eight 
  are defined in stdlib.tf as ANSI foreground colors.  The bg* colors are 
  defined in stdlib.tf as ANSI background colors.  The numbered colors are 
  defined in stdlib.tf to work with the corresponding cxterm colors.  They 
  can all be redefined as described below.  

  You can use a defined color in any attribute string.  For example, to make 
  /hilite'd text appear blue, you can /set hiliteattr=Cblue.  

  On some terminals, lighter versions of ANSI colors can be produced by 
  combining bold with a color; for example, light red is BCred.  

  Note: color will not work if you are running tf under older versions of 
  iscreen, since they do not understand the color codes.  

  To define your own codes (for terminals other than ANSI), you will need to 
  edit the color variables.  The code to enable color <name> is stored in a 
  variable called %{start_color_<name>}.  The code to turn it off is stored 
  in %{end_color}.  These variables may contain carat notation and 
  backslashed ascii codes in decimal, octal, or hexadecimal (e.g., ESC is ^[, 
  \27, \033, or \0x1B).  

  The default definition of %end_color is "\033[37;40;0m".  This assumes your 
  terminal has white text on a black background.  For black on white, you 
  should "/set end_color \033[30;47;0m".  

  If %{emulation} is set to "ansi_attr", ANSI codes sent by the server will 
  be interpreted by tf.  As a result, if the %{start_color_<name>} variables 
  have been edited to match your terminal, tf will translate ANSI color codes 
  from the server into codes for your terminal.  See: %emulation.  

  See: attributes 

@/complete
@%completion_list
@completion

completion

  Usage: 

  /REQUIRE complete.tf

  /complete 
  ___________________________________________________________________________

  Loading complete.tf will define the following keybindings: 

  ESC TAB 
          complete from context, input history, or %{completion_list}.  
  ESC ;   complete from %{completion_list}.  
  ESC i   complete from input history.  
  ESC /   filename completion.  
  ESC @   hostname completion.  
  ESC %   variable name completion.  
  ESC ^W  world name completion.  

  To use them, type part of a word, type one of the keybindings, and the rest 
  of the word will be filled in for you automagically.  ESC TAB attempts to 
  figure out from context what kind of completion you want; the other 
  bindings do more explicit completions.  

  By "from context", I mean it will look for patterns and decide which type 
  of completion to use.  For example, if the line begins with "/load", it 
  will use filename completion; if the word begins with "%" or "%{", it will 
  use variable name completion; etc.  

  The "ESC TAB" and "ESC ;" bindings will use the %{completion_list} 
  variable, in which you can store a list of any words you want to be able to 
  complete.  

  You can also define your own types of completion.  See the 
  %{TFLIBDIR}/complete.tf file for more information.  

  See: /bind, tfrc 

@copy
@warranty
@copying
@copyright

copyright

  TinyFugue - programmable mud client
  Copyright (C) 1993, 1994, 1995, 1996 Ken Keys 

  Regexp package is Copyright (C) 1986 by University of Toronto.  

  For bug reports, questions, suggestions, etc., I can be reached by email at 
  hawkeye@tcp.com.  For problems specific to the OS/2 version, contact 
  Andreas Sahlbach at asa@stardiv.de.  Please see "bugs" before sending a bug 
  report.  

  This program is free software; you can redistribute it and/or modify it 
  under the terms of the GNU General Public License as published by the Free 
  Software Foundation; either version 2 of the License, or (at your option) 
  any later version.  

  This program is distributed in the hope that it will be useful, but WITHOUT 
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
  more details.  

  You should have received a copy of the GNU General Public License along 
  with this program; if not, write to the Free Software Foundation, Inc., 675 
  Mass Ave, Cambridge, MA 02139, USA.  

#sites
#find
#where
#www
#ftp
  The latest version of TinyFugue can be found at: 

    *  http://ftp.tcp.com/pub/mud/Clients/tinyfugue/ 
    *  ftp://tf.tcp.com/pub/tinyfugue/ 
    * Australia: ftp://ftp.progsoc.uts.edu.au/pub/tinyfugue/ 

  Other ftp sites may not have the latest version.  

  Also see http://tf.tcp.com/~hawkeye/tf/ for the latest info on TF.  

@syntax
@body
@macro body
@reentrance
@execution
@expansion
@evaluation

evaluation

  A Builtin Command is any of the commands listed under "commands".  All 
  builtin commands start with '/'.  All builtins have a return value, usually 
  nonzero for success and 0 for failure.  

  A Macro Command is a user-defined command.  Macro commands also start with 
  '/'.  The return value of a macro is the return value of its body when 
  executed.  

  If a macro and builtin have the same name, e.g., "foo", the command "/foo" 
  will call the macro.  You can always execute the builtin with the command 
  "/@foo".  

  A Simple Command is any command that does not start with '/'.  The text of 
  such a command is sent directly to the current world, if there is one.  The 
  return value of a simple command is 1 if the text is successfully sent to 
  the current world, otherwise 0.  

  A Compound Command is one of /IF.../ENDIF or /WHILE.../DONE.  These are 
  described under separate help sections.  Their return value is that of the 
  last command executed.  

  A List is a sequence of commands separated by "%;" tokens.  The return 
  value of a List is the return value of the last command executed in the 
  body.  An empty List has a return value of 1.  

  Some characters within a macro body undergo substitution.  These special 
  characters are not interpreted as themselves, but cause some evaluation to 
  be performed, and the result substituted in place of these characters.  
  This is described under "substitution".  

#scope
#dynamic scope
  When an expansion begins, a new scope is created.  A local variable created 
  during the expansion will be placed in this new scope.  The scope and all 
  variables in it are destoyed when the expansion exits.  

  Any variable reference will refer to the variable with that name in the 
  nearest enclosing (i.e., most recently created) still existing scope.  This 
  is called "dynamic scope".  

  Lexical scope can be simulated to some extent by using variable 
  substitutions with the correct number of '%'s instead of variable 
  references.  (Remember, a "reference" uses the name by itself in an 
  expression, like "/test foo"; a "substitution" uses '%' characters, like 
  "/test %foo").  

#
  See: commands, macros, substitution, /if, /while 

@logic
@math
@strings
@arithmetic
@expression
@expressions

expressions

  Expressions contain operators and operands.  They can be used in $[...] 
  expression subs and in /test.  
#operators
Operators
  In the following list, operators are listed in groups, from highest to 
  lowest precedence.  Operators listed together have equal precedence.  The 
  letters in the table below correspond to the type of objects acted on by 
  the operators: i and j for integer, s and t for string.  All operators 
  group left-to-right except assignment, which groups right-to-left.  

  (expr)  Parentheses, for grouping.  

  fn(args) 
          Perform function <fn> on <args> (see: functions).  

  !i      Boolean NOT (1 if i==0, otherwise 0).  
  +i      Unary positive (useful for converting a string to an 
          integer).  
  -i      Unary negative.  

  i * j   Integer multiplication.  
  i / j   Integer division.  

  i + j   Integer addition.  
  i - j   Integer subtraction.  

  i = j   Integer equality.  
  i == j  Integer equality.  
  i != j  Integer inequality.  
  s =~ t  String equality (case sensitive).  
  s !~ t  String inequality (case sensitive).  
  s =/ t  String s matches glob pattern t.  
  s !/ t  String s does not match glob pattern t.  
  i < j   Integer less than.  
  i <= j  Integer less than or equal.  
  i > j   Integer greater than.  
  i >= j  Integer greater than or equal.  

  i & j   Boolean AND.  j will be evaluated if and only if i is true.  

  i | j   Boolean OR.  j will be evaluated if and only if i is false.  

  i ? x : y 
  i ? : y 
          Conditional.  If i is nonzero, the result is the value of 
          expression x; otherwise it is the value of expression y.  If x is 
          omitted, the value of i is used in its place.  

  v := s  Assignment.  The identifier "v" refers to the variable in 
          the nearest scope.  If not found, a new variable is created at the 
          global level, as if by /set.  

  x , y   Comma.  Expressions x and y are evaluated; the result is 
          the value of y.  Only useful if x has some side effect.  

  The comparison operators return 0 for false, nonzero for true.  The boolean 
  operators stop evaluating as soon as the value of the expression is known 
  ("short-circuit").  This does not affect the value of the expression, but 
  is important when the second operand performs side effects.  

#operands
Operands
  Operands can be any of: 

    * Integers.  
    * Time values of the form hh:mm or hh:mm:ss (will be converted to 
      integer seconds, and can be used anywhere integers are required).  
    * Strings of characters, surrounded with quotes.  
    * Variable references (see below).  
    * Variable substitutions (see below).  
    * Macro substitutions.  
    * Command substitutions.  

  Named variables may be accessed by simply using their name (with no leading 
  '%').  This is called a variable reference.  

  Variable substitutions of the form "{var}" and "{var-default}" may be used 
  to access any variable (named or positional).  Note that there is no 
  leading '%', and the '{' and '}' are required.  

  Variable substitutions beginning with '%' may also be used, but are not 
  recommended, since the multiple '%'s required in nested macros can quickly 
  get confusing.  It always easier to use one of the above methods.  

  All operands will be automatically converted to the type expected by the 
  operator.  String to integer conversion is done by interpreting leading 
  digits as an integer; e.g., "12ab" becomes 12, and "xyz" becomes 0.  
  Integer to string conversion is straightfoward.  Enumerated variables 
  (i.e., special variables that are allowed to have only a limited set of 
  values, such as visual, which can only be "off" or "on") are converted to 
  strings in a straightforward manner.  Enumerated variables are converted to 
  integers by having one integer stand for each of the allowed values.  "Off" 
  is always 0, "on" is always "1", etc.  This makes "!visual" and "visual == 
  0" the same as "visual =~ 'off'".  Other (non-enumerated) variable 
  references are treated as strings.  

#
Examples
  Given the variables 

      /set X=5
      /set name=Hawkeye
      /set visual=1

  here are some expressions and their values: 

      Expression             Value   Comments
      ----                   -----   --------
      3 + X * 2                 13   3 + (5 * 2) = 13. 
      "foo" =~ "bar"             0   "foo" is not identical to "bar". 
      name =/ 'hawk*'            1   "Hawkeye" matches the glob "hawk*". 
      X =~ "+5"                  0   X is interpreted as string "5". 
      X == "+5"                  1   string "+5" is converted to integer 5. 
      visual & (X > 0)           1   visual is nonzero, AND %X is positive. 

  See: functions, /test, evaluation, patterns 

@file
@files
@filename
@filenames
@filename expansion

filename expansion

  Certain strings are treated as filenames in tf (%{TFHELP}; %{TFLIBDIR}; 
  %{TFLIBRARY}; arguments to /load, /lcd; etc.).  Those strings undergo 
  filename expansion as described below.  

  If <file> begins with '~', all characters after the '~' up to the first '/' 
  or end of string are treated as a user name, and the '~' and user name are 
  replaced with the name of the home directory of that user.  If the user 
  name is empty, %{HOME} is substituted.  

  For example, if bob's home directory is /users/bob, then the command "/load 
  ~bob/macros.tf" will attempt to load the file /usrs/bob/macros.tf.  

  "~user" expansion is not supported on systems that do not have the 
  getpwnam() function.  

@-
@--
@options

options

  Many commands take options to modify their behavior, following these rules 
  (similar to UNIX conventions, but not identical): 

    *  All options must be immediately preceded by '-'.  
    *  Options may be grouped after a single '-'.  
    *  Some options may take string, numeric, or time arguments.  There 
      must be no space between the option and the argument.  
    *  String option-arguments may be delmited by a space, double quotes, 
      single quotes, or backquotes.  A delimiter character within the string 
      can be escaped by preceding it with '\'.  
    *  All options must precede normal arguments.  
    *  A '-' or '--' by itself may be used to mark the end of the 
      options.  This is useful when the first (non-option) argument begins 
      with '-'.  

  See also: getopts().  

@function
@functions

functions

  Functions can be used in $[...] and /test expressions.  A function call is 
  made with a function name, followed by a parenthesized list of 
  comma-separated arguments.  

  In the following list of functions and descriptions, arguments <s> and <t> 
  are any string value, and <i> and <j> are any integer value.  

#ascii
#ascii()
  ascii(s) 
          (int) Integer code of the first character of <s>, The character 
          does not have to be ASCII, but may be any character allowed by your 
          locale.  
#char
#char()
  char(i) 
          (str) character with integer code <i>.  If <i> is outside the range 
          allowed by your locale, it will be silently forced into the allowed 
          range.  
#echo
#echo()
  echo(s) 
          (int) Echoes <s> to the screen, like /echo, and returns 1.  
#filename
#filename()
  filename(s) 
          (str) Performs filename expansion on <s> as described under 
          "filenames".  
#ftime
#ftime()
  ftime(s,i) 
          (str) Formats a system time <i> (obtained from time()) according to 
          format <s>.  If <s> is "@", a raw system time will be displayed.  
          Any other <s> will be used as a strftime(3) format if your system 
          supports it.  If <s> is blank or strftime() is not supported, "%c" 
          will be used.  See your local strftime(3) man page for a 
          description of the format string.  The format may also be affected 
          by the locale, determined by %LANG.  See also: time(), %TZ.  
#
  getopts(s) 
          (int) Parse command line options according to format <s>.  See 
          "getopts()".  
#getpid
#getpid()
  getpid() 
          (int) Process id number of tf.  
#idle
#idle()
  idle()  (int) Number of seconds since last keypress.  
  idle(s) 
          (int) Number of seconds since last activity on the socket to the 
          world named by <s>, or -1 on error.  
#kbdel
#kbdel()
  kbdel(i) 
          (int) Delete from the cursor to position <i> in the input buffer.  
          Returns the new position.  
#kbgoto
#kbgoto()
  kbgoto(i) 
          (int) Move the cursor to position <i> in the input buffer.  Returns 
          the new position (which may be different than <i> if <i> would put 
          the cursor outside the buffer).  
#kbhead
#kbhead()
  kbhead() 
          (str) Return the current input up to the cursor.  
#kblen
#kblen()
  kblen() 
          (int) Length of current input line.  
#kbmatch
#kbmatch()
  kbmatch() 
          (int) Finds one of "()[]{}" under or to the right of the cursor, 
          and returns the position of its match, or -1 if not found.  (See 
          also: keybindings) 
#kbpoint
#kbpoint()
  kbpoint() 
          (int) Return the current position of the cursor in input.  
#kbtail
#kbtail()
  kbtail() 
          (str) Return the current input after the cursor.  
#kbwordleft
#kbwordleft()
  kbwordleft() 
          (int) Position of beginning of word.  (See also: %wordpunct) 
#kbwordright
#kbwordright()
  kbwordright() 
          (int) Position just past end of word.  (See also: %wordpunct) 
#mod
#mod()
  mod(i,j) 
          (int) Remainder of <i> divided by <j>.  
#moresize
#moresize()
  moresize() 
          (int) Number of lines queued at a more prompt.  
#rand
#rand()
  rand()  (int) Random number in the range [0, system maximum].  
  rand(j) 
          (int) Random number in the range [0, <j> - 1].  
  rand(i,j) 
          (int) Random number in the range [<i>, <j>].  
#
  read()  (str) Reads a line from keyboard input.  See seperate 
          "read()" topic.  
#regmatch
#regmatch()
  regmatch(s, t) 
          (str) Compares string <t> to regexp <s>.  Subexpressions can later 
          be extracted using the Pn variables or %Pn substitutions.  (See 
          also: regexp) 
#strcat
#strcat()
  strcat(...) 
          (str) Join strings (takes any number of string arguments).  
#strchr
#strchr()
  strchr(s, t) 
          (int) First position within <s> of any character contained in <t>, 
          or -1 if not found.  (For you C programmers, this is actually more 
          like strcspn() or strpbrk()).  
#strcmp
#strcmp()
  strcmp(s, t) 
          (int) Returns a number less than, equal to, or greater than 0 if 
          <s> is lexicographically less than, equal to, or greater than <t>, 
          respectively.  
#strlen
#strlen()
  strlen(s) 
          (int) Length of string <s>.  
#strncmp
#strncmp()
  strncmp(s, t, i) 
          (int) Like strcmp(), but compares only the first <i> characters of 
          <s> and <t>.  
#strrchr
#strrchr()
  strrchr(s, t) 
          (int) Last position within <s> of any character contained in <t>, 
          or -1 if not found.  
#strrep
#strrep()
  strrep(s, i) 
          (str) Returns a string containing <i> repetitions of <s>.  
#strstr
#strstr()
  strstr(s, t) 
          (int) First position of <t> within <s>, or -1 if not found.  
#substr
#substr()
  substr(s, i) 
  substr(s, i, j) 
          (str) Substring of <s>, starting at position <i>, with length <j>.  
          If <j> is omitted, it defaults to the remaining length of <s>.  If 
          <i> or <j> is negative, they are counted as absolute values from 
          the end of <s>.  
#systype
#systype()
  systype() 
          (str) System type, either "unix" or "os/2".  
#time
#time()
  time()  (int) System time (typically seconds since 00:00:00 GMT, 
          January 1, 1970).  See also: /time, ftime().  
#tolower
#tolower()
  tolower(s) 
          (str) Convert all characters in <s> to lower case.  
#toupper
#toupper()
  toupper(s) 
          (str) Convert all characters in <s> to upper case.  
#

  String positions are always counted from 0.  Therefore the first character 
  of a string <s> is substr(s, 0, 1), and the last character is substr(s, 
  strlen(s)-1).  

  Range checking is done on string positions.  Any position given outside the 
  allowed range will be silently forced to the closest value that is in the 
  range.  

  Macros and builtin commands can be called as functions.  Currently, a 
  command called as ``$[command("word1 word2...  wordN")]'' will be executed 
  as if by ``/command word1 word2...  wordN''.  This argument passing syntax 
  is subject to change in future versions, so you shouldn't rely too heavily 
  on passing multiple words in this way.  

  To evaluate a function for its "side effect" only, you can call it from 
  /test and ignore the return value (e.g., "/test kbdel(0)").  

  Examples: 

  Capitalize first letter of string <s>: 

        strcat(toupper(substr(s, 0, 1)), substr(s, 1))

  Extract the number from a string <dbref> of the form "(#123PML)": 

        0 + substr(dbref, strchr(dbref, "#") + 1)

  See: expressions 

@getopts
@getopts()

getopts()

  Usage: 

  getopts(<options>)
  ___________________________________________________________________________

  getopts() is a function that parses and validates macro options according 
  to the format described by <options>.  <Options> is a list of letters that 
  getopts will accept; if a letter is followed by ':', the option will be 
  expected to have an argument.  The option syntax accepted by getopts() is 
  the same as that accepted by builtin tf commands, as described under 
  "options".  

  When an option is found, getopts() creates a new local variable named 
  "opt_X", where "X" is the letter of the option.  If an argument is given, 
  the variable will get that argument as its value; otherwise, the variable 
  will have a value of "1".  

  Options that are not used are not cleared, so if variables with the same 
  names exists in a parent scope, they will be inherited.  For this reason, 
  you should normally use /let to initialize the variables to 0, blank, or 
  any other default value you want, before calling getopts().  

  The argument list will be shifted to discard the options that have been 
  parsed, so %{*} will contain the remainder of the arguments, without the 
  options.  

  If getopts() encounters an error, it will print an error message and return 
  0; otherwise, it returns nonzero.  

  Using getopts(), /escape, and /split, it is possible to write macros that 
  behave just like builtin tf commands.  

  Here's a contrived example to illustrate how getopts() works: 


    /def foo = \
        /let opt_a=0%; \
        /let opt_b=0%; \
        /let opt_c=0%; \
        /let opt_s=%; \
        /if (!getopts("abcs:")) /break%; /endif%; \
        /echo option a:  %{opt_a}%;\
        /echo option b:  %{opt_b}%;\
        /echo option c:  %{opt_c}%;\
        /echo option s:  %{opt_s}%;\
        /echo args: %{*}%;\
        /split %{*}%;\
        /echo name: %{P1}%;\
        /echo body: %{P2}

  Now, all of these commands are equivalent: 

        /foo -a -b -s"xxx yyy" -- whiz = bang biff
        /foo -a -b -s"xxx yyy" whiz = bang biff
        /foo -ab -s"xxx yyy" whiz = bang biff
        /foo -abs"xxx yyy" whiz = bang biff

  and produce this output: 

        option a:  1
        option b:  1
        option c:  0
        option s:  xxx yyy
        args: whiz = bang biff
        name: whiz
        body: bang biff

  But the command: 

        /foo -a -x whiz = bang biff

  produces the output: 

        foo: invalid option 'x'

  See: expressions, functions, options, /escape, /split 

@style
@hints

hints

  Some hints and style tips: 

    *  Use a high-priority trigger on yourself to prevent loops.  Say I 
      want to throw a tomato at anyone who says the word "tomato", and I 
      write the following trigger: 

        /def -t"*tomato*" tomato = :throws a tomato at %1. 

      If Ben uses the word tomato, I will trigger, and then see the text 
      "Hawkeye throws a tomato at Ben." That text contains the word tomato, 
      which will trigger me again, creating an infinite loop.  One way to 
      prevent this is by creating a high-priority trigger on myself which 
      does nothing: 

        /def -p99999 -t"{Hawkeye|You}*" anti_loop

      Now, when I see "Hawkeye throws a tomato at Ben", the /anti_loop 
      trigger will catch it before /tomato does, so I won't loop.  

    *  Use multiple lines, spacing, and indentation in /load files.  
      Normally, commands must be on one line.  But in files read with /load, 
      if a line ends in '\', the following line will have leading whitespace 
      stripped and the two lines will be joined.  This makes it much easier 
      (for humans) to read complex macros.  Compare the two identical macros 
      below, and see which is easier to read.  


        /def count=/let i=1%;/while (i<=%1) say %i%;/let i=$[i+1]%;/done


        /def count = \
            /let i=1%; \
            /while ( i <= %1 ) \
                say %i%; \
                /let i=$[i + 1]%; \
            /done

    *  Use comments in /load files.  Complicated macros are much easier 
      to read if you include a short comment describing the arguments to the 
      macro and what it does.  Lines beginning with ';' are comments, and are 
      ignored during /load.  

    *  Name all triggers and hooks.  If you ever need to /load a file a 
      second time, triggers, hilites, hooks, and gags without names may be 
      duplicated.  But if they are named, old copies of macros will be 
      replaced with new copies of macros with the same name.  Naming macros 
      also makes it easier to /list or otherwise find them.  

    *  Don't use "weird" characters in macro names.  Although any macro 
      name is legal, some characters can have unwanted expansion effects.  
      Weird characters are also harder to read.  You should stick to letters, 
      numbers, and '_' characters.  In particular, avoid '~' characters, 
      since they are used in library macros.  

    *  Use local variables instead of global variables if possible.  This 
      avoids conflicts when two macros use a variable with the same name.  If 
      you're using a variable in an expression, use /let first to initialize 
      the variable in the local scope.  But remember, when you use a variable 
      reference (by name, as opposed to a variable substitution using "%"), 
      TF uses dynamic scoping (see: scope).  

    *  Use variable references instead of %-substitutions in expressions.  
      Because macro bodies are expanded, something like "/test %1" is prone 
      to problems if %1 contains any special characters.  But by using a 
      variable reference you can avoid this problem; for example, "/test 
      {1}".  

    *  Debugging: "/set mecho=on" to see what commands are being 
      executed, or "/connect localhost echo" to see what you're sending to 
      the socket.  "/set emulation=debug" and "telopt=on" to see exactly what 
      the socket is sending to tf.  

@scrollback
@history

history

  Associated commands: 

  /recall
  /quote
  /histsize
  /recordline
  ^<string1>^<string2>
  Recall previous/next keys (RECALLB/RECALLF, default ^P and ^N)
  Recall beginning/end keys (RECALLBEG/RECALLEND, default ^[< and ^[>)
  Search backward/forward keys (SEARCHB/SEARCHF, default ^[p and ^[n)

  TinyFugue stores lines in 4 different types of history lists.  Input 
  history records the last 100 commands from the keyboard, including the 
  current line.  Each world has a world history, which stores 1000 lines of 
  output from that world.  Local history stores 100 lines of output generated 
  by TF, i.e.  anything that didn't come from a world.  Global history is an 
  integrated list of 1000 lines from TF and every world.  The history sizes 
  can be changed with the /histsize command and the %{histsize} variable.  

  /recall is used to display text from any of the history lists.  The /quote 
  command may be used to quote out of any history list using the /quote # 
  feature.  

#^^
#^
  Typing ^<string1>^<string2> finds the last command in the input history 
  containing <string1>, replaces <string1> with <string2>, and executes the 
  modified line.  

#
  The recall keys replace the current input with a line from the input 
  history list.  See /dokey for details.  

  See also /log.  
@hook
@hooks

hooks

  Associated commands: 

  /def    define a macro with any fields 
  /hook   define a hook macro 
  /unhook 
          undefine a hook macro 

  Hooks are a method of calling a macro based on special events within TF, in 
  much the same way as triggers call macros based on socket text.  Hooks 
  allow the user to customize the behavior of TinyFugue and automate special 
  functions.  

  A hook definition has two parts: an <event> and a <pattern>.  When the 
  event occurs, the macro will be executed if the arguments supplied by the 
  event match the macro's <pattern> (see the section on "patterns").  

  If multiple hooks match the same event and pattern, one or more are 
  selected as described under "priority".  

  Most hooks have a default message associated with them, which will be 
  displayed to the tferr stream (i.e., the screen) with the attributes of the 
  hook if one is defined.  Thus a hook with a gag attribute will suppress the 
  display of the message.  

  Hook may be have multi-shots, in which case it and the macro it is 
  associated with is removed after executing a specified number of times.  

      Event Name  Arguments       Default Message or Action
      ----------  ---------       -------------------------
#ACTIVITY
      ACTIVITY    world           '% Activity in world <world>'
                                  (called only the first time activity
                                  occurs on a given socket.)
#BACKGROUND
      BACKGROUND  world           '% Trigger in world <world>'
#BAMF
      BAMF        world           '% Bamfing to <world>'
#CONFAIL
      CONFAIL     world, reason   '% "Connection to <world> failed: <reason>'
#CONFLICT
      CONFLICT    macro           '% <macro> conflicts with builtin command.'
#CONNECT
      CONNECT     world           '% Connection to <world> established.'
#DISCONNECT
      DISCONNECT  world, reason   '% Connection to <world> closed: <reason>.'
                                  (Called if you "QUIT" or socket closes,
                                   but not if you use /dc.)
#KILL
      KILL        pid             (process ends)
#LOAD
      LOAD        file            '% Loading commands from file <file>'
#LOADFAIL
      LOADFAIL    file, reason    '% <file>: <reason>'
#LOG
      LOG         file            '% Logging to file <file>'
#LOGIN
      LOGIN       world,char,pass (automatic login)
#MAIL
      MAIL        file            '% You have new mail in <file>.'
#MORE
      MORE                        '--More--' (reverse bold)
#PENDING
      PENDING     world           'Hostname resolution for <world> in progress'
      PENDING     world           '% Connection to <world> in progress'
#PROCESS
      PROCESS     pid             process starts
#PROMPT
      PROMPT      text            <text> is a partial (unterminated) line
                                  from the server.  See "prompts"
#PROXY
      PROXY       world           (proxy connection to <world> has completed)
#REDEF
      REDEF       obj_type, name  '% Redefined <obj_type> <name>'
#SIGWINCH
#RESIZE
      RESIZE      columns, lines  (window was resized)
#RESUME
      RESUME                      '% Resuming TinyFugue'
#SEND
      SEND        text            (text sent to current socket)
                                  (see note below ("hooks"))
#SHADOW
      SHADOW      var_name        '% Variable <var_name> overshadows global'
#SHELL
      SHELL       type, command   '% Executing <type>: <command>'
#SIGHUP
      SIGHUP                      (SIGHUP caught; tf terminates)
#SIGTERM
      SIGTERM                     (SIGTERM caught; tf terminates)
#SIGUSR1
      SIGUSR1                     (SIGUSR1 caught; no effect)
#SIGUSR2
      SIGUSR2                     (SIGUSR2 caught; no effect)
#WORLD
      WORLD       world           '---- World <world> ----'
#

  Notes: 

  The -w and -T options to /def can be used to restrict hooks to matching 
  only when the current world matches the world or world type.  

  BACKGROUND's "% Trigger in world " message can be quieted for individual 
  triggers by defining them with /def -q, or for all triggers with "/def -ag 
  -hBACKGROUND".  

  The SEND hook is called whenever text would be sent to the current socket.  
  If a SEND hook matches the text that would be sent, the text is not sent 
  (unless the hook was defined with /def -q), and the hook is executed 
  instead.  SEND hooks are never called from the /send command, but they can 
  be called from any macro or command line that sends plain text.  

  When successfully connected to a new socket, these events occur: 1) If 
  %{sockmload} is on and there is a file associated with the world), the file 
  will be loaded (and the LOAD hook will be called); 2) If this is a proxy 
  connection, the PROXY hook is called; 3) The CONNECT hook is called; 4) If 
  %{login} is on, and a character and password is defined, the LOGIN hook is 
  called.  

  The message for the CONNECT hook is displayed only if the connection was 
  pending.  The standard library defines a default CONNECT hook to /fg the 
  socket, which in turn calls the WORLD hook; define your own CONNECT hook if 
  you want to override this automatic /fg.  

  The SIGHUP, SIGTERM, SIGUSR1, and SIGUSR2 hooks are called when the 
  corresponding signal is received.  For SIGHUP and SIGTERM, TF will 
  terminate immediately after executing the hook; if the hook calls any 
  commands with delayed effects (/repeat, /quote, /connect), those effects 
  will not occur before termination.  

  Examples: 


      /hook ACTIVITY|DISCONNECT {TT|SM}* = /world %1

  will cause TF to automatically switch to TT or SM if either becomes active 
  or disconnected.  

      /def -t'tiny.mush' -hSEND mush_escape = /send - $(/escape \%[ %*)

  will catch any line sent to a world of type 'tiny.mush', escape all 
  occurrances of '%', '[' and '\' within that line, and send the new line 
  instead of the original.  This is useful for avoiding unwanted 
  interpretation of '%', '[', and '\' on TinyMUSH servers.  

      /hook SIGHUP = /log on%; /recall /10

  will log the last 10 lines of output if you are unexpectedly disconnected 
  from your tf session.  

  See also: macros, triggers, patterns, priority, /signal 

@topics

topics

  Topics marked with + are new; those marked with * have changed since the 
  last version.  Many topics also have subtopics that are not listed here 
  (e.g., individual variables, hooks, and functions).  


    copying       copyright; no warranty
    intro         introduction to tf
    startup       how to start tf
    *interface    how input works
    tfrc          personal config file
    visual        split-screen mode
    commands      list of commands
    worlds        defining worlds
    patterns      pattern matching
    variables     state and environment
    *globals      special tf variables
    attributes    special text display
    prompts       using LP/Diku prompts
    problems      bugs, core dumps, etc. 
    macros        user-defined commands
    sockets       world connections
    history       recall and logging
    priority      trigger/hook selection
    keybindings   keyboard operations
    *color        terminal color codes
    evaluation    macro body execution
    protocol      LP/Diku prompt protocol
    *expressions  math and string operations
    utilities     useful extra command files
    triggers      automatic command execution based on incoming text
    *hooks        automatic command execution based on tf events
    library       macros and variables in stdlib.tf
    processes     timed commands and command quoting
    *subs         arithmetic, command, macro, and variable substitutions
    *functions    special expression operations
    hints         some hints and style tips for macro programming
    +tfio         output, error, and world streams
    +proxy        connecting to outside hosts via a proxy server (firewall)
    

@typing
@user
@interface

interface

  Any input line that does not begin with '/' will be sent directly to the 
  foreground world, if there is one.  A line starting with more than one '/' 
  will be sent to the forground socket after having the first '/' removed.  
  (Exception: lines may be caught with a SEND hook before being sent; see 
  "hooks").  

#/!
#/@
#/
  Any input line beginning with a single '/' is a TF command.  If the word 
  immediately following the '/' is the name of a macro, that macro will be 
  called; otherwise, the builtin command with that name will be called.  
  Several special characters between '/' and the name modify the behavior of 
  the command: '@' will call the named builtin command instead of the macro; 
  and '!' will negate the return value of the command.  
#

  Input lines of the form "^old^new" will cause TF to search backward in the 
  input history for a line containing "old", replace that text with "new", 
  and execute the modified command.  See: history.  

  Many special functions, such as backspace, can be performed by special keys 
  or sequences of keys.  See "dokey" for a complete list.  You can also 
  define your own commands and bind them to key sequences.  See bind.  

  Normally, user input does not undergo the expansion that macro bodies 
  undergo.  The /eval command can be used to expand text before executing it.  
  If the %{sub} flag is on (it is off by default), user input undergoes macro 
  body expansion without the %{sub} flag.  The %{sub} flag also applies to 
  text generated by "^old^new" history commands.  See: history, /sub, 
  variables 

  Control characters may be input literally.  A literal control character 
  will be displayed in the input window in printable form in bold reverse.  
  Note that since most control keys are also parts of the default 
  keybindings, it will usually be necessary to type ^V (/dokey LNEXT) to 
  avoid invoking the keybinding.  

  International characters may be input if %{LANG} is set to a locale that 
  supports them and your system supports locales.  The only exception is the 
  character \0200, which will be mapped to \0.  Any input character that is 
  not valid in your locale and has the high bit set (normally generated by 
  holding the "meta" key) will be translated to ESC plus that character with 
  the high bit stripped.  This allows M-x and ^[x to invoke the same ^[x 
  keybinding.  See %istrip, %LANG.  

  See also: visual, options 

@intro
@me
@newbie
@tinyfugue
@introduction

introduction

  TinyFugue is a MUD client.  It helps you connect to a MUD, in a much more 
  convenient manner than telnet.  You can connect to a mud world using the 
  same syntax as you would with telnet: "tf <host> <port>".  Or, while 
  running tf, you can use "/connect <host> <port>".  To make things easier, 
  you can give names to worlds, using /addworld, and then use "tf <name>" and 
  "/connect <name>".  If you store a set of /addworld commands in a file, TF 
  can read them automatically when it starts.  You can even connect to more 
  than one world at the same time, and switch between them.  See: /connect, 
  /fg, /addworld, worlds, tfrc.  

  Any line you type that starts with a single '/' is a tf command.  Anything 
  else you type will be sent to the mud.  See: interface, commands.  

  You can define your own tf commands, called macros.  The simplest type of 
  macro is just an abbreviation or alias for a longer command or commands.  
  But macros can also perform much more powerful tasks.  See: macros, /def.  

  You can tell tf to watch for certain patterns in the text from the mud, and 
  then do special things when it sees that pattern: display the text in a 
  special way (hilite); not display the text at all (gag); execute a macro 
  command (trigger); or do any combination of these.  See: attributes, 
  triggers, /hilite, /gag, /trig, /def.  

  In visual mode, TF will split the screen into two windows: one for input, 
  and one for output.  TF will display useful information on the line 
  separating the two windows, such as the name of the foreground world.  To 
  use it, just type "/visual on".  See: %visual, mode.  

  TF keeps a history of every line it prints, every line sent by the mud, and 
  every command you enter.  You can see those histories using /recall.  You 
  can also have this text saved in a file using /log.  See: history, /recall, 
  /log.  

  See also: topics 

@keys
@kbbind
@kbfunc
@kbfunc.tf
@kbbind.tf
@keybindings

keybindings

  Default keybindings, commands, and meanings: 

  Key     Command                 Meaning
  ---     -------                 -------
  ^?      /dokey BSPC             backspace
  ^A      /dokey_home             cursor to beginning of line
  ^B      /dokey_wleft            cursor to beginning of word
  ^D      /dokey_dch              delete character
  ^E      /dokey_end              cursor to end of line
  ^F      /dokey_wright           cursor to end of word
  ^G      /beep 1                 beep
  ^H      /dokey BSPC             backspace
  ^I      /dokey page             scroll 1 screenful at --More-- prompt
  ^J      /dokey NEWLINE          execute current line
  ^K      /dokey_deol             delete to end of line
  ^L      /dokey redraw           redraw screen
  ^N      /dokey recallf          recall forward input history
  ^P      /dokey recallb          recall backward input history
  ^R      /dokey REFRESH          refresh line
  ^T      /kb_transpose_chars     transpose characters
  ^U      /dokey DLINE            delete line
  ^V      /dokey LNEXT            input next key literally
  ^W      /dokey BWORD            delete backward word (space-delimited)
  ^[^E    /kb_expand_line         expand current line in place
  ^[spc   /kb_collapse_space      change multiple spaces to a single space
  ^[-     /kb_goto_match          move cursor to matching parenthesis or bracket
  ^[.     /kb_last_argument       input last word of previous line
  ^[J     /dokey selflush         selective flush (flush non-hilited text)
  ^[OA    /dokey UP               cursor up
  ^[OB    /dokey DOWN             cursor down
  ^[OC    /dokey RIGHT            cursor right
  ^[OD    /dokey LEFT             cursor left
  ^[[A    /dokey UP               cursor up
  ^[[B    /dokey DOWN             cursor down
  ^[[C    /dokey RIGHT            cursor right
  ^[[D    /dokey LEFT             cursor left
  ^[_     /kb_last_argument       input last word of previous line
  ^[b     /fg -foreground previous socket
  ^[c     /kb_capitalize_word     capitalize word
  ^[d     /dokey_dword            delete forward word
  ^[f     /fg ->                  foreground next socket
  ^[h     /dokey hpage            scroll half screenful at --More-- prompt
  ^[j     /dokey flush            flush (discard text after --More-- prompt)
  ^[l     /kb_downcase_word       downcase word
  ^[n     /dokey searchf          search forward input history
  ^[p     /dokey searchb          search backward input history
  ^[u     /kb_upcase_word         upcase word
  ^[v     /test insert:=!insert   toggle insert mode
  ^[^?    /kb_backward_kill_word  delete backward word (punctuation-delimited)

  At startup, tf also examines the terminal settings for keys corresponding 
  to the /dokey functions UP, DOWN, LEFT, RIGHT, BSPC, BWORD, DLINE, REFRESH, 
  and LNEXT, and binds them accordingly if different than the default 
  bindings listed above.  

#cut
#paste
#cut and paste
#bash
#emacs
#extra keybindings
  Some additional keyboard operations can be defined by /loading these 
  library files: 

  kb-bash.tf 
          keybindings like those in bash 
  kb-emacs.tf 
          keybindings like those in emacs 
  kbregion.tf 
          cut-and-paste operations 
  kbstack.tf 
          save the current line and recall it later 

  See the comments at the top of each file for further documentation.  

#
  See: /dokey, /bind, completion, %wordpunct 

@stdlib.tf
@local.tf
@lib
@library
@library
@standard library

standard library

  When TF is started, commands are loaded from the standard library 
  (%{TFLIBDIR}/stdlib.tf).  If the installer has created an optional local 
  library (%{TFLIBDIR}/local.tf), that will also be loaded.  Macros defined 
  in the standard library are marked with the invisible option ("-i") so they 
  will not be processed by /list, /save and /purge unless forced.  Redefining 
  or undefining such a macro will clear the -i option, so customized macros 
  with the same names as library macros can be created, listed, saved, and 
  purged.  

  See also: utilities 

#filename macros
Filenames:

  These macros may be redefined to any filename.  LOGFILE contains the 
  default filename used by /log.  MACROFILE, HILITEFILE, GAGFILE, TRIGFILE, 
  BINDFILE, HOOKFILE, and WORLDFILE contain the default filenames used by the 
  /load* and /save* families of commands.  
#

#list*
List commands:

  /listdef <spec> 
          equivalent to '/list <spec>'.  
  /listhilite <spec> 
          lists hilites on <spec>.  
  /listgag <spec> 
          lists gags on <spec>.  
  /listtrig <spec> 
          lists triggers on <spec>.  
  /listbind <spec> 
          lists key bindings matching <spec> 
  /listhook <spec> 
          lists hooks matching <spec>.  

  See: /list 

#purge*
Purge commands:

  /purgedef <spec> 
          purges macros whose name matches <spec> 
  /purgehilite <spec> 
          purges macros with hilites on <spec> 
  /purgegag <spec> 
          purges macros with gags on <spec> 
  /purgetrig <spec> 
          purges macros with triggers on <spec> 
  /purgedeft <spec> 
          purges named macros with triggers on <spec> 
  /purgebind <spec> 
          purges key bindings matching <spec>.  
  /purgehook <spec> 
          purges hooks matching <spec>.  

  See: /purge 

#load*
Load commands:

  /loaddef, /loadhilite, /loadgag, /loadtrig, /loadbind, /loadhook, 
  /loadworld.  All take a <file> argument; if the argument is omitted, the 
  appropriate default filename macro is used.  

  See: /load 

#save*
Save commands:

  /savedef, /savehilite, /savegag, /savetrig, /savebind, /savehook, 
  /saveworld.  All take a <file> argument.  If <file> is omitted, the 
  appropriate default filename macro is used.  

  See: /save 

#compression
#compress
File compression:

  The helpfile, personal config file, and files read with /load may be stored 
  compressed on disk.  If TF can not find a file with the specified name, it 
  will add ${COMPRESS_SUFFIX} to the filename and try to read it by piping it 
  through ${COMPRESS_READ}.  ${COMPRESS_READ} should contain the name of a 
  shell command that takes a filename as an argument, and prints its output 
  on standard output.  The default values for ${COMPRESS_SUFFIX} and 
  ${COMPRESS_READ} defined in the library are ".Z" and "zcat" for unix, 
  ".zip" and "unzip -p" for os/2.  Undefining ${COMPRESS_SUFFIX} will disable 
  this feature.  Note: /save, /saveworld, and /log do not write compressed 
  files.  

#retry
World connection commands:

  /retry <world> [<delay>] 
          Try to connect to <world>; repeat every <delay> seconds until 
          successful.  
  /retry_off [<world>] 
          Cancels "/retry <world>" (default: all worlds) 

#hilite_whisper
#hilite whisper
#hilite_page
#hilite page
Hilite commands:

  /hilite_whisper, /hilite_page, /nohilite_whisper, and /nohilite_page turn 
  on or off hiliting several different page and whisper formats.  

#
Backward compatible commands:

  /reply, /act, /nolog, /nologin, /nologme, /noquiet, and /nowrap are 
  provided for compatibility.  

@autologin
@login

login

  If the %{login} flag is on when you connect to a world, and that world was 
  defined with a character, password, and optional worldtype, TF will attempt 
  to automatically login to that world.  

  Autologin is done by a hook defined in the standard library.  The hook for 
  the default worldtype uses TinyMUD login format; there are also hooks for 
  "tiny", "lp", "lpp", and "telnet" worldtypes.  You can also define your own 
  LOGIN hooks.  

  See: hooks, variables, /addworld 

@macros

macros

  The simplest kind of macro has a name and a body.  The body is a list of 
  one or more commands, separated by '%;' tokens.  These commands are 
  executed when the macro is called.  For example, if you define a macro like 

      /def time_warp = :jumps to the left!%;:steps to the right!

  and call it by typing 

      /time_warp

  you will execute the commands 

      :jumps to the left!
      :steps to the right!

  A macro name is the way of calling it from the command line or from another 
  macro.  You can execute a macro by typing '/' followed by the name of the 
  macro.  If a macro and builtin have the same name, the macro will be 
  called.  Typing '/@' followed by the name will always call the builtin 
  command.  

  A macro body, or execution text, is the commands and/or text executed when 
  the macro is called.  This text is evaluated according to the rules 
  described under "evaluation".  

  Macros actually have many more fields, described below.  All fields 
  (including name and body) are optional.  

  name    The name of the macro.  Names should begin with a letter, 
          and contain letters, numbers, or '_' characters.  

  body    One or more commands to be executed when macro is called.  

  number  All macros are automatically numbered sequentially.  This 
          field can not be changed.  

  trigger 
          when text matches the trigger pattern, the macro may be called.  

  hook    the macro can be called when a TF hook event occurs.  

  keybinding 
          the macro will be called when its keybinding is typed.  

  shots   the macro will be deleted after it is triggered or hooked a 
          certain number of times.  

  priority 
          when multiple triggers match the same text, the one with the 
          highest priority is selected (see "priority").  

  fall-thru 
          on a trigger or hook, allows additional macros of lower priority to 
          be run (see "priority").  

  world   the macro can only be triggered/hooked by text/events from 
          a particular world.  

  worldtype 
          the macro can only be triggered/hooked by text/events from a 
          particular type of world.  

  attributes 
          bold, underline, etc.  for displaying trigger text.  

  probability 
          when triggered, the macro has a certain probability of being 
          executed.  

  invisibility 
          prevents handling of macro by /list, /save, or /purge.  

  Macros may be called in several ways: 

    * a command of the form "/name" 
    * triggered by text from a socket (see "triggers") 
    * hooked by a tinyfugue event (see "hooks") 
    * by keybindings 

  Associated commands: 

  /def    define a named macro, with any fields 
  /trig   define a trigger macro 
  /hilite 
          define a hilite macro 
  /gag    define a gag macro 
  /bind   define a keybinding macro 
  /hook   define a hook macro 
  /undef  undefine a named macro 
  /unhook 
          undefine a hook macro 
  /unbind 
          undefine a keybinding macro 
  /undefn 
          undefine a macro by number 
  /undeft 
          undefine a macro by trigger 
  /purge  undefine a set of macros 
  /list   display a list of macros 
  /load   load commands from a file 
  /save   save macro definitions to a file 

  See also: triggers, gags, hilites, hooks 

@mailing list
@mail list

mailing list

  The TinyFugue mailing list is an email forum for discussion of topics 
  related to TinyFugue.  To subscribe, send email to majordomo@tcp.com with a 
  body of "subscribe tinyfugue".  

  Also see http://tf.tcp.com/~hawkeye/tf/ for the latest info on TF.  

@visual
@nonvisual
@windows
@screen
@mode

mode

  TinyFugue has two main interface modes: Visual and non-visual.  If 
  possible, visual mode will be enabled by default, unless %{visual} is 
  explictly set "off" in .tfrc.  Visual mode is enabled with the "/visual on" 
  command, and is highly recommended.  

Visual mode
  The Visual interface has two windows: the bottom window is for input, the 
  top for output.  If your terminal can scroll in a region, output will 
  scroll; otherwise if your terminal can delete and insert lines, TF will 
  simulate scrolling; otherwise it will wrap from bottom to top, clearing two 
  lines ahead.  The %{scroll} variable can be set to explicitly choose 
  scrolling or wrapping.  The %{isize}, %{cleardone}, and %{clearfull} 
  variables can be used to customize the visual display.  See: %isize, 
  %cleardone, %clearfull.  

  The two windows are separated by a status line that looks something like 
  this: 

    --More--_WorldName________(Read)_(Active: n)_(Log)_(Mail)_(Typeover)_clock

    * "--More--" indicates that there is more text to be seen.  
    * "<WorldName>" is the name of the current socket's world.  
    * "Read" indicates that keyboard input is being read by read().  
    * The "Active" indicator shows the number of sockets with unseen 
      text.  
    * "Log" indicates that there is one or more log file open.  
    * "Mail" indicates that the file named by %MAIL contains unread mail.  
    * "Typeover" indicates that %insert is off.  
    * If %clock is not off, the current time is displayed at the right 
      end of the status line.  

Non-visual mode
  In the non-visual interface, input and output are both displayed on the 
  bottom line.  If you are typing and output appears, your input is cleared, 
  the output is displayed, and your input is redisplayed on the last line.  
  If your input has wrapped around to a second or third line, only the last 
  line will be cleared and redisplayed.  

  ___________________________________________________________________________

  In both modes, output text is wrapped around at a right margin of one less 
  than the number of columns on your screen (typically 79) unless wrapping 
  has been turned off.  In addition, if you set the variable %{wrapspace}, 
  all lines after the first in a wrapped piece of text will be indented by 
  that many spaces.  See: %wrap, %wrapsize, %wrapspace.  

  If the %{more} flag is on, output is suspended when the screen is full, and 
  you can use the TAB key to continue.  See: /more, /dokey.  

@-
@--
@options

options

  Many commands take options to modify their behavior, following these rules 
  (similar to UNIX conventions, but not identical): 

    *  All options must be immediately preceded by '-'.  
    *  Options may be grouped after a single '-'.  
    *  Some options may take string, numeric, or time arguments.  There 
      must be no space between the option and the argument.  
    *  String option-arguments may be delmited by a space, double quotes, 
      single quotes, or backquotes.  A delimiter character within the string 
      can be escaped by preceding it with '\'.  
    *  All options must precede normal arguments.  
    *  A '-' or '--' by itself may be used to mark the end of the 
      options.  This is useful when the first regular argument begins with 
      '-'.  

  See also: getopts().  

@patterns

patterns

  Patterns are used in triggers, hooks, /purge, /list, and /recall.  There 
  are three styles of pattern matching available: "simple" comparison, "glob" 
  (similar to shell filename patterns), and "regexp" (regular expressions).  
  The style used by a particular command is determined either by the use of 
  the -m option or the setting of the global variable %{matching}.  

#comparison
#simple
#simple matching
Simple matching ("simple")

  The pattern is compared directly to the string.  There are no special 
  characters.  Case is significant.  

#smatch
#globbing
#glob
Globbing ("glob")

  Globbing is the default matching style, and was the only style available 
  before version 3.2.  It is similar to filename expansion ("globbing") used 
  by many shells (but is only used for comparison, not expansion).  

  There are several special sequences that can be used in tf globbing: 

    *  The '*' character matches any number of characters.  

    *  The '?' character matches any one character.  

    *  Square brackets ([...]) can be used to match any one of a sequence 
      of characters.  Ranges can be specified by giving the first and last 
      characters with a '-' between them.  If '^' is the first character, the 
      sequence will match any character NOT specified.  

    *  Curly braces ({...}) can be used to match any one of a list of 
      words.  Different words can be matched by listing each within the 
      braces, separated by a '|' (or) character.  Both ends of {...} will 
      only match a space or end of string.  Therefore "{foo}*" and "{foo}p" 
      do not match "foop", and "*{foo}" and "p{foo}" do not match "pfoo".  

      Patterns containing "{...}" can easily be meaningless.  A valid {...} 
      pattern must: (a) contain no spaces, (b) follow a wildcard, space, or 
      beginning of string, (c) be followed by a wildcard, space, or end of 
      string.  

      The pattern "{}" will match the empty string.  

    *  Any other character will match itself, ignoring case.  A special 
      character can be made to match itself by preceeding it with '\' to 
      remove its special meaning.  

  Examples:
  "d*g" matches "dg", "dog", "drug", "debug", "dead slug", etc. 
  "d?g" matches "dog", "dig" and "dug" but not "dg" or "drug". 
  "M[rs]." matches "Mr." and "Ms."
  "M[a-z]" matches "Ma", "Mb", "Mc", etc. 
  "[^a-z]" matches any character that is not in the English alphabet. 
  "{storm|chup*}*" matches "chupchup fehs" and "Storm jiggles". 
  "{storm|chup*}*" does NOT match "stormette jiggles". 

#re
#regex
#regexp
#regular expressions
Regular expressions ("regexp")

  The regexp package was written by Henry Spencer, and is similar to those 
  used in egrep and many text editors.  See also: regmatch(), substitution.  
  The following excerpt is taken from Henry Spencer's regexp(3) man page.  

       REGULAR EXPRESSION SYNTAX
            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. 

       AMBIGUITY
            If a regular expression could match two different parts of
            the input string, it will match the one which begins
            earliest.  If both begin in the same place    but match
            different lengths, or match the same length in different
            ways, life gets messier, as follows. 

            In general, the possibilities in a list of branches are
            considered in left-to-right order, the possibilities for
            `*', `+', and `?' are considered longest-first, nested
            constructs are considered from the outermost in, and
            concatenated constructs are considered leftmost-first.  The
            match that will be chosen is the one that uses the earliest
            possibility in the first choice that has to be made.  If
            there is more than one choice, the next will be made in the
            same manner (earliest possibility) subject to the decision
            on the first choice.  And so forth. 

            For example, `(ab|a)b*c' could match `abc' in one of two
            ways.  The first choice is between `ab' and `a'; since `ab'
            is earlier, and does lead to a successful overall match, it
            is chosen.  Since the `b' is already spoken for, the `b*'
            must match its last possibility-the empty string-since it
            must respect the earlier choice. 

            In the particular case where no `|'s are present and there
            is only one `*', `+', or `?', the net effect is that the
            longest possible match will be chosen.  So `ab*', presented
            with `xabbbby', will match `abbbb'.  Note that if `ab*' is
            tried against `xabyabbbz', it will match `ab' just after
            `x', due to the begins-earliest rule.  (In effect, the
            decision on where to start the match is the first choice to
            be made, hence subsequent choices must respect it even if
            this leads them to less-preferred alternatives.)

Comparison of glob and regexps. 

      regexp              equivalent glob (except for case sensitivity)
      ------              ---------------
      "part of line"      "*part of line*"
      "^entire line$"     "entire line"
      "(^| )word( |$)"    "*{word}*"
      "^(You|Hawkeye) "   "{You|Hawkeye} *"
      "foo.*bar"          "*foo*bar*"
      "f(oo|00)d"         "*{*food*|*f00d*}*"
      "line[0-9]"         "*line[0-9]*"
      "^[^ ]+ whispers,"  "{*} whispers,*"
      "foo(AB|XY)?bar"    "*{*foobar*|*fooABbar*|*fooXYbar*}*"
      "zoo+m"             none
      "foo ?bar"          none
      "(foo bar|frodo)"   none

Notes. 

    * For best speed, make the beginning of your patterns as specific as 
      possible.  
    * Do not use ".*" or "^.*" at the beginning of a regexp.  It is very 
      inefficient, and not needed.  Use %PL instead if you need to retrieve 
      the value of the left side.  
    * If a glob and regexp can do the same job, use the glob, it's 
      usually faster.  

@priorities
@fallthru
@fall-thru
@selection
@priority
@priority rules

priority

  When more than one macro is matched by a trigger or hooked event, the 
  following rules are used to select which of the macros will be run: 

  Macros are tested in order of decreasing priority.  Fall-thrus of a given 
  priority are compared before non-fall-thrus of the same priority.  

  Each matching fall-thru macro is executed immediately when it is found.  
  When the first matching non-fall-thru macro is found, all the 
  non-fall-thrus of equal priority are collected, and the search ends.  One 
  of the non-fall-thrus is chosen at random and executed.  

  So, in the simple case when there are no fall-thrus, the highest priority 
  match is chosen.  If there is more than one of the highest priority, one of 
  those is chosen at random.  

  Fall-thru macros are defined with /def -F.  

  See: triggers, hooks, macros, /def 

@bug
@bugs
@core
@crash
@report
@hawkeye
@author
@support
@problems

problems

  If you have an old version of TF, chances are your bug has already been 
  fixed.  The latest version of TF should be available for anonymous ftp from 
  ftp.tcp.com in pub/mud/Clients/tinyfugue.  

  Also see http://tf.tcp.com/~hawkeye/tf/ for the latest info on TF.  See 
  "/help mailing list" for information on how to subscribe to the tinyfugue 
  mailing list.  

  Send general bug reports, questions, etc, to hawkeye@tcp.com.  For problems 
  specific to the OS/2 version, contact Andreas Sahlbach at asa@stardiv.de.  
  When reporting a problem or bug, please provide this information: 

  The version of TF (type "/version" in tf).  Please give the number, don't 
  just say "the latest version", because you might be behind.  The operating 
  system version (type "uname -a" in the shell).  If tf won't install, send 
  the Build.log file (UNIX only) if there is one, or send a log of the 
  installation errors (don't leave out parts just because you don't know what 
  they mean or think they're irrelevant).  If you have a bug or core, give me 
  ALL messages from tf, not just the last line.  If you have a bug or core, 
  tell me what you did or what happened before the problem, and if the 
  problem is repeatable.  If you have a core, do NOT send the core file.  But 
  if you know how, and tf was compiled with debugging option (usually '-g'), 
  a stack trace would be useful (use the 'where' command in gdb or dbx).  

#
  The following bugs are known.  Don't bother reporting them.  

  The %{lp} and %{emulation} variables should work on a per-socket basis 
  (This is partially overcome with WORLD hooks).  

  If a shell quote (/quote !) reads a partial line from the child process, tf 
  will hang until the line is completed.  

  /recall by timestamp doesn't work when switching to/from daylight savings 
  time (but /recall by age always works).  

@tinyprocesses
@process
@proc
@processes

processes

  Associated topics: 

  /quote
  /repeat
  /ps
  /kill
  %ptime
  %lpquote

  The /quote and /repeat commands in Fugue are done by setting up internal 
  processes that run concurrently with normal input and output.  

  /ps can be used to get a listing of the currently running processes and 
  their process ID's (for use with /kill).  

  /kill can be used to terminate a process.  

  Processes can be either synchronous or asynchronous.  Synchronous processes 
  run immediately when they are started, and run to completion before any 
  other commands are executed.  Synchronous processes are new in version 3.3 
  beta 10.  

  Asynchronous processes are merely scheduled to be run by a /quote or 
  /repeat command; the actual execution occurs at some later time.  They can 
  be run based on two different criteria: 

  1.  Normally, processes run whenever a specific period of time has elapsed.  
  The delay can be specified when the process is started, or will default to 
  the value of %{ptime}.  

  2.  If the %{lpquote} flag is on, processes run whenever a prompt is 
  received from the server, indicating that the previous command as 
  completed.  Example: 

          /lpquote on
          /quote /send !echo n; echo w; echo w; echo s

  will send the commands "n", "w", "w", and "s", but will wait to send a 
  command until the prompt following the last command is seen.  

  If an asynchronous /quote or /repeat is followed immediately by another 
  command, the other command will run first, because the asynchronous process 
  was only scheduled, not actually executed.  Use a synchronous /quote or 
  /repeat to force the process to run before any other commands.  

  Bodies of /repeat undergo macro body expansion when they are executed; text 
  generated by /quote does not.  

  See also: utilities (/at, /tick) 

@goahead
@eor
@end-of-record
@protocol
@prompt protocol

prompt protocol

  TF will recognize the TELNET protocol commands GOAHEAD or END-OF-RECORD as 
  the end of a prompt.  If you are responsible for a server that has prompts, 
  and wish to make it more friendly to TF users, choose one of these options: 

  GOAHEAD: Send IAC GA (\377 \371) after each prompt.  This is the easier of 
  the two options.  In many servers, this can be done at the beginning of the 
  routine that reads user input.  Disadvantage: could possibly cause problems 
  in clients that don't understand TELNET protocol (but usually, they will 
  just pass it through to the terminal, which will usually ignore it).  

  END-OF-RECORD: Send IAC WILL EOR (\377 \373 \031) when the user connects.  
  If the client responds with IAC DO EOR, then you can send IAC END-OF-RECORD 
  (\377 \357) after each prompt; otherwise, do nothing special in prompts.  
  Disadvantage: requires extra state per descriptor and more understanding of 
  telnet protocol.  Advantage: minimizes potential problems for clients that 
  do not recognize telnet protocol.  

  For more information on TELNET protocol, see RFCs 854, 855, 885, and 1123.  
  RFCs can be obtained via FTP from NIS.NSF.NET, NISC.JVNC.NET, 
  VENERA.ISI.EDU, WUARCHIVE.WUSTL.EDU, SRC.DOC.IC.AC.UK, FTP.CONCERT.NET, 
  DS.INTERNIC.NET, or NIC.DDN.MIL.  

  See also: /telnet, prompts 

@lp
@diku
@prompt
@prompts

prompts

  Most LP muds, Diku muds, telnetd, and some other types of servers send 
  unterminated prompts, that is, prompts that do not end with newline or any 
  other special character.  Normally, TF will not display text until a 
  newline is received, so you may not see the prompt until after you press 
  return.  But if the %{lp} flag is on, TF will attempt to separate these 
  prompts from normal text and display them correctly.  

  The recommended way to use the %{lp} flag is to define your worlds with one 
  of the /addlp, /adddiku, or /addtelnet commands.  The %{lp} flag will be 
  turned on automatically when you switch to such a world, and turned off for 
  the other predefined world types.  See: /addworld.  

  TF also provides a PROMPT hook, which allows you to tell it what to look 
  for in a prompt.  When an unterminated line is received, the PROMPT hook is 
  called immediately.  If there is no match, TF will use the timeout method 
  described below (if %{lp} is on).  But if there is a matching PROMPT hook, 
  TF will forget about the line (unless the hook was defined with /def -q) 
  and let the hook deal with it.  By combining the PROMPT hook with the 
  /prompt command, you can recognize most prompts immediately without having 
  to use the %{lp} timing mechanism.  The typical way of doing this is: 

      /def -h"PROMPT *> " catch_prompt = /prompt %*

  So, whenever TF receives an unterminated line that ends in "> ", 
  catch_prompt will see it, and use /prompt to copy it to the current prompt.  

  If an unterminated line is not matched by any PROMPT hook, and it is not 
  followed by more text within a short period of time, TF will assume it is a 
  prompt.  This method is not foolproof.  If the delay is too short, broken 
  lines will look like prompts, and will briefly appear in the input window 
  until the rest of the line arrives, at which time both parts of the line 
  will be printed as normal output.  If the delay is too long, there will be 
  an annoying delay before displaying real prompts.  

  The delay can be varied by setting the variables prompt_sec=<seconds> and 
  prompt_usec=<microseconds>.  The default values are prompt_sec=0 and 
  prompt_usec=250000 (that is, 0.25 seconds).  

  All of this hackery can be avoided if the server sends unambiguous prompts.  
  TF will recognize "*\b" (that is, "*" followed by backspace) and anything 
  ending with GOAHEAD or END-OF-RECORD telnet characters.  When TF sees such 
  text, it does not wait for a delay, but calls the PROMPT hook immediately; 
  if there is no match, TF displays the prompt immediately.  To avoid some 
  minor glitches, you should leave the %{lp} flag off when connected to such 
  a server.  If you are responsible for a server and wish to make it more 
  TF-friendly, see "protocol".  

  See also: %login, prompt protocol, /addworld 

@firewall
@proxy
@proxy server

proxy server

  If %{proxy_host} is defined, all connections will go through a proxy server 
  (firewall).  The actual connection is made to %proxy_host and %proxy_port.  
  When the connection completes, the PROXY hook is called (before the CONNECT 
  hook).  A PROXY hook defined in the standard library calls /proxy_command, 
  which by default is defined as "telnet ${world_host} ${world_port}".  If 
  your proxy server requires a different command, you should redefine 
  /proxy_command.  

  Before the connection is made, ${world_host}, ${world_port}, error 
  messages, and /listsockets refer to the proxy server; after the connection 
  is made, they refer to the server defined in /addworld.  

  Note that tf has no way of knowing if the command sent to the proxy server 
  actually succeeded in opening a connection to the destination server; if it 
  failed, tf will happily call the LOGIN hook and send your login command to 
  the proxy server instead of the destination.  To get around this, you could 
  do this: disable the LOGIN hook; have /proxy_command define a trigger on 
  some successful connection message; have the trigger send the login 
  command.  

  For example, if to reach out.side.edu 4201, your site requires you to first 
  telnet to firewall.anal.com and then type "telnet out.side.edu 4201", you 
  could set it up like this: 

      /set proxy_host=firewall.anal.com
      /addworld outside out.side.edu 4201

  See: /addworld, %proxy_host, %proxy_port 

@quoting
@/qsh
@/qtf
@/qfile
@/qmud
@quoter.tf

quoter.tf

  Usage: 

  /REQUIRE quoter.tf

  /qdef [<prefix>] <name> - quote a current macro definition
  /qmac [<prefix>] <name> - quote a macro from a macro file
  /qworld [<prefix>] <name> - quote a world definition
  /qfile [<prefix>] <name> - quote a file
  /qtf <cmd> - quote a tf command
  /qsh <cmd> - quote a shell command
  /qmud <cmd> - quote a mud command
  ___________________________________________________________________________

  Each of these commands will quote some text to the current world.  <prefix> 
  is prepended to each generated line.  The default prefix is ":|", but can 
  be changed in /qdef, /qmac, /qworld, and /qfile.  

  /qmac will search a list of commonly used filenames.  To add your own, add 
  them to %{_qmac_files}.  

  /qworld will not list passwords.  

  /qmud requires that the world supports OUTPUTPREFIX and OUTPUTSUFFIX.  

  See: /quote, /list, /listworlds, /sh, tfrc 

@read
@read()

read()

  Expression usage: 

  read()
  ___________________________________________________________________________

  In an expression, read() reads a line of input from the keyboard until the 
  newline key is pressed or "/dokey newline" is executed.  During read(), all 
  existing keybindings continue to work normally.  

  Any text already in the input buffer is not cleared when read() starts.  
  Text entered after read() starts is appended to the existing text, and when 
  the read() ends, its result is the entire input buffer.  Lines entered 
  during a read() are not saved in the input history (but you can use 
  "/recordline -i" to save them explicitly).  

  read() (and the macro that called it) can be interrupted with a SIGINT, 
  normally generated by typing CTRL-C.  

  As an example, here's a simplified version of /cat: 

    /def mycat = \
        /let line=%; \
        /let all=%; \
        /while ((line:=read()) !~ ".") \
            /test all:=strcat(all, line)%; \
        /done%; \
        /eval %{all}

  Executing "/mycat" will repeatedly read lines from the keyboard, and assign 
  them to <line>.  If the line matches ".", the loop ends.  Each <line> is 
  appended onto <all>.  After the loop ends, the contents of <all> are 
  evaluated.  

  Caveat: during a read(), if a macro calls /dokey newline, the newline will 
  not be executed immediately, but will be held until the rest of the 
  commands in the macro are processed.  For example, consider the keybinding 
  "/def -b'^[^M' = /dokey newline%; /send go".  Normally, typing ^[^M would 
  execute the current input buffer, then send "go" to the server.  But during 
  a read(), typing ^[^M would send "go" first, and then do the newline that 
  completes the read().  

  See: interface, /input, expressions 

@redirection

redirection

  If TF is started with input or output redirected, %more will be ignored and 
  SIGINT (^C) will kill TF without prompting.  TF will not exit when EOF is 
  reached; the /quit command must be given explicitly.  

  On UNIX systems, it is possible to write a tf script starting with the 
  lines: 

      #!/bin/sh
      exec tf -n $* <$0

  and following with any tf commands.  The file can then be executed directly 
  like a shell script.  

@
@sockets

sockets

  Associated topics: 

  /connect 
          open a socket connection to a world 
  /dc     close (disconnect) a socket 
  /fg     bring a socket into the foreground 
  %login  enable automatic login 
  /listsockets 
          display a list of open sockets 
  idle()  idle time 
  %background 
          determines when to process text from background sockets 
  %bg_output 
          determines how to display text from background sockets 

#foreground
#background
#foreground/background
  A socket is an open connection to a world.  TF can have multiple sockets 
  open simultaneously.  Only one of these can be displayed at a time; this is 
  called the foreground socket.  In visual mode, the name of the world on the 
  foreground socket is displayed on the status line.  Other sockets are in 
  the background.  Text from any socket is triggered and stored in history 
  immediately, but is not displayed until that socket is brought into the 
  foreground.  Turning off the %{bg_output} flag prevents the display when 
  the socket is foregrounded.  Turning off the %{background} flag prevents 
  all processing until the socket is foregrounded.  

#current
  The current socket is the socket to which commands are sent.  The current 
  socket is almost always the same as the foreground socket, except: 1) when 
  a trigger is called from any socket, that socket becomes the current socket 
  for the duration of the trigger execution; 2) when a /repeat or /quote with 
  world redirection runs (-w option), that world's socket becomes the current 
  socket for the duration of the process execution.  

#
  Text from a socket goes through a number of checks before being displayed.  
  If the text matches any trigger patterns, a macro may be executed, or the 
  text may be gagged or hilited.  If the text was not gagged, TF also checks 
  to see if it should be suppressed because of %quiet, /watchdog or 
  /watchname.  Finally, the text is added to the world's history and the 
  global history, and is queued for display.  

  You can open a new socket in several ways: 

    * By giving the world name or address on the command line when 
      starting tf.  
    * By using a /connect or /world command.  
    * By "bamfing" through a portal between muds (see "bamf").  

  You can switch between foreground sockets with the /fg command; and the 
  next socket and previous socket keys, which default to ESC B and ESC F, and 
  can be modified with /bind.  

  If the %{quitdone} flag is on, and you disconnect from all worlds (either 
  with /dc or because the other end of the socket closes), Fugue will exit.  

  If the %{sockmload} flag is on, a world's macro file will be loaded when 
  you switch to the socket for that world (either with the next and previous 
  socket keys or with the /world command).  

  TF supports several TELNET options; see telnet.  

  If %{proxy_host} is defined, all connections will go through a proxy 
  server.  See: proxy.  

  See also: worlds 

@flags
@globals
@global variables
@environment
@special
@special variable
@special variables

special variables

  Many options in TF can be controlled by setting special global variables.  
  Many variables have a limited number of permitted values, with 
  corresponding integer values; these are called enumerated variables.  All 
  flags are enumerated variables which can have the values "off" (0) or "on" 
  (1).  Numeric variables can have any integer value (within the range 
  allowed by your system).  Attempting to unset numeric variable or give it a 
  string value will force its value to 0.  A variable's type (enumerated, 
  numeric, or string) affects its behavior in expressions.  

Read-only variables
  The following special variables can be examined, but not set: 

##
#%#
  #       The number of words in a macro's argument text.  

#?
#%?
  ?       The return value of the most recently executed command or 
          macro.  

#
  1,2...  
  L1,L2...  
  * 
  R       Positional parameters.  See "substitution".  

#
  P<n> 
  PL 
  PR      The text matched by the <n>th parenthesized subexpression, 
          or the text to the left or right of the matched text, in the last 
          successful regexp comparison.  See %Pn for more details.  

#
Special global variables
  The following special global variables can be examined and set.  In the 
  following list, a '=' following a variable name indicates its default 
  value.  For variables that do not have defaults listed, the default is 
  dependant on your system or configuration.  

#HOME
#%HOME
  HOME    Your home directory, used by /cd and filename expansion.  
          This is usually inherited from the environment when tf starts.  

#locale
#LANG
#%LANG
  LANG    If your system supports locales, TF will set the LC_ALL 
          locale according to the value of %{LANG} (which should usually be 
          set in the environment before TF starts).  Valid values for %{LANG} 
          and their meanings depend on your system; for details, see your 
          system's documentation for setlocale(3).  Locale affects the set of 
          allowed characters, the date and time format, and more.  If unset, 
          TF will use the default "C" locale, which allows the ascii 
          character set.  See also: %istrip.  

#MAIL
#%MAIL
  MAIL    If %{maildelay} is nonzero, TF will tell you there is new 
          mail when the file named by %{MAIL} has been modified but not yet 
          read.  If %{MAIL} is undefined, TF will try to define it as the 
          file with your login name in the mail directory.  

#SHELL
#%SHELL
  SHELL   Shell used by /sh and /quote !.  This is usually inherited 
          from the environment when tf starts.  

#TERM
#%TERM
  TERM    Terminal type.  Changing the value of %{TERM} at any time 
          will cause TF to re-initialize its display functions to use the new 
          value.  This is usually inherited from the environment when tf 
          starts.  

#TFHELP
#%TFHELP
  TFHELP=%{TFLIBDIR}/tf-help 
          The name of the file used by /help.  

#TFLIBDIR
#%TFLIBDIR
  TFLIBDIR 
          The name of the TF library directory, which should contain the help 
          file (tf-help), the standard library (stdlib.tf), the local library 
          (local.tf), and many useful utility files.  See also: /load.  

#TFLIBRARY
#%TFLIBRARY
  TFLIBRARY=%{TFLIBDIR}/stdlib.tf 
          The name of the library file loaded at startup.  This can be set in 
          the environment before starting tf, to load from an alternate 
          library file.  

#TZ
#%TZ
  TZ      On most systems, the timezone used to display formatted 
          times.  The value is usually the local timezone name, followed by 
          the difference in hours from GMT, followed by an optional daylight 
          saving timezone name; for example, "PST8PDT".  For details, see 
          your system documentation for tzset(3) or environ(5).  This is 
          usually inherited from the environment when tf starts.  

#background
#%background
  background=on 
          (flag) If on, text from background worlds is processed and recorded 
          immediately upon receipt.  Otherwise, the text is ignored until the 
          socket is brought into the foreground.  In either case, the text is 
          not displayed until the socket is brought into the foreground (but 
          see %{bg_output}).  

#backslash
#%backslash
  backslash=on 
          (flag) Enables use of '\' to quote the following character 
          literally during macro expansion.  Generally, this should only be 
          turned off if you are having problems with '\' in macros written 
          before version 3.0.  

#bamf
#%bamf
  bamf=off 

          off     (0): server "portals" are ignored.  
          on      (1): Unter-style bamfing is enabled (disconnect).  
          old     (2): Old-style bamfing is enabled (no disconnect).  

#bg_output
#%bg_output
  bg_output=on 
          (flag) If on, output from a background world will be displayed when 
          that world is brought into the foreground.  If off, background 
          output will not be displayed, but it will go through all other 
          normal processing, including triggers and history (so it can be 
          accessed with /recall).  This flag is ignored if the %{background} 
          flag is off.  

#borg
#%borg
  borg=on 
          (flag) Enables trigger bodies (attributes are unaffected).  (See: 
          triggers) 

#clearfull
#%clearfull
  clearfull=off 
          (flag) In visual mode, clear input window rather than scroll when 
          full.  Always 1 if terminal can not scroll.  

#cleardone
#%cleardone
  cleardone=off 
          (flag) In visual mode, enables clearing of input window when return 
          is pressed.  

#clock
#%clock
  clock=12-hour 
          If set to "12-hour" or "24-hour", the current time will be 
          displayed on the status line in visual mode.  If "off", time will 
          not be displayed.  

#raw
#%raw
#canon
#print
#%print
#ansi
#ansi_strip
#%ansi_strip
#ansi_attr
#emulation
#%emulation
  emulation=ansi_attr 
          Determines how special codes sent by the server should be 
          interpreted by tf.  Valid values are: 

          raw:    No processing done; lines not wrapped; all 
                  nonprintable characters are displayed, and their effect is 
                  undefined (depending mainly on your terminal).  TF's input 
                  display is not guaranteed correct; use at your own risk.  
                  This mode allows the server to have most of the control 
                  over the screen, but is not guaranteed to give the desired 
                  effect.  For best results, %{visual} should be "off", and 
                  tf attributes should not be used.  
          print:  Tabs expanded; backspaces interpreted; lines 
                  wrapped; nonprintable characters stripped.  
          ansi_strip: 
                  Like "print", but ansi-like codes are also stripped.  
          ansi_attr: 
                  Like "ansi_strip", but ansi-like attribute (color) codes 
                  will be converted to tf's internal format and displayed 
                  correctly (on any terminal).  Other ansi-like codes (e.g., 
                  cursor motion) will be stripped.  Recommended for servers 
                  that send vt100/ansi attributes.  
          debug:  converts nonprinting characters to a printable 
                  form.  See also: %telopt.  

          See also: %tabsize, attributes 

#end_color
#%end_color
  end_color 
          The code that should be sent to your terminal to return to normal 
          color after a %{start_color_<name>} code.  See: color.  

#gag
#%gag
  gag=on  (flag) Enable gag attribute in triggers.  (See: /gag, 
          /nogag) 

#gethostbyname
#%gethostbyname
  gethostbyname 
          Set to "blocking" or "nonblocking" to determine how hostname 
          resolution is done.  On OS/2, default is "nonblocking".  On UNIX, 
          default is "blocking", because nonblocking is usually slower unless 
          you have a fast machine and slow name service.  

#gpri
#%gpri
  gpri=0  Priority of subsequent /gags.  (See: /gag) 

#hook
#%hook
  hook=on 
          (flag) Enable hooks.  (See: hooks, /hook) Note that autologin and 
          automatic %{lp} setting will not work if %{hook} is 0.  

#hilite
#%hilite
  hilite=on 
          (flag) Enable underline, reverse, flash, dim, hilite, and bold 
          attributes in triggers.  (See: /hilite, /nohilite) 

#hiliteattr
#%hiliteattr
  hiliteattr=B 
          Defines the attributes used by hilites.  Can be any combination of 
          attributes, including color names.  (See: attributes, /hilite) 

#histsize
#%histsize
  histsize=1000 
          When a new world history is created, it will have space for 
          %{histsize} lines.  A world history is created the first time text 
          is sent to it.  (See also: /histsize) 

#hpri
#%hpri
  hpri=0  Priority of subsequent /hilites.  

#insert
#typeover
#%insert
  insert=on 
          (flag) If on, keyboard input is inserted; if off, input overstrikes 
          existing text.  

#isize
#%isize
  isize=3 
          Size of input window in visual mode.  

#istrip
#%istrip
  istrip=off 
          (flag) If on, the high bit will be stripped from all input 
          characters.  Otherwise, all characters allowed by the locale will 
          be accepted as input; characters not allowed by the locale have 
          their high bits converted to an ESC character, allowing M-x and ^[x 
          to invoke the same keybinding.  

#kecho
#%kecho
  kecho=off 
          (flag) Re-echoing of keyboard input, preceeded by %{kprefix}.  See 
          also: /localecho.  

#kprefix
#%kprefix
  kprefix= 
          Prefix for echoed keyboard text, if %{kecho} is on.  

#login
#%login
  login=on 
          (flag) Enable automatic login hook.  (See: hooks, /world) 

#lp
#%lp
  lp=off  (flag) Displays partial lines as prompts, after a short 
          timeout.  Useful for LP and Diku MUDs.  (See: prompts) 

#lpquote
#%lpquote
  lpquote=off 
          (flag) If on, waits for LP prompt for /quote and /repeat, instead 
          of operating on a timed basis.  (See: processes, /quote, /repeat) 

#maildelay
#%maildelay
  maildelay=60 
          Delay in seconds between mail checks.  Setting this to 0 disables 
          mail checking.  The file to be checked is named by the %{MAIL} 
          variable.  

#matching
#%matching
  matching=glob 
          Determines the default pattern matching style.  

          "simple": 
                  straightforward string comparison.  
          "glob": 
                  shell-like matching (as before version 3.2).  
          "regexp": 
                  regular expression.  

          See also: patterns, regmatch(), %Pn.  

#max_iter
#%max_iter
  max_iter=1000 
          Maximum number of iterations in a /while loop.  A value of 0 will 
          allow unlimited iterations.  

#max_recur
#%max_recur
  max_recur=100 
          Maximum depth of recursive macro calls or triggers.  A value of 0 
          will allow unlimited recursion.  

#mecho
#%mecho
  mecho=off 

          "off" (0): 
                  do not echo macro expansions.  
          "on" (1): 
                  echo expansions of non-invisible macros.  
          "all" (2): 
                  echo expansions of all macros.  

          %{mprefix} will be prepended once for each recursion level when 
          macro expansion echoing is enabled.  

#more
#%more
  more=off 
          (flag) Displays output one screenfull at a time.  (See: /more) 

#mprefix
#%mprefix
  mprefix=+ 
          Prefix for macro echoing, if %{mecho} is not "off".  

#oldslash
#%oldslash
  oldslash=on 
          (flag) If on, sequences of more than one '/' in a macro body will 
          be compressed by one during macro expansion.  This allows macros 
          written before version 3.0 to work properly.  You are encouraged to 
          turn this off.  (See: evaluation) 

#prompt_sec
#%prompt_sec
#prompt_usec
  prompt_sec=0 
  prompt_usec=250000 
          These two variables control the delay used to recognize 
          unterminated prompts.  (See: prompts).  

#proxy_host
#%proxy_host
#proxy_port
#%proxy_port
  proxy_host= 
  proxy_port=23 
          These two variables describe the proxy server used for worlds 
          defined with /addworld -p.  (See: proxy).  

#ptime
#%ptime
  ptime=1 
          Default delay (in seconds) between /quote and /repeat process runs.  

#qecho
#%qecho
  qecho=off 
          (flag) Echoing of /quote text, prefixed by %{qprefix}.  

#qprefix
#%qprefix
  qprefix= 
          Prefix for /quote echoing, if %{qecho} is on.  

#quiet
#%quiet
  quiet=off 
          (flag) Gag text after login until the mud sends "Use the WHO 
          command", "### end of messages ###", or 25 lines.  Note: This will 
          not function correctly on MUDs which don't send those strings or 25 
          lines in the introductory text.  

#quitdone
#%quitdone
  quitdone=off 
          (flag) Quit upon disconnection from last socket.  

#redef
#%redef
  redef=on 
          (flag) Allows redefinition of existing worlds, keybindings, and 
          named macros.  

#refreshtime
#%refreshtime
  refreshtime=250000 
          The delay (in microseconds) for redisplaying your keyboard input 
          after it is overwritten by incoming text in non-visual mode.  If 
          you you are on a slow modem, you may wish to increase this delay.  
          On a fast connection, you may wish to decrease it.  The default is 
          250000 (1/4 second).  

#scroll
#%scroll
  scroll=on 
          (flag) In visual mode, scroll output instead of wrapping from 
          bottom to top.  

#shpause
#%shpause
  shpause=off 
          (flag) Wait for a keypress after returning from /sh.  

#snarf
#%snarf
  snarf=off 
          (flag) Don't send empty lines to the server.  

#sockmload
#%sockmload
  sockmload=off 
          (flag) Load macro files when foregrounding a world ("/dokey 
          socketf", "/dokey socketb", or "/fg").  Normally, a world's macro 
          file is loaded only when TF first connects to it.  (Note: the WORLD 
          hook is more useful than sockmload).  

#start_color_name
#%start_color_name
  start_color_<name> 
          The code that should be sent to your terminal to produce color 
          <name>.  See: color.  

#tab
#%tab
#tabs
#tabsize
#%tabsize
  tabsize=8 
          Tabs will be replaced with spaces to pad to a multiple of 
          %{tabsize}.  

#telopt
#%telopt
  telopt=off 
          (flag) Display telnet option negotiations (for debugging purposes).  
          See also: %emulation=debug.  

#sub
#%sub
  sub=off 

          "off" (0): 
                  input is not expanded.  
          "on" (1): 
                  input "%;" is expanded to newlines.  
          "full" (2): 
                  input undergoes full macro expansion.  

#time_format
#%time_format
  time_format=%H:%M 
          The format used to display times in /recall and /time.  The default 
          displays hours and minutes.  See ftime() for a description of the 
          format.  

#visual
#%visual
  visual=off 
          (flag) Divides the screen into an input window and an output 
          window.  (See: mode) 

#watchdog
#%watchdog
  watchdog=off 
          (flag) Gag repeated lines.  (See: /watchdog) 

#watchname
#%watchname
  watchname=off 
          (flag) Gag overactive players.  (See: /watchname) 

#wordpunct
#%wordpunct
  wordpunct=_ 
          List of punctuation that will be considered to be part of a word 
          instead of delimiting the ends of a word, by kbwordleft() and 
          kbwordright() (and therefore by /dokey WLEFT, WRIGHT, etc).  

#wrap
#%wrap
  wrap=on 
          (flag) Enable wordwrap on the screen.  TF will try to break lines 
          between words to fit them within %{wrapsize} columns.  %{wrap} is 
          ignored if %{emulation} is "raw".  

#wraplog
#%wraplog
  wraplog=off 
          (flag) Enable wordwrap in log files.  See also: %wrap.  

#wrapsize
#%wrapsize
  wrapsize=79 
          Lines (input and output) extending past this column will be split.  
          Default value is one less than the number of columns on your 
          terminal (typically 80).  Output is not wrapped if %{emulation} is 
          "raw".  See also: %wrap, %wrapspace.  

#indent
#%indent
#wrapspace
  wrapspace=0 
          Wrapped text is indented by this many spaces.  See also: %wrap, 
          %wrapsize.  

#
  The builtin commands /gag, /hilite, /hook, /nogag, /nohilite, /watchdog, 
  and /watchname set the corresponding variables, and also perform additional 
  functions.  

  The standard library also defines /background, /bamf, /borg, /clearfull, 
  /cleardone, /gpri, /hpri, /insert, /isize, /login, /lp, /lpquote, /kecho, 
  /mecho, /more, /ptime, /qecho, /quiet, /quitdone, /redef, /shpause, 
  /sockmload, /sub, /visual and /wrapspace macros to set the values of the 
  corresponding variables.  

  Note: The variables 'L' and 'R' are reserved (see: variables).  You should 
  not assign values to them.  

  See: variables, /set 

@status
@status bar
@status line

status line

  See: mode, /more, %MAIL, %insert, %clock, /log, sockets 
@subs
@substitution

substitution

  Before a macro body or arguments to /eval are executed, special character 
  sequences are replaced with new text as described below.  

#%;
#newline
#command separator
Command separation. 
%;

  Separates commands within a macro body.  Example: ":falls down.%;:goes 
  BOOM!" is sent as two separate lines.  "%\" is also accepted, for backward 
  compatibility, but is discouraged.  

#character substitution
#\n
#\
#ascii
Character substitution. 
\n
\c

  In the first form, the character whose ASCII code is <n> is substituted.  
  If <n> starts with "0x", it is interpreted as a hexadecimal number; 
  otherwise, if <n> starts with "0", it is interpreted as octal; otherwise, 
  it is interpreted as decimal.  In the second form, the character <c> is 
  substituted.  This is useful for escaping any special meaning <c> has; in 
  particular, "\\" is substituted with "\".  If the variable %{backslash} is 
  off, the \c form does not have this special interpretation.  

#//
Slash compression. 
//... 

  If %{oldslash} is on, sequences of slashes are replaced with a sequence of 
  one fewer slashes.  A single slash, however, is left alone.  This feature 
  remains for backward compatibility only; you are encouraged to turn 
  %{oldslash} off to disable this.  

#$[
#$[]
Expression evaluation. 
$[expression]

  The <expression> is evaluated and its value is substituted in its place.  
  See "expressions".  

#$(
#$()
#command subs
#command substitution
Command substitution. 
$(commands)

  The <commands> are executed, and their output is substituted in its place 
  (much like the ` ` operator in most shells).  If <commands> produce more 
  than one line of output, they will be concatenated to form one line.  

  Example: 

          /def showdef = :quotes a macro:  $(/list %{1-@})

  could be used to display one of your macros to other mudders.  

#$
#${
#${}
#macro subs
#macro substitution
Macro substitution. 
${name}
$name$

  The body of the macro <name> is substituted.  The first form is preferred.  
  In the first form, the brackets may be omitted if the subsequent text could 
  not be confused as part of the name.  

  Example: The text "${foo}" would be replaced with the body of the macro 
  named "foo".  

#$$
Dollar compression. 
$$... 

  Sequences of '$'s are replaced by a sequence of one fewer '$'s.  A single 
  '$', however, is left alone, unless it introduces one of the substitutions 
  described above.  

#%
#%{
#%{}
#%n
#%1
#%R
#%L
#%*
#variable subs
#variable substitution
#positional parameters
#arguments
#parameters
#variables and parameters
Variable and Argument substitution. 
%{selector}
%{selector-default}

  The value of a variable or an argument to the macro is substituted, as 
  determined by <selector>.  The brackets are recommended for clarity, but 
  may be omitted if there is no default and the text following it can not be 
  interpreted as part of the selector.  The selector can be any of: 

  <name>  The value of the variable <name> is substituted.  Names are 
          case sensitive.  

  * or 0  selects the entire argument line.  

  1, 2, 3, etc.  
          selects the corresponding positional parameter (word) from the 
          argument text.  There is no maximum parameter number.  

  -1, -2, -3, etc.  
          selects from the argument text all words except the first, all 
          except the first two, all except the first three, etc.  

  L1, L2, etc.  
          selects the last word, second-to-last word, etc.  "L" is the same 
          as "L1".  

  -L1, -L2, etc.  
          selects all words from the argument text except the last, all 
          except the last two, etc.  "-L" is the same as "-L1".  

  Pn      selects the text matching the <n>th parenthesized 
          subexpression from the last regular expression match.  See %Pn.  

  R       selects a word from the argument text at random.  (see 
          also: rand()) 

  Variable names are case sensitive; "L" and "R" selectors are not.  

  If the selected expansion would be empty, and a <default> value is given, 
  the default will be substituted instead.  Thus "%{1-foofle}" is replaced 
  with the first word if there is one, or "foofle" if not.  The <default> 
  value may contain variable, macro, expression, and command substitutions.  

  The "argument text" used for parameter substitutions depends on where the 
  expansion occurs.  In a macro call, it is the arguments to the macro.  In a 
  trigger call, it is the text which triggered the macro.  In an /eval 
  statement, it is inherited from the caller.  

  Note that in expressions, it is easiest to omit the % and just use the 
  {selector[-default]} part.  If the selector is a variable name and no 
  default is desired, the name may be used directly in an expressions without 
  % or {...}.  

#%{PL}
#%PL
#%{PR}
#%PR
#%{Pn}
#%Pn
#%P
#subexpressions
#regexp subexpressions
Regexp subexpressions. 
%{Pn}

  This is actually a special case of variable substitution.  The %Px 
  variables get their values from the last successful regexp match in scope.  
  %P0 expands to the text matched by the entire regexp.  %Pn expands to the 
  text matched by the <n>th parenthesised subexpression of the regexp.  %PL 
  and %PR expand to the text to the left and right, respectively, of the text 
  matched by the entire regexp.  The "scope" of a regexp match is the 
  lifetime of the macro expansion it triggered, hooked, or in which it 
  occurred (i.e., with regmatch()).  

  For example, after the text "Jabba the Hutt goes east." matches the regexp 

    " goes ([^ ]*)\.$"

  then the following expansions will be available until the macro exits: PL = 
  "Jabba the Hutt"; P0 = " goes east."; P1 = "east".  

  The number <n> can be anything from 0 to 9; other values will be silently 
  ignored.  If there is no subexpression corresponding to <n>, the 
  substitution will be ignored.  When parentheses are nested, <n> refers to 
  the order of the opening parentheses.  

  The %Pn subs will always refer to the first regexp match on the line, even 
  if a partial hilite (/def -P) causes the regexp to be applied more than 
  once.  

#%%
#percent compression
Percent compression. 
%%... 

  Sequences of '%'s are replaced by a sequence of one fewer '%'s.  A single 
  '%', however, is left alone unless it introduces one of the substitutions 
  described above.  

#
Examples 
  Here are a couple of simple examples.  

  Definition: /def advice = whisper %1 = Let the wookie win. 
  Command: /advice R2D2
  Sends: whisper R2D2 = Let the wookie win. 

  Definition: /set ending=meister
  Definition: /def greet = :waves to %{1-Jack}%{ending}. 
  Command: /greet
  Sends: :waves to Jackmeister. 
  Command: /greet Dave
  Sends: :waves to Davemeister. 

  For some more complex examples, look at the files in TFLIBDIR.  

  See: evaluation, expressions 

@summary

summary

  See "intro" for basic information on using TF.  See "topics" for a list of 
  other help topics.  See "commands" for a complete list of TF builtin 
  commands.  See "/help" for instructions on using /help.  

  If you are having problems with TF and wish to contact the author, see 
  "problems".  

  If you are having trouble reading the help sections because text is 
  scrolling off the screen, try typing "/more on" before /help, and then 
  press TAB at a "--More--" prompt when you're ready to continue.  

@command line
@commandline
@startup
@invocation
@tf

tf

  Syntax: 

  tf [-f[<file>]] [-vlqn] [<world>]
  tf [-f[<file>]] [-vlq] <host> <port> 
  ___________________________________________________________________________

  At startup, TF initializes its special variables; any variables defined in 
  the environment will override TF's default values for the variables with 
  the same name.  TF then loads commands from the standard macro library 
  (stdlib.tf), the optional local macro library (local.tf), and your personal 
  configuration file (see tfrc).  Then, TF will try to connect to <world>, or 
  <host> <port>.  If no world is given, TF will try to connect to the first 
  world defined with /addworld in the configuration file(s).  If no worlds 
  are defined, or TF can not connect to the specified world, TF will start up 
  in unconnected mode.  

  Options: 

  -f<file> 
          Load <file> instead of the normal personal config file.  
  -f      Do not load any personal config file at startup.  
  -n      Do not connect to any world automatically at startup.  
  -l      Disable automatic login.  
  -q      Enable quiet login.  
  -v      Disable automatic switch to visual mode.  

  If the variable TFLIBRARY is defined in the environment, its value will be 
  used as the name of a file to load instead of the default library.  

  If the variable LANG is defined in the environment, its value will be used 
  as the locale in which tf operates.  Locale affects the character set, date 
  and time formatting, and more.  

  See http://tf.tcp.com/~hawkeye/tf/ for the latest info on TF.  

  See also: intro, tfrc, library, worlds, /addworld 

@tfout
@tferr
@streams
@tfio

tfio

  TF normally does its output through "streams", which are analagous to the 
  streams of C stdio.  

  Output from most tf commands, including /echo, are output to "tfout", which 
  is normally attached to the screen.  Tf error messages, hook messages, and 
  the output of "/echo -e" are output to "tferr", which is always attached to 
  the screen.  

  Text from a world or "/echo -w" is sent to a stream for that world.  Text 
  sent to a world stream will be stored in the history of that world.  If 
  that world is the foreground world, the text is sent to the screen 
  immediately; otherwise, it will not be displayed until world is brought 
  into the foreground.  

  During a command /quote or $() command substitution, tfout is attached to a 
  temporary queue that collects the output of the command.  But tferr remains 
  attached to the screen at all times, so error messages, hook messages, and 
  "/echo -e" are still displayed to the screen and not captured by the output 
  redirection.  

  See also: interface, substitution, /quote.  

@config
@configuration
@customization
@customizing
@tfrc
@tinytalk
@.tinytalk
@.tfrc

.tfrc

  At startup, TF attempts to load and execute commands from the %HOME/.tfrc 
  or %HOME/tfrc personal config file.  This file can contain any commands you 
  want executed automatically when TF starts.  

  Some useful commands to include in your personal config file: 

  /addworld 
          Define a world.  TF will autoconnect to the first world.  
  /hilite 
          Define a hilite.  
  /gag    Define a gag.  
  /load   Load commands from another file.  
  /require 
          Load a library file.  
  /set    Set a variable.  There are many special variables that 
          change the behavior of tf, listed under "special variables".  

  %TFLIBDIR contains a sample "tfrc" file that you may want to copy and 
  modify to fit your tastes.  

  For backward compatibility, TF will load ~/.tinytalk if it exists.  The use 
  of ~/.tinytalk is discouraged.  

  See: startup, library, special variables, /load 

@timer
@timing

timing

  See: processes, /repeat, /quote, utilities (/at, /tick), %clock, /time.  
@tools
@/reedit
@/name
@/getline
@/xtitle
@tools.tf

tools.tf

  Usage: 

  /REQUIRE tools.tf
  ___________________________________________________________________________

  /REEDIT <macroname> 
          Stick an existing macro definition in the input window for editing.  

  /NAME [<name>] 
          Change your character name (on a TinyMUD style mud).  

  /GETLINE <n> 
          Grab the <n>th line from history and stick it in the input buffer.  

  /XTITLE <text> 
          Put <text> on the titlebar of an xterm.  

  See: /sh, /edit, /recall, tfrc 

@triggers

triggers

  Before we get into the gory details, here's a simple example of a trigger: 

    /def -t"{*} has arrived." greet = :waves to %1. 

  This command defines a macro called "greet".  Whenever text like "Bob has 
  arrived." is received, /greet will be executed automatically, sending the 
  text ":waves to Bob." to the server.  

  Associated commands: 

  /def    define a macro with any fields 
  /trig   define a trigger macro 
  /trigp  define a trigger macro with priority 
  /trigc  define a trigger macro with probability 
  /trigpc 
          define a trigger macro with probability and priority 
  /gag    define a trigger macro to gag text 
  /hilite 
          define a trigger macro to hilite text 
  /trigger 
          call a trigger macro manually 

  Triggers are a method of calling a macro based on incoming text.  When a 
  line of text from a socket matches the trigger pattern of a macro, that 
  macro becomes a candidate for automatic execution.  

  If multiple macros have triggers which match the same text, one or more are 
  chosen for execution as described under "priority".  

  The <text> which triggers a macro is given to the macro as arguments, as if 
  it had been called with ``/<macro> <text>''.  Positional parameters refer 
  the the corresponding word in the triggering text (see also: %n).  If the 
  trigger is a regexp, subexpression parameters refer to the text matched by 
  the corresponding parenthesised subexpression (see also: %Pn).  

  If the selected macro(s) have display attributes, the attributes are used 
  to display the text which triggered the macro.  

  If a macro has the world field set, it can only be triggered by text from 
  that world.  

  If a macro has a probability less than 100%, it might not be executed even 
  if it is triggered.  

  Triggers can be disabled by turning the %{borg} flag off.  

  If the %{background} flag is turned off, text from background sockets will 
  not cause triggering until that socket is brought into the foreground.  

  Triggers can also be set off manually with the command /trigger.  

  The /def command is the only way to specify a multi-shot trigger.  All 
  other commands which define triggers will create permanent triggers.  

  Note that tf may run slowly if there are many triggers defined, since every 
  trigger must be compared against every received line of text.  Choose your 
  triggers carefully.  

  See also: patterns, macros, gags, hilites, hooks, priority 

@util
@utils
@/alias
@/at
@/complete
@completion
@/putfile
@map
@/psh
@quoter
@/rwho
@spell
@/spell_line
@space_page
@/speedwalk
@/tick
@/watch
@worldqueue
@utilities

utilities

  The library directory %{TFLIBDIR} contains many useful utility files ending 
  in ".tf".  To use any one of them, simply /load or /require the file.  For 
  example, to enable ESC-TAB completion automatically, just "/require 
  completion.tf" from your .tfrc file.  Some of the more useful files: 

  alias.tf 
          /alias, etc: create commands without '/'.  
  at.tf   /at: execute commands at a specified time.  
  complete.tf 
          Automagic word completion.  
  filexfer.tf 
          /putfile, /getfile: transfer files to/from a mud.  
  kb-bash.tf 
          Keybindings similar to those in bash.  
  kb-emacs.tf 
          Keybindings similar to those in emacs.  
  kb-os2.tf 
          Extra default key bindings for OS/2 keyboards.  
  kbbind.tf 
          Default keybindings.  
  kbfunc.tf 
          Macros used by kbbind.tf.  
  map.tf  Mapping commands (like tintin).  
  psh.tf  /psh: like /sh, but uses your favorite shell.  
  quoter.tf 
          Various quoting macros.  
  rwho.tf 
          Remote WHO from a mudwho server.  
  spc-page.tf 
          Old-style SPACE key scrolling at --More-- prompt.  
  spedwalk.tf 
          Single character movement (like tintin).  
  spell.tf 
          Spelling checker.  
  tick.tf 
          Diku tick counter (like tintin).  
  tr.tf   /tr: character translation 
  watch.tf 
          /watch: Watch for a particular player.  
  world-q.tf 
          Keep track of active worlds.  

  There are also other files, not listed here.  

  For complete instructions on any of these utilities, see the help section 
  for that topic if there is one, or read the comments at the top of each 
  file.  Sorry, I haven't gotten around to documenting them very well.  

  Note to unix users: many library files were renamed in version 3.5, but the 
  old names still work (via soft links).  

@variables
@variable

variables

  Associated commands: 

  /set    set the value of a global variable 
  /let    set the value of a local variable 
  /setenv 
          set the value of an environment variable 
  /unset  unset a variable 
  /export 
          move an global variable to the environment 

  A TinyFugue variable has a name and a value.  Names are case sensitive, and 
  should start with a letter and contain only letters, numbers, and 
  underscores.  A value can be any string, but special flag and numeric 
  variables will automatically convert their value to an integer.  

  Variables may either be local, global, or exported.  Global variables are 
  imported from the environment when tf starts, or defined with /set; they 
  are visible to all tf commands.  Local variables are created with /let or 
  assignment expressions, and only exist in the scope in which they were 
  created.  Exported variables are global variables which are also visible to 
  subshells, so they can be used by commands /sh, the '!' option of /quote, 
  and file uncompression.  

  The value of a variable can be obtained using a '%' substitution (see 
  "substitution"), or by simply using its name in an expression (see 
  "expressions").  

  See "special variables" for a list of special variables.  

@worlds

worlds

  Associated commands: 

  /addworld 
          define a new world 
  /world  connect to a defined world 
  /dc     disconnect from a world 
  /unworld 
          undefine a world 
  /purgeworld 
          undefine a group of worlds 
  /saveworld 
          save world definitions to a file 
  /listworlds 
          load world definitions from a file 

  Fugue stores a list of "worlds" that it knows about.  Each world has six 
  fields associated with it: 

    * A name (which is simply a label for the world) 
    * A type (optional) 
    * A character name (optional) 
    * A character password (optional) 
    * A host address 
    * A host port 
    * A macro file (optional).  

  The character name, password, and type are used by automatic login, if the 
  %{login} flag is on.  

  The macro file is loaded when a socket is opened to the world.  It can 
  contain any commands you want executed automatically when you connect to 
  that world.  If the flag %{sockmload} is on, this file will also be loaded 
  whenever you switch to a world with the SOCKETB and SOCKETF keys (see 
  sockets, /dokey, hooks (CONNECT)).  

  Fugue also keeps track of a world named "default", which is just a dummy 
  world with a character name and password, and optionally a macro file.  If 
  a default world is defined, worlds without character, password, or file 
  fields will use the values from the default world.  

#$world_name
#$world_character
#$world_password
#$world_host
#$world_port
#$world_mfile
#$world_type
#fields
  World information can be accessed with these macro expansions: 

    * ${world_name} 
    * ${world_character} 
    * ${world_password} 
    * ${world_host} 
    * ${world_port} 
    * ${world_mfile} 
    * ${world_type} 

  For example: 
  /eval say I am ${world_character} on ${world_name}.  
  This would tell the rest of the world some stuff they probably don't care 
  about, namely the label your Fugue has assigned to the current world and 
  the character name under which it logged on.  

  See also: sockets 

@
