home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / new / game / role / amigamud / amdoc1 / builtins.txt next >
Text File  |  1994-08-07  |  159KB  |  3,833 lines

  1.             The AmigaMUD Builtin Functions
  2.  
  3.  
  4. This file documents all of the builtin functions in the AmigaMUD
  5. system. The functions are listed in alphabetical order. Each is given
  6. with the category it is in, along with its prototype. Each is then
  7. described and, if appropriate, examples are given. More general
  8. discussions can be found in the ProgConcepts.txt file. The "utility"
  9. in the prototypes indicates that the builtin function does not change
  10. the effective user when it is executed. Some builtins have "wizard" in
  11. their prototype, which means they can only be used by full wizards,
  12. and not by apprentices. Also, some functions can only be executed by
  13. SysAdmin, but this is not indicated in their header.
  14.  
  15.  
  16. AAn: output
  17. proc utility AAn(string s1, s2)string
  18.  
  19.     AAn is used to make output look more like proper English. It
  20.     returns a string which is the concatenation of its two string
  21.     arguments, with either " a " or " an " inserted between them,
  22.     depending on whether the first letter of the second string is a
  23.     vowel or not. E.g.
  24.  
  25.     AAn("You do not have", "apple") => "You do not have an apple"
  26.     AAn("You do not have", "tree")    => "You do not have a tree"
  27.     AAn("", "whatzit") => "a whatzit"
  28.  
  29. AbortEffect: effects
  30. proc utility AbortEffect(thing who; int kind, id)void
  31.  
  32.     AbortEffect is used to abort an ongoing effect in a full client.
  33.     'who' is the thing of the client to be affected, or nil to mean
  34.     the active client. 'kind' is the kind of effect to be aborted,
  35.     with values: 0 => sound, 1 => speech, 2 => music. 'id' is the
  36.     identifier of the specific affect to be aborted. This id is
  37.     also given when the effect is started. E.g.
  38.  
  39.     VSpeak(nil, "Hello there!", 777);
  40.     ...
  41.     AbortEffect(nil, EFFECT_SPEECH, 777);
  42.  
  43. ABPrint: output
  44. proc utility ABPrint(thing location, agent1, agent2; string str)void
  45.  
  46.     ABPrint outputs string 'str' to all clients with the given
  47.     location, except those whose things are identified by 'agent1' and
  48.     'agent2'. Either or both of these can be nil to be ignored. The
  49.     standard scenario uses ABPrint during combat, to allow three
  50.     different messages to be given: one to the attacker, one to the
  51.     victim, and one to any onlookers. The last uses ABPrint.
  52.  
  53. AddButton: effects
  54. proc utility AddButton(int x, y, n; string str)void
  55.  
  56.     AddButton is used to add a mouse-button to the graphics window of
  57.     the active client. 'x' and 'y' give the co-ordinates of the top-
  58.     left corner of the button, 'n' gives the identifier of the button,
  59.     and 'str' is the text contents of the button. The length of the
  60.     text determines the width of the button. Buttons are 16 pixels
  61.     high and 16 + 8 * <text-length> pixels wide. Empty buttons can be
  62.     produced by using strings containing only spaces. When the user
  63.     clicks on the button, the identifier, 'n', is sent to the server
  64.     for processing by the character's current "button action". If
  65.     there is already a button with the indicated id, then the new
  66.     button is ignored. E.g.
  67.  
  68.     AddButton(20, 10, BUTTON_ID, "Hit");
  69.  
  70. AddHead: database
  71. proc utility AddHead(<any list> theList;
  72.     <corresponding element type> theElement)void
  73.  
  74.     AddHead is used to add an element to the front of a list. It is a
  75.     generic function in that it works for any type of list. The new
  76.     element is inserted before any existing elements, so it will have
  77.     index 0 in the list. E.g.
  78.  
  79.     private l CreateIntList().
  80.     l[0]. => error
  81.     AddHead(l, 10).
  82.     l[0]. => 10
  83.     l[1]. => error
  84.     AddHead(l, 999).
  85.     l[0]. => 999
  86.     l[1]. => 10
  87.  
  88. AddRegion: effects
  89. proc utility AddRegion(int x1, y1, x2, y2, n)void
  90.  
  91.     AddRegion adds a mouse sensitive rectangular region to the
  92.     graphics window of the active client. The window is not visible,
  93.     but a mouse-click inside of it (that doesn't hit a button or a
  94.     region with lower identifier) will return the identifier of the
  95.     region and the co-ordinates of the click relative to the top-left
  96.     corner of the region. 'x1' and 'y1' are the co-ordinates of the
  97.     top-left corner of the region, and 'x2' and 'y2' are the co-
  98.     ordinates of the bottom-right corner of the region. Point (x2, y2)
  99.     is included in the region. 'n' is the identifier for the region.
  100.     Such a region is used in the standard scenario over the entire
  101.     map-view area of the graphics window. The position of the click
  102.     relative to the position of the player cursor determines which
  103.     direction the user wants to move in. Another region is used for
  104.     the icon editor. Attempting to add a region using an identifier
  105.     that is already in use has no effect. E.g.
  106.  
  107.     AddRegion(10, 10, 90, 150, REGION_ID);
  108.  
  109. AddTail: database
  110. proc utility AddTail(<any list> theList;
  111.     <corresponding element type> theElement)void
  112.  
  113.     AddTail adds the indicated element to the end of the list. It is
  114.     generic, in that it will work on any type of list. See also
  115.     'AddHead'. E.g.
  116.  
  117.     private l CreateIntList().
  118.     l[0]. => error
  119.     AddTail(l, 10).
  120.     l[0] => 10
  121.     l[1] => error
  122.     AddTail(l, 999).
  123.     l[0] => 10
  124.     l[1] => 999
  125.  
  126. After: machine/character
  127. proc utility After(int seconds; action theAction)void
  128.  
  129.     After is the heart of automatic activities in AmigaMUD. It
  130.     arranges things so that after 'seconds' seconds, function
  131.     'theAction' is called (with no parameters). The function must be
  132.     one which returns no result (void). When the function is called,
  133.     the active agent will be either the character who was active when
  134.     After was called, or the machine which was active when After was
  135.     called. Note that all such scheduled actions are cancelled when
  136.     the server is shut down - they are not automatically re-installed
  137.     when the server is restarted. Characters and machines have
  138.     activation actions, which are called when the server restarts,
  139.     which can be used to restart any 'After' actions. Any machine
  140.     which does things independently of players will normally have one
  141.     or more 'After' activities. Continuous scheduling of actions can
  142.     be done by using After as the last thing done in a function called
  143.     by After. E.g.
  144.  
  145.     private proc machineStep()void:
  146.         /* Do things based on the machine's state and what is
  147.            happening around it. */
  148.         ...
  149.         After(30 + Random(30), machineStep);
  150.     corp;
  151.  
  152. AgentLocation: machine/character
  153. proc utility AgentLocation(thing theAgent)thing
  154.  
  155.     AgentLocation returns the thing which is the current location of
  156.     the agent whose thing is passed as 'theAgent'. 'theAgent' can be
  157.     the thing of a player character or of a machine. Note that it is
  158.     possible for an agent to be nowhere, so that AgentLocation returns
  159.     nil. Builtin "Here()" is similar to "AgentLocation(Me())". If a
  160.     player character thing is passed, and that character is not
  161.     currently connected, AgentLocation will return nil.
  162.  
  163. APrint: output
  164. proc utility APrint(string message)void
  165.  
  166.     APrint is the AmigaMUD broadcast facility. It sends the given
  167.     'message' to all active clients on the MUD. It is useful for use
  168.     by SysAdmin to make announcements, like "system going down in five
  169.     minutes". The standard scenario uses it to announce when a
  170.     character solves a quest. Note that the server flushes output to
  171.     any given client before it starts output to another client. Thus,
  172.     any messages printed using "APrint" should be done all at once,
  173.     otherwise unwanted newlines may appear.
  174.  
  175. BootClient: machine/character
  176. proc utility BootClient(character who)void
  177.  
  178.     BootClient can be used to force a player off of the system. It is
  179.     equivalent to code running for the player executing "Quit()". The
  180.     client will be shutdown when it is next non-active (which is
  181.     normally immediately). Note that BootClient allows the character
  182.     to execute any shutdown code. BootClient is a graceful boot. If
  183.     something is wrong (e.g. the shutdown code causes troubles), the
  184.     more forceful 'NukeClient' can be used. NukeClient will often mess
  185.     up the character, however.
  186.  
  187. CallEffect: effects
  188. proc utility CallEffect(thing who; int whichEffect)void
  189.  
  190.     CallEffect is used to execute an effect which has been defined
  191.     for the client 'who'. Effects are identified by an identifier
  192.     given when the effect is created using 'DefineEffect' and
  193.     'EndEffect'. If the identified effect is not known to the remote
  194.     client (the "MUD" program), then nothing is done. CallEffect
  195.     can be used inside an effect being defined, in which case it is
  196.     like an effect subroutine call. E.g.
  197.  
  198.     DefineEffect(nil, EFFECT_ID);
  199.     ...
  200.     /* graphics, sound, etc. effect calls */
  201.     ...
  202.     CallEffect(nil, SUBROUTINE_EFFECT_ID);
  203.     ...
  204.     EndEffect();
  205.     ...
  206.     CallEffect(nil, EFFECT_ID);
  207.  
  208. CanEdit: machine/character
  209. proc utility CanEdit()bool
  210.  
  211.     CanEdit returns an indication of whether or not the active agent
  212.     can edit functions and strings. Thus, the scenario can use
  213.     'EditString' to allow editing of a description, or can use line-
  214.     by-line input to read it. In general, a player using "MUD" can
  215.     edit, as can a local player using "SMUD", and all others cannot.
  216.  
  217. Capitalize: utility
  218. proc utility Capitalize(string str)string
  219.  
  220.     Capitalize returns its string argument 'str', but with its first
  221.     character capitalized (made upper-case) if it is a letter. E.g.
  222.  
  223.     Capitalize("hello") => "Hello"
  224.     Capitalize("123") => "123"
  225.  
  226. ChangeName: machine/character
  227. proc utility wizard ChangeName(string newName)void
  228.  
  229.     ChangeName allows the active character to change his/her name.
  230.     Just assigning to property "p_pName" does not work, and will
  231.     result in an inconsistent character. Valid names must be non-
  232.     empty, must not contain any punctuation, must be no more than 20
  233.     characters long, and must not match any existing character name.
  234.  
  235. Character: machine/character
  236. proc utility Character(string name)character
  237.  
  238.     Character looks up the passed 'name' in the 'Characters' table,
  239.     returning nil or the named character. The character does not have
  240.     to be connected. Note that the value returned is of type character
  241.     and not of type thing - use 'CharacterThing' to return the thing
  242.     for the character.
  243.  
  244. CharacterLocation: machine/character
  245. proc utility CharacterLocation(character theCharacter)thing
  246.  
  247.     CharacterLocation is similar to AgentLocation, in that it returns
  248.     the thing which is the location of the 'theCharacter'. Only
  249.     character values can be passed, however, and the character's
  250.     location is returned even if the character is not currently
  251.     connected to the MUD.
  252.  
  253. CharacterTable:  machine/character
  254. proc utility CharacterTable(character theCharacter)table
  255.  
  256.     CharacterTable returns the table which is the private table of
  257.     'theCharacter'. All player characters have such a table.
  258.  
  259. CharacterThing: machine/character
  260. proc utility CharacterThing(character theCharacter)thing
  261.  
  262.     CharacterThing returns the thing associated with player character
  263.     'theCharacter'. All characters have such a thing. The reverse
  264.     action is performated by 'ThingCharacter'.
  265.  
  266. ClearButtons: effects
  267. proc utility ClearButtons()void
  268.  
  269.     ClearButtons removes all buttons from the active client's display,
  270.     and also removes the corresponding data structures. This is used
  271.     when a new set of buttons is to be drawn. When the buttons are
  272.     removed, the spaces they occupied are filled in with colour 0.
  273.  
  274. ClearRegions: effects
  275. proc utility ClearRegions()void
  276.  
  277.     ClearRegions removes all mouse-hit regions from the active client.
  278.     Since such regions are not visible, this operation is not visible.
  279.  
  280. ClearThing: database
  281. proc utility ClearThing(thing theThing)void
  282.  
  283.     ClearThing removes all properties from the passed thing. Even
  284.     properties which cannot normally be changed by the effective user
  285.     are removed. The use-counts on the properties themselves and on
  286.     their values (if appropriate) are decremented appropriately. If
  287.     the thing has a usecount of 0, it will be released, and the space
  288.     it occupied in the database will be available for reuse.
  289.     Similarly, any properties or values whose usecounts become 0 will
  290.     also be freed. ClearThing is normally used for operations like
  291.     destroying objects and rooms. Note that a local variable (or
  292.     function parameter) pointing to a thing does not consititute a
  293.     formal use of that that thing, so that variable becomes invalid if
  294.     there are no uses of the thing and it is ClearThing'd. E.g.
  295.  
  296.     th := CreateThing(nil); /* thing has no uses yet! */
  297.     ClearThing(th);     /* thing is now gone! th is invalid */
  298.     th@prop := 6;        /* this can crash the system! */
  299.  
  300. ClientsActive: utility
  301. proc utility ClientsActive()bool
  302.  
  303.     ClientsActive returns 'true' if there are currently any player
  304.     characters active in the MUD, and 'false' otherwise. It is useful
  305.     in the step functions of machines to determine whether or not they
  306.     should be normally active or should go quiescent for a while.
  307.     Well-behaved machines go mostly quiescent when there are no active
  308.     clients, to minimize the load that the AmigaMUD server puts on the
  309.     system when there are no players. E.g.
  310.  
  311.     define tp_myMachine proc machineStep()void:
  312.  
  313.         doLotsOfNeatThings();
  314.         if ClientsActive() then
  315.         After(10 + Random(10), machineStep);
  316.         else
  317.         After(100, machineStep);
  318.         fi;
  319.     corp;
  320.  
  321. ClientVersion: machine/character
  322. proc utility ClientVersion(thing who)int
  323.  
  324.     ClientVersion returns the version number of the indicated client
  325.     program. This allows scenarios to do different actions depending
  326.     on that version. E.g. if newer versions of the clients offer more
  327.     capabilities, then they can be used, and older versions can use
  328.     older capabilities. The version number is the integral part of the
  329.     displayed version number times ten plus the decimal part. E.g. for
  330.     release V0.6 ClientVersion returns 6. Unfortunately, this builtin
  331.     returned an incorrect value in version 0.5. Also unfortunately,
  332.     the version released as V0.7 still contained internal version
  333.     numbers of 0.6 . E.g.
  334.  
  335.     if ClientVersion(nil) >= 20 then
  336.         doFancyNewSuperNeatEffect(nil);
  337.     else
  338.         doGrungyOldUglyEffect(nil);
  339.     fi;
  340.  
  341. CloseFile: utility
  342. proc utility CloseFile(int fileId)void
  343.  
  344.     CloseFile closes the indicated file. Any buffered output data is
  345.     written to the real file. The file indicated by 'fileId' is no
  346.     longer valid for 'ReadFile'/'WriteFile' operations. Only SysAdmin
  347.     may use this function.
  348.  
  349. Count: utility
  350. proc utility Count(<any list> theList)int
  351.  
  352.     Count is a generic function, accepting any type of list. It
  353.     returns the count of the number of elements in that list. E.g.
  354.  
  355.     for i from 0 upto Count(theList) - 1 do
  356.         doSomethingWith(theList[i]);
  357.     od;
  358.  
  359. CreateActionList: database
  360. proc utility CreateActionList()list action
  361.  
  362.     CreateActionList returns a new, empty list of actions.
  363.  
  364. CreateActionListProp: database
  365. proc utility CreateActionListProp()property list action
  366.  
  367.     CreateActionListProp returns a new property which can be used to
  368.     attach a list of actions to a thing. The new property has no name,
  369.     so it should be put into a table to give it one. E.g.
  370.  
  371.     define myTable myNewProp CreateActionListProp().
  372.     myTestThing@myNewProp := CreateActionList().
  373.     AddTail(myTestThing@myNewProp, myNeatFunction).
  374.  
  375. CreateActionProp: database
  376. proc utility CreateActionProp()property action
  377.  
  378.     CreateActionProp returns a new property which can be used to
  379.     attach a single action to a thing. The new property has no name,
  380.     so it should be put into a table to give it one. E.g.
  381.  
  382.     define myTable myNewProp CreateActionProp().
  383.     myTestThing@myNewProp := myNeatFunction.
  384.  
  385. CreateBoolProp: database
  386. proc utility CreateBoolProp()property bool
  387.  
  388.     CreateBoolProp returns a new property which can be used to attach
  389.     a bool flag to a thing. The new property has no name, so it should
  390.     be put into a table to give it one. E.g.
  391.  
  392.     define myTable myNewProp CreateBoolProp().
  393.     myTestThing@myNewProp := true.
  394.  
  395. CreateCharacter: machine/character
  396. proc utility CreateCharacter(string name, password)void
  397.  
  398.     CreateCharacter creates a new character. The other way that
  399.     characters can be created is by players themselves when they are
  400.     connecting to the system. The latter requires that they know the
  401.     creation password (if one is set) and that the creation password
  402.     not start with an asterisk ("*"). If the system administrator
  403.     decides to disallow such character creations, then all characters
  404.     must be explicitly created using CreateCharacter. 'name' is the
  405.     desired name of the new character, and as usual, must not contain
  406.     any spaces or punctuation characters. 'password' is the initial
  407.     password for the character - the player can change it later. E.g.
  408.  
  409.     CreateCharacter("Fred_Smith", "xyzzy").
  410.  
  411. CreateGrammar: parsing
  412. proc utility CreateGrammar()grammar
  413.  
  414.     CreateGrammar returns a new, empty grammar. A grammar in AmigaMUD
  415.     is a type of table used to hold command words, and the information
  416.     on how to handle those words. Grammars separate from the main
  417.     grammar are useful for implementing "subcommands" like the build
  418.     commands, and for implementing sets of special commands for use in
  419.     special locations or on special occasions.
  420.  
  421. CreateGrammarProp: database
  422. proc utility CreateGrammarProp()property grammar
  423.  
  424.     CreateGrammarProp returns a new property which can be used to
  425.     attach a grammar to a thing. The new property has no name, so it
  426.     should be put into a table to give it one. E.g.
  427.  
  428.     define myTable myNewProp CreateGrammarProp().
  429.     myTestThing@myNewProp := CreateGrammar().
  430.     VerbTail(myTestThing@myNewProp, "spelunk", doSpelunk).
  431.  
  432. CreateIntArray: database
  433. proc utility CreateIntArray(int size)list int
  434.  
  435.     CreateIntArray returns and fills in a new list of integers. Unlike
  436.     'CreateIntList', the list returned by CreateIntArray is not empty.
  437.     It has space for 'size' elements, and those elements are all
  438.     initialized to 0. This routine is a convenient way to initialize
  439.     such things as icons and mapping tables for coordinate based
  440.     areas. E.g.
  441.  
  442.     list int li;
  443.  
  444.     li := CreateIntArray(10);
  445.     li[5] := 7;
  446.  
  447. CreateIntList: database
  448. proc utility CreateIntList()list int
  449.  
  450.     CreateIntList returns a new, empty list of integers.
  451.  
  452. CreateIntListProp: database
  453. proc utility CreateIntListProp()property list int
  454.  
  455.     CreateIntListProp returns a new property which can be used to
  456.     attach a list of ints to a thing. The new property has no name,
  457.     so it should be put into a table to give it one. E.g.
  458.  
  459.     define myTable myNewProp CreateIntListProp().
  460.     myTestThing@myNewProp := CreateIntList().
  461.     AddTail(myTestThing@myNewProp, 27).
  462.  
  463. CreateIntProp: database
  464. proc utility CreateIntProp()property int
  465.  
  466.     CreateIntProp returns a new property which can be used to attach
  467.     an int to a thing. The new property has no name, so it should be
  468.     put into a table to give it one. E.g.
  469.  
  470.     define myTable myNewProp CreateIntProp().
  471.     myTestThing@myNewProp := 145.
  472.  
  473. CreateMachine: machine/character
  474. proc utility CreateMachine(string name; thing theThing, location;
  475.     action startup)void
  476.  
  477.     CreateMachine is used to create a new machine. Machines are used
  478.     in AmigaMUD to perform actions independent of any players. Each
  479.     machine has a corresponding thing, just like players do. The name
  480.     of a machine can be similar to a player's name, like "Packrat", or
  481.     it can be more like an object's name, like "rat;big,hairy".
  482.     Machines can also have empty names, in which case they will not
  483.     show up in rooms, unless 'ForEachAgent' is used to scan agents.
  484.     'theThing' is the thing which holds all of the machine's
  485.     properties. 'location' is the initial location for the machine; it
  486.     can be nil. 'startup' is an action, having no parameters and no
  487.     result, which will be called when the machine has been created.
  488.     It is normally used to start up any "step" routine which the
  489.     machine uses to perform periodic action. 'startup' can be nil.
  490.     E.g.
  491.  
  492.     private tp_witches CreateTable().
  493.     define tp_witches witchSpell CreateActionProp().
  494.     define tp_witches witchCharacter CreateIntProp().
  495.     define tp_witches WC_GOOD 0.
  496.     define tp_witches WC_NEUTRAL 1.
  497.     define tp_witches WC_EVIL 2.
  498.     define tp_witches proc spellTurnNosePurple(thing who)void:
  499.         /* turn somebody's nose purple */
  500.     corp;
  501.     define tp_witches proc witchStep()void:
  502.         /* various and sundry nasty stuff */
  503.         After(10, witchStep);
  504.     corp;
  505.     define tp_witches proc witchInit()void:
  506.         After(10, witchStep);
  507.     corp;
  508.     define tp_witches proc createWitch()void:
  509.         thing theWitch;
  510.  
  511.         theWitch := CreateThing(modelWitch);
  512.         theWitch@witchSpell := spellTurnNosePurple;
  513.         theWitch@witchCharacter := WC_EVIL;
  514.         CreateMachine("Crondik;Witch", theWitch, r_blackPit,
  515.               witchInit);
  516.     corp;
  517.  
  518. CreateStringProp: database
  519. proc utility CreateStringProp()property string
  520.  
  521.     CreateStringProp returns a new property which can be used to
  522.     attach a string to a thing. The new property has no name, so it
  523.     should be put into a table to give it one. E.g.
  524.  
  525.     define myTable myNewProp CreateStringProp().
  526.     myTestThing@myNewProp := "hello there world".
  527.  
  528. CreateTable: database
  529. proc utility CreateTable()table
  530.  
  531.     CreateTable returns a new empty table. The table can be used to
  532.     store symbols. Separate tables are used so that the number of
  533.     symbols in your private table (or the public one) does not get too
  534.     large. Having too many symbols in a single table can cause
  535.     problems for the database cache, uses a lot of memory, and is hard
  536.     to handle for the user. The source files for the standard scenario
  537.     create quite a few new tables, usually one or more per major
  538.     source file. The symbols defined in that source file that are not
  539.     needed outside of that source file are put into that table. See
  540.     the example given with 'CreateMachine' for an example of using
  541.     such a table.
  542.  
  543. CreateTableProp: database
  544. proc utility CreateTableProp()property table
  545.  
  546.     CreateTableProp returns a new property which can be used to attach
  547.     a table to a thing. The new property has no name, so it should be
  548.     put into a table to give it one. E.g.
  549.  
  550.     define myTable myNewProp CreateTableProp().
  551.     myTestThing@myNewProp := CreateTable().
  552.  
  553. CreateThing: database
  554. proc utility CreateThing(thing parent)thing
  555.  
  556.     CreateThing returns a new thing in the database. The new thing's
  557.     parent is set to 'parent', which can be nil. CreateThing is used
  558.     to create nearly all items that a player will interact with in
  559.     AmigaMUD: rooms, objects, monsters, etc. A newly created thing has
  560.     no properties other than any inherited from its parent (and its
  561.     parent's parent, etc.)
  562.  
  563. CreateThingList: database
  564. proc utility CreateThingList()list thing
  565.  
  566.     CreateThingList returns a new, empty list of things.
  567.  
  568. CreateThingListProp: database
  569. proc utility CreateThingListProp()property list thing
  570.  
  571.     CreateThingListProp returns a new property which can be used to
  572.     attach a list of things to a thing. The new property has no name,
  573.     so it should be put into a table to give it one. E.g.
  574.  
  575.     define myTable myNewProp CreateThingListProp().
  576.     myTestThing@myNewProp := CreateThingList().
  577.     AddTail(myTestThing@myNewProp, myOtherTestThing).
  578.  
  579. CreateThingProp: database
  580. proc utility CreateThingProp()property thing
  581.  
  582.     CreateThingProp returns a new property which can be used to attach
  583.     a thing to another thing. The new property has no name, so it
  584.     should be put into a table to give it one. This kind of property
  585.     is used, for example, to point from one room to another, to
  586.     indicate a connection between the rooms. E.g.
  587.  
  588.     define myTable myNewProp CreateThingProp().
  589.     myTestThing@myNewProp := myOtherThing.
  590.  
  591. Date: utility
  592. proc utility Date()string
  593.  
  594.     Date returns a string containing the current time and date. E.g.
  595.  
  596.     Date() => "Sat Jun 11 16:49:14 1994"
  597.  
  598. DateShort: utility
  599. proc utility DateShort()string
  600.  
  601.     Date returns a string containing the current time and date. The
  602.     form returned is in a shorter form than that returned by 'Date',
  603.     and is sortable.
  604.  
  605.     DateShort() => "94/06/11 16:49:17"
  606.  
  607. DefineAction: symbols
  608. proc utility DefineAction(table theTable; string name;
  609.     action theAction)bool
  610.  
  611.     DefineAction adds an entry to the 'theTable', with name 'name'
  612.     which is a new name for the passed action 'theAction'. This
  613.     routine is mainly of use in the builder code. The value returned
  614.     is 'true' if the definition was successful, else 'false'.
  615.  
  616. DefineCounter: symbols
  617. proc utility DefineCounter(table theTable; string name;
  618.     property int theCounter)bool
  619.  
  620.     DefineCounter adds a new int property symbol to the indicated
  621.     table. It is mainly used in the builder code. DefineCounter
  622.     returns 'true' if the definition succeeded.
  623.  
  624. DefineEffect: effects
  625. proc utility DefineEffect(thing who; int whichEffect)void
  626.  
  627.     DefineEffect starts the definition of a new effect for the client
  628.     indicated by 'who'. 'whichEffect' is an identifier for the new
  629.     effect; it must be different for each effect defined. Defining an
  630.     affect sends the "code" for the effect to the client, and the
  631.     client adds that effect code to its effect cache. From then on,
  632.     unless that effect is flushed from the effect cache, the effect
  633.     can be called in that client by simply sending a CallEffect
  634.     request. An effect can be an entire global effect, such as the
  635.     standard scenario's view of the streets scene, or can be an
  636.     "effects subroutine" such as one for a horizontal door. The
  637.     scenario can test whether or not a client has a copy of an effect
  638.     with a given id using the 'KnowsEffect' builtin. For example, here
  639.     is the code in the standard scenario for displaying one of the
  640.     locations in the Squirrel quest area:
  641.  
  642.     if not KnowsEffect(nil, SQ_VALLEY13_ID) then
  643.         DefineEffect(nil, SQ_VALLEY13_ID);
  644.         GSetImage(nil, "sq_valley13");
  645.         IfFound(nil);
  646.         GShowImage(nil, "", 0, 0, 160, 100, 0, 0);
  647.         Else(nil);
  648.         AutoOpenSpace();
  649.         GSetPen(nil, C_FOREST_GREEN);
  650.         GAMove(nil, 80, 50);
  651.         GEllipse(nil, 70, 40, true);
  652.         Fi(nil);
  653.         EndEffect();
  654.     fi;
  655.     CallEffect(nil, SQ_VALLEY13_ID);
  656.  
  657.     If the current client (nil) does not know the effect indicated by
  658.     int constant "SQ_VALLEY13_ID", then the definition of that effect
  659.     is sent to the client. After that definition, if needed, the
  660.     effect is called to display the image. Inside the effect, the
  661.     client program is asked to look for an image called "sq_valley13".
  662.     If that image is found, then it is displayed, and the effect is
  663.     complete. If the image is not found, then an approximation of the
  664.     image is drawn using the "AutoOpenSpace" autographics routine, and
  665.     adding a green ellipse to it, representing the oak tree.
  666.  
  667. DefineFlag: symbols
  668. proc utility DefineFlag(table theTable; string name;
  669.     property bool theFlag)bool
  670.  
  671.     DefineFlag adds a new bool property symbol to the indicated
  672.     table. It is mainly used in the builder code. DefineFlag returns
  673.     true if the definition succeeded.
  674.  
  675. DefineString: symbols
  676. proc utility DefineString(table theTable; string name;
  677.     property string theString)bool
  678.  
  679.     DefineString adds a new string property symbol to the indicated
  680.     table. It is mainly used in the builder code. DefineString returns
  681.     true if the definition succeeded.
  682.  
  683. DefineTable: symbols
  684. proc utility DefineTable(table theTable; string name; table newTable)bool
  685.  
  686.     DefineTable adds a reference to a table, 'newTable', to another
  687.     table, 'theTable', with name 'name'. Thus, 'theTable' now contains
  688.     'newTable' as one of its entries. This function is mostly used by
  689.     the builder code.
  690.  
  691. DefineThing: symbols
  692. proc utility DefineThing(table theTable; string name; thing theThing)bool
  693.  
  694.     DefineThing adds a reference to a thing, 'theThing', to a table,
  695.     'theTable', with name 'name'. Thus, 'theTable' now contains
  696.     'theThing' as one of its entries. This function is mostly used by
  697.     the builder code.
  698.  
  699. DelElement: database
  700. proc utility DelElement(<any list> theList;
  701.     <corresponding element type> valu)void
  702.  
  703.     DelElement is used to delete an element from a list. It is a
  704.     generic function in that it works for any kind of list. 'valu',
  705.     the element to be deleted, must be of the corresponding type. It
  706.     is not an error if the element is not found in the list. If the
  707.     list contains more than one occurrence of the element, only the
  708.     first one (the one with the lowest index) is deleted. E.g.
  709.  
  710.     private th CreateThing(nil).
  711.     private listIntProp CreateIntListProp().
  712.     th@listIntProp := CreateIntArray(5).
  713.     th@listIntProp[0] := 7.
  714.     th@listIntProp[4] := 7.
  715.     th@listIntProp.
  716.     ==> {7, 0, 0, 0, 7}
  717.     DelElement(th@listInt, 7).
  718.     th@listIntProp.
  719.     ==> {0, 0, 0, 7}
  720.     DelElement(th@listInt, 7).
  721.     th@listIntProp.
  722.     ==> {0, 0, 0}
  723.  
  724. DeleteSymbol: symbols
  725. proc utility DeleteSymbol(table theTable; string name)bool
  726.  
  727.     DeleteSymbol attempts to delete symbol 'name' from table
  728.     'theTable'. If it can, it does so and returns 'true', otherwise
  729.     it returns 'false'. If it fails to delete the symbol, an error
  730.     comment will have been printed to the active client.
  731.  
  732. DeleteWord: parsing
  733. proc utility DeleteWord(grammar theGrammar; string theWord)void
  734.  
  735.     DeleteWord deletes word 'theWord' from grammar 'theGrammar'. It is
  736.     an error to try to delete a word that is not in the grammar, or if
  737.     you do not own the grammar. Also, if the word has any existing
  738.     synonyms, it cannot be deleted - those synonyms must be deleted
  739.     first.
  740.  
  741. DescribeKey: database
  742. proc utility DescribeKey(int key)void
  743.  
  744.     DescribeKey considers the int argument passed to it to be a valid
  745.     AmigaMUD internal key, and attempts to describe the value of that
  746.     key. This function can be run ONLY by SysAdmin, since it is
  747.     potentially dangerous. SysAdmin should be careful to only use key
  748.     values that are known to be valid, since invalid keys can result
  749.     in aborts in the database code. Keys are usually expressed as
  750.     hexadecimal int constants for this purpose.
  751.  
  752. DescribeSymbol: 
  753. proc utility DescribeSymbol(table theTable; string name)void
  754.  
  755.     DescribeSymbol will print out a description of the value of symbol
  756.     'name' in table 'theTable', provided that that symbol is in the
  757.     table. This is very similar to the "describe" wizard-mode command,
  758.     except that only one specific table is searched for the key. This
  759.     function is used to implement the "@describe" builder command.
  760.  
  761. DestroyCharacter: machine/character
  762. proc utility DestroyCharacter(string theCharacter)void
  763.  
  764.     DestroyCharacter is used to remove an unwanted player character
  765.     from the database. If the character is currently connected, they
  766.     will be disconnected (as in 'BootClient') and the destruction will
  767.     happen after the connection is gone. This function deletes the
  768.     character data structure, the corresponding thing, and all
  769.     properties of that thing. It cannot undo all that the character
  770.     may have done to the system, such as creating rooms and objects,
  771.     killing off monsters or other players, etc. Only SysAdmin, or code
  772.     that SysAdmin writes, can use DestroyCharacter. E.g.
  773.  
  774.     DestroyCharacter("Bad_Boy").
  775.  
  776. DestroyMachine: machine/character
  777. proc utility DestroyMachine(thing machine)void
  778.  
  779.     DestroyMachine is used to destroy a machine that is no longer
  780.     needed. For example, in the standard scenario DestroyMachine is
  781.     used to destroy monsters in the Proving Grounds that are killed.
  782.     The thing of the specific machine to be destroyed is passed. If
  783.     there is still a reference to the machine's thing when this
  784.     function is called, the machine data structure and all properties
  785.     of the thing are deleted, but the thing itself will stay until all
  786.     references to it are gone.
  787.  
  788. DumpThing: utility
  789. proc utility DumpThing(thing key)void
  790.  
  791.     DumpThing can only be executed by SysAdmin, directly at the
  792.     wizard-mode prompt. It symbolically dumps out everything about the
  793.     passed thing. It does not matter what tables the needed symbols
  794.     are in - they will be found. This operation can be quite
  795.     expensive, in that it may have to access all of the tables in the
  796.     system. The operation could also crash the server if not enough
  797.     cache space or memory is available. This is why the function is so
  798.     restricted. The symbols are printed as "paths" if they are not in
  799.     the public symbol table. A path starts with the name of the player
  800.     who owns the table, followed by possibly more table names, and
  801.     finally a symbol, all separated by slashes. If a private symbol
  802.     table itself is printed, then it is printed as the name of the
  803.     character followed by "/PRIVATE". All of these paths are enclosed
  804.     in angle brackets ("<" and ">") to distinguish them from normal
  805.     symbolic output. Here is some example output:
  806.  
  807. > DumpThing(Parent(Me()@p_pWeapon)).
  808. <THING:08000953>: thing, parent <NIL-THING>, owner SysAdmin, useCount 2,
  809.     propCount 8, ts_readonly:
  810.   <p_oName>: "Thor;Hammer,of.hammer"
  811.   <t_base/p_oDesc>:
  812. "The Hammer of Thor appears to be a special weapon. It smashes instead of "
  813. "slashes, but that is likely to be just as effective. It appears to be quite "
  814. "heavy and unwieldy, but you seem to have no trouble with it."
  815.   <t_base/p_oPrice>: 1000000
  816.   <t_base/p_oHome>: <SysAdmin/tp_misc/r_lostAndFound>
  817.   <t_fight/p_oStrBonus>: 3
  818.   <t_fight/p_oAccuracy>: 10
  819.   <t_fight/p_oDamage>: 15
  820.   <t_fight/p_oWieldAction>: <SysAdmin/tp_fight/weaponWield>
  821.  
  822. Editing: utility
  823. proc utility Editing()bool
  824.  
  825.     Editing returns 'true' if the active client is currently using an
  826.     editor within the AmigaMUD system. This happens when the user
  827.     edits a string or a function. Editing a string can be triggered by
  828.     the scenario code calling 'EditString', or by a wizard or
  829.     apprentice calling it directly. Editing a function can be
  830.     triggered by the "edit" wizard-mode command or by using the
  831.     'EditProc' builtin. Editing is useful to prevent attempts to start
  832.     a second edit when one is already in progress.
  833.  
  834. EditProc: utility
  835. proc utility EditProc(action theProc)void
  836.  
  837.     EditProc is a way for executing AmigaMUD code to trigger editing
  838.     of an AmigaMUD function. This has the same effect as a user in
  839.     wizard mode using the "edit" command.
  840.  
  841. EditString: utility
  842. proc utility EditString(string str; action handler; bool raw;
  843.     string prompt)void
  844.  
  845.     EditString throws the active client into an editor (either the
  846.     internal one or an external one), editing the string given by
  847.     'str'. 'handler' must be supplied, and must be a function of type:
  848.  
  849.     proc editHandler(string newString; bool success)void
  850.  
  851.     'prompt' is the string that will appear in the message bar at the
  852.     bottom of the editing window in the internal editor. If 'raw' is
  853.     'true', then when the string is read back from the edit session,
  854.     any newlines in the string are copied directly, as are any
  855.     occurences of '\'. If 'raw' is false, then any newlines in the
  856.     string are converted to spaces, if not following another space (in
  857.     the latter case they are just discarded), and any '\' escape
  858.     sequences are replaced by the character they represent. When this
  859.     is all done, the resulting string is passed to the 'handler'
  860.     function, along with a flag saying whether or not the edit was
  861.     successful. The edit can fail if the user aborts out of the
  862.     builtin editor, or if the AmigaMUD system has any problem starting
  863.     an external editor. Also, if the builtin editor fails to allocate
  864.     memory to hold the string, the edit will fail. So, if the handler
  865.     is called with 'success' 'false', it should not modify anything.
  866.     The standard scenario sets 'raw' to true for news articles and
  867.     usenet mail, and sets it to 'false' for everything else (in-MUD
  868.     mail, descriptions, etc.). All of this is done by the
  869.     "GetDocument" function defined in "util.m".
  870.  
  871. Else: effects
  872. proc utility Else(thing who)void
  873.  
  874.     Else is used in effects routines to switch to an alternative.
  875.     The Else is executed at effect generation time, in the remote
  876.     client program, not at any time in the server. Currently, the only
  877.     condition that it can work with is that set up by 'IfFound', which
  878.     tests for the success of one of: GLoadBackGround, GSetImage,
  879.     GShowImage with a name included, GShowBrush, SPlaySound or
  880.     MPlaySong.
  881.  
  882. EndEffect: effects
  883. proc utility EndEffect()void
  884.  
  885.     EndEffect marks the end of an effect definition. See the
  886.     description of DefineEffect for an example.
  887.  
  888. EraseButton: effects
  889. proc utility EraseButton(int n)void
  890.  
  891.     EraseButton removes and erases the mouse button identified by 'n'
  892.     from the display of the active client.
  893.  
  894. EraseRegion: effects
  895. proc utility EraseRegion(int n)void
  896.  
  897.     EraseRegion removes the mouse-select region identified by 'n' from
  898.     the records of the active client.
  899.  
  900. Execute: utility
  901. proc utility Execute(string command)void
  902.  
  903.     Execute attempts to execute the passed 'command' as an AmigaOS
  904.     shell command line. The command is executed on the server machine.
  905.     Only SysAdmin, or a function written by SysAdmin, can use this
  906.     function. SysAdmin is warned to never write a function that allows
  907.     any users to execute an arbitrary command. Technically, the call
  908.     to AmigaOS used is:
  909.  
  910.     nilHandle := Open("nil:", MODE_READWRITE);
  911.     Execute(command, 0, nilHandle);
  912.  
  913.     The sample scenario sources use Execute to call on the UUCP
  914.     programs to post usenet mail and news.
  915.  
  916. FailText: effects
  917. proc utility FailText(thing who; string message)void
  918.  
  919.     FailText can be used in a scenario to indicate to the remote user
  920.     which file, requested as part of an effect, could not be opened.
  921.     The standard scenario uses it to print "The birds sing." if the
  922.     sound file "AmigaMUD:Sounds/birds" cannot be opened when needed.
  923.     The failure message, preceeded by the path to the file, is printed
  924.     in the text window of the client. E.g.
  925.  
  926.     define tp_proving0 proc birdsSingOnce(thing client)void:
  927.         if SOn(client) then
  928.         SPlaySound(client, "birds", BIRDS_SING_ID);
  929.         IfFound(client);
  930.         Else(client);
  931.             FailText(client, "The birds sing.");
  932.         Fi(client);
  933.         else
  934.         SPrint(client, "The birds sing.\n");
  935.         fi;
  936.     corp;
  937.  
  938.     Note that this code only tries to find and play the file if the
  939.     client has Sound enabled.
  940.  
  941. Fi: effects
  942. proc utility Fi(thing who)void
  943.  
  944.     Fi is used to end a condition inside an effect. See the
  945.     description of IfFound for more details.
  946.  
  947. FindActionSymbol: symbols
  948. proc utility FindActionSymbol(table theTable; action theAction)string
  949.  
  950.     FindActionSymbol is used to try to find a symbol, in table
  951.     'theTable' for action 'theAction'. If such a symbol is found, it
  952.     is returned, else an empty string is returned. This function is
  953.     used in the builder code to try to print a symbolic name for an
  954.     action in a checker list.
  955.  
  956. FindAgent: machine/character
  957. proc utility FindAgent(string name)thing
  958.  
  959.     FindAgent is the basic means of identifying a reference to an
  960.     agent (a player character or a machine) by a user command. It
  961.     searches the lists of active players and active machines, looking
  962.     for one in the same room as the active client, whose name matches
  963.     that given. If 'name' is the name of a player character, then that
  964.     character is looked for and returned if found in the room.
  965.     Otherwise, 'name' is matched, using 'MatchName', against all of
  966.     the machines in the room. The first one matched, if any, is
  967.     returned. As a special case, the strings "me", "myself", "self"
  968.     and "yourself" return either the active character or the active
  969.     machine. This search is done by substituting the "MeString" value
  970.     for 'name'. Thus, if 'SetMeString' has been used to alter that
  971.     name, then the altered version is searched for. This technique is
  972.     used with Packrat, so that commands such as "Give xxx to me" will
  973.     do the expected thing. If no such agent is found, nil is returned.
  974.  
  975. FindAgentAsChild: machine/character
  976. proc utility FindAgentAsChild(thing room, parent)thing
  977.  
  978.     FindAgentAsChild searches for a machine in the indicated room
  979.     which is a direct child of the thing 'parent'. For example, in the
  980.     standard scenario, the monsters in the Proving Grounds are
  981.     normally direct children of the generic monsters defined in
  982.     "monsters.m". Thus, FindAgentAsChild can be used to search a room
  983.     for a monster cloned from one of those original models. If no such
  984.     machine is found, nil is returned.
  985.  
  986. FindAgentAsDescendant: machine/character
  987. proc utility FindAgentAsDescendant(thing room, parent)thing
  988.  
  989.     FindAgentAsDescendant is very similar to FindAgentAsChild. The
  990.     difference is that FindAgentAsDescendant will look all the way
  991.     back through the parentage chain of each machine it checks, to see
  992.     if 'parent' is on that chain. Thus if machine "three" inherits
  993.     from machine "two" which inherits from machine "one" and machine
  994.     "three" is in the room being searched, then FindAgentAsDescendant
  995.     will find it, but FindAgentAsChild will not. Both will find
  996.     machine "two".
  997.  
  998. FindAgentAt: machine/character
  999. proc utility FindAgentAt(thing location; string name)thing
  1000.  
  1001.     FindAgentAt is related to FindAgent. It looks in the given room
  1002.     for a player character or machine whose name matches 'name'.
  1003.     FindAgentAt does NOT do the special handling of "me", etc.
  1004.     however. It is most useful for code which wants to determine if
  1005.     someone or something is in some other specific room. If no such
  1006.     agent is found, nil is returned.
  1007.  
  1008. FindAgentWithChildOnList: machine/character
  1009. proc utility FindAgentWithChildOnList(thing room;
  1010.     property list thing listProp; thing parent)thing
  1011.  
  1012.     FindAgentWithChildOnList performs a search of the form 'look for
  1013.     an agent which has an XXX'. 'room' is the room to search in.
  1014.     'listProp' is the property on the agents which points to a list of
  1015.     things, on which to search for a thing which is a child of
  1016.     'parent'. For example, if a magic fountain is only active if
  1017.     someone or something in the room is carrying the magic doodad,
  1018.     then "FindAgentWithChildOnList(room, p_oCarrying, o_doodad)" will
  1019.     perform the required search. Note that the search will not find
  1020.     the doodad inside a container being carried, nor will it find it
  1021.     in any list other than the one indicated. This, and other similar
  1022.     searches, can be done using AmigaMUD code, but the builtin is much
  1023.     more efficient, provided it performs the required search.
  1024.  
  1025. FindAgentWithFlag: machine/character
  1026. proc utility FindAgentWithFlag(thing room; property bool flagProp)thing
  1027.  
  1028.     FindAgentWithFlag looks for an agent (player character or machine)
  1029.     in the given room which has property 'flagProp' set to true. For
  1030.     example, if a scenario were to define a flag "p_pHasCold",
  1031.     indicating that the player has a cold, then the search for
  1032.     infection could be done by "FindAgentWithFlag(room, p_pHasCold).
  1033.     If no such agent is found, nil is returned.
  1034.  
  1035. FindAgentWithFlagOnList: machine/character
  1036. proc utility FindAgentWithFlagOnList(thing room;
  1037.     property list thing listProp; property bool flagProp)thing
  1038.  
  1039.     FindAgentWithFlagOnList performs a search of the form 'look for an
  1040.     agent which has something which is XXX". 'room' is the room to
  1041.     search in. 'listProp' is the property on the agents which points
  1042.     to a list of things, on which to search for a thing which has
  1043.     property 'flagProp' set to 'true'. The standard scenario uses this
  1044.     routine to see if anyone in a given room is carrying a light with
  1045.     "FindAgentWithFlagOnList(room, p_pCarrying, p_oLight)". Note that
  1046.     the search will not find a light source that is inside a container
  1047.     being carried. If no such agent is found, then nil is returned.
  1048.  
  1049. FindAgentWithNameOnList: machine/character
  1050. proc utility FindAgentWithNameOnList(thing room;
  1051.     property list thing listProp;
  1052.     property string nameProp; string name)thing
  1053.  
  1054.     FindAgentWithNameOnList performs a search of the form 'look for an
  1055.     agent which has something called XXX". 'room' is the room to
  1056.     search in. 'listProp' is the property on the agents which points
  1057.     to a list of things, on which to search for a thing which has
  1058.     string property 'nameProp' which matches 'name'. The searching of
  1059.     the lists is done using 'FindName'. This function is a bit more
  1060.     general than 'FindAgentWithFlagOnList', but it is also quite a bit
  1061.     more expensive to use. Instead of looking for someone with one of
  1062.     a specific type of "apple", this function can look for someone
  1063.     with any kind of "apple", for example.
  1064.  
  1065. FindAnyWord: parsing
  1066. proc utility FindAnyWord(grammar theGrammar; string theWord)int
  1067.  
  1068.     FindAnyWord is a generalization of 'FindWord'. It looks for word
  1069.     'theWord' in the indicated grammar. The id code for the word is
  1070.     returned if it is found, else 0 is returned. If the word is a
  1071.     synonym of another word, then the code of that other word is
  1072.     returned.
  1073.  
  1074. FindChildOnList: database
  1075. proc utility FindChildOnList(list thing theList; thing parent)bool
  1076.  
  1077.     FindChildOnList looks through the elements of 'theList', looking
  1078.     for a thing which is a direct child of 'parent'. If one is found,
  1079.     then FindChildOnList returns 'true', and 'FindResult' can be used
  1080.     to retrieve the actual thing, else 'false' is returned.
  1081.  
  1082. FindElement: database
  1083. proc utility FindElement(<any list> theList;
  1084.     <corresponding element type> valu)int
  1085.  
  1086.     FindElement is a generic routine used to search lists. It works on
  1087.     any kind of list, searching for the corresponding type of value.
  1088.     If the value is found in the list, then the index of the first one
  1089.     is returned, else -1 is returned.
  1090.  
  1091. FindFlagOnList: database
  1092. proc utility FindFlagOnList(list thing theList; property bool flagProp)
  1093.     bool
  1094.  
  1095.     FindFlagOnList is used to search a list of things for a thing
  1096.     which has property 'flagProp' set to true. Note that this search
  1097.     searches for the flag on the things in the list as well as on all
  1098.     of their ancestors. Thus, its result is 'true' if and only if the
  1099.     found thing yields 'true' when looking up the property on it. If
  1100.     such a thing is found, then it can be retrieved with 'FindResult'.
  1101.  
  1102. FindKey: utility
  1103. proc utility FindKey(int key)void
  1104.  
  1105.     FindKey is a very powerful and very expensive routine. It will
  1106.     search the entire database for a symbol whose value is the passed
  1107.     key. The key is normally given as a hexadecimal int constant. All
  1108.     definitions of the key are printed out, one per line, showing the
  1109.     paths of tables to the key. Because of the expense of this
  1110.     function, only SysAdmin can execute it. E.g. if wizard "Fred" has
  1111.     the key in his table "lower" in his table "castle" as "rose", and
  1112.     wizard "Joe" has the key in his table "rooms" as symbol "redRose",
  1113.     then the output would be:
  1114.  
  1115.     FindKey(0xXXXXXXXX).
  1116.     Fred/castle/lower/rose
  1117.     Joe/rooms/redRose
  1118.  
  1119. FindMachineIndexed: machine/character
  1120. proc utility FindMachineIndexed(string name; int index)thing
  1121.  
  1122.     FindMachineIndexed returns the 'index'th machine whose name
  1123.     matches (using MatchName) 'name'. If no such machine exists, then
  1124.     nil is returned. Thus, we can scan through all of the goblins in
  1125.     the scenario with:
  1126.  
  1127.     i := 0;
  1128.     while
  1129.         goblin := FindMachineIndexed("goblin", i);
  1130.         goblin ~= nil
  1131.     do
  1132.         processGoblin(goblin);
  1133.         i := i + 1;
  1134.     od;
  1135.  
  1136.     Note that if "processGoblin" deletes the goblin, this simple loop
  1137.     will skip the next one, so "processGoblin" should return a value
  1138.     indicating that it has done so, and "i" should not be incremented.
  1139.     If it is known beforehand that scanning through all of the goblins
  1140.     is needed, then it is probably easier to just link them together
  1141.     in a big linked list as they are created/destroyed.
  1142.  
  1143. FindName: utility
  1144. proc utility FindName(list thing theList; property string nameProp;
  1145.     string theName)status
  1146.  
  1147.     FindName is the general string-searching routine in AmigaMUD. It
  1148.     searches the elements of 'theList', looking for a value of string
  1149.     property 'nameProp' which matches 'theName'. Matching is
  1150.     determined by builtin function 'MatchName'. If no such element is
  1151.     found, then 'fail' is returned. If one such element is found, then
  1152.     'succeed' is found, and if more than one is found, 'continue' is
  1153.     returned. If either 'succeed' or 'continue' is returned, then
  1154.     builtin 'FindResult' can be used to return the found thing. Note
  1155.     that the string 'theName' is in the internal "noun;adj,adj" form.
  1156.     If the string begins with a decimal number and a colon, which is
  1157.     the form that 'GetNounPhrase' and 'Parse' yield for the syntax
  1158.     "adj adj noun #number", then the 'continue' result is not
  1159.     possible, and the 'number'th matching thing is returned. In this
  1160.     case, the numbers are one-origin, not the normal zero-origin. E.g.
  1161.  
  1162.     st := FindName(Me()@p_pCarrying, p_oName, name);
  1163.     if st = fail then
  1164.         Print("You aren't carrying any " + FormatName(name));
  1165.     elif st = continue then
  1166.         Print(FormatName(name) + " is ambiguous here");
  1167.     else
  1168.         theThing := FindResult();
  1169.         /* process theThing */
  1170.     fi;
  1171.  
  1172. FindResult: utility
  1173. proc utility FindResult()thing
  1174.  
  1175.     FindResult is used to return the matching thing from three kinds
  1176.     kinds of searches. These are: 'FindName', 'FindFlagOnList', and
  1177.     'FindChildOnList'.
  1178.  
  1179. FindThingSymbol: symbols
  1180. proc utility FindThingSymbol(table theTable; thing theThing)string
  1181.  
  1182.     FindThingSymbol is used to try to find a symbol, in table
  1183.     'theTable' for thing 'theThing'. If such a symbol is found, it
  1184.     is returned, else an empty string is returned. This function is
  1185.     used in the builder code to supply a symbol for the "current"
  1186.     object.
  1187.  
  1188. FindWord: parsing
  1189. proc utility FindWord(grammar theGrammar; string theWord)int
  1190.  
  1191.     FindWord looks up word 'theWord' in grammar 'theGrammar'. If the
  1192.     word is found, then its unique identifier in the grammar is
  1193.     returned. If the word is not found, then 0 is returned. If the
  1194.     word is not a base definition, i.e. it is a synonym of some other
  1195.     word, then 0 is also returned. See 'FindAnyWord'.
  1196.  
  1197. Flush: database
  1198. proc utility Flush()void
  1199.  
  1200.     Flush forces the internal server caches to be written through to
  1201.     the database files. Its effect is very transitory, however, in
  1202.     that further execution in the server, including by machines, can
  1203.     modify the internal cached forms, thus making the stored forms
  1204.     invalid again. Flush performs the same action as the "MUDFlush"
  1205.     program.
  1206.  
  1207. ForceAction: machine/character
  1208. proc utility ForceAction(thing theAgent; action theAction)status
  1209.  
  1210.     ForceAction is used to force another agent, either a player
  1211.     character or a machine, to perform an action. The action to be
  1212.     performed is the function 'theAction' which must have no
  1213.     parameters and must return a "status" result. That result is
  1214.     returned by ForceAction. When the action is forced, it is executed
  1215.     on behalf of the agent, so that, for example, "Me()" will be that
  1216.     agent, and "Here()" will be that agent's location. "TrueMe()" can
  1217.     still be used to find the agent which is active at the time of the
  1218.     call to ForceAction. The standard scenario uses ForceAction for a
  1219.     number of purposes, including activities relating to killing
  1220.     monsters in combat.
  1221.  
  1222. ForEachAgent: machine/character
  1223. proc utility ForEachAgent(thing location; action theAction)void
  1224.  
  1225.     ForEachAgent is a general routine which can be used to perform
  1226.     searches that the specific 'FindAgentXXX' routines cannot. It can
  1227.     also be used to perform actions on a number of agents. It scans
  1228.     through the active agents, both player characters and machines,
  1229.     and for each one which is in the given location (or for each one
  1230.     if 'location' is nil) calls the passed action with that agent as
  1231.     its parameter. E.g. we can write a routine which will have each
  1232.     agent announce its location:
  1233.  
  1234.     private proc announce(thing theAgent)void:
  1235.         thing where;
  1236.         string m;
  1237.  
  1238.         m := FormatName(theAgent@p_pName) + " is ";
  1239.         where := AgentLocation(theAgent);
  1240.         if where = nil then
  1241.         m := m + "nowhere";
  1242.         else
  1243.         m := m + where@p_rName;
  1244.         fi;
  1245.         APrint(m + ".\n");
  1246.     corp;
  1247.     ForEachAgent(nil, announce).
  1248.  
  1249. FormatName: output
  1250. proc utility FormatName(string theName)string
  1251.  
  1252.     FormatName converts a string in "internal" noun-phrase form to one
  1253.     in "external" form. The internal form is the form that consists of
  1254.     a noun (or a set of alternatives, separated by commas), optionally
  1255.     followed by a semicolon and a comma-separated list of adjectives.
  1256.     Any number of those complete forms can be given as alternatives,
  1257.     separated by periods. The external form uses only the first
  1258.     complete alternative. It consists of the adjectives, separated by
  1259.     spaces, followed by another space and the first noun alternative.
  1260.     E.g.
  1261.  
  1262.     FormatName("dog") => "dog"
  1263.     FormatName("dog;big,black") => "big black dog"
  1264.     FormatName("dog,pooch;big,black") => "big black dog"
  1265.     FormatName("Spot.dog,pooch;big,black") => "Spot"
  1266.  
  1267. GAMove: effects
  1268. proc utility GAMove(thing who; int x, y)void
  1269.  
  1270.     GAMove moves the drawing cursor (not any displayed curser) of the
  1271.     given client to the given absolute position. Valid absolute
  1272.     positions with the V1.0 MUD client are: 0 <= x < 320, 0 <= y < 99.
  1273.  
  1274. GCircle: effects
  1275. proc utility GCircle(thing who; int r; bool fill)void
  1276.  
  1277.     GCircle draws a circle on the graphics window of the given client.
  1278.     The circle is of radius 'r', and is centered at the current
  1279.     drawing cursor position. The circle is drawn using the currently
  1280.     selected graphics pen. If 'fill' is true, then the circle is
  1281.     filled in, else just an outline is drawn. Note that the entire
  1282.     circle must be within the graphics drawing area, or it will not be
  1283.     drawn.
  1284.  
  1285. GClear: effects
  1286. proc utility GClear(thing who)void
  1287.  
  1288.     GClear clears the entire graphics area of the selected client to
  1289.     the background colour (pen 0).
  1290.  
  1291. GColours: effects
  1292. proc utility GColours(thing who)int
  1293.  
  1294.     GColours returns the number of colours that the indicated client
  1295.     can display. For the V1.0 Amiga "MUD" client, this is 32.
  1296.  
  1297. GCols: effects
  1298. proc utility GCols(thing who)int
  1299.  
  1300.     GCols returns the number of graphics columns that the indicated
  1301.     client can display. For the V1.0 Amiga "MUD" client, this is 320.
  1302.  
  1303. GDefineTile: effects
  1304. proc utility GDefineTile(thing who; int id, width, height;
  1305.     list int data)void
  1306.  
  1307.     GDefineTile sends a tile definition to the indicated client. From
  1308.     then on, that tile can be referenced by 'GDisplayTile' without
  1309.     being sent from the server again. 'id' is a unique identifier for
  1310.     that tile pattern. 'width' and 'height' are the width and height
  1311.     of the tile in pixels. 'data' is an int array whose size must be
  1312.     equal to (width * height + 3) / 4, i.e. the number of pixels
  1313.     rounded up to the nearest 4. Each int in the list represents 4
  1314.     pixels, with 8 bits used for each one. The pixels are stored row
  1315.     by row. For example, here is a routine to return a 32 pixel wide
  1316.     by 20 pixel high tile which is a miniature of the town view in the
  1317.     standard scenario:
  1318.  
  1319.     define t_tiles proc makeTownTile()list int:
  1320.         list int tile;
  1321.     
  1322.         tile := CreateIntArray(160);
  1323.         tile[0] := 0x1d1d1d1d;
  1324.         tile[1] := 0x1d1d1d1d;
  1325.         tile[2] := 0x1d1d1d1d;
  1326.         tile[3] := 0x1d1d0301;
  1327.         tile[4] := 0x0101031d;
  1328.         tile[5] := 0x1d1d1d1d;
  1329.         tile[6] := 0x1d1d1d1d;
  1330.         tile[7] := 0x1d1d1d1d;
  1331.         tile[8] := 0x1d1d1d1d;
  1332.         tile[9] := 0x1d1d1d1d;
  1333.         tile[10] := 0x1d1d1d1d;
  1334.         tile[11] := 0x1d1d0301;
  1335.         tile[12] := 0x0101031d;
  1336.         tile[13] := 0x1d1d1d1d;
  1337.         tile[14] := 0x1d1d1d1d;
  1338.         tile[15] := 0x1d1d1d1d;
  1339.         tile[16] := 0x1d1d1d1d;
  1340.         tile[17] := 0x1d1d1d1d;
  1341.         tile[18] := 0x1d1d1d1d;
  1342.         tile[19] := 0x1d1d0301;
  1343.         tile[20] := 0x0101031d;
  1344.         tile[21] := 0x1d1d1d1d;
  1345.         tile[22] := 0x1d1d1d1d;
  1346.         tile[23] := 0x1d1d1d1d;
  1347.         tile[24] := 0x1d1d1d1d;
  1348.         tile[25] := 0x1d1d1d1d;
  1349.         tile[26] := 0x1d1d1d1d;
  1350.         tile[27] := 0x1d1d0301;
  1351.         tile[28] := 0x0101031d;
  1352.         tile[29] := 0x1d1d1d1d;
  1353.         tile[30] := 0x1d1d1d1d;
  1354.         tile[31] := 0x1d1d1d1d;
  1355.         tile[32] := 0x1d1d1d1d;
  1356.         tile[33] := 0x1d1d1d1d;
  1357.         tile[34] := 0x1d1d1d1d;
  1358.         tile[35] := 0x1d1d0301;
  1359.         tile[36] := 0x0101031d;
  1360.         tile[37] := 0x1d1d1d1d;
  1361.         tile[38] := 0x1d1d1d1d;
  1362.         tile[39] := 0x1d1d1d1d;
  1363.         tile[40] := 0x1d1d1d1d;
  1364.         tile[41] := 0x1d1d1d1d;
  1365.         tile[42] := 0x1d1d1d1d;
  1366.         tile[43] := 0x1d1d0301;
  1367.         tile[44] := 0x0101031d;
  1368.         tile[45] := 0x1d1d1d1d;
  1369.         tile[46] := 0x1d1d1d1d;
  1370.         tile[47] := 0x1d1d1d1d;
  1371.         tile[48] := 0x1d1d1d1d;
  1372.         tile[49] := 0x1d1d1d1d;
  1373.         tile[50] := 0x1d1d1d1d;
  1374.         tile[51] := 0x1d1d0301;
  1375.         tile[52] := 0x0101031d;
  1376.         tile[53] := 0x1d1d1d1d;
  1377.         tile[54] := 0x1d1d1d1d;
  1378.         tile[55] := 0x1d1d1d1d;
  1379.         tile[56] := 0x1d1d1d1d;
  1380.         tile[57] := 0x1d1d1d1d;
  1381.         tile[58] := 0x1d1d1d1d;
  1382.         tile[59] := 0x1d1d0301;
  1383.         tile[60] := 0x0101031d;
  1384.         tile[61] := 0x1d1d1d1d;
  1385.         tile[62] := 0x1d1d1d1d;
  1386.         tile[63] := 0x1d1d1d1d;
  1387.         tile[64] := 0x03030303;
  1388.         tile[65] := 0x03030303;
  1389.         tile[66] := 0x03030303;
  1390.         tile[67] := 0x03030301;
  1391.         tile[68] := 0x01010303;
  1392.         tile[69] := 0x03030303;
  1393.         tile[70] := 0x03030303;
  1394.         tile[71] := 0x03030303;
  1395.         tile[72] := 0x01010101;
  1396.         tile[73] := 0x01010101;
  1397.         tile[74] := 0x01010101;
  1398.         tile[75] := 0x01010101;
  1399.         tile[76] := 0x01010101;
  1400.         tile[77] := 0x01010101;
  1401.         tile[78] := 0x01010101;
  1402.         tile[79] := 0x01010101;
  1403.         tile[80] := 0x01010101;
  1404.         tile[81] := 0x01010101;
  1405.         tile[82] := 0x01010101;
  1406.         tile[83] := 0x01010101;
  1407.         tile[84] := 0x01010101;
  1408.         tile[85] := 0x01010101;
  1409.         tile[86] := 0x01010101;
  1410.         tile[87] := 0x01010101;
  1411.         tile[88] := 0x03030303;
  1412.         tile[89] := 0x03030303;
  1413.         tile[90] := 0x03030303;
  1414.         tile[91] := 0x03030301;
  1415.         tile[92] := 0x01010303;
  1416.         tile[93] := 0x03030303;
  1417.         tile[94] := 0x03030303;
  1418.         tile[95] := 0x03030303;
  1419.         tile[96] := 0x1d1d1d1d;
  1420.         tile[97] := 0x1d1d1d1d;
  1421.         tile[98] := 0x1d1d1d1d;
  1422.         tile[99] := 0x1d1d0301;
  1423.         tile[100] := 0x0101030d;
  1424.         tile[101] := 0x0f0d0d0e;
  1425.         tile[102] := 0x0d030d0d;
  1426.         tile[103] := 0x0f0d0d03;
  1427.         tile[104] := 0x1d1d1d1d;
  1428.         tile[105] := 0x1d1d1d1d;
  1429.         tile[106] := 0x1d1d1d1d;
  1430.         tile[107] := 0x1d1d0301;
  1431.         tile[108] := 0x0101030f;
  1432.         tile[109] := 0x0f0f0e0e;
  1433.         tile[110] := 0x0e030d0f;
  1434.         tile[111] := 0x0f0f0d03;
  1435.         tile[112] := 0x1d1d1d1d;
  1436.         tile[113] := 0x1d1d1d1d;
  1437.         tile[114] := 0x1d1d1d1d;
  1438.         tile[115] := 0x1d1d0301;
  1439.         tile[116] := 0x0101030e;
  1440.         tile[117] := 0x0f0d0d0e;
  1441.         tile[118] := 0x0303030d;
  1442.         tile[119] := 0x0f0d0d03;
  1443.         tile[120] := 0x1d1d1d1d;
  1444.         tile[121] := 0x1d1d1d1d;
  1445.         tile[122] := 0x1d1d1d1d;
  1446.         tile[123] := 0x1d1d0301;
  1447.         tile[124] := 0x01010e0e;
  1448.         tile[125] := 0x0e0d0d1d;
  1449.         tile[126] := 0x0316031d;
  1450.         tile[127] := 0x0d0d0d03;
  1451.         tile[128] := 0x1d1d1d1d;
  1452.         tile[129] := 0x1d1d1d1d;
  1453.         tile[130] := 0x1d1d1d1d;
  1454.         tile[131] := 0x1d1d0301;
  1455.         tile[132] := 0x0101030e;
  1456.         tile[133] := 0x0d0f0d0d;
  1457.         tile[134] := 0x0303030d;
  1458.         tile[135] := 0x0d0f0d03;
  1459.         tile[136] := 0x1d1d1d1d;
  1460.         tile[137] := 0x1d1d1d1d;
  1461.         tile[138] := 0x1d1d1d1d;
  1462.         tile[139] := 0x1d1d0301;
  1463.         tile[140] := 0x0101030d;
  1464.         tile[141] := 0x0f0f0f0d;
  1465.         tile[142] := 0x0d030d0d;
  1466.         tile[143] := 0x0f0f0f03;
  1467.         tile[144] := 0x1d1d1d1d;
  1468.         tile[145] := 0x1d1d1d1d;
  1469.         tile[146] := 0x1d1d1d1d;
  1470.         tile[147] := 0x1d1d0301;
  1471.         tile[148] := 0x0101030d;
  1472.         tile[149] := 0x0d0f0d0d;
  1473.         tile[150] := 0x0d030d0d;
  1474.         tile[151] := 0x0d0f0d03;
  1475.         tile[152] := 0x1d1d1d1d;
  1476.         tile[153] := 0x1d1d1d1d;
  1477.         tile[154] := 0x1d1d1d1d;
  1478.         tile[155] := 0x1d1d0301;
  1479.         tile[156] := 0x01010303;
  1480.         tile[157] := 0x03030303;
  1481.         tile[158] := 0x03030303;
  1482.         tile[159] := 0x03030303;
  1483.         tile
  1484.     corp;
  1485.  
  1486.     The use of hexadecimal for the numbers makes it easier to see the
  1487.     individual pixels, since there are two hexadecimal digits for each
  1488.     one. The value for the pixel is the pen to use to draw that pixel.
  1489.     If the width of the tile is not a multiple of 4, then the values
  1490.     get quite a bit harder to see in this form. This routine was
  1491.     produced by a short program which reads an IFF ILBM image of the
  1492.     tile and writes out the definition of the tile for AmigaMUD. As of
  1493.     the V0.7 release, the scenario does not make use of the tile
  1494.     facility.
  1495.  
  1496. GDeleteIcon: effects
  1497. proc utility GDeleteIcon(thing who, whoseIcon)void
  1498.  
  1499.     GDeleteIcon removes the icon for agent 'whoseIcon' from the
  1500.     display of agent 'who'. The "MUD" program for 'who' also forgets
  1501.     the definition of the icon. This variant is used when the icon is
  1502.     that of a transient machine (like a monster), so that if the same
  1503.     thing key happens to get re-used for another machine, the system
  1504.     will not accidentally display the icon for the old use of that
  1505.     key, rather than the new one. See GRemoveIcon for an example.
  1506.  
  1507. GDisplayTile: effects
  1508. proc utility GDisplayTile(thing who; int id)void
  1509.  
  1510.     GDisplayTile instructs the "MUD" program of 'who' to display the
  1511.     indicated tile at the current drawing position. The top-left
  1512.     corner pixel of the tile will go at the drawing position, and the
  1513.     drawing position will not be changed.
  1514.  
  1515. GEllipse: effects
  1516. proc utility GEllipse(thing who; int a, b; bool fill)void
  1517.  
  1518.     GEllipse is very similar to GCircle, except that it draws an
  1519.     ellipse with major radius 'a' and minor radius 'b'.
  1520.  
  1521. GetIndent: output
  1522. proc utility GetIndent()int
  1523.  
  1524.     GetIndent returns the current output indent value for the active
  1525.     client. See 'SetIndent' for an example.
  1526.  
  1527. GetNounPhrase: parsing
  1528. proc utility GetNounPhrase(grammar theGrammar; string theString;
  1529.     int separator)string
  1530.  
  1531.     GetNounPhase is part of the AmigaMUD input parsing facility. It is
  1532.     normally called internal to 'Parse' as part of parsing a verb with
  1533.     a direct object or both direct and indirect objects. It can be
  1534.     called directly by user code however. It basically strips one noun
  1535.     phrase from the front of the passed string. The noun phrase is
  1536.     terminated by the end of the string, a punctuation mark such as
  1537.     ".", ",", or ";", or by the occurrence of the given separator
  1538.     word, as defined in the given grammar. Note that GetNounPhrase can
  1539.     return an empty string if a terminator is found at the beginning
  1540.     of the passed string. Any leading "a", "an" or "the" will be
  1541.     stripped from the noun phrase. Any leading "#<number" will be
  1542.     placed at the beginning of the returned noun-phrase, separated
  1543.     from the rest of the phrase by a ":". If the scanned input
  1544.     contained only articles ("a", "an", "the") and "#<number>", but no
  1545.     other words, then GetNounPhrase will print "I need a noun in that
  1546.     sentence." and return an empty string. In a successful operation,
  1547.     the part of the input string not consumed by the noun phrase will
  1548.     be left in the "tail buffer" (see 'GetTail', 'SetTail',
  1549.     'GetWord'). The returned string is the parsed noun phrase in
  1550.     AmigaMUD internal form, i.e. <noun;adj,adj,...>.
  1551.  
  1552.     GetNounPhrase is typically used in a 'VerbTail' verb, which is
  1553.     doing nonstandard parsing of an input command. See, for example,
  1554.     its use in Caretaker's input parsing or the "with" verb in the
  1555.     standard scenario. GetNounPhrase can also be used as the inverse
  1556.     of 'FormatName'.
  1557.  
  1558. GetSeed: utility
  1559. proc utility GetSeed()int
  1560.  
  1561.     GetSeed returns the current value of the server's random number
  1562.     seed. This, in combination with 'SetSeed' can be used to generate
  1563.     reproducible pseudo-random events or structures.
  1564.  
  1565. GetString: utility
  1566. proc utility GetString(string initial; action handler; string prompt)void
  1567.  
  1568.     GetString is used to prompt the user for a string value, and to
  1569.     supply it to the scenario code. Note, however, that GetString does
  1570.     not return the string from the user. The server cannot wait for
  1571.     the user to type the string in, so the result comes back
  1572.     indirectly. GetString is passed a handler action, which will be
  1573.     called with the string the user typed in, when the user has
  1574.     finished typing in that string. Because 'GetString' invokes a
  1575.     string requester in the "MUD" client program, it can only be used
  1576.     when the player is using that client program, either locally or
  1577.     remotely. The 'GOn' builtin can be used to test this. 'prompt'
  1578.     will appear as a prompt in the top of the string requester, and
  1579.     'initial' will be the initial contents of the string requester's
  1580.     input area. When the handler action is called, it is called with
  1581.     two parameters. The first is the string, and the second is a bool
  1582.     value indicating whether or not the user aborted out of the string
  1583.     requester. GetString is used in several places in the button
  1584.     operated building code. For example:
  1585.  
  1586.     proc gotNameString(string s; bool ok)void:
  1587.         if ok then
  1588.         if s = "" then
  1589.             Me()@p_pWhichThing -- p_oNameProp;
  1590.         else
  1591.             Me()@p_pWhichThing@p_oNameProp := s;
  1592.         fi;
  1593.         fi;
  1594.         Me() -- p_pWhichThing;
  1595.     corp;
  1596.  
  1597.     proc requestNewName(thing theThing)void:
  1598.         Me()@p_pWhichThing := thing;
  1599.         GetString(theThing@p_oNameProp, gotNameString,
  1600.               "Enter new name:");
  1601.     corp;
  1602.  
  1603. GetTail: parsing
  1604. proc utility GetTail()string
  1605.  
  1606.     GetTail returns the current contents of the server's "tail
  1607.     buffer". This value can be set by 'SetTail', or 'GetNounPhrase',
  1608.     but is usually set by the internal parsing code. When a 'VerbTail'
  1609.     verb is being parsed, the tail buffer is set to contain the
  1610.     remainder of the input command, after the verb. 'GetWord' can be
  1611.     used to pull "words" out of the tail buffer, one at a time. This
  1612.     allows such a verb to do whatever kind of parsing it wants on the
  1613.     input command.
  1614.  
  1615. GetThingStatus: database
  1616. proc utility GetThingStatus(thing theThing)<thing status>
  1617.  
  1618.     GetThingStatus returns the access status of the passed thing. This
  1619.     can be one of: 'ts_public', 'ts_private', 'ts_readonly', and
  1620.     'ts_wizard', as explained in previous documents.
  1621.  
  1622. GettingString: utility
  1623. proc utility GettingString()bool
  1624.  
  1625.     GettingString returns 'true' if there is currently an active
  1626.     client (i.e. the code running is not that for a machine, triggered
  1627.     independently), and that client is already involved in a
  1628.     'GetString' call. Otherwise, it returns 'false'. This can be used
  1629.     to avoid getting run-time errors from trying to use 'GetString'
  1630.     when it is already in use.
  1631.  
  1632. GetWord: parsing
  1633. proc utility GetWord()string
  1634.  
  1635.     GetWord returns the next "word" from the current tail buffer. For
  1636.     this purpose, a "word" is either a string enclosed in quotation
  1637.     marks (") or a word ended with a space. GetWord does not strip off
  1638.     leading spaces before looking for a word. It assumes that that
  1639.     has already been done, which is the case when 'SetTail', or
  1640.     'GetNounPhrase' sets up the tail buffer, and when a VerbTail is
  1641.     being handled. GetWord removes any trailing spaces after the word
  1642.     it returns, thus preserving the assumption. GetWord can return an
  1643.     empty string if the tail buffer is empty, or if it encountered a
  1644.     pair of adjacent quotation marks. GetWord is most often used
  1645.     inside VerbTail verbs, which require special parsing.
  1646.  
  1647. GiveThing: database
  1648. proc utility GiveThing(thing theThing; character theCharacter)void
  1649.  
  1650.     GiveThing changes the ownership of the passed thing to be the
  1651.     passed character. The operation will fail with a runtime error if
  1652.     either is nil, or the current owner of the thing is not the
  1653.     effective player, and the effective player is not SysAdmin.
  1654.     Changing the owner of a thing can be used when giving an object to
  1655.     a different player. It effects the access rights to the thing.
  1656.  
  1657. GLoadBackGround: effects
  1658. proc utility GLoadBackGround(thing who; string name)void
  1659.  
  1660.     GLoadBackGround is a graphic effect routine which instructs the
  1661.     remote "MUD" client to load in a background image. This image is
  1662.     loaded from "AmigaMUD:BackGrounds/<name>" on the client machine.
  1663.     The image should be be at least 320 x 100 pixels. If the IFF file
  1664.     contains a colour palette, then that palette is loaded, and
  1665.     replaces the current one for the entire graphics window. If the
  1666.     background file is not found, nothing is done, but the "failure"
  1667.     flag is set in the client, and can be tested via 'IfFound'.
  1668.  
  1669. GNewIcon: effects
  1670. proc utility GNewIcon(thing theCharacter; list int newIcon)void
  1671.  
  1672.     GNewIcon associates a new icon with the specified character. Icons
  1673.     are attached to the thing as property 'p_pIcon', which is of type
  1674.     "property list int". The list of ints given must be exactly 8
  1675.     elements long. This function is used to assign the new icon value
  1676.     instead of just using a direct assignment statement, since it
  1677.     checks for a valid icon, and it will update the display of any
  1678.     clients who are currently displaying the icon for this character,
  1679.     and will invalidate any copies of the icon in the icon caches of
  1680.     other clients. Icons are 16 pixel by 16 pixel bitmaps which are
  1681.     displayed on top of client graphics images to indicate the
  1682.     presence of the character in the same room as the client's
  1683.     character. Note that icons are not full-colour - they are shown
  1684.     using the currently selected icon colour only. The client "MUD"
  1685.     programs keep a backup copy of the graphics imagery behind the
  1686.     icon, so removing an icon can be done without having to redraw the
  1687.     graphics imagery. Also, the clients keep a cache of all icons that
  1688.     they have seen, so that the icon data does not have to be resent
  1689.     to redisplay the icon.
  1690.  
  1691. GOn: effects
  1692. proc utility GOn(thing who)bool
  1693.  
  1694.     GOn returns 'true' if the indicated client can display graphics.
  1695.     This is currently true only if the client is running the "MUD"
  1696.     client, either locally or remotely. Note that the "MUD" program
  1697.     can hide the graphics window (e.g. while editing), but it will
  1698.     indicate that graphics are "on" at that time, and will update the
  1699.     hidden graphics window appropriately. The "MUD" program can turn
  1700.     graphics off altogether, in which case 'GOn' on that client will
  1701.     return 'false', and graphics effects operations for that client
  1702.     are not sent.
  1703.  
  1704.     GOn is really just an efficiency measure, allowing the scenario to
  1705.     avoid executing a bunch of graphics-related code if the results
  1706.     would be discarded anyway.
  1707.  
  1708. GPalette: effects
  1709. proc utility GPalette(thing who)bool
  1710.  
  1711.     GPalette on a given client returns 'true' if that client has a
  1712.     palette containing alterable graphics pens. A client running on a
  1713.     system which has only fixed colours would return 'false'. The
  1714.     scenario does not currently use this information.
  1715.  
  1716. GPixel: effects
  1717. proc utility GPixel(thing who)void
  1718.  
  1719.     GPixel writes a single pixel, using the current graphics pen, at
  1720.     the current graphics position, on the indicated client. Neither
  1721.     the pen nor the position are changed.
  1722.  
  1723. GPolygonEnd: effects
  1724. proc utility GPolygonEnd(thing who)void
  1725.  
  1726.     GPolygonEnd is used to close off and draw the current polygon. See
  1727.     GPolygonStart for an example.
  1728.  
  1729. GPolygonStart: effects
  1730. proc utility GPolygonStart(thing who)void
  1731.  
  1732.     GPolygonStart starts drawing a polygon on the indicated client.
  1733.     The polygon will be filled with the current graphics pen. The
  1734.     sides of the polygon are defined using the 'GADraw' and 'GRDraw'
  1735.     effects routines. Multiple polygons can be drawn at once by using
  1736.     the 'GAMove' and 'GRMove' routines to move without drawing. For
  1737.     example, the following code uses polygon drawing to draw part of
  1738.     the "doors room" in the Proving Grounds, as seen from beyond the
  1739.     doors:
  1740.  
  1741.     define tp_proving5 PR_DOORS2_ID NextEffectId().
  1742.     define tp_proving5 proc drawDoors2()void:
  1743.     
  1744.         if not KnowsEffect(nil, PR_DOORS2_ID) then
  1745.         DefineEffect(nil, PR_DOORS2_ID);
  1746.         GSetImage(nil, "pr_doors2");
  1747.         IfFound(nil);
  1748.             GShowImage(nil, "", 0, 0, 160, 100, 0, 0);
  1749.         Else(nil);
  1750.             GSetPen(nil, C_DARK_GREY);
  1751.             GAMove(nil, 0, 0);
  1752.             GRectangle(nil, 159, 99, true);
  1753.     
  1754.             GSetPen(nil, C_LIGHT_GREY);
  1755.             GPolygonStart(nil);
  1756.             GAMove(nil, 70, 99);
  1757.             GRDraw(nil, -10, -19);
  1758.             GRDraw(nil, -20, 0);
  1759.             GRDraw(nil, 0, -20);
  1760.             GRDraw(nil, 20, -20);
  1761.             GRDraw(nil, 40, 0);
  1762.             GRDraw(nil, 20, 20);
  1763.             GRDraw(nil, 0, 20);
  1764.             GRDraw(nil, -20, 0);
  1765.             GRDraw(nil, -10, 19);
  1766.             GPolygonEnd(nil);
  1767.     
  1768.             drawDoors1();
  1769.         Fi(nil);
  1770.         EndEffect();
  1771.         fi;
  1772.         CallEffect(nil, PR_DOORS2_ID);
  1773.     corp;
  1774.  
  1775. GRDraw: effects
  1776. proc utility GRDraw(thing who; int deltaX, deltaY)void
  1777.  
  1778.     GRDraw is used to draw a line, starting at the current graphics
  1779.     position, moving the relative X-Y distance specified by the passed
  1780.     delta values. The graphics drawing position is updated to the new
  1781.     position. The line is drawn using the current graphics pen.
  1782.  
  1783. GRectangle: effects
  1784. proc utility GRectangle(thing who; int width, height; bool fill)void
  1785.  
  1786.     GRectangle is used to draw a rectangle on the graphics window of
  1787.     the indicated client. The top-left corner of the rectangle is at
  1788.     the current graphics position. The bottom-right corner is
  1789.     determined by the passed 'width' and 'height' values. If 'fill' is
  1790.     'true', then the rectangle is filled with the current graphics pen,
  1791.     else only the border of the rectangle is drawn with that pen. Note
  1792.     that the rectangle is actually drawn as one larger than the
  1793.     indicated 'width' and 'height', since both the top-left and the
  1794.     bottom-right corners are considered to be within the rectangle.
  1795.     This can be a little misleading, but it was felt to be simpler
  1796.     then describing the subtraction of 1 from the values to get the
  1797.     coordinates of the lower-right corner. Thus, to fill the entire
  1798.     graphics window on the "MUD" client, one could use:
  1799.  
  1800.     GSetPen(nil, <colour>);
  1801.     GAMove(nil, 0, 0);
  1802.     GRectangle(nil, 159, 99);
  1803.  
  1804. GRedrawIcons: effects
  1805. proc utility GRedrawIcons(thing who)void
  1806.  
  1807.     GRedrawIcons causes the selected client "MUD" program to redisplay
  1808.     all of the icons that it believes should currently be displayed.
  1809.     This, in combination with 'GUndrawIcons', allows the graphics
  1810.     imagery behind the icons to be changed without having to manually
  1811.     remove and then re-draw all of the icons. Note that 'PlaceCursor'
  1812.     and 'RemoveCursor' should also be used, to make sure that the
  1813.     cursor appears again. If the entire graphics display is going to
  1814.     be redrawn, then 'GUndrawIcons' and 'RemoveCursor' need not be
  1815.     used. For example, to make a small change to the graphics display,
  1816.     e.g. opening or closing a door, etc., the following could be used:
  1817.  
  1818.     ...
  1819.     RemoveCursor();
  1820.     GUndrawIcons(nil);
  1821.     /* modify picture */
  1822.     GRedrawIcons(nil);
  1823.     PlaceCursor(cursorX, cursorY);
  1824.     ...
  1825.  
  1826.     Note that 'RemoveCursor' and 'PlaceCursor' operate implicitly on
  1827.     the active client, so most situations of changing the display for
  1828.     a given room should use 'ForEachAgent' to cause the displays of
  1829.     all clients whose characters are in the room to be properly
  1830.     updated.
  1831.  
  1832. GRemoveIcon: effects
  1833. proc utility GRemoveIcon(thing who, whoseIcon)void
  1834.  
  1835.     GRemoveIcon removes the display of the icon for character
  1836.     'whoseIcon' from the display of client 'who'. The pattern of the
  1837.     icon is not removed from 'who's icon cache. This is the normal way
  1838.     to remove an icon from a display - 'GDeleteIcon' is used when the
  1839.     client should also forget the definition of the icon. This needs
  1840.     to be done, for example, when 'whoseIcon' represents a monster
  1841.     being killed, in which case the thing for the monster might be
  1842.     soon re-used for another monster that should have a different
  1843.     icon. Here is how this is handled in the standard scenario:
  1844.  
  1845.     /*
  1846.      * UnShowIcon - remove my icon from anyone else here.
  1847.      */
  1848.     
  1849.     define t_icons proc utility UnShowIconOnce(thing th)void:
  1850.         thing me;
  1851.     
  1852.         me := Me();
  1853.         if (me@p_pIcon ~= nil or me@p_pStandard) and Parent(me) = nil
  1854.         then
  1855.         /* If the player or machine has a specific icon, or
  1856.            this is a player or a "standard" machine (Packrat,
  1857.            etc.), and this is not a cloned entity, then we
  1858.            just tell the client to undisplay the icon, but to
  1859.            remember it for later use. */
  1860.         GRemoveIcon(th, me);
  1861.         else
  1862.         /* Otherwise, we tell the client to undisplay the icon, 
  1863.            but also to forget it, since the thing associated
  1864.            with it may be reused later for something with a
  1865.            different icon. */
  1866.         GDeleteIcon(th, me);
  1867.         fi;
  1868.     corp;
  1869.     
  1870.     define t_icons proc utility public UnShowIcon()void:
  1871.     
  1872.         ForEachAgent(Here(), UnShowIconOnce);
  1873.     corp;
  1874.  
  1875. GResetColours: effects
  1876. proc utility GResetColours(thing who)void
  1877.  
  1878.     GResetColours resets the graphics palette of the indicated client
  1879.     to the default set of colours:
  1880.  
  1881.     0x000,        /* 00 - black */
  1882.     0x777,        /* 01 - dark grey */
  1883.     0x999,        /* 02 - medium grey */
  1884.     0xccc,        /* 03 - light grey */
  1885.     0xfff,        /* 04 - white */
  1886.     0xd00,        /* 05 - brick red */
  1887.     0xf00,        /* 06 - red */
  1888.     0xf80,        /* 07 - red-orange */
  1889.     0xf90,        /* 08 - orange */
  1890.     0xfc0,        /* 09 - gold */
  1891.     0xfd0,        /* 10 - cadmium yellow */
  1892.     0xff0,        /* 11 - lemon yellow */
  1893.     0xbf0,        /* 12 - lime green */
  1894.     0x0f0,        /* 13 - green */
  1895.     0x8e0,        /* 14 - light green */
  1896.     0x2c0,        /* 15 - dark green */
  1897.     0x0b1,        /* 16 - forest green */
  1898.     0x0ca,        /* 17 - blue green */
  1899.     0x0db,        /* 18 - aqua */
  1900.     0x1fb,        /* 19 - light aqua */
  1901.     0x6fe,        /* 20 - sky blue */
  1902.     0x6ce,        /* 21 - light blue */
  1903.     0x00f,        /* 22 - blue */
  1904.     0x69f,        /* 23 - dark blue */
  1905.     0xc1f,        /* 24 - violet */
  1906.     0xc0e,        /* 25 - purple */
  1907.     0xf1f,        /* 26 - magenta */
  1908.     0xfac,        /* 27 - pink */
  1909.     0xdb9,        /* 28 - tan */
  1910.     0xc80,        /* 29 - brown */
  1911.     0xa70,        /* 30 - medium brown */
  1912.     0xa87        /* 31 - dark brown */
  1913.  
  1914. GResetIcons: effects
  1915. proc utility GResetIcons(thing who)void
  1916.  
  1917.     GResetIcons instructs the indicated client to believe that it
  1918.     currently has no icons displayed. This is quicker when moving from
  1919.     room to room (i.e. icon-set to icon-set) than removing all of the
  1920.     individual icons. Note that this routine does not remove the icon
  1921.     imagery from the graphics window. Any icons which were initially
  1922.     displayed as "temporary" (see 'GShowIcon'), are removed form the
  1923.     client's icon cache.
  1924.  
  1925. GRMove: effects
  1926. proc utility GRMove(thing who; int deltaX, deltaY)void
  1927.  
  1928.     GRMove moves the graphics cursor in the indicated direction from
  1929.     its current position. No drawing on the screen takes place. This
  1930.     routine can also be used while drawing a polygon, and has a
  1931.     similar effect.
  1932.  
  1933. GRows: effects
  1934. proc utility GRows(thing who)int
  1935.  
  1936.     GRows returns the number of rows of pixels in the graphics window
  1937.     of the indicated client. Currently, the only graphics client is
  1938.     the "MUD" client, and it has 100 rows of pixels. If the client in
  1939.     use does not support graphics, then 0 is returned.
  1940.  
  1941. GScrollRectangle: effects
  1942. proc utility GScrollRectangle(thing who;
  1943.     int xDelta, yDelta, x1, y1, x2, y2)void
  1944.  
  1945.     GScrollRectangle instructs the client to shift a rectangular
  1946.     region of its graphics window. The coordinates of the top-left and
  1947.     bottom-right corners of the affected rectangle are given. The
  1948.     delta values indicate the direction in which to scroll the
  1949.     rectangle. Positive values for the deltas indicate scrolling away
  1950.     from the top-left corner in that direction. Data scrolled out of a
  1951.     side of the rectangle is lost. The contents of the region of the
  1952.     rectangle scrolled away from is undefined. One good use of
  1953.     GScrollRectangle is in implementing a scrolling map-view type of
  1954.     display: when the character walks off of the edge of the visible
  1955.     area (or comes close), use GScrollRectangle to scroll the entire
  1956.     graphics window, and then fill in the scrolled-from area with
  1957.     tiles or imagery for newly visible terrain.
  1958.  
  1959. GSetColour: effects
  1960. proc utility GSetColour(thing who; int which, colour)void
  1961.  
  1962.     GSetColour sets graphics pen 'which' in client 'who' to colour
  1963.     'colour'. For the Amiga "MUD" client, the 'which' values can range
  1964.     from 0 to 31, and the 'colour' value is a 12 bit RGB value (4 bits
  1965.     of red, 4 bits of green, and 4 bits of blue).
  1966.  
  1967. GSetIconPen: effects
  1968. proc utility GSetIconPen(thing who; int colour)void
  1969.  
  1970.     GSetIconPen sets which pen (colour) is to be used to draw icons in
  1971.     the graphics window. The entire set of icons currently displayed
  1972.     by the client is redrawn using the new pen.
  1973.  
  1974. GSetImage: effects
  1975. proc utility GSetImage(thing who; string name)void
  1976.  
  1977.     GSetImage sets the given image name to be the current "active"
  1978.     image. The active image is used by 'GShowImage' if 'GShowImage' is
  1979.     passed an empty string. With the Amiga "MUD" client program, path
  1980.     "AmigaMUD:Images/" is prepended to the image name. If the image
  1981.     file is found, it is loaded into the client's cache. If it is not
  1982.     found, nothing happens, but the "failed" flag is set in the
  1983.     client, and can be tested by subsequent 'IfFound' tests.
  1984.  
  1985. GSetPen: effects
  1986. proc utility GSetPen(thing who; int pen)void
  1987.  
  1988.     GSetPen sets the pen to use for subsequent graphics operations,
  1989.     such as line drawing, rectangles, circles, polygons, etc.
  1990.  
  1991. GSetTextColour: effects
  1992. proc utility GSetTextColour(thing who; int which, colour)void
  1993.  
  1994.     GSetTextColour sets the colour of pen 'which' in client 'who',
  1995.     used in the text window. In the Amiga "MUD" client, pen numbers
  1996.     can be from 0 to 3, and 'colour' is a 12 bit RGB value, with 4
  1997.     bits for red, 4 bits for green, and 4 bits for blue. Note that
  1998.     setting the text colours will also affect either the background of
  1999.     the text window, or one of the border-and-menu colours, so the
  2000.     colours used should be selected carefully.
  2001.  
  2002. GShowBrush: effects
  2003. proc utility GShowBrush(thing who; string name;
  2004.     int displayX, displayY)void
  2005.  
  2006.     GShowBrush overlays a brush image onto the graphics window at the
  2007.     indicated position. The brush is loaded from "AmigaMUD:Brushes/
  2008.     <name>". If the brush file cannot be found, then nothing happens,
  2009.     but the "not found" flag is set, and can be tested by 'IfFound'.
  2010.     The difference between a brush and an image is that a brush has
  2011.     either a mask plane or a background colour, so that it can be
  2012.     overlayed on top of the existing graphics as a non-rectangular
  2013.     shape.
  2014.  
  2015. GShowIcon: effects
  2016. proc utility GShowIcon(thing who, whoseIcon;
  2017.     bool isMonster, isTemporary)void
  2018.  
  2019.     GShowIcon shows the icon for character (or NPC) 'whoseIcon' on the
  2020.     graphics window of client 'who'. If the client has no record of
  2021.     the indicated icon, then it will either use the default non-
  2022.     monster icon (the smiley face) or the default monster icon (the
  2023.     growly thing), depending on 'isMonster'. If the icon is displayed
  2024.     as temporary, then when a 'GResetIcons' is done, the icon is
  2025.     deleted from the client completely. This is used when 'whoseIcon'
  2026.     is inheriting its icon from a parent thing, since then 'whoseIcon'
  2027.     is not a unique identifier for the icon.
  2028.  
  2029. GShowImage: effects
  2030. proc utility GShowImage(thing who; string name;
  2031.     int imageX, imageY, imageWidth, imageHeight, displayX, displayY)void
  2032.  
  2033.     GShowImage loads an IFF image file from "AmigaMUD:Images/<name>"
  2034.     onto the graphics window. The image is placed with its top-left
  2035.     corner at 'displayX', 'displayY', and is taken from the whole
  2036.     image file at offset 'imageX', 'imageY', with size 'imageWidth' by
  2037.     'imageHeight'. Being able to display a smaller segment from a
  2038.     large image file allows one image file to contain several images.
  2039.     For example, one file could contain all of the needed images to
  2040.     represent a 3D maze view. This allows the entire set of images to
  2041.     be accessed quickly, and treated as a whole in the client's cache.
  2042.     Also, making changes to the set of images can be easier if they
  2043.     are all displayed at once in a paint program.
  2044.  
  2045. GText: effects
  2046. proc utility GText(thing who; string text)void
  2047.  
  2048.     GText displays the given string as text, using the default system
  2049.     font, in the current graphics pen, at the current graphics
  2050.     position, in the given client's graphics window. The graphics
  2051.     position is moved up to just past the end of the text (such that
  2052.     another GText would append the text properly). Note that, in the
  2053.     Amiga "MUD" client, the current position row is used as the
  2054.     position for the baseline of the font, which is the conceptual
  2055.     line drawn at the bottom of the non-descending part of the
  2056.     characters.
  2057.  
  2058. GType: effects
  2059. proc utility GType(thing who)string
  2060.  
  2061.     GType returns the name of the graphics display of the client.
  2062.     Since the Amiga "MUD" client is the only client so far, the value
  2063.     returned is "Amiga".
  2064.  
  2065. GUndrawIcons: effects
  2066. proc utility GUndrawIcons(thing who)void
  2067.  
  2068.     GUndrawIcons instructs the specified client to remove all of the
  2069.     currently displayed icons from the graphics window. The client
  2070.     does not forget about the icons, it only undraws them (by
  2071.     replacing the background imagery which was saved when the icons
  2072.     were drawn). GUndrawIcons, in combination with 'GRedrawIcons', can
  2073.     be used to allow easy modification of the imagery that is "behind"
  2074.     the icons. See GRedrawIcons.
  2075.  
  2076. HasAdjective: parsing
  2077. proc utility HasAdjective(string name, adjective)bool
  2078.  
  2079.     HasAdjective returns 'true' if the given 'name', which must be in
  2080.     the standard AmigaMUD "noun;adj,adj..." form, contains 'adjective'
  2081.     as one of its adjectives. Note that HasAdjective handles only a
  2082.     simple internal form for the name - multiple alternatives are not
  2083.     handled.
  2084.  
  2085. Here: machine/character
  2086. proc utility Here()thing
  2087.  
  2088.     Here returns the current location of the active character (or
  2089.     machine.) The return value can be nil if the character has no
  2090.     location. The location of something can be set by the calls
  2091.     'SetLocation', 'SetCharacterLocation' and 'SetAgentLocation'.
  2092.  
  2093. IfFound: effects
  2094. proc utility IfFound(thing who)void
  2095.  
  2096.     This effect routine causes the specified client to test the last-
  2097.     set value of its "not found" flag, and either enable or disable
  2098.     the execution of effects code as a result. See GPolygonStart for a
  2099.     typical example of using IfFound.
  2100.  
  2101. Index: utility
  2102. proc utility Index(string s1, s2)int
  2103.  
  2104.     Index returns the index in string 's1' of the first (leftmost)
  2105.     occurrence of string 's2'. Index positions, like string substring
  2106.     positions, start with index 0. If string 's2' cannot be found in
  2107.     string 's1', then Index returns -1.
  2108.  
  2109. IntToString: utility
  2110. proc utility IntToString(int n)string
  2111.  
  2112.     IntToString returns a string containing the decimal form of the
  2113.     passed int value. If the value is negative, the returned string
  2114.     will start with a minus sign, but no plus sign is inserted for
  2115.     positive values of 'n'.
  2116.  
  2117. IPrint: output
  2118. proc utility IPrint(int number)void
  2119.  
  2120.     IPrint prints the decimal form of 'number' to the current client.
  2121.     It is equivalent to "Print(IntToString(number))", but a bit more
  2122.     efficient, since it doesn't have to allocate and free a string,
  2123.     and is only one call instead of two.
  2124.  
  2125. IsAncestor: database
  2126. proc utility IsAncestor(thing myKey, parentKey)bool
  2127.  
  2128.     IsAncestor returns 'true' if 'parentKey' is the parent of 'myKey',
  2129.     or the parent of the parent of 'myKey', or the parent of... i.e.
  2130.     it returns 'true' if 'parentKey' is on the ancestor chain of
  2131.     'myKey'.
  2132.  
  2133. IsApprentice: machine/character
  2134. proc utility IsApprentice()bool
  2135.  
  2136.     IsApprentice returns 'true' if the active client is a player, and
  2137.     that player is an apprentice.
  2138.  
  2139. IsAre: output
  2140. proc utility IsAre(string s1, s2, s3, s4)string
  2141.  
  2142.     IsAre eases the output of correct English for plural nouns. This
  2143.     is perhaps best described by examples:
  2144.  
  2145.     IsAre("There", "no", "pie", "here.")  => "There is no pie here."
  2146.     IsAre("There", "no", "pies", "here.") => "There are no pies here."
  2147.     IsAre("There", "", "pie", "here.")      => "There is a pie here."
  2148.     IsAre("There", "", "apple", "here.")  => "There is an apple here."
  2149.     IsAre("There", "", "pies", "here.")   => "There are some pies here."
  2150.  
  2151.     If 's2' is empty, then IsAre uses either "a" or "an", depending on
  2152.     whether 's3' starts with a consonant or a vowel ("aeiou"). It uses
  2153.     "is" or "are" depending on whether 's3' ends in an "s" or not.
  2154.     Note that this test for plurality can easily be wrong. Note also
  2155.     that IsAre inserts all needed spaces.
  2156.  
  2157. IsDefined: symbols
  2158. proc utility IsDefined(table theTable; string name)bool
  2159.  
  2160.     IsDefined returns 'true' if string 'name' is defined in table
  2161.     'theTable', else it returns 'false'. If 'theTable' is nil, then
  2162.     'name' is looked up in all "in-use" tables.
  2163.  
  2164. IsNormal: machine/character
  2165. proc utility IsNormal()bool
  2166.  
  2167.     IsNormal returns 'true' if the active agent is a player who has
  2168.     status 'normal'.
  2169.  
  2170. IsProgrammer: machine/character
  2171. proc utility IsProgrammer()bool
  2172.  
  2173.     IsProgrammer returns 'true' if the active agent is a player who
  2174.     has status 'wizard' or 'apprentice', i.e. is someone who can do
  2175.     programming.
  2176.  
  2177. IsWizard: machine/character
  2178. proc utility IsWizard()bool
  2179.  
  2180.     IsWizard returns 'true' if the active agent is a player who has
  2181.     status 'wizard'.
  2182.  
  2183. It: utility
  2184. proc utility It()thing
  2185.  
  2186.     It returns the thing last set via 'SetIt'. The thing stored in
  2187.     this special "global variable" is reset to nil whenever a message
  2188.     arrives at the server, and whenever 'Parse' starts a new command.
  2189.     Thus It is valid only during the parsing of one input command. By
  2190.     convention, It is the object (in the English language sense) of
  2191.     the current input sentence, if there is one. See the description
  2192.     of programming within the standard scenario for information on how
  2193.     It is used in that scenario. See also 'ItName' and 'WhoName.
  2194.  
  2195. ItName: utility
  2196. proc utility ItName()string
  2197.  
  2198.     ItName returns a string containing the internal form of the noun
  2199.     phrase used with a 'Verb1' verb, or the first noun phrase (the
  2200.     direct object) used with a 'Verb2' verb. ItName is maintained
  2201.     directly by the AmigaMUD parser ('Parse'). Similarly, 'WhoName'
  2202.     returns the internal form string of the indirect object (the
  2203.     second noun phrase) associated with a 'Verb2' verb. The only use
  2204.     of ItName in the standard scenario is in a "getaction" attached to
  2205.     a fake bugtape piece in the toolshed - it is used to see if the
  2206.     phrase the player gave for the object contained the words "long"
  2207.     or "longer", via 'HasAdjective'. See also 'WhoName'.
  2208.  
  2209. KnowsEffect: effects
  2210. proc utility KnowsEffect(thing who; int whichEffect)bool
  2211.  
  2212.     KnowEffect returns 'true' if client 'who' knows the contents of
  2213.     effect 'whichEffect'. This is asking if the client "MUD" program
  2214.     has already been sent the definition of the effect, so that it
  2215.     doesn't have to be sent again (via 'DefineEffect') before being
  2216.     called up (via 'CallEffect').
  2217.  
  2218. Length: utility
  2219. proc utility Length(string str)int
  2220.  
  2221.     Length returns the number of characters in the passed string. This
  2222.     includes any special newline or tab characters. The length of an
  2223.     empty string is 0.
  2224.  
  2225. Log: utility
  2226. proc utility wizard Log(string message)void
  2227.  
  2228.     Log causes the passed string to be appended to the server's "MUD.
  2229.     log" file. This is used in the standard scenario for commands like
  2230.     "complain", "typo", etc. Log can also be used to record error
  2231.     situations. Care should be taken, however, to not Log too much,
  2232.     else the MUD.log file can grow very large. That is why this
  2233.     function is restricted to full wizards.
  2234.  
  2235. LookupAction: symbols
  2236. proc utility LookupAction(table theTable; string name)action
  2237.  
  2238.     'name' is looked up in 'theTable'. If it is found, and the symbol
  2239.     is an action, then that action is returned, else nil is returned.
  2240.     If 'theTable' is nil, then 'name' is looked up in all currently
  2241.     "in-use" tables.
  2242.  
  2243. LookupCounter: symbols
  2244. proc utility LookupCounter(table theTable; string name)property int
  2245.  
  2246.     'name' is looked up in 'theTable'. If it is found, and the symbol
  2247.     is an int property, then that property is returned, else nil is
  2248.     returned. If 'theTable' is nil, then 'name' is looked up in all
  2249.     currently "in-use" tables.
  2250.  
  2251. LookupFlag: symbols
  2252. proc utility LookupFlag(table theTable; string name)property bool
  2253.  
  2254.     'name' is looked up in 'theTable'. If it is found, and the symbol
  2255.     is a bool property, then that property is returned, else nil is
  2256.     returned. If 'theTable' is nil, then 'name' is looked up in all
  2257.     currently "in-use" tables.
  2258.  
  2259. LookupString: symbols
  2260. proc utility LookupString(table theTable; string name)property string
  2261.  
  2262.     'name' is looked up in 'theTable'. If it is found, and the symbol
  2263.     is a string property, then that property is returned, else nil is
  2264.     returned. If 'theTable' is nil, then 'name' is looked up in all
  2265.     currently "in- use" tables.
  2266.  
  2267. LookupTable: symbols
  2268. proc utility LookupTable(table theTable; string name)table
  2269.  
  2270.     'name' is looked up in 'theTable'. If it is found, and the symbol
  2271.     is a table, then that table is returned, else nil is returned. If
  2272.     'theTable' is nil, then 'name' is looked up in all currently "in-
  2273.     use" tables.
  2274.  
  2275. LookupThing: symbols
  2276. proc utility LookupThing(table theTable; string name)thing
  2277.  
  2278.     'name' is looked up in 'theTable'. If it is found, and the symbol
  2279.     is a thing, then that thing is returned, else nil is returned. If
  2280.     'theTable' is nil, then 'name' is looked up in all currently "in-
  2281.     use" tables.
  2282.  
  2283. MakeApprentice: machine/character
  2284. proc utility MakeApprentice(character who; bool doNow)void
  2285.  
  2286.     The given character is made into an apprentice. If 'doNow' is
  2287.     'true', and the character is currently connected, then the client
  2288.     the character is connected through is immediately put into "wizard
  2289.     mode". The status of SysAdmin cannot be changed, and only full
  2290.     wizards can change someone's status. The wizard who promotes a
  2291.     character is recorded as that character's sponsor.
  2292.  
  2293. MakeNormal: machine/character
  2294. proc utility MakeNormal(character who)void
  2295.  
  2296.     The given player is made into a normal player. Only SysAdmin can
  2297.     demote someone, and SysAdmin cannot demote himself. If the player
  2298.     was an apprentice or wizard, and was currently active in wizard
  2299.     mode, then the character's client is immediately forced out of
  2300.     wizard mode.
  2301.  
  2302. MakeWizard: machine/character
  2303. proc utility MakeWizard(character who; bool doNow)void
  2304.  
  2305.     The given character is made into a full wizard. If 'doNow' is
  2306.     'true', and the character is currently connected, then the client
  2307.     the character is connected through is immediately put into "wizard
  2308.     mode". The status of SysAdmin cannot be changed, and only full
  2309.     wizards can change someone's status. The wizard who promotes a
  2310.     character is recorded as that character's sponsor.
  2311.  
  2312. MatchName: parsing
  2313. proc utility MatchName(string stored, parsed)int
  2314.  
  2315.     MatchName is the bottom-level of the AmigaMUD routines which tie
  2316.     together input commands and the database. It matches an internal
  2317.     form of a user input noun phrase against an internal form of a
  2318.     stored one. The stored internal form can have several noun phrase
  2319.     alternatives, separated by periods. Each internal form consists of
  2320.     a comma-separated list of noun alternatives, possibly followed by
  2321.     a semicolon and a comma-separated list of adjectives. There must
  2322.     be no spaces anywhere. If the parsed form can be matched by any of
  2323.     the stored forms, then the index of that stored form (the first is
  2324.     index 0) is returned. If none of the stored forms can match the
  2325.     parsed form, then -1 is returned. Examples:
  2326.  
  2327.     stored                    parsed        result
  2328.     ------------------------------------------------------------------
  2329.     dog,pooch,canine;large,black.Fido        pooch;black    0
  2330.     dog,pooch,canine;large,black.Fido        fido        1
  2331.     dog,pooch,canine;large,black.Fido        Fido;black    -1
  2332.     dog,pooch,canine;large,black.Fido        dog;black,large 0
  2333.     dog,pooch,canine;large,black.Fido        canine        0
  2334.     shelf;wooden.shelf,shelve,shelving;wood,wooden
  2335.                         shelves;wood    1
  2336.                         shelf;wooden    0
  2337.                         shelves;wooden    1
  2338.                         shelving;wood    1
  2339.  
  2340.     Note that excess trailing 's's on the parsed nouns are assumed to
  2341.     be for pluralization and are ignored. Also, case is ignored. The
  2342.     'shelf' example illustrates the use of two alternatives, the first
  2343.     of which is "clean", in that it will come out nicely via
  2344.     'FormatName', and the second of which contains lots of forms, so a
  2345.     variety of user input forms will work.
  2346.  
  2347. Me: utility
  2348. proc utility Me()thing
  2349.  
  2350.     Me returns the thing associated with the active agent. This can be
  2351.     a player character or a machine. Me can never return nil.
  2352.  
  2353. MeCharacter: utility
  2354. proc utility MeCharacter()character
  2355.  
  2356.     MeCharacter returns the character for an active player character.
  2357.     If the active agent is a machine, then MeCharacter returns the
  2358.     character of the owner of the active machine.
  2359.  
  2360. Mine: database
  2361. proc utility Mine(thing theThing)bool
  2362.  
  2363.     Mine returns 'true' if the passed thing is owned by the current
  2364.     effective player.
  2365.  
  2366. MOn: effects
  2367. proc utility MOn(thing who)bool
  2368.  
  2369.     MOn returns 'true' if the indicated client currently has music
  2370.     playing enabled. As of version 0.7, music is not implemented in
  2371.     the "MUD" client, so this function is irrelevant.
  2372.  
  2373. MoveSymbol: symbols
  2374. proc utility MoveSymbol(table fromTable, toTable; string name)bool
  2375.  
  2376.     MoveSymbol moves symbol 'name' from table 'fromTable' to table
  2377.     'toTable'. MoveSymbol will not move symbols to or from the
  2378.     Character or Builtin tables, and will not add a duplicate symbol
  2379.     to 'toTable'. Each table must either be the public table, or owned
  2380.     by the effective player, or the effective player must be SysAdmin.
  2381.  
  2382. MPlaySong: effects
  2383. proc utility MPlaySong(thing who; string name; int id)void
  2384.  
  2385.     MPlaySong starts the playing of a song in the indicated client.
  2386.     The song is loaded from "AmigaMUD:Music/<name>". If the indicated
  2387.     song cannot be found, then nothing is done, and the "not found"
  2388.     flag is set, and can be tested by 'IfFound'. 'id' is an identifier
  2389.     associated with the playing of the song, and will be given as the
  2390.     second parameter to a call to the character's "effectdone action"
  2391.     triggered when the song finishes playing or is aborted with
  2392.     'AbortEffect'. The first parameter will be 2 for a music effect.
  2393.  
  2394. MVolume: effects
  2395. proc utility MVolume(thing who; int volume)void
  2396.  
  2397.     MVolume sets the volume for music that is played in the indicated
  2398.     client. The default volume is full volume, which is represented as
  2399.     10000; thus a value of 5000 is half volume.
  2400.  
  2401. NewCharacterPassword: utility
  2402. proc utility wizard NewCharacterPassword()void
  2403.  
  2404.     NewCharacterPassword triggers a sequence of events between the
  2405.     server and the client whereby the client is asked to enter and
  2406.     verify a new password. If verified, the new password is entered as
  2407.     the character's password.
  2408.  
  2409. NewCreationPassword: utility
  2410. proc utility NewCreationPassword()void
  2411.  
  2412.     NewCreationPassword triggers a sequence of events between the
  2413.     server and the client whereby the client is asked to enter and
  2414.     verify a new password. If verified, the new password is entered as
  2415.     the new character creation password. This builtin can only be
  2416.     called directly by SysAdmin. If the character creation password is
  2417.     empty, then no password is needed to create a new character. If
  2418.     the new password starts with an asterisk ('*'), then new
  2419.     characters cannot be created by clients, but must be manually
  2420.     created by SysAdmin, using 'CreateCharacter'.
  2421.  
  2422. Normal: utility
  2423. proc utility Normal()void
  2424.  
  2425.     Normal puts the active client into normal (non-wizard) mode, if it
  2426.     is not already in that mode. If the active character is a newly
  2427.     created one that has not yet connected, then the new character
  2428.     action is run for that character. Normal will fail at that point
  2429.     if the scenario does not have a handler proc for text input.
  2430.  
  2431. Note: utility
  2432. proc utility Note()void
  2433.  
  2434.     Note prints a copyright notice to the active client.
  2435.  
  2436. NPrint: output
  2437. proc utility NPrint(string str)void
  2438.  
  2439.     NPrint is much the same as 'Print', except that it will not print
  2440.     newlines. It will stop before any newline in the string that it is
  2441.     passed. NPrint prints a single newline at the end of the string.
  2442.     NPrint also temporarily sets the status of the active client to
  2443.     "wizard", so that no '@'s will appear in front of the output line.
  2444.     NPrint is used to print an arbitrarily retrieved string, in a way
  2445.     that doesn't unnecessarily include the leading '@'s, but in a way
  2446.     that precludes most "spoofing" by apprentices and wizards.
  2447.  
  2448. NukeClient: machine/character
  2449. proc utility NukeClient(character who)void
  2450.  
  2451.     NukeClient violently forces the indicated character out of the
  2452.     game. No attempt is made to nicely shut the character down by
  2453.     allowing the character's "inactive action" to run. This routine
  2454.     should be used only as a last resort, since it can leave things in
  2455.     a confused state.
  2456.  
  2457. OpenFileForRead: utility
  2458. proc utility OpenFileForRead(string fileName)int
  2459.  
  2460.     OpenFileForRead will open the named file for reading. 'fileName'
  2461.     is a full path or is relative to where MUDServ was started. The
  2462.     value returned is 0 to indicate some kind of failure, or some
  2463.     other value to indicate success. The resulting identifier can be
  2464.     used with 'ReadFile', and should eventually be closed with
  2465.     'CloseFile'. Only SysAdmin, or code written by SysAdmin, can use
  2466.     OpenFileForRead.
  2467.  
  2468. OpenFileForWrite: utility
  2469. proc utility OpenFileForWrite(string fileName)int
  2470.  
  2471.     OpenFileForWrite will open the named file for reading. 'fileName'
  2472.     is a full path or is relative to where MUDServ was started. The
  2473.     value returned is 0 to indicate some kind of failure, or some
  2474.     other value to indicate success. The resulting identifier can be
  2475.     used with 'WriteFile', and should eventually be closed with
  2476.     'CloseFile'. Only SysAdmin, or code written by SysAdmin, can use
  2477.     OpenFileForWrite.
  2478.  
  2479. OPrint: output
  2480. proc utility OPrint(string str)void
  2481.  
  2482.     OPrint prints the passed string to all clients in the same room
  2483.     (with the same location) as the active client, except the active
  2484.     client. If used from a machine, then the string is printed to all
  2485.     clients in the same room as the machine.
  2486.  
  2487. Owner: database
  2488. proc utility Owner(thing theThing)character
  2489.  
  2490.     Owner returns the character who owns the passed thing. Note that
  2491.     it is a character value that is returned, not that character's
  2492.     thing.
  2493.  
  2494. Parent: database
  2495. proc utility Parent(thing theThing)thing
  2496.  
  2497.     Parent returns the parent thing of the passed thing. The returned
  2498.     value can be nil if the thing has no parent. A thing's parent is
  2499.     the first in the chain of other things that it will inherit
  2500.     properties from.
  2501.  
  2502. Parse: parsing
  2503. proc utility Parse(grammar theGrammar; string sentence)int
  2504.  
  2505.     Parse is the starting point for the internal parsing capabilities
  2506.     of AmigaMUD. It is passed a grammar to parse with, and a string
  2507.     containing one or more commands to be parsed. The commands in the
  2508.     string are separated by periods or semicolons. Each command is
  2509.     assumed to start with a verb, and that verb is looked up in the
  2510.     grammar. If the verb is not found, then Parse will complain "I
  2511.     don't know the word XXX.\n" and will return without parsing any
  2512.     more sentences. Similar errors in handling the expected noun
  2513.     phrases for the verb also result in early termination. Parse
  2514.     returns the number of commands that were successfully parsed and
  2515.     executed. Note that early termination can also be triggered by the
  2516.     semantic code associated with the verbs. See the section on
  2517.     parsing in file "ProgConcepts.txt" for much more information.
  2518.  
  2519. PlaceCursor: effects
  2520. proc utility PlaceCursor(int x, y)void
  2521.  
  2522.     PlaceCursor instructs the "MUD" client program for the active
  2523.     client to place the cursor at position 'x', 'y'. If the cursor was
  2524.     already shown somewhere, then it is removed from that location,
  2525.     and the background imagery and icons replaced, before it is
  2526.     redrawn at the new location.
  2527.  
  2528. Pluralize: output
  2529. proc utility Pluralize(string str)string
  2530.  
  2531.     Pluralize uses simple checks to attempt to pluralize the passed
  2532.     string, and return the new result. The rules that Pluralize uses
  2533.     are:
  2534.  
  2535.     if the string ends in "y" then
  2536.         if there is a vowel before the "y", add s"
  2537.         else replace the "y" with "ies"
  2538.     if the string ends in "x", "s", "i" or "o", add "es"
  2539.     otherwise, add "s"
  2540.  
  2541.     Note: the rules here have changed since the original releases.
  2542.  
  2543.     Examples:
  2544.     toy => toys, day => days, guy => guys
  2545.     fly => flies, try => tries
  2546.     box => boxes, kiss => kisses, potato => potatoes
  2547.     dog => dogs, bill => bills
  2548.  
  2549. Pose: machine/character
  2550. proc utility Pose(string what)void
  2551.  
  2552.     The passed string, prefixed with the formatted name of the active
  2553.     agent and a space, is printed to all clients in the same room as
  2554.     the active agent. Also, the same string is passed to a generated
  2555.     call to the "poseAction" of all machines in the same room which
  2556.     have one. The order in which these things happen is not defined.
  2557.  
  2558. Print: output
  2559. proc utility Print(string str)void
  2560.  
  2561.     Print is the basic output function in AmigaMUD. The passed string
  2562.     is printed to the active client, if there is one. As with all
  2563.     other output to a client, the system will word-wrap and indent the
  2564.     output text into the output width of the client's display.
  2565.  
  2566. PrintAction: output
  2567. proc utility PrintAction(action theAction)void
  2568.  
  2569.     A textual, pretty-printed representation of the passed action is
  2570.     printed to the active client. The only current use for this
  2571.     builtin is in the standard scenario's building code, when the user
  2572.     asks to describe the direction checkers on an exit.
  2573.  
  2574. PrintNoAts: output
  2575. proc utility PrintNoAts(bool flag)bool
  2576.  
  2577.     This builtin allows the selection of whether or not '@'s are
  2578.     prepended to all output lines which contain text produced by
  2579.     AmigaMUD code written by apprentices rather than full wizards.
  2580.     This provision is made so that players who wish to be protected
  2581.     from possible "spoofing" by apprentices can be, while those who
  2582.     like such things as part of the game can allow it to be unmarked.
  2583.     In the standard scenario, this is used by the "ats" verb.
  2584.  
  2585. PrivateTable: utility
  2586. proc utility PrivateTable()table
  2587.  
  2588.     PrivateTable returns the private symbol table of the active
  2589.     client. Machines do not have symbol tables. The private symbol
  2590.     table, like the public symbol table and the Builtin table, is
  2591.     always "in-use".
  2592.  
  2593. PublicTable: utility
  2594. proc utility PublicTable()table
  2595.  
  2596.     PublicTable returns the public symbol table. The public symbol
  2597.     table, like the client's private symbol table and the Builtin
  2598.     table, is always "in-use".
  2599.  
  2600. Quit: utility
  2601. proc utility Quit()void
  2602.  
  2603.     Quit sets a flag on the active client, so that when the processing
  2604.     of the current message is complete, that client will be shut down
  2605.     and terminated. This is the standard way for a client to exit from
  2606.     the MUD via a command. Exiting in this way, like an exit request
  2607.     directly from a client (e.g. the close box in "MUD"), allows the
  2608.     client's "idle action" to be executed. In the standard scenario
  2609.     this action is used to do any area specific exit actions, such as
  2610.     moving the character out of SysAdmin's office; to make the current
  2611.     room dark if the character had the only source of light; to print
  2612.     a message indicating the character is exiting; and to clear some
  2613.     properties on the client thing.
  2614.  
  2615. Random: utility
  2616. proc utility Random(int range)int
  2617.  
  2618.     Random returns a random integer between zero and one less than the
  2619.     passed range. E.g. Random(2) will return 0 or 1. The random number
  2620.     seed used by Random can be accessed via 'GetSeed' and 'SetSeed'.
  2621.     The random number generator used is seeded by the time of day at
  2622.     the server, and is a version of the minimal standard generator as
  2623.     described in "Random Number Generators: Good Ones are Hard to
  2624.     Find" by Stephen K. Park and Keith W. Miller in Volume 31 Number
  2625.     10 of the Communications of the ACM.
  2626.  
  2627. ReadFile: utility
  2628. proc utility ReadFile(int fileId)string
  2629.  
  2630.     ReadFile reads and returns a line from the indicated file. The
  2631.     file must have been opened for reading. If the line in the file is
  2632.     longer than 512 characters, then only the first 512 are returned,
  2633.     but the entire line is consumed in the file. Reading an empty line
  2634.     returns a string containing a single space. An end-of-file
  2635.     condition on the file returns an empty string.
  2636.  
  2637. RemHead: database
  2638. proc utility RemHead(<any list> theList)void
  2639.  
  2640.     RemHead removes the head (first) element from the passed list. The
  2641.     list will now have one less element then it had before, and all
  2642.     elements will be shuffled one position towards the front.
  2643.  
  2644. RemoveCursor: effects
  2645. proc utility RemoveCursor()void
  2646.  
  2647.     RemoveCursor removes the cursor from the active client's graphics
  2648.     window. The background and icons behind the cursor are put back as
  2649.     of when the cursor was drawn.
  2650.  
  2651. RemTail: database
  2652. proc utility RemTail(<any list> theList)void
  2653.  
  2654.     RemTail removes the tail (last) element from the passed list. The
  2655.     list will now have one less element then it had before, but all
  2656.     other elements are still at the same place as they were.
  2657.  
  2658. RenameSymbol: symbols
  2659. proc utility RenameSymbol(table theTable; string oldName, newName)bool
  2660.  
  2661.     RenameSymbol changes the name of symbol 'oldName' in table
  2662.     'theTable' to be 'newName'. The effective user must own the table
  2663.     or be SysAdmin, or the table must be the public table. 'oldName'
  2664.     must exist in the table, and 'newName' must not.
  2665.  
  2666. RunLimit: utility
  2667. proc utility RunLimit(int newValue)int
  2668.  
  2669.     RunLimit sets the execution time limit within the MUD to be the
  2670.     given number of seconds. The old limit is returned. MUDServ
  2671.     enforces this limit for the processing of each message from a
  2672.     client (and hence of the processing of each input line, keypad
  2673.     keypress, mouse action, effect completion, etc.) and for the
  2674.     processing resulting from a machine or client's 'After' code. If
  2675.     the limit is exceeded, the execution is aborted and MUDServ goes
  2676.     on to the next input message or 'After' event. Time spent in the
  2677.     database code flushing the cache does not count as execution time.
  2678.     This limit should be fairly large (I use 100 seconds) while
  2679.     compiling a large scenario, but should be smaller (I use 10
  2680.     seconds) during normal operation. An even smaller limit may be
  2681.     appropriate on faster processors.
  2682.  
  2683. Say: machine/character
  2684. proc utility Say(string what)void
  2685.  
  2686.     The passed string, prefixed with the formatted name of the active
  2687.     agent and " says: ", is printed to all clients in the same room as
  2688.     the active agent. Also, the same string is passed to a generated
  2689.     call to the "sayAction" of all machines in the same room which
  2690.     have one. The order in which these things happen is not defined.
  2691.     The standard scenario has a wrapper, 'DoSay', around Say, which
  2692.     checks for and calls a "sayChecker" in the current room, and which
  2693.     will optionally echo the say back to the active client.
  2694.  
  2695. SelectName: parsing
  2696. proc utility SelectName(string names; int which)string
  2697.  
  2698.     SelectName returns a substring of 'names' which is the 'which'th
  2699.     internal-form name within it. Indexing starts at 0, and if the
  2700.     index is out of range, an empty string is returned. E.g.
  2701.  
  2702.     "dog;big.puppy;red.canine;large,ferocious" 0 => "dog;big"
  2703.     "dog;big.puppy;red.canine;large,ferocious" 1 => "puppy;red"
  2704.     "dog;big.puppy;red.canine;large,ferocious" 2 =>
  2705.         "canine;large,ferocious"
  2706.     "dog;big.puppy;red.canine;large,ferocious" 4 => ""
  2707.  
  2708.     Actually, SelectName simply returns the 'which'th period-separated
  2709.     substring of a string. SelectName is useful for extracting the
  2710.     name indicated by a successful 'MatchName' call.
  2711.  
  2712. SelectWord: parsing
  2713. proc utility SelectWord(string words; int which)string
  2714.  
  2715.     SelectWord returns the 'which'th comma- or period- separated
  2716.     substring of the passed 'words' string. E.g.
  2717.  
  2718.     "red,blue,green.yellow,cyan"    0 => "red"
  2719.     "red,blue,green.yellow,cyan"    1 => "blue"
  2720.     "red,blue,green.yellow,cyan"    2 => "green"
  2721.     "red,blue,green.yellow,cyan"    3 => "yellow"
  2722.     "red,blue,green.yellow,cyan"    4 => "cyan"
  2723.     "red,blue,green.yellow,cyan"    5 => ""
  2724.  
  2725. ServerVersion: utility
  2726. proc utility ServerVersion()int
  2727.  
  2728.     ServerVersion returns the version of the MUDAgent server, as an
  2729.     integer. The integer is the actual version number times 10. E.g.
  2730.     for V0.7 of the server, ServerVersion returns 7, and for V1.0 it
  2731.     will return 10.
  2732.  
  2733. SetAgentLocation: machine/character
  2734. proc utility wizard SetAgentLocation(thing agent, where)void
  2735.  
  2736.     SetAgentLocation sets the location of the passed agent to be the
  2737.     passed thing. This can be used to "teleport" a player or machine
  2738.     to some other location. Note that other things would have to be
  2739.     done in a typical scenario. SetAgentLocation will only work on an
  2740.     active character - inactive characters are not agents.
  2741.  
  2742. SetButtonPen: effects
  2743. proc utility SetButtonPen(int which, pen)void
  2744.  
  2745.     SetButtonPen selects pen 'pen' of the graphics pens to be the
  2746.     'which'th button pen. The button pens are as follows:
  2747.  
  2748.     pen    default         use
  2749.     -------------------------------------------------
  2750.      0    1 - dark grey        background of letters
  2751.      1    9 - gold        letters
  2752.      2    2 - medium grey     outer border colour
  2753.      3    3 - light grey        middle border colour
  2754.      4    4 - white        inner border colour
  2755.      5    9 - gold        background of highlighted letters
  2756.      6    1 - dark grey        highlighted letters
  2757.  
  2758. SetCharacterActiveAction: machine/character
  2759. proc utility wizard SetCharacterActiveAction(action newAction)action
  2760.  
  2761.     SetCharacterActiveAction sets the action that is executed whenever
  2762.     the character becomes active, i.e. connects to the MUD after not
  2763.     being connected. It is NOT called when the character is first
  2764.     being initialized - the "new character action" set by
  2765.     'SetNewCharacterAction' is executed then, and that is when the
  2766.     "active action" is usually set up. The old "active action", if
  2767.     any, is returned. The "active action" is usually used to do
  2768.     something like a "look around" command to display graphics, etc.
  2769.     for the user, and to create a standard set of mouse-buttons. The
  2770.     action used must have no parameters and no result.
  2771.  
  2772. SetCharacterButtonAction: machine/character
  2773. proc utility wizard SetCharacterButtonAction(action newAction)action
  2774.  
  2775.     SetCharacterButtonAction sets the action that will be called by
  2776.     the system in response to a button-click in the Amiga "MUD" client
  2777.     program. The action must have one int parameter (the identifier
  2778.     of the button clicked) and no result. The old "button action", if
  2779.     any, is returned.
  2780.  
  2781. SetCharacterEffectDoneAction: machine/character
  2782. proc utility wizard SetCharacterEffectDoneAction(action newAction)action
  2783.  
  2784.     SetCharacterEffectDoneAction sets the action that is called by the
  2785.     system when an effect completes on the client for the active
  2786.     character, or is aborted using 'AbortEffect'. The action must have
  2787.     two int parameters. The first is a code indicating which kind of
  2788.     action is completing:
  2789.  
  2790.     0 => sound
  2791.     1 => speech
  2792.     2 => music
  2793.  
  2794.     The second parameter is the identifier for the particular effect
  2795.     that is completing (or has been aborted with 'AbortEffect'), as
  2796.     given when the effect was started. This routine can be used to
  2797.     create continuously-running or looping graphical, sound and
  2798.     musical effects. The old such action, if any, is returned.
  2799.  
  2800. SetCharacterIdleAction: machine/character
  2801. proc utility wizard SetCharacterIdleAction(action newAction)action
  2802.  
  2803.     SetCharacterIdleAction sets on the active character the action to
  2804.     be called by the system when the character leaves the game. The
  2805.     action must have no parameters and no result. Note that the action
  2806.     is not called if the client is forced out of the game with
  2807.     'NukeClient' (that is how to get rid of a client when its "idle
  2808.     action" goes into an infinite loop when there is a very long
  2809.     timeout in effect!) The "idle action" will often do things like
  2810.     taking the character out of single-occupancy areas like Questor's
  2811.     Office in the standard scenario, and other scenario-dependent
  2812.     character shutdown things. The previous "idle action" for the
  2813.     character, if any, is returned.
  2814.  
  2815. SetCharacterInputAction: machine/character
  2816. proc utility wizard SetCharacterInputAction(action newAction)action
  2817.  
  2818.     SetCharacterInputAction sets on the active character the action to
  2819.     be called by the system when the player running the character
  2820.     enters an input line when not in "wizard mode". The action must
  2821.     have one string parameter - the input line entered, and no result.
  2822.     The action will typically check for one or two special cases (like
  2823.     a leading " or :), and then pass most lines to the AmigaMUD
  2824.     'Parse' function for general parsing. The character's previous
  2825.     "input action", if any, is returned.
  2826.  
  2827. SetCharacterLocation: machine/character
  2828. proc utility SetCharacterLocation(character theCharacter;
  2829.     thing newLocation)void
  2830.  
  2831.     SetCharacterLocation sets the location of character 'theCharacter'
  2832.     to be the given thing. Unlike 'SetAgentLocation', this routine can
  2833.     be used on a character that is not currently active. It cannot,
  2834.     however, be used on a machine. See also 'SetLocation'.
  2835.  
  2836. SetCharacterMouseDownAction: machine/character
  2837. proc utility wizard SetCharacterMouseDownAction(action newAction)action
  2838.  
  2839.     SetCharacterMouseDownAction sets on the active character the
  2840.     action that the system will call when the user clicks the left
  2841.     mouse button and releases it inside a defined rectangular "mouse
  2842.     region" set up with 'AddRegion'. The action must have 3 int
  2843.     parameters and no result. When called, it is passed the identifier
  2844.     of the region clicked in (supplied to 'AddRegion') and the x and y
  2845.     coordinates of the click relative to the top-left corner of the
  2846.     region. "mouse down" actions are used for things like the icon
  2847.     editor in the standard scenario. The previous "mouse down" action,
  2848.     if any, is returned.
  2849.  
  2850. SetCharacterRawKeyAction: machine/character
  2851. proc utility wizard SetCharacterRawKeyAction(action newAction)action
  2852.  
  2853.     SetCharacterRawKeyAction sets on the active character the action
  2854.     that the system will call when the user presses a numeric keypad
  2855.     key or other special key supported by the system. This allows the
  2856.     scenario to control the shortcut actions performed in response to
  2857.     those keypresses. The keycodes supported in this way are:
  2858.  
  2859.     scenario symbol   value (hex)    meaning
  2860.     -------------------------------------------
  2861.     KEY_HELP        0x0020    HELP key
  2862.     KEY_KP_UL        0x0001    keypad 7
  2863.     KEY_KP_U        0x0002    keypad 8
  2864.     KEY_KP_UR        0x0003    keypad 9
  2865.     KEY_KP_L        0x0004    keypad 4
  2866.     KEY_KP_C        0x0005    keypad 5
  2867.     KEY_KP_R        0x0006    keypad 6
  2868.     KEY_KP_DL        0x0007    keypad 1
  2869.     KEY_KP_D        0x0008    keypad 2
  2870.     KEY_KP_DR        0x0009    keypad 3
  2871.     KEY_KP_PLUS        0x000a    keypad +
  2872.     KEY_KP_MINUS        0x000b    keypad -
  2873.     
  2874.     The previous "rawkey action", if any, is returned.
  2875.  
  2876. SetContinue: utility
  2877. proc utility SetContinue(bool state)void
  2878.  
  2879.     SetContinue instructs the parser whether or not to allow the
  2880.     definition of actions that contain errors. If the state is set to
  2881.     'true', then such actions are defined and entered into the
  2882.     database. They cannot be executed, however. If the state is set to
  2883.     'false', then an error in defining an action (proc) prevents it
  2884.     from being entered into any symbol tables. The normal state will
  2885.     be 'false'. The 'true' state is useful when sourcing large source
  2886.     files so that an error in one function will not cause further
  2887.     errors, in functions which call the first, due to the first not
  2888.     being defined.
  2889.  
  2890. SetCursorPattern: effects
  2891. proc utility SetCursorPattern(list int newPattern)void
  2892.  
  2893.     SetCursorPattern sets the pattern to be used for the graphics
  2894.     cursor available in the graphics window. Like icons, the cursor,
  2895.     manipulated by 'PlaceCursor' and 'RemoveCursor', is a 16 pixel by
  2896.     16 pixel pattern in a single colour ('SetCursorPen'). The list of
  2897.     ints used to define the cursor must have exactly 8 elements (16 *
  2898.     16 / 32), even if the defined cursor is not fully 16 x 16. The
  2899.     cursor pattern is sent to the client, and will take effect
  2900.     immediately if the cursor is currently visible.
  2901.  
  2902. SetCursorPen: effects
  2903. proc utility SetCursorPen(int pen)void
  2904.  
  2905.     SetCursorPen selects the pen to be used for drawing the cursor in
  2906.     the graphics window. The pen is any of the graphics drawing pens.
  2907.     If the cursor is currently visible, it will be redrawn in the new
  2908.     colour. Note that neither SetCursorPen nor SetCursorPattern can
  2909.     directly affect a client other than the one for the active player.
  2910.     If needed, that can be accomplished using 'ForceAction'.
  2911.  
  2912. SetEffectiveTo: utility
  2913. proc utility SetEffectiveTo(character thePlayer)void
  2914.  
  2915.     SetEffectiveTo sets the "effective character", i.e. the one whose
  2916.     access rights are to be in effect, to 'thePlayer'. For obvious
  2917.     security reasons, only SysAdmin, or code written by SysAdmin, can
  2918.     use this function. In other words, the effective player can only
  2919.     be changed in this way if it is currently SysAdmin. The effective
  2920.     player is usually set automatically to the owner of any function
  2921.     called, if that function is not marked as 'utility'. The
  2922.     "effective status" is set to 'apprentice', giving only apprentice
  2923.     access rights.
  2924.  
  2925. SetEffectiveToNone: utility
  2926. proc utility SetEffectiveToNone()void
  2927.  
  2928.     SetEffectiveToNone sets the "effective character" to be no-one.
  2929.     This removes any access that was previously available via the
  2930.     effective player. Any wizard or apprentice can use this function,
  2931.     since it only removes access rights. The "effective status" is set
  2932.     to 'normal', giving neither apprentice nor wizard access rights.
  2933.  
  2934. SetEffectiveToReal: utility
  2935. proc utility SetEffectiveToReal()void
  2936.  
  2937.     SetEffectiveToReal sets the "effective character" back to the real
  2938.     character, i.e. the active character or the owner of the active
  2939.     machine. This is only allowed if the effective character is
  2940.     SysAdmin, since it involves the addition of access rights. The
  2941.     "effective status" is set to the status of the real player, giving
  2942.     whatever access that real player has.
  2943.  
  2944. SetIndent: output
  2945. proc utility wizard SetIndent(int newIndent)void
  2946.  
  2947.     SetIndent sets the current output indentation column. Subsequent
  2948.     lines of output, via 'Print', or any other mechanism, will be
  2949.     indented on the left by 'newIndent'. This is useful when printing
  2950.     lists of things, such as inventories, contents, etc. This, in
  2951.     combination with automatic word wrap and the ability to set the
  2952.     output width, almost makes AmigaMUD seem like a little text
  2953.     formatter. The programmer is advised to check that things are
  2954.     working out correctly, however, since things get complicated with
  2955.     text going to multiple clients, and with some clients desiring
  2956.     '@'s in front of any line containing apprentice-generated output.
  2957.  
  2958. SetIt: utility
  2959. proc utility SetIt(thing theThing)void
  2960.  
  2961.     SetIt sets the value of the 'It' global variable, which is
  2962.     accessible via the 'It' builtin. See the description of 'It' for
  2963.     more details.
  2964.  
  2965. SetLocation: machine/character
  2966. proc utility wizard SetLocation(thing where)void
  2967.  
  2968.     SetLocation sets the location of the active character or machine
  2969.     to the given thing. This is the most common way of moving from one
  2970.     room to another (in conjunction with other scenario-specific
  2971.     things of course).
  2972.  
  2973. SetMachineActive: machine/character
  2974. proc utility SetMachineActive(thing machine; action theAction)action
  2975.  
  2976.     SetMachineActive sets, on the machine structure associated with
  2977.     'machine', the action that will be called by the system on behalf
  2978.     of that machine (with 'Me' set accordingly) when the server is
  2979.     restarted. This allows the machine to restart its periodic
  2980.     actions, and do any other system-startup initializations. The
  2981.     machine's previous "active action", if any, is returned.
  2982.  
  2983. SetMachineIdle: machine/character
  2984. proc utility SetMachineIdle(thing machine; action theAction)action
  2985.  
  2986.     SetMachineIdle sets, on the machine structure associated with
  2987.     'machine', the action that will be called by the system on behalf
  2988.     of that machine (with 'Me' set accordingly) when the server is
  2989.     being shut down. This allows the machine to do any shutdown
  2990.     activities that the scenario might need. The old "idle action", if
  2991.     any, is returned. The standard scenario uses this capability with
  2992.     the 'TimeKeeper' machine to subtract off the shutdown time from
  2993.     the wait time of each of its events.
  2994.  
  2995. SetMachinePose: machine/character
  2996. proc utility SetMachinePose(thing machine; action theAction)action
  2997.  
  2998.     SetMachinePose sets, on the machine structure associated with
  2999.     'machine', the action that will be called by the system whenever
  3000.     any agent does a 'Pose' in the room the machine is in. The action
  3001.     must have one string parameter, which will be the string passed to
  3002.     the 'Pose' builtin, with the posing agent's name prefixed. This
  3003.     allows a machine to respond to things like people waving, etc. The
  3004.     previous "pose action", if any, is returned. The standard scenario
  3005.     uses a "pose action" on Packrat to allow her to copy any pose that
  3006.     anyone nearby does.
  3007.  
  3008. SetMachinesActive: machine/character
  3009. proc utility SetMachinesActive(bool state)void
  3010.  
  3011.     SetMachinesActive controls whether or not machines are to be
  3012.     active at all in the scenario. A value of 'false' for 'state'
  3013.     makes machines inactive. This control is useful for debugging, and
  3014.     for controlling wayward machines.
  3015.  
  3016.     Note: As of the V0.7 release, this facility is broken. Actually,
  3017.     it appears to be only half implemented. Oops.
  3018.  
  3019. SetMachineSay: machine/character
  3020. proc utility SetMachineSay(thing machine; action theAction)action
  3021.  
  3022.     SetMachineSay sets, on the machine structure associated with
  3023.     'machine', the action that will be called by the system whenever
  3024.     any agent does a 'Say' in the room the machine is in. The action
  3025.     must have one string parameter, which will be the string passed to
  3026.     the 'Say' builtin, with the speaking agent's name prefixed. This
  3027.     allows machines to respond to spoken commands and comments. The
  3028.     previous "say action", if any, is returned. The standard scenario
  3029.     uses machine "say actions" in a number of places. 'SetSay' can be
  3030.     used to easily pull off the added parts of the string.
  3031.  
  3032. SetMachineWhisperMe: machine/character
  3033. proc utility SetMachineWhisperMe(thing machine; action theAction)action
  3034.  
  3035.     SetMachineWhisperMe sets, on the machine structure associated with
  3036.     'machine', the action that will be called by the system whenever
  3037.     any agent whispers directly to the machine. The action must have
  3038.     one string parameter, which will be the text whispered, preceeded
  3039.     by "<name> whispers:", where <name> is the formatted name of the
  3040.     agent doing the whispering. The previous "whisperme action", if
  3041.     any, is returned. 'SetWhisperMe' can be used to pull the string
  3042.     apart easily.
  3043.  
  3044. SetMachineWhisperOther: machine/character
  3045. proc utility SetMachineWhisperOther(thing machine; action theAction)action
  3046.  
  3047.     SetMachineWhisperOther sets, on the machine structure associated
  3048.     with 'machine', the action that will be called by the system
  3049.     whenever the machine "overhears" an agent whispering to another
  3050.     agent. The chance of the overhearing is controlled by the call to
  3051.     'Whisper' used. The action must have one string parameter and no
  3052.     result. The parameter will the the string whispered, preceeded by
  3053.     "<name1> whispers to <name2>:", where <name1> is the formatted
  3054.     name of the agent doing the whispering, and <name2> is the
  3055.     formatted name of who they are whispering to. The previous
  3056.     "whisperother action", if any, is returned. 'SetWhisperOther' can
  3057.     be used to pull apart the argument string.
  3058.  
  3059. SetMeString: utility
  3060. proc utility SetMeString(string name)void
  3061.  
  3062.     SetMeString sets the string that is used as the name of the active
  3063.     client when FindAgent is asked to find "self", "myself",
  3064.     "yourself" or "me". This string is set by the system to the name
  3065.     of the active client when any action is started on behalf of the
  3066.     client. Modifying the value is useful for some situations
  3067.     involving 'ForceAction'.
  3068.  
  3069. SetNewCharacterAction: machine/character
  3070. proc utility SetNewCharacterAction(action newAction)action
  3071.  
  3072.     SetNewCharacter sets the global action which is executed whenever
  3073.     a new character is initialized. This is done when a player first
  3074.     connects to that character in non-wizard mode, or when 'Normal' is
  3075.     first executed by the character. The old value of the
  3076.     "newcharacter action" is returned. This action will typically do
  3077.     things like initializing the character for properties that the
  3078.     scenario assumes all characters have, moving the character to the
  3079.     entry location, etc.
  3080.  
  3081. SetPrompt: utility
  3082. proc utility wizard SetPrompt(string prompt)string
  3083.  
  3084.     SetPrompt sets the prompt for the active client. The old prompt is
  3085.     returned. The default prompt is "input> ". Note that "wizard mode"
  3086.     has prompts of its own, not related to the character's prompt. The
  3087.     prompt will change immediately, unless there is currently a
  3088.     partial input line typed.
  3089.  
  3090. SetRemoteSysAdminOK: utility
  3091. proc utility SetRemoteSysAdminOK(bool state)void
  3092.  
  3093.     SetRemoteSysAdminOK sets whether or not the server will accept a
  3094.     login of SysAdmin via a remote connection. A connection via
  3095.     'MUDAgent' is always a remote connection, and a connection via
  3096.     'SMUD' is remote if the '-r' flag is given to 'SMUD'. The default
  3097.     is to not accept a remote SysAdmin connection, and it is highly
  3098.     recommended that you never change the setting. Doing so makes it
  3099.     possible for someone to learn or guess your SysAdmin password,
  3100.     which makes your entire system (not just AmigaMUD) wide open to
  3101.     that person.
  3102.  
  3103. SetSay: parsing
  3104. proc utility SetSay(string what)string
  3105.  
  3106.     SetSay is useful for interpreting a string passed to a machine
  3107.     "say action". It takes a string of the form "xxx says: yyy",
  3108.     returns "xxx" and puts "yyy" into the tail buffer, where it can be
  3109.     accessed with 'GetTail' and 'GetWord'.
  3110.  
  3111. SetSeed: utility
  3112. proc utility SetSeed(int newSeed)void
  3113.  
  3114.     SetSeed sets the seed for the server's random number generator.
  3115.     The value of the seed can be obtained via 'GetSeed'. Setting the
  3116.     seed allows for the generation of repeatable pseudo-random
  3117.     sequences, which can be used to reproduce a randomly generated
  3118.     area each time it is needed.
  3119.  
  3120. SetSingleUser: utility
  3121. proc utility SetSingleUser(bool state)void
  3122.  
  3123.     SetSingleUser sets a flag inside the database that controls
  3124.     whether the database represents a single-user "Adventure"-style
  3125.     game or a multi-user MUD. In single-user mode, the concept of
  3126.     "characters" does't really exist - when a client connects (only
  3127.     one is ever allowed at a time), no character name or password is
  3128.     required - the game goes right into handling user input. Note that
  3129.     because of the way MUDServ operates, the current state is always
  3130.     saved implicitly, and in order to make a saved position, the
  3131.     entire MUD database (MUD.data, MUD.index) must be backed up.
  3132.  
  3133. SetTail: parsing
  3134. proc utility SetTail(string str)void
  3135.  
  3136.     SetTail directly sets the value of the server's "tail" string.
  3137.     This string is set implicitly by a number of actions, including
  3138.     the parsing of a 'VerbTail' verb. The value of the string can be
  3139.     retrieved using 'GetTail', and individual words in it can be
  3140.     retrieved one at a time using 'GetWord'.
  3141.  
  3142. SetThingStatus: database
  3143. proc utility SetThingStatus(thing theThing; <thing status> status)void
  3144.  
  3145.     SetThingStatus sets the status of 'theThing' to 'status'. The
  3146.     "effective player" must own the thing, or the effective and real
  3147.     players must both be SysAdmin (i.e. SysAdmin is typing directly in
  3148.     wizard mode, or is running his own actions). The value of 'status'
  3149.     must be one of: 'ts_public', 'ts_private', 'ts_readonly', and
  3150.     'ts_wizard', as explained in previous documents.
  3151.  
  3152. SetWhisperMe: parsing
  3153. proc utility SetWhisperMe(string what)string
  3154.  
  3155.     SetWhisperMe is useful for interpreting a string passed to a
  3156.     machine "whisperme action". It takes a string of the form "xxx
  3157.     whispers: yyy", returns "xxx" and puts "yyy" into the tail buffer,
  3158.     where it can be accessed with 'GetTail' and 'GetWord'.
  3159.  
  3160. SetWhisperOther: parsing
  3161. proc utility SetWhisperOther(string what)string
  3162.  
  3163.     SetWhisperOther is useful for interpreting a string passed to a
  3164.     machine "whisperother action". It takes a string of the form "xxx
  3165.     whispers to yyy: zzz", returns "xxx" and puts "yyy zzz" into the
  3166.     tail buffer, where it can be accessed with 'GetTail' and
  3167.     'GetWord'.
  3168.  
  3169. ShowCharacter: utility
  3170. proc utility ShowCharacter(character who)void
  3171.  
  3172.     ShowCharacter prints to the active client the status of the
  3173.     indicated character. This includes the connection status, the
  3174.     character status (normal/apprentice/wizard), and an indication of
  3175.     whether or not the character is "new" (has executed the "newplayer
  3176.     action").
  3177.  
  3178. ShowCharacters: utility
  3179. proc utility ShowCharacters(bool longForm)int
  3180.  
  3181.     If 'longForm' is 'true', then ShowCharacters effectively calls
  3182.     'ShowCharacter' for each existing character. If 'longForm' is
  3183.     'false', then ShowCharacters prints just the names of all of the
  3184.     existing characters. Both lists are preceeded by "Existing
  3185.     characters as of " and the time and date. ShowCharacters returns
  3186.     the number of existing characters.
  3187.  
  3188. ShowClients: utility
  3189. proc utility ShowClients(bool longForm)int
  3190.  
  3191.     If 'longForm' is 'true' then ShowClients shows the name of all
  3192.     active clients, followed by their connection time and whether or
  3193.     not they are currently in "wizard mode". If 'longForm' is 'false',
  3194.     then ShowClients just shows the names of all active clients. Both
  3195.     forms are preceeded by "Active clients as of " and the current
  3196.     time and date. ShowClients returns the number of active clients.
  3197.  
  3198. ShowTable: symbols
  3199. proc utility ShowTable(table theTable)void
  3200.  
  3201.     ShowTable shows the symbols in the passed table. Only the names of
  3202.     the symbols are shown - 'DescribeSymbol' can be used to show the
  3203.     definition of a given symbol.
  3204.  
  3205. ShowWord: parsing
  3206. proc utility ShowWord(grammar theGrammar; string theWord)void
  3207.  
  3208.     ShowWord looks 'theWord' up in 'theGrammar' and prints, to the
  3209.     active client, the definition of that word. The output is one of:
  3210.  
  3211.     - not in grammar
  3212.     - code <n> {a separator word}
  3213.     - synonym of "xxx"
  3214.     - code <n> string tail verb => <action>
  3215.     - code <n> verb with alternatives:
  3216.         - no object
  3217.         - direct object
  3218.         - direct and indirect objects
  3219.         separator {<NONE> or "yyy"}
  3220.         => <action>
  3221.  
  3222. ShowWords: parsing
  3223. proc utility ShowWords(grammar theGrammar)void
  3224.  
  3225.     ShowWords prints, to the active client, the words in 'theGrammar'.
  3226.     The list is not sorted, but is in multiple columns. 'ShowWord' can
  3227.     be used to see the definition of a given word in the grammar.
  3228.  
  3229. ShutDown: utility
  3230. proc utility ShutDown(bool yesNo)bool
  3231.  
  3232.     ShutDown can be used by SysAdmin to set or clear the "shutdown
  3233.     flag". If this flag is set when the server reaches the state of
  3234.     having no clients, the server will shut itself down and exit.
  3235.  
  3236. SOn: effects
  3237. proc utility SOn(thing who)bool
  3238.  
  3239.     SOn returns 'true' if the indicated client ('who') has sound
  3240.     output enabled, and 'false' otherwise. A text-only client will
  3241.     always have all effects disabled.
  3242.  
  3243. SPlaySound: effects
  3244. proc utility SPlaySound(thing who; string name; int id)void
  3245.  
  3246.     SPlaySound instructs client 'who' to start playing an IFF 8SVX
  3247.     sound sample from "AmigaMUD:Sounds/<name>". The operation of the
  3248.     effect is given identifier 'id', and proceeds without the server
  3249.     or client waiting for it. When the sound is complete (or is
  3250.     aborted with 'AbortEffect'), the server will call the client's
  3251.     "effect done" action with parameters 0 and 'id'.
  3252.  
  3253. SPrint: output
  3254. proc utility SPrint(thing agent; string str)void
  3255.  
  3256.     SPrint prints string 'str' to client 'agent'. This is typically
  3257.     used when one character or machine is affecting another. As usual,
  3258.     the string will be word-wrapped into the client's display width.
  3259.  
  3260. StringReplace: utility
  3261. proc utility StringReplace(string s1; int pos; string s2)string
  3262.  
  3263.     StringReplace returns a string which is a copy of 's1', but with
  3264.     the characters starting at position 'pos' (zero origin) replaced
  3265.     by the characters of 's2'. If there is more of 's1' beyond the
  3266.     end of the 's2' replacement, it remains unchanged.
  3267.  
  3268. StringToAction: utility
  3269. proc utility StringToAction(string str)action
  3270.  
  3271.     StringToAction is one of the more powerful features of AmigaMUD.
  3272.     It takes a string, generated in whatever manner is needed, and
  3273.     attempts to parse and compile it into an action. The set of "in-
  3274.     use" tables controls the set of symbols that can be used, as
  3275.     usual. Any error messages generated as a result of the compilation
  3276.     will go to the active client (if any). If the compilation is
  3277.     successful, the newly created action is returned, else nil is
  3278.     returned. The standard scenario uses StringToAction to compile
  3279.     "builder actions" created by builders.
  3280.  
  3281. StringToInt: utility
  3282. proc utility StringToInt(string str)int
  3283.  
  3284.     StringToInt attempts to turn string 'str' into an integer value,
  3285.     which it returns. A leading '+' or '-' sign can be present. If the
  3286.     string cannot be decoded into a decimal integer, then a run-time
  3287.     error is generated. Note that 'StringToInt' simply stops at the
  3288.     first non-digit, as long as at least one digit is present.
  3289.  
  3290. StringToPosInt: utility
  3291. proc utility StringToPosInt(string str)int
  3292.  
  3293.     StringToPosInt is a safer alternative than 'StringToInt' for
  3294.     converting user input into an integer. It does not accept a '+' or
  3295.     '-' sign, but it will return -1 if the string it is passed does
  3296.     not start with a decimal digit.
  3297.  
  3298. Strip: utility
  3299. proc utility Strip(string st)string
  3300.  
  3301.     Strip will remove quotation marks (") from around a string and
  3302.     will expand escaped characters ('\n' and '\t') from the passed
  3303.     string, returning the processed result. The result is also left in
  3304.     the "tail buffer", where it can be accessed with 'GetWord'. If the
  3305.     string starts with a quotation mark, then that mark is stripped
  3306.     off, and any trailing mark is also stripped off, but internal
  3307.     marks are kept. If the first character of the string was not a
  3308.     quotation mark, then all marks are kept intact.
  3309.  
  3310. SubString: utility
  3311. proc utility SubString(string str; int start, length)string
  3312.  
  3313.     SubString returns a substring of 'str', starting at postion
  3314.     'start' (zero origin) for length 'length'. If 'start' + 'length'
  3315.     is greater than the length of 'str', then the resulting substring
  3316.     will be cut short. SubString will only abort execution if either
  3317.     'start' or 'length' is less than zero.
  3318.  
  3319. SVolume: effects
  3320. proc utility SVolume(thing who; int volume)void
  3321.  
  3322.     SVolume sets the sound playback volume in client 'who'. 'volume'
  3323.     is a value from 0 - 10000, with, e.g. 5000 representing half of
  3324.     the full volume.
  3325.  
  3326. Synonym: parsing
  3327. proc utility Synonym(grammar theGrammar; string oldWord, newWord)void
  3328.  
  3329.     Synonym defines a synonym in 'theGrammar'. 'oldWord' is looked up
  3330.     in the grammar, and must be found, else a run-time error is
  3331.     produced. 'newWord', which must not exist in the grammar, is made
  3332.     to be a synonym of that word. Note that you cannot make a synonym
  3333.     of a synomym - you must make another synonym of the original word
  3334.     instead.
  3335.  
  3336. TextHeight: output
  3337. proc utility wizard TextHeight(int newHeight)int
  3338.  
  3339.     TextHeight sets the active client's text output height to
  3340.     'newHeight' lines of text, returning the old value. A client using
  3341.     the Amiga "MUD" program has the text height set to the height of
  3342.     the full text window, which will vary depending on overscan and
  3343.     PAL versus NTSC. For other clients, the default height is 23
  3344.     lines. The number of lines is useful for code which wants to
  3345.     paginate output, such as the email and news readers in the
  3346.     standard scenario.
  3347.  
  3348. TextWidth: output
  3349. proc utility wizard TextWidth(int newWidth)int
  3350.  
  3351.     TextWidth sets the active client's text output width to 'newWidth'
  3352.     columns, returning the old value. A client using the Amiga "MUD"
  3353.     program has the text width set to the width of the text window,
  3354.     which will vary depending on overscan. For other clients, the
  3355.     default width is 78 characters. The text output width is the width
  3356.     to which the server's output code will wrap output text going to
  3357.     the client. Note that the Amiga "MUD" client program will also
  3358.     wrap output text to its actual text window width, so making the
  3359.     client's text width value too large makes a real mess.
  3360.  
  3361. ThingCharacter: machine/character
  3362. proc utility ThingCharacter(thing theThing)character
  3363.  
  3364.     ThingCharacter returns the character associated with 'theThing',
  3365.     if there is one. If there isn't one, then nil is returned. The
  3366.     opposite conversion, from character to thing, is done by
  3367.     'CharacterThing'. Note that 'ThingCharacter' will only find an
  3368.     active client - it does not check inactive characters.
  3369.  
  3370. Time: utility
  3371. proc utility Time()int
  3372.  
  3373.     Time returns the current time in seconds, from some arbitrary
  3374.     start point, as an integer. This is useful for comparing when
  3375.     events happen, by storing the time value as the event happens.
  3376.  
  3377. Trace: utility
  3378. proc utility wizard Trace(int n)void
  3379.  
  3380.     Trace will add an entry to the server's trace buffer, titled "user
  3381.     trace", and with numerical value 'n'. This trace buffer is a
  3382.     circular buffer, currently of size 100 entries (although this may
  3383.     change in the future), in which the server records a history of
  3384.     recent events. This trace buffer is dumped out, latest event to
  3385.     earliest event, if the server aborts. The entire trace facility
  3386.     may be compiled out of the server in some future release.
  3387.  
  3388. Trim: utility
  3389. proc utility Trim(string str)string
  3390.  
  3391.     Trim returns a copy of its argument string, but with any leading
  3392.     and trailing spaces removed. Internal spaces are not altered.
  3393.  
  3394. TrueMe: utility
  3395. proc utility TrueMe()thing
  3396.  
  3397.     TrueMe returns the identity of the original character or machine
  3398.     for this execution. The use of 'ForceAction' will not change the
  3399.     value returned, unlike that returned from 'Me'. The standard
  3400.     scenario uses TrueMe from some of the Packrat code, to determine
  3401.     the identity of the player who instructs her to do something.
  3402.  
  3403. UnUseTable: symbols
  3404. proc utility UnUseTable(table theTable)bool
  3405.  
  3406.     UnUseTable removes 'theTable' from the set of "in-use" tables.
  3407.     Symbols defined in that table, and not in any other in-use table,
  3408.     will no longer be available for use when compiling. This is the
  3409.     same as the "unuse" command in wizard mode.
  3410.  
  3411. UseTable: symbols
  3412. proc utility UseTable(table theTable)bool
  3413.  
  3414.     UseTable adds 'theTable' to the set of "in-use" tables. Symbols in
  3415.     the table will now be available for use when compiling. This is
  3416.     the same as the "use" command in wizard mode.
  3417.  
  3418. Verb: parsing
  3419. proc utility Verb()string
  3420.  
  3421.     Verb returns the string which the user entered as the verb for the
  3422.     current command. In the presence of synonyms for a verb, this
  3423.     allows the scenario code to know which form of a verb the user
  3424.     typed. This can be useful when making minor distinctions of
  3425.     meaning or usage.
  3426.  
  3427. Verb0: parsing
  3428. proc utility Verb0(grammar theGrammar; string theVerb; int separatorCode;
  3429.     action theAction)void
  3430.  
  3431.     Verb0 enters string 'theVerb' into grammer 'theGrammar' as a verb
  3432.     which takes no (0) objects (in the English language sense). If
  3433.     'separatorCode' is nonzero, then it is the code for a word which
  3434.     can be given with this verb in order to distinguish it from other
  3435.     possible uses of the same word as a verb. The AmigaMUD parser will
  3436.     call action 'theAction' with no parameters when it parses this
  3437.     verb/separator combination. The action should return a boolean
  3438.     value, with 'false' indicating that something has gone wrong, and
  3439.     any remaining commands on the input line should not be processed.
  3440.     Some examples:
  3441.  
  3442.     private proc goNorth()bool:
  3443.         if Here()@p_rNorth = nil then
  3444.         Print("You can't go that way.\n");
  3445.         false
  3446.         else
  3447.         SetLocation(Here()@p_rNorth);
  3448.         true
  3449.         fi
  3450.     corp;
  3451.     Verb0(G, "north", 0, goNorth).
  3452.     Synonym(G, "north", "n").
  3453.  
  3454.     private proc sitUp()bool:
  3455.         ...
  3456.     corp;
  3457.     Verb0(G, "sit", FindWord(G, "up"), sitUp).
  3458.  
  3459. Verb1: parsing
  3460. proc utility Verb1(grammar theGrammar; string theVerb; int separatorCode;
  3461.     action theAction)void
  3462.  
  3463.     Verb1 adds to grammar 'theGrammar' verb 'theVerb' which expects a
  3464.     direct object when it is used. 'separatorCode', if not zero, is a
  3465.     word which can be between the verb and its direct object noun-
  3466.     phrase, or after the noun-phrase. The AmigaMUD parser will
  3467.     automatically handle multiple noun phrases, separated by commas or
  3468.     "and"s, and will pass them, in internal "noun;adj,adj,..." form,
  3469.     in turn to action 'theAction'. The action should return a bool,
  3470.     with 'false' indicating that some error has occurred, and no more
  3471.     calls to it should be made for this command, and that no more
  3472.     commands from the current input line should be processed. It is
  3473.     possible for 'theAction' to be called with an empty string if the
  3474.     verb is used by itself, and no object-less variant of that verb
  3475.     exists. Examples:
  3476.  
  3477.     private proc pickUp(string what)bool:
  3478.         status st;
  3479.         thing th;
  3480.  
  3481.         if what = "" then
  3482.         Print("Pick up what?\n");
  3483.         false
  3484.         else
  3485.         st := FindName(Here()@p_rContents, what);
  3486.         if st = continue then
  3487.             Print(FormatName(what) + " is ambiguous.\n");
  3488.             false
  3489.         elif st = fail then
  3490.             Print("There is no " + FormatName(what) + " here.\n");
  3491.             false
  3492.         else
  3493.             th := FindResult();
  3494.             AddTail(Me()@p_pCarrying, th);
  3495.             DelElement(Here()@p_rContents, th);
  3496.             Print(FormatName(what) + " picked up.\n");
  3497.             true
  3498.         fi
  3499.         fi
  3500.     corp;
  3501.     Verb1(G, "pick", FindWord(G, "up"), pickUp).
  3502.     Verb1(G, "take", 0, pickUp).
  3503.  
  3504.     Note that it is important to do the 'AddTail' before the
  3505.     'DelElement', so that if there are no other references to the
  3506.     objec,t it doesn't get deleted by the database code. Assume the
  3507.     player is in a room containing:
  3508.  
  3509.     small whisk broom
  3510.     straw broom
  3511.     pewter mug
  3512.     brass bell
  3513.     large red ball
  3514.  
  3515.     then, the following commands should produce:
  3516.  
  3517.     pick up the pewter mug
  3518.         -> pewter mug picked up.
  3519.     pick the basket up.
  3520.         -> There is no basket here.
  3521.     take
  3522.         -> Pick up what?
  3523.     Pick the broom up.
  3524.         -> broom is ambiguous.
  3525.     Take small broom, straw broom and the large red ball.
  3526.         -> small whisk broom picked up.
  3527.         -> straw broom picked up.
  3528.         -> large red ball picked up.
  3529.     Pick the brass bell and mug up.
  3530.         -> brass bell picked up.
  3531.         -> pewter mug picked up.
  3532.  
  3533. Verb2: parsing
  3534. proc utility Verb2(grammar theGrammar; string theVerb; int separatorCode;
  3535.     action theAction)void
  3536.  
  3537.     Verb2 adds to 'theGrammar' verb 'theVerb' as a verb which takes
  3538.     both a direct object and an indirect object. 'separatorCode' must
  3539.     be nonzero, and the word it is the code for (or a synonym) must be
  3540.     present in an input command that matches the verb. The separator
  3541.     word separates the direct object noun-phrase from the indirect
  3542.     object noun-phrase, as in "Put the marble INTO the bag.".
  3543.     'theAction' is an action which the parser will call to handle the
  3544.     verb. It will be passed two strings - the internal form of the
  3545.     direct object, and the internal form of the indirect object. The
  3546.     AmigaMUD parser will automatically handle input commands with
  3547.     multiple direct objects, separated by commas or "and"s and will
  3548.     call the action sequentially with them and the single indirect
  3549.     object. If no objects of either kind are given, the parser will
  3550.     complain with "<verb> who/what <separator> who/what?". If a direct
  3551.     object is given, but no indirect object, then the complaint will
  3552.     be of the form "<verb> <direct object> <separator> who/what?". If
  3553.     an indirect object but no direct object is given, then the parser
  3554.     will complain "<verb> who/what <separator> <indirect object>?".
  3555.     Thus, a Verb2 handler does not have to worry about handling empty
  3556.     strings. The handler returns a bool value, with 'false' indicating
  3557.     that something has gone wrong, and the parser should not call it
  3558.     for any further objects in this command, and any further commands
  3559.     in the current input line should also be cancelled. An example:
  3560.  
  3561.     private proc doPutIn(string itemRaw, containerRaw)bool:
  3562.     thing item, container;
  3563.     string itemName, containerName;
  3564.     status st;
  3565.  
  3566.     itemName := FormatName(itemRaw);
  3567.     containerName := FormatName(containerRaw);
  3568.     st := MatchName(Me()@p_pCarrying, itemRaw);
  3569.     if st = continue then
  3570.         Print(Capitalize(itemName) + " is ambiguous.\n");
  3571.         false
  3572.     elif st = fail then
  3573.         Print("You have no " + itemName + ".\n");
  3574.         false
  3575.     else
  3576.         item := FindResult();
  3577.         st := FindName(Me()@p_pCarrying, containerRaw);
  3578.         if st = continue then
  3579.         Print(Capitalize(containerName) + " is ambiguous.\n");
  3580.         false
  3581.         elif st = fail then
  3582.         Print("You have no " + containerName + ".\n");
  3583.         false
  3584.         else
  3585.         container := FindResult();
  3586.         if container@p_oContents = nil then
  3587.             Print("You can't put things into the " +
  3588.             containerName + ".\n");
  3589.             false
  3590.         else
  3591.             AddTail(container@p_oContents, item);
  3592.             DelElement(Me()@p_pCarrying, item);
  3593.             Print("You put the " + itemName + " into the " +
  3594.             containerName + ".\n");
  3595.             true
  3596.         fi
  3597.         fi
  3598.     fi
  3599.     corp;
  3600.     Verb2(G, "put", FindWord(G, "in"), doPutIn).
  3601.     Verb2(G, "put", FindWord(G, "into"), doPutIn).
  3602.     Synonym(G, "put", "place").
  3603.  
  3604.     Assume the player is carrying:
  3605.  
  3606.     small whisk broom
  3607.     straw broom
  3608.     pewter mug
  3609.     brass bell
  3610.     large red ball
  3611.     canvas sack
  3612.  
  3613.     then, the following commands should produce:
  3614.  
  3615.     put mug in sack
  3616.         -> You put the pewter mug into the canvas sack.
  3617.     Place the large red ball into the brass bell.
  3618.         -> You can't put things into the brass bell.
  3619.     put broom in sack
  3620.         -> Broom is ambiguous.
  3621.     place the bell into broom
  3622.         -> Broom is ambiguous.
  3623.     put bell, ball and whisk broom into sack
  3624.         -> You put the brass bell into the canvas sack.
  3625.         -> You put the large red ball into the canvas sack.
  3626.         -> You put the small whisk broom into the canvas sack.
  3627.  
  3628. VerbTail: parsing
  3629. proc utility VerbTail(grammar theGrammar; string theVerb;
  3630.     action theAction)void
  3631.  
  3632.     VerbTail adds verb 'theVerb' to grammar 'theGrammar' as a verb
  3633.     which is simply given the rest of the command to interpret as it
  3634.     sees fit. 'theAction' must have no parameters and return a bool
  3635.     result, with 'false' meaning that any further commands in the
  3636.     current input line should be skipped. When 'theAction' is called,
  3637.     the rest of the command will be in the "tail buffer", where it can
  3638.     be accessed using 'GetWord' and 'GetTail'. VerbTail verbs are used
  3639.     to handle verb forms which do not fit into the Verb0, Verb1 or
  3640.     Verb2 formats. The standard scenario uses VerbTail forms for many
  3641.     of the building commands (and the build command itself), since
  3642.     their formats do not involve noun-phrases at all. An example:
  3643.  
  3644.     private proc doTell()bool:
  3645.         string name, word;
  3646.         thing who;
  3647.  
  3648.         name := GetWord();
  3649.         if name = "" then
  3650.         Print("Tell who to what?\n");
  3651.         false
  3652.         else
  3653.         who := FindAgent(name);
  3654.         if who = nil then
  3655.             Print("There is no-one here by that name.\n");
  3656.             false
  3657.         else
  3658.             word := GetWord();
  3659.             if word == "to" then
  3660.             Say(name + "," + GetTail());
  3661.             else
  3662.             Say(name + "," + word + " " + GetTail());
  3663.             fi;
  3664.             true
  3665.         fi
  3666.         fi
  3667.     corp;
  3668.     VerbTail(G, "tell", doTell).
  3669.     Synonym(G, "tell", "instruct").
  3670.  
  3671.     This makes the form "tell xxx [to] yyy" an alternate way to try to
  3672.     speak commands to others in the room. The following inputs could
  3673.     result in the given spoken output or complaints:
  3674.  
  3675.     tell SysAdmin to go away
  3676.         -> "SysAdmin, go away
  3677.     tell
  3678.         -> Tell who to what?
  3679.     tell Furklewitz to snybuld the whulsyp.
  3680.         -> There is no-one here by that name.
  3681.     Instruct SysAdmin go north.
  3682.         -> "SysAdmin, go north
  3683.  
  3684. VNarrate: effects
  3685. proc utility VNarrate(thing who; string phonemes; int id)void
  3686.  
  3687.     VNarrate instructs the specified client to use its narrator.device
  3688.     to speak the given phoneme sequence. If that client doesn't have
  3689.     the device, then nothing happens except a small error comment in
  3690.     the client's text window. This will only happen if the client has
  3691.     voice output enabled, however. 'id' is supplied as an identifier
  3692.     for this effect. When the effect completes, or is aborted, the
  3693.     system will call the character's "effects done" action, if any,
  3694.     passing it the values 1 and 'id'. See the Amiga manuals for a
  3695.     description of the format of a phoneme sequence. Phoneme sequences
  3696.     can be produced by using the 'VTranslate' builtin, provided the
  3697.     server is running on a system containing 'translator.library' in
  3698.     its LIBS: directory. For example:
  3699.  
  3700.     define tp_mall proc bankSay()status:
  3701.         if VOn(nil) then
  3702.         VParams(nil, 150, 120, 0, 0, 64);
  3703.         VNarrate(nil,
  3704.             "WEH5LKAHM KAH4STAHMER. DIH4PAAZIHT MAH4NIY TUWDEY1.",
  3705.             BANK_SPEECH_ID);
  3706.         VReset(nil);
  3707.         fi;
  3708.         continue
  3709.     corp;
  3710.  
  3711. VOn: effects
  3712. proc utility VOn(thing who)bool
  3713.  
  3714.     VOn returns 'true' if the specified client can accept voice
  3715.     output, and that feature has not been disabled by the user. Note
  3716.     that the presence of 'narrator.device' is NOT checked.
  3717.  
  3718. VParams: effects
  3719. proc utility VParams(thing who; int rate, pitch, mode, sex, volume)void
  3720.  
  3721.     VParams sets the parameters for voice output on the specified
  3722.     client. These parameters are only the old, pre 2.0 'narrator.
  3723.     device' parameters, and are:
  3724.  
  3725.     rate - the speed of the speech, default 150
  3726.     pitch - the pitch of the speech, default 110
  3727.     mode - the mode (natural = 0, robotic = 1), default natural
  3728.     sex - the speaker sex (male = 0, female = 1), default male
  3729.     volume - the volume of the speech, with 64 being full volume
  3730.  
  3731. VReset: effects
  3732. proc utility VReset(thing who)void
  3733.  
  3734.     VReset instructs the specified client to reset its voice
  3735.     parameters to the specified values. See 'VParams' for those
  3736.     values.
  3737.  
  3738. VSpeak: effects
  3739. proc utility VSpeak(thing who; string words; int id)void
  3740.  
  3741.     VSpeak instructs the specified client to speak the given English
  3742.     text. The text is translated to phonemes in the server, and will
  3743.     thus fail if the server does not have "LIBS:translator.library".
  3744.     The speaking is given effects identifier 'id', and the system will
  3745.     arrange to call the character's "effects done" action with
  3746.     parameters 1 and 'id' when it completes or is aborted. No speech
  3747.     will be produced if the client does not have "narrator.device"
  3748.     available. Example:
  3749.  
  3750.     VSpeak(CharacterThing(Character("SysAdmin")),
  3751.         "Hey wimp! Your mother wears army boots!", 0).
  3752.  
  3753. VTranslate: effects
  3754. proc utility VTranslate(string words)string
  3755.  
  3756.     VTranslate translates English text string 'words' into a phoneme
  3757.     sequence, which it returns. If the server does not have access to
  3758.     "LIBS:translator.library", then an empty string is returned.
  3759.     Output phoneme sequences are restricted to 999 characters.
  3760.  
  3761. VVolume: effects
  3762. proc utility VVolume(thing who; int volume)void
  3763.  
  3764.     VVolume sets the overall speech volume for the given client. A
  3765.     value of 10000 is full volume, 5000 is half volume, etc. This
  3766.     value is a long-term value, and is used to scale any individual
  3767.     volume set via 'VParams'.
  3768.  
  3769. Whisper: machine/character
  3770. proc utility Whisper(string what; thing who; int percent)bool
  3771.  
  3772.     Whisper is used to attempt to whisper to a specific other agent in
  3773.     the same room as the active one. 'what' is what is to be
  3774.     whispered, 'who' is who to whisper it to, and 'percent' is the
  3775.     likelihood that any other agent in the room will overhear the
  3776.     whisper (evaluated once for each other agent in the room). If
  3777.     'who' is a player, they will see: "<name> whispers: <what>", where
  3778.     <name> is the name of the active agent. If 'who' is a machine,
  3779.     then that machine's "whisperme action", if any, is called with a
  3780.     string of the same format. If 'percent' is greater than zero then
  3781.     each other character or machine in the same room may overhear the
  3782.     whisper ('percent' = 50 gives a 50 percent chance, etc.). Players
  3783.     will see a message of the form "<name> whispers to <who-name>:
  3784.     <what>". Machines will have their "whisperother action", if any,
  3785.     called with a string of that form. For example, if player "Fred"
  3786.     whispers to player "Joe" the string "help me kill sam", then Joe
  3787.     will see:
  3788.  
  3789.     Fred whispers: help me kill sam
  3790.  
  3791.     and any overhearer will see:
  3792.  
  3793.     Fred whispers to Joe: help me kill sam
  3794.  
  3795. WhoName: parsing
  3796. proc utility WhoName()string
  3797.  
  3798.     WhoName returns the internal form of the indirect object given by
  3799.     the user for a Verb2 verb. This can be used for special checks for
  3800.     particular adjectives, etc. See also 'ItName'.
  3801.  
  3802. WizardMode: utility
  3803. proc utility WizardMode()bool
  3804.  
  3805.     WizardMode attempts to put the active client into "wizard mode",
  3806.     where input lines go directly to the AmigaMUD programming language
  3807.     parser, rather than to the character's "input action". The attempt
  3808.     will fail (silently) if the active agent is a machine, or if the
  3809.     active client is not enabled for wizarding (has status normal), or
  3810.     if the client program in use is not capable of going into wizard
  3811.     mode. There currently aren't any such client programs, but it is
  3812.     easier to produce a client for a machine other than the Amiga if
  3813.     the wizard-mode stuff (programming language parsing, etc.) can be
  3814.     left out.
  3815.  
  3816. Word: parsing
  3817. proc utility Word(grammar theGrammar; string theWord)int
  3818.  
  3819.     Word adds word 'theWord' to grammar 'theGrammar'. The word is not
  3820.     a verb, but is available for use as a "separator word" with a
  3821.     verb, or for whatever other use is needed. The identifying code
  3822.     for the word is returned. If the word cannot be added to the
  3823.     grammar, then 0 is returned.
  3824.  
  3825. WriteFile:
  3826. proc utility WriteFile(int fileId; string theString)void
  3827.  
  3828.     WriteFile writes string 'theString' to the open file identified by
  3829.     'fileId'. No modifications are made to the string - it is written
  3830.     exactly as it is given. A runtime error results if 'fileId' is not
  3831.     currently valid, or was not opened for writing. Only SysAdmin, or
  3832.     code owned by SysAdmin, can use WriteFile.
  3833.