Core Utility Help #14
Aliases: Core Utility Help
3 verbs · 50 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
find_topics | this none this | rxd | #14 | 19 |
get_topic | this none this | rxd | #14 | 6 |
dump_topic | this none this | rxd | #14 | 6 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
$login | #14 | rc | #29 | list of 77{"$login", "------", "This object manages command parsing for unconnected players and governs the initiation of an actual connection. There are verbs pertaining to registration, controlling player creation, and doing site-locks (see `help blacklist' on $wiz_help).", "", "COMMANDS FOR UNCONNECTED PLAYERS", "", "Recall that for each line that an unconnected player types, the server parses that line into words (the same way normal commands are parsed into a list of words that is then assigned to `args') and then #0:do_login_command is called.", "", " :parse_command (@args) => {verb, @args}", " given the sequence of arguments that were fed to #0:do_login_command", " this returns the name of a verb on $login to be called together with a ", " list of arguments to be passed to it.", "", "By default this just returns args iff args[1] names an actual verb on $login that is +x and has args {\"any\",\"none\",\"any\"}. Otherwise, it returns one of", "", " .blank_command -- verb to call if command line is empty", " .bogus_command -- verb to call if command line otherwise unintelligible", "", "In both cases :parse_command returns a verbname followed by the entire args list passed to it (including the would-be verb at the beginning if any).", "", "Currently the following verbs are available to non-connected players", "", " h*elp @h*elp -- print .welcome_message", " ? -- print a short list of available commands", " w*ho @w*ho -- print a list of logged in players (excluding wizards)", " co*nnect @co*nnect -- connect to an existing player", " cr*eate @cr*eate -- create a new player", " up*time @up*time -- tell how long the server has been running", " version @version -- tell which version of the server is running", " q*uit @q*uit -- logoff", "", "Adding a new command is fairly straightforward; just create a verb on $login, making sure a previous verb doesn't already match the name you want to give it. Then give it args of \"any\" \"none \"any\" and make sure it is +x. Such a verb should begin with `if (caller != #0) return E_PERM; ...' so as to prevent anyone other from a not-logged-in player from making use of it.", "", "CUSTOMIZATIONS", "", " .welcome_message ", " -- the message for \"help\" to print.", " .create_enabled ", " == 0 => @create prints .registration_string if one tries to use it", " == 1 => anyone from a non-blacklisted site (see `help blacklist')", " may use @create to make a new player", "", " .registration_address", " -- an email address for character creation requests", " .registration_string ", " -- string to print to players to give them information about how to get ", " a character created for them, .registration_address is substituted ", " for %e, % for %%", " .newt_registration_string", " -- string to print to @newted players (see `help @newt').", " same substitutions as for .registration_string.", "", " .max_connections", " -- integer representing the maximum connected players permitted on this moo.", " .connection_limit_msg", " -- string printed out when this is reached.", " .lag_exemptions", " -- list of non-wizard players who may login anyway.", "", "Other verbs", " :registration_string() => .registration_string with substitutions", " :newt_registration_string() => .newt_registration_string with substitutions", " :player_creation_enabled(connection) ", " decides whether someone on connection should be allowed to create ", " a player. If you decide this shouldn't depend strictly on the blacklist", " and on the value of .create_enabled, here's where the extra code can go.", " :check_for_shutdown()", " prints a warning message to append to the login banner in the event ", " that the server will be going down soon.", " :check_player_db()", " prints a warning message to append to the login banner in the event ", " that $player_db is being reloaded to warn players that their character", " names might not be recognized.", "", "SITE LOCKS", "see `help blacklist'", ""} |
$container | #14 | rc | #29 | list of 29{"The Generic Container (for programmers)", "", "In addition to the command verbs described under `help containers'", "and the _msg properties described in `help container-messages',", "the following verbs and properties are available for use within programs", "", ".opened == TRUE iff the container is open", ".dark == TRUE iff the contents of the container may be seen", ".opaque -- describes the correlation between .open and .dark", " == 0 container is always !dark", " == 1 container is dark iff it is closed", " == 2 container is always dark ", "", ":set_opaque(newvalue) ", " changes the .opaque value for the container", " => newvalue or E_PERM or E_INVARG", "", ":set_opened(newvalue) ", " opens/closes the container (updates .open and .dark) according to newvalue", " => newvalue or E_PERM", "", ":is_openable_by(player) ", " what the :open command uses to test whether the player should be able to open", " the container. By default this refers to .open_key (set by", " @(un)lock_for_open), but the object owner is free to customize this.", "", "N.B.: There is no way to directly set .dark; .dark can be changed only by ", "changing one of .opaque or .opened. Use :set_opaque(0) and :set_opaque(2)", "to have .dark change independently of the value of .opened."} |
$mail_agent | #14 | rc | #29 | list of 68{"$mail_agent", "", "This object contains a two distinct sets of routines:", "", " 1. utilities for performing basic mailsystem functions, e.g.,", " matching on recipient names, resolving mail forwarding, ", " formatting messages, sending messages", "", "Recipient Matching", "", "match - match on a $mail_recipient", "match_recipient - match on either a $mail_recipient or a player", "match_failed - print angry messages to the user for $failed/ambiguous_match", "", "look_self - provides a list of available $mail_recipients", "check_names", "touch", "accept", "", "Message Format", "", "make_message - produces a message in the canonical transmission format", "name - single recipient => string for address field", "name_list - list of recipients => string for address field", "parse_address_field - address field string => object list", "", "Sending Messages", "", "send_message - advertised message sending routine.", "raw_send - raw message sending routine ", " (only called by $mail_editor:send and this:send_message)", "resolve_addr - converts a given list recipients into a list of actual ", " recipients and objects to be notified.", "sends_to - Does X forward (transitively) to Y", "", "Mail Options", "", "option ", "option_verbose", "", " 2. canonical versions of mail_recipient verbs", "", "Ideally, the verbs to perform operations on a given mail recipient would be located on the recipient itself, except for the fact that these verbs also need to be located on players, which for various reasons, shouldn't be children of $mail_recipient. Multiple inheritance would solve our problems, but we don't have it yet. Ergo, both $mail_recipient and $player refer to the following verbs here:", "", "display_seq_full print entire text of messages (@read)", "display_seq_headers print headers of messages (@mail)", "rm_message_seq remove messages (@rmm)", "undo_rmm undo last rm_message_seq (@unrmm)", "expunge_rmm flush removed messages (@unrmm expunge)", "list_rmm list removed messages (@unrmm list)", "renumber renumber messages (@renumber)", "msg_summary_line msg header => display_seq_headers/list_rmm summary line", "", "parse_message_seq command line msg sequence spec => message sequence", "new_message_num => message number of next new message", "length_all_msgs => number of messages (total)", "length_num_le => number of messages numbered <= some number", "length_date_le => number of messages dated <= some date", "exists_num_eq => true iff there exists a messsage with the given number", "from_msg_seq => message sequence of msgs from given sender(s)", "to_msg_seq => message sequence of msgs to given recipient(s)", "subject_msg_seq => message sequence of msgs with subjects containing text", "body_msg_seq => message sequence of msgs with bodies containing text", "messages_in_seq => list of {message number, message} pairs", "", "messages == :messages_in_seq(1,:length_all_msgs()+1) (obsolete)", "", "The $mail_agent versions of these verbs are set_task_perms(caller_perms()) and perform their operations on caller, which in turn is assumed to have done any necessary security checks."} |
MR-subscribing | #14 | rc | #29 | list of 38{"Subscribing to Mail Recipients", "------------------------------", "There are two notions of being \"subscribed\" to a mailing list/recipient.", "", "(1) Hard subscribed == being on the recipient's .mail_forward list so that mail sent to this list is forwarded to one's own .messages as well (see `help mail-forwarding').", "", "(2) Soft subscribed == keeping track of a current message for this recipient and (optionally) being on the recipient's .mail_notify list.", "", "", "Each player has a .current_message property that contains, for each recipient the player cares to keep track of, a current message number and a last read date.", "", "player:current_message(rcpt) (somewhat obsolete)", " => player's current message number for rcpt ", "", "player:get_current_message(rcpt) ", " => player's {current message number for rcpt, last-read-date for rcpt}", "", "player:make_current_message(rcpt)", " => adds a current_message entry for rcpt (NOOP if rcpt == player)", "", "player:set_current_message(rcpt,n|E_NONE,[,date])", " => sets player's current message number for rcpt to n iff n!=E_NONE", " updates the last-read-date for rcpt to date iff date > last-read-date", "", "player:kill_current_message(rcpt)", " => removes current-message info for rcpt (NOOP if rcpt == player)", "", "", "On $mail_recipient, .mail_forward and .mail_notify are -c so one needs to use the following verbs to actually modify them.", "", " :add_forward(@new_recipients)", " :delete_forward(@recpients)", " :add_notify(@new_notifiees)", " :delete_notify(@notifiees)", "", "A recipient's owner is, of course, allowed to make arbitrary changes to .mail_forward and .mail_notify. However, the default versions of these verbs also allow any player to add him/herself to a recipient's .mail_forward or .mail_notify if the recipient is readable (see `help MR-access') by him/her.", "", "Likewise any player may use the :delete* verbs to delete him/herself from any .mail_forward/.mail_notify list, regardless of his actual access to the list."} |
MR-naming | #14 | rc | #29 | list of 15{"One may always refer to a list by its object number. In order to refer to it by name, it must be contained in $mail_agent, which holds all mailing lists, i.e., those that you want others to be able to refer to by name.", "", "The .aliases field holds the names by which one may refer to the list, but only those names not containing spaces actually count for anything. As with certain other types of objects (e.g., players), set_aliases() needs to be called in order to change the .aliases field.", "", "$mail_agent:match(name) ", " is the canonical way to obtain the objectid of a mailing list ", " given the name (\"*\" is assumed; an initial \"*\" will be dropped).", "", "$mail_agent:match_recipient(name) ", " is the canonical way to obtain the objectid of a list or player", " matching the given name. An initial \"*\" indicates that this is ", " supposed to be a list.", "", "$mail_agent:match_failed(objid,name) ", " is the mail_recipient counterpart to $command_utils:object_match_failed"} |
MR-access | #14 | rc | #29 | list of 32{"Controlling Access to Mail Recipients", "-------------------------------------", ":is_writable_by(one) - one may alter/add/remove saved messages", ":is_readable_by(one) - one may read messages.", ":is_usable_by(one) - one may send to this list", "", "By default, these verbs refer to the following properties:", "", "writers - list of players other from the owner who can do anything", "readers - if == 1, indicates a public mailing list.", " list of additional readers (by default anyone who receives mail ", " sent to the list can read the saved messages).", "moderated - if false, indicates a normal mail recipient everyone can send to.", " otherwise this should be a list of approved senders.", "", "Terminology:", " A mailing list is \"public\" if everyone can read it.", " A mailing list is \"moderated\" if not everyone can send to it.", "", "Note that while being able to write to a recipient implies being able to read from it or send to it, neither of read-ability or send-ability implies the other.", "", "It is highly recommended that if you are creating custom mail recipients with variable reader/sender lists, i.e., you find you need to write your own :is_readable/usable/writabe_by verbs, you are best off if such verbs are of the form", "", " return pass(@args) || << your_test(args[1]) >>", "", "and have .writers == .readers == {} and .moderated == 1. This will ensure", " (1) wizards having write access", " --- necessary in order for :receive_message to work", " (2) writers being able to read and send (the converse being a ludicrous ", " situation), ", " (3) persons on the mail_forward list of someone with reader access will also", " have read access (convenient)."} |
$mail_recipient | #14 | rc | #29 | list of 20{"Generic Mail Recipient", "----------------------", "A \"mail recipient\" is, by definition, an object that can be sent mail.", "Mail recipients must either be players or descendants of $mail_recipient.", "", "One source of confusion is that the terms \"mail recipient\", \"mail folder\", \"mailing list\", and \"mail collection\" really all refer to the same kind of object. It so happens that $mail_recipient serve several distinct functions and we tend to use whatever term happens to best match the application under discussion, e.g., it's a \"mailing list\" if we're playing with its .mail_forward property but it's also a \"mail folder\" if we're examining the messages that have been saved in it.", "", "Note that, by default, a freshly created recipient is accessibly only by you. If you wish to make a publically accessible recipient, set .readers=1. Furthermore, if you want to allow a message on your recipient to be removed by its sender without your intervention, set .rmm_own_msgs=1. Finally, in order for other players to be able to refer to your recipient by name, the object must reside in $mail_agent. $mail_agent will not accept the object unless it has an actual description and a name distinct from all other mail recipient names/aliases.", "", "Topics:", "", " MR-access -- controlling read, write and send access to a recipient", " MR-naming -- naming conventions and how to match on recipient names", " MR-sequences -- message sequence arguments to $mail_recipient verbs", " MR-reading -- reading messages/headers on recipients", " MR-searching -- searching message lists for patterns in certain fields", " MR-writing -- removing and renumbering messages", " MR-subscribing -- updating .mail_forward, .mail_notify ", " and the story of .current_message", " MR-expiration -- expiring and netmailing messages from recipients"} |
receiving-mail | #14 | rc | #29 | list of 24{"Receiving Mail", "--------------", "By definition a recipient \"receives\" a mail message when its :receive_message verb is called with that message as an argument.", "", ":new_message_num()", "=> number that will be assigned to the next incoming message.", "By default this returns the maximum of the message numbers appearing in ", "messages or .messages_going, incremented by 1. If the recipient is a player", "then the value returned will be 1 higher if it conflicts with the player's ", "current message number for him/herself.", "", ":receive_message(msg,sender)", "By default this first calls this:new_message_num to obtain a message number to assign to the incoming message and then appends {num,msg} to this.messages. ", "`sender', the original sender, is supplied in case one wants different ", "action depending on who is sending the message (e.g., mail-gagging).", "The return value should be an error or string if :receive_message is considered to have failed in some way. Otherwise, a number should be returned --- this number is given to any :notify_mail routines that are called and is expected to either be 0 or the number assigned to the incoming message.", "", "Note that :receive_message can do arbitrary things, including resending the same message to a new destination. Hacking :receive_message to resend messages is different from using .mail_forward in the following respects", " (1) the resent message is considered to be a distinct message having this ", " object as its \"author\" --- i.e., the From: line will necessarily be ", " different.", " (2) since this \"forwarding\" is invisible to the mailsystem, ", " there is no protection against loops and multiple copies.", ""} |
mail-format | #14 | rc | #29 | list of 34{"Mail Transmission Format", "------------------------", "There is a standard message format used for transmitting messages. This is the format that $mail_editor:make_message produces, and that :receive_message verbs on players and $mail_recipients expect to see. The (currently experimental) @refile and @copym commands also use this format to transfer messages.", "", "This *transmission* format is distinct from the *storage* format, though, for convenience this same format is often used as well for storing messages in player collections and ordinary $mail_recipient children though, in general, there is no requirement that this be the case.", "", "A transmitted message is a list in the following form", "", " date (number),", " the time() value at the time the message was sent.", " from (string),", " the sending object (address list form)", " if this is not a player, an additional header will indicate the ", " current ownership of the object.", " to (string),", " recipients (address list form) which can either be players ", " or $mail_recipient descendents.", " subject (string),", " subject of the message, or \" \" if there is no subject,", " @additional optional headers (list of strings),", " each header has the form \"<header-name>: text\" where <header-name>: ", " is padded out to a width of 10 columns for the convenience of ", " :display_message. Currently \"Reply-to: <address list>\" is the only ", " additional header in use,", " \"\",", " @body of message (list of strings)", "", "Note that the from, to and subject lines do *not* include a header name like \"From:\", \"To:\", or \"Subject:\". The @'s indicate that the lists in question get spliced in (as usual), thus the entire message is a list whose first element is a number and the rest are strings.", "", "The address lists that appear in the from and to lines is a string in the form a sequence of object ids, each enclosed in parentheses and preceded by optional text, e.g.,", "", " \"*Core-DB-Issues (#8175), Rog (#4292), and Haakon (#2)\"", "", "The text is intended to give the current name of each object for the benefit of human readers, but is actually ignored by all header parsing routines. The convention is that the text is either a player name or a * followed by a mailing list name."} |
mail-resolve | #14 | rc | #29 | list of 52{"Resolving Mail Forwarding & Notification", "----------------------------------------", "For each recipient of a given mail message, the following two verbs are called to determine where the message should actually go and who should be notified about it:", "", ":mail_forward([from])", " should return either", " . a list of objects (either players or $mail_recipients)", " to which mail for this recipient will be redirected.", " . a string error message to be printed to the player sending the message.", " If this recipient is one of the original destinations (i.e., not the", " result of a previous forwarding), no mail is actually sent.", "", " If :mail_forward returns a nonempty list, the recipient itself will *not*", " actually receive the mail message unless it is included in the list.", " #-1 is allowed to be on the list; it is ignored but does make the list ", " nonempty. Thus, having :mail_forward() return {#-1} is the canonical way", " to have arriving mail disappear without being kept or forwarded.", "", ":mail_notify([from]) ", " should return a list of objects that are to be told about any mail sent ", " to this recipient (whether or not the recipient actually receives it).", " Said objects must have a :notify_mail verb, but other from that, there ", " is no restriction on what these can be.", "", " object:notify_mail is called with the arguments ", " (sender,recipients,msgnumbers) where ", " recipients == list of recipients including object in .mail_notify", " msgsnumbers == corresponding list of :receive_message return values", " (or 0 if :receive_message is not actually called, which", " will be the case if the recipient forwards without keeping)", "", "When called as part of a mail send, the `from' argument is the immediate predecessor on the forwarding chain. The default versions of these verbs return the values of .mail_forward and .mail_notify respectively (pronoun_subbing if the value is a string), unless this is a moderated mailing list and `from' is an unapproved sender (see `help MR-access') in which case the following verbs are called instead:", "", ":moderator_forward(from) ", " what :mail_forward should return for mail coming from unapproved senders", " This returns .moderator_forward (pronoun_subbed if a string) by default.", "", ":moderator_notify(from)", " what :mail_notify should return for mail coming from unapproved senders", " This returns .moderator_notify (pronoun_subbed if a string) by default.", "", "Since the :mail_forward verbs only see the previous sender in the forwarding chain, if, e.g, B is moderated but A can send to B (i.e., B:mail_forward(A) returns an actual list), then any mail sent to A goes to B even if the original sender isn't normally allowed to send to B directly.", "", "These verbs should all allow `from' to be omitted in which case they should return as if `from' were a generic approved sender (e.g., wizard).", "", "It should rarely be necessary to actually modify any of :*_forward/*_notify verbs, since one has a fair amount of control over their behavior via the following properties", "", " .mail_forward", " .mail_notify", " .moderated (see `help MR-access')", " .moderator_forward", " .moderator_notify"} |
sending-mail | #14 | rc | #29 | list of 24{"Sending Mail", "------------", "$mail_agent:send_message(from,recipients,headers,body)", " from: sender of the message ", " (this must be you or something you own; otherwise => E_PERM)", " recipients: object or list of objects (must all be players or ", " $mail_recipient descendants)", " headers: either a string (contents of the Subject: line) ", " or a list {subject,replytos} replytos is a list ", " of objects designated to receive replies.", " Use {\"\",replytos} to have a Reply-to: without a Subject:", "", "This is the canonical way to send a mail message from a program.", "This calls $mail_agent:make_message to format the arguments into an actual message (see `help mail-format') and then $mail_agent:raw_send to do the actual sending which goes as follows:", "", " (1) Call :mail_forward on all recipients add any new recipients thus obtained to final recipient list, keep calling mail:forward on the new recipients until we obtain no additional recipients. If one of the initial recipients is invalid, is not a player or $mail_recipient, or has its mail_forward return a string error, then we print the error message and abort at this point with no mail being sent. If one of the later recipients bombs similarly, error messages are printed, but in this case mail still goes out to the other recipients.", "", " (2) Call :mail_notify on all recipients encountered in stage (1) to get a list of objects to notify.", "", " (3) All final recipients receive the message (see `help receive-mail')", " (4) All notifications are delivered (using :notify_mail())", "", "We return {0, @failed_recipients} if we bombed out at step 1.", "Otherwise return {1, @actual_rcpts} indicating what mail was sent."} |
mail-system | #14 | rc | #29 | list of 13{"Mail System", "-----------", "The following topics describe the guts of the LambdaCore mail system", "", "sending-mail -- how to send mail from a program; what happens.", "mail-forwarding -- how to do mail forwarding/notification (the simple version)", "mail-resolve -- how mail forwarding/notification works, in gory detail", "receiving-mail -- what :receive_message should do", "mail-format -- format of transmitted messages", "mail-command-parsing (TODO) -- routines for parsing mail commands", "", "$mail_recipient -- generic non-player mail recipient", "$mail_agent -- mail utility object"} |
$player_db | #14 | rc | #29 | list of 34{"", "Database of Players", "-------------------", "This is an instance of the Generic Database ($generic_db) that", "holds the {name/alias,#objectid} pairs for every ", "name and alias of every player in the MOO.", "", "Verbs supplied include", "", " :find(string) => player or $ambiguous_match or $failed_match", " :find_exact(string) => player or $failed_match (does not do partial matches)", " :find_all(string) => list of all matching players", "", " :insert(string,player) ", " records that string is now a name or alias of player", " :delete(string) ", " removes string from the db", " :available(string)", " returns 1 if string is available as a player name or alias,", " an object if string is in use, or 0 if string is otherwise unavailable.", " :load()", " resets the db, inserting all current player names and aliases.", "", "The internal representation and all of the above verbs (except :load() and", ":available()) are as described for $generic_db.", "", "It should be noted that for any application that involves resolving a player name from a command line, you should be using $string_utils:match_player() rather than $player_db:find(), since the former will deal correctly with other ways of referring to players apart from their names and aliases (e.g., literal object numbers, \"me\", \"$no_one\"...).", "", ":load() needs to be done periodically as it is possible for the player db ", "to get out of synch with reality. In particular, there is currently no way", "to block someone writing his own player :recycle() verb that neglects to ", "remove his names from the player db.", "", "While a :load() is in progress the .frozen property is set to 1 to indicate that any results of :find*() are not to be trusted."} |
core-index | #14 | rc | #29 | {"*index*", "Core Utility Help Topics"} |
object-matching | #14 | rc | #29 | list of 64{"", "Which :match...() Verb Do I Call?", "---------------------------------", "There are many situations where one wishes to obtain an object from a room or a player's .contents whose name/aliases matches a particular string. There are four main verbs available for this and it is important to understand the distinctions between them and how they are supposed to be used.", "", "(*) LOC:match(\"X\")", " -- what you get looking for something that is inside LOC and named \"X\".", " By default, this looks through LOC.contents to find a unique object ", " having a name or alias that has \"X\" as a prefix.", "", "Essentially, you can think of :match as a contents-matching verb, though, e.g., for rooms you also get matches on exits as well.", "", "(*) LOC:match_object(\"X\", YOU) [YOU defaults to player]", "(*) YOU:my_match_object(\"X\", LOC) [LOC defaults to player.location]", " -- what YOU get being located at LOC and looking for something named \"X\".", " By default these both return $string_utils:match_object(\"X\",LOC,YOU)", "", "(*) $string_utils:match_object(\"X\", LOC, YOU) ", " -- what you *would* get *if* YOU were a typical player, YOU were inside LOC,", " YOU were looking for something named \"X\", *and* LOC were a typical place.", "", "In other words, $string_utils:match_object describes the :match_object() algorithm for \"typical places\" and the :my_match_object for \"typical players\":", "", " (1) check for \"X\" being one of \"\", \"me\", \"here\", \"$something\", or \"#n\"", " (2) try YOU:match(\"X\") i.e., something in your inventory (maybe)", " (3) try LOC:match(\"X\") i.e., some object in the room (maybe)", "", "The distinction between these location:match_object and player:my_match_object has to do with whether the player or the location should determine what the matching algorithm is. Which one you should use depends on the command that you are writing. If you are writing a command with a virtual-reality flavor, then you should be respecting the room owner's idea of which objects you can \"see\" and thus the command should be calling the location's :match_object verb. If you are writing a building/programming command where it is appropriate for the player to determine the matching algorithm --- whether because the current location is irrelevant, not to be trusted, or both --- then the player's :my_match_object verb should be called.", "", "Examples:", "", " `look diamond in box'", " calls box:match(\"diamond\"). This is a match on the contents of box.", "", " `take ball', ", " calls player.location:match_object(\"ball\")", " to determine which \"ball\" to take. Note that if the room is dark, ", " we might not be able to find any \"ball\".", "", " `@program widget:foo', ", " calls player:my_match_object(\"widget\") to get the player's own idea", " of what \"widget\" should be. Note that if I were carrying something ", " named \"widget\" and expecting to be programming a :foo() verb on it,", " it would be potentially disastrous should the room where I am decide", " for me to be programming something else (not even necessarily ", " called \"widget\").", "", "Object Matching Failures", "------------------------", "As with other matching routines, one gets back ", "", " $failed_match in the case of no matching object", " $ambiguous_match in the case of more than one matching object", " $nothing in the case of a blank string argument", "", "or an object-id. In these first 3 cases, one usually wants to translate these nonresults to the player; this is what $command_utils:object_match_failed. The standard idiom to mimic what the builtin parser does, say, with the direct object is", "", " dobj = foo:match_???(dobjstr);", " if($command_utils:object_match_failed(dobj, dobjstr))", " \"...give up. nothing to do. error message has already printed...\";", " else", " \"...dobj is something useful. Continue...\";", " ...", " endif"} |
$no_one | #14 | rc | #29 | list of 25{"$no_one", "-------", "... is a powerless player. He owns no objects, not even himself; nor does he own any verbs. He is, however, a programmer and thus may use eval(). In fact his sole purpose is to evaluate questionable code. `questionable' could be in either or both of the following senses ", "", "(1) Its origin is sufficiently uncertain so that there is no obvious way of deciding whose permissions it should run under.", "(2) The code itself is potentially malicious, i.e., to the extent that one does not want to be evaluating it using one's own permissions.", "", "set_task_perms($no_one); is thus the canonical idiom in wizard code for rendering anything that follows mostly harmless. For use by ordinary programmers, we have:", "", " $no_one:eval(string)", "", "which attempts to evaluate an arbitrary string using $no_one's permissions.", "string is either an expression or \";\" followed by one or more statements, of which the final semicolon may be omitted. return values are what eval() would return (either {1,value} or {0,@error_messages}).", "", "Similarly, we have", "", " $no_one:eval_d(string)", "", "which attempts to evaluate the specified string, but does it without the debug flag turned on (so that, for example, you'll get an error as opposed to terminating by traceback).", "", "And, as a helpful utility for calling verbs whose behavior may be unpredictable, there is", "", " $no_one:call_verb(object, verb name, args)", "", "which calls the specified verb with $no_one's permissions."} |
$exit | #14 | rc | #29 | list of 19{"Exits", "-----", "An exit can be renamed by either the owner of the exit or the owner of its source.", "", "The standard verbs that are called in exit movement are:", "", ":move(object) - moves the object via this exit", ":invoke() - equivalent to :move(player)", "", "When an exit is invoked on a particular object (via exit:move(object)), the following occurs.", "", "(1) The exit may be locked against the object, in which case we print the ", " nogo messages and quit.", "", "(2) (room=exit.dest):bless_for_entry(object) is called. Assuming that exit is recognized by room as being a legitimate entrance (i.e., is in room.entrances), this will enable room:accept(object) to return true.", "", "(3) object:moveto(room) is called and the various messages (see `help exit-messages') are :announced/:told. Note that this, in accordance with the way the builtin move() (and hence the default :moveto()) works, we get a call to room:accept(object) which checks for the room itself being locked against the object, and otherwise returns true if the blessing in the previous step worked. The move is performed, here:exitfunc(object) and room:enterfunc(object) are called. In particular, room:enterfunc clears the blessing bestowed in (2) now that it is no longer needed.", "", "In general, the move may fail, in which case we :announce the (o)nogo_msgs."} |
$room | #14 | rc | #29 | list of 81{"The Generic Room ($room)", "----------------", "", "(1) Announcements", "", ":announce (@text) => broadcasts to all except player", ":announce_all (@text) => broadcasts to all", ":announce_all_but (objects,@text) => broadcasts to all except those in objects", "", "say, emote", "", "", "(2) Command recovery", "", ":huh (verb,args) - server hook: last chance to make sense of verb", ":here_huh (verb,args) - room's last attempt to parse something", ":here_explain_syntax (this,verb,args) - attempts to explain usage of verb", "", "", "(3) Residency", "", "free_home - true => @sethome allows anyone to set his .home to be here", "residents - objects on this list may teleport in and/or set their homes here.", "", ":accept_for_abode(player) ", " => true iff player should be allowed to set .home to this room.", "", "@resident*s", "", "", "(4) Looking", "", "dark - true => contents are not visible", "ctype - 0..3 for four different styles of .contents lists", "", ":match (string) => exit or object in room's .contents", ":tell_contents (objects,ctype) - format objects according to ctype, tell player", "", "l*ook", "", "", "(5) Entrance and exit.", "", ":accept (object) - Called by move() and :moveto() before an object enters a room, if false is returned, movement is prevented. Protocol permits this verb to make noise (though this is discouraged) as this is the only place the room will learn the object's original location.", "", ":acceptable (object) - Called by verbs which wish to check whether movement will be possible. Protocol prohibits this verb from making noise and requires it to return the same value as :accept would for the same arguments.", "", ":is_unlocked_for (object) - interface with the @lock protocol. Returns true or false depending on the state of locks for the object with the room. Other things may prevent entrance even if this returns true. Protocol prohibits this verb from making noise. ", "", ":enterfunc (object) - called after entrance has succeeded. Noise is fine.", "", ":exitfunc (object) - called after an object has successfully left. Noisemaking is fine.", "", "(6) Topology and Movement via Exits", "", "See `help $exit' for an explanation of how the generic $exit works.", "", "free_entry - true => `teleporting' in is allowed", " false => only residents may teleport in", "exits - list of invokable exits leading from this room", "entrances - list of recognized exits leading to this room", "blessed_object - object currently entering via an exit", "blessed_task - task_id for entering object", "", ":match_exit (string) => exit whose name matches string", ":bless_for_entry (object) - set up room to accept object arriving from entrance", ":add_exit (exit)", ":add_entrance (exit)", ":remove_exit (exit)", ":remove_entrance (exit)", "", "e/east/w/west/s/south/n/north/ne/northeast/nw/northwest/se/southeast/sw/southwest/u/up/d/down, go, @add-exit, @add-entrance, @remove-exit, @remove-entrance, @exits, @entrances ", "", "", "(7) Ejection", "", "victim_ejection_msg/oejection_msg/ejection_msg", ":*_msg() messages", "", "@eject", ""} |
$help | #14 | rc | #29 | {"*forward*", "$generic_help"} |
$generic_db | #14 | rc | #29 | list of 79{"Generic Database", "----------------", "This holds a collection of {string key, datum} pairs, where datum can be anything. At most one datum may be associated with any given string. Data may be anything (lists, strings, numbers, objectids). If you like, you can think of this as an array indexed by strings.", "Verbs supplied include", "", " :find(string) => datum, $ambiguous_match or $failed_match", " :find_key(string) => full string key, $ambiguous_match or $failed_match", " :find_exact(string) => datum or $failed_match (no partial matches)", " :find_all(string) => list of all data corresponding to matching strings", " :find_all_keys(string) => list of all matching strings", "", " :insert(string,datum) ", " if the string is already present in the db, ", " changes the associated datum and returns {old_datum};", " otherwise enters a new {string,datum} pair and return 0.", " :delete(string)", " if there is a datum associated with string, ", " remove this association and return {datum}; otherwise return 0.", " :delete2(string,datum)", " if the given datum is associated with string, ", " removes that association and return {datum}, ", " if some other datum is associated with string, just return {other datum}", " otherwise return 0.", " :clearall([4|3])", " removes all associations from the database.", " optional argument changes the type of the database ", " (4 is normal, 3 is a kludge for when the data are simply boolean flags", " i.e., this is a set of strings rather than a string-indexed array;", " more on this below)", "", " count [entries|chars] in this", " provide some vague statistics about how big this thing is.", "", "N.B. As entries get made, properties belonging to $generic_db.owner will be created on the db object itself. These properties will be created having flags as specified by .node_perms, which by default is \"r\", but can be changed to \"\" should you want to ensure that randoms don't have access to the raw information.", "", "Implementation notes", " - - - - - - - - - -", "The representation is as a `trie', a tree in which each internal node corresponds to a prefix shared by two or more strings in the db.", "Each internal node is kept in a property named \" \"+<prefix>, where <prefix> is a prefix shared by all strings in the subtree under this node.", "The property value is a 4 element list", "", "this.(\" \"+<prefix>)[1] = <common>", " maximal continuation shared by all strings beginning with prefix", " i.e., all these names actually begin with <prefix>+<common>", "", "this.(\" \"+<prefix>)[2] = <continuations>", " string of all characters <c> that can follow <prefix>+<common> for which", " there is more than one string in the db beginning with <prefix>+<common>+<c>", "", "this.(\" \"+<prefix>)[3] = <exact_matches>", " list of all strings in this subtree for which ", " the character (or lack thereof) following the <prefix>+<common> substring ", " suffices to determine the string.", "", "this.(\" \"+<prefix>)[4] = <data>", " list of data corresponding to the strings in [3].", "", "Child nodes are this.(\" \"+<prefix>+<common>+<c>) ", " for all <c> in this.(\" \"+<prefix>)[2].", "The root node is this.(\" \").", "If, e.g., there are 2 or more strings in the db beginning with a, ", "there will be a node this.(\" a\"). ", "If all of these strings actually begin with \"ani\", then this.(\" a\")[1]==\"ni\".", "The db consisting of the 5 correspondences", "", " {\"animal\", #1}", " {\"anime\", #2}", " {\"anil\", #3}", " {\"anile\", #4}", " {\"banal\", #5}", "", "would be represented", "", "this.(\" \") =={\"\", \"a\", {\"banal\"}, {#5}}", "this.(\" a\") =={\"ni\",\"lm\", {}, {}}", "this.(\" anim\")=={\"\", \"\", {\"animal\",\"anime\"},{#1,#2}}", "this.(\" anil\")=={\"\", \"\", {\"anil\",\"anile\"}, {#3,#4}}", "", "In some cases one may merely wish to hold a collection of strings without trying to associate a particular datum with each string. One may then instead set up a db without the fourth field on each of the properties. In this case the datum is taken to be the found string itself and that is what gets returned by :find*() in the event of a successful search. :find and :find_key are then equivalent as are :find_all and :find_all_keys. To setup the db this way, do a :clearall(3). :clearall(4) reverts to the above described type of db with a separately kept datum. Note that you can't change the type without emptying the db. 3 and 4 are currently the only db types allowed."} |
$generic_editor | #14 | rc | #29 | list of 201{"The Generic Editor enables a player to edit a list of strings. While one might contrive to use it directly, it is rather intended as a parent for some actual editor. It supplies the following commands:", "", "say <text> w*hat ", "emote <text> abort ", "lis*t [<range>] [nonum] q*uit,done,pause ", "ins*ert [<ins>] [\"<text>] ", "n*ext,p*rev [n] [\"<text>] ", "del*ete [<range>] ", "f*ind /<str>[/[c][<range>]] ", "s*ubst /<str1>/<str2>[/[g][c][<range>]]", "m*ove,c*opy [<range>] to <ins> ", "join*l [<range>] ", "fill [<range>] [@<col>] ", "", "$editor_help.(cmdname) descrbes cmdname", "$editor_help.insert descrbes insertion points (<ins>)", "$editor_help.ranges descrbes range specifications (<range>)", "", "You'll notice that nowhere does it say how to load in a given list of strings or how and where one may save said list away when one is done editing. These commands are supplied by the child editor object. The generic editor contains only the code for editing lines, though it defines additional functions for use by the children:", "", " :loaded(player)", " returns the index (player in this.active) iff text has been loaded", " from somewhere, otherwise returns 0.", "", " Note that, by default, there is a difference between ", "", " having nothing loaded (:text(who)==0) and ", " having loaded something with no text (:text(who)=={}).", "", " If you don't care about this distinction in a particular case,", " just do (player in this.active) instead of this:loaded(player). ", " If you don't want your editor to make this distinction at all, do", "", " @stateprop texts={} for <youreditor>", "", " which changes the initial value of :text() to {} ", "", "In all functions below, 'who' is the index returned by :loaded(player) ", "", "BTW, be careful about using 'player' in non-user (i.e., +x this-none-this) verbs --- much better to have the user verb get the index with :loaded() and then pass that around. ", "", "Also be careful about suspend() and verbs that call suspend(). In particular, the player's index in the .active list can change during the suspend interval, so you must be sure to obtain the index (e.g., using :loaded()) again after the suspend() returns.", "", "For your non-user verbs, we have", "", " :ok(who)", " returns E_PERM if the caller is not an editor verb and E_RANGE", " if 'who' does not point to a valid session.", "", "which should take care of the more egregious security holes (but maybe not the less egregious ones). For getting and loading text, we have", "", " :text(who) ", " the current text string list or 0 if nothing loaded yet.", " :load(who,text)", " loads the given list of strings as the text to be edited.", " this also resets the 'changed' flag and pushes the insertion ", " point to the end.", "", "and various flags and properties (all of the set_* routines return E_PERM when not called from an editor verb, E_RANGE if who is out of bounds, E_INVARG if something is wrong with the 2nd arg, or the new value, which may not necessarily be the same as the 2nd arg (e.g., set_insertion(..,37) on a 5 line text buffer returns 6).", "", " :changed(who)", " has the text been altered since the last save/load?", " (the child editor gets to define what \"save\" means).", " :set_changed(who,value)", " Any child editor command that is considered to save the text should do a ", " :set_changed(who,0). ", " Note that if the changed flag is 0, the session will be flushed when ", " the player leaves the editor, so you may also want certain commands to", " do set_changed(who,1)...", "", " :origin(who)", " room where the player came from. ", " :set_origin(who,room)", " can be used to change the room the player will return to when finished", " editing. Since origin gets set even in cases where the player teleports", " into the editor you probably won't usually need to do this.", "", " :insertion(who)", " current insertion point.", " :set_insertion(who,linenumber)", " linenumber needs to be a positive integer and will get ", "", " :readable(who)", " whether the current editing session has been made globally readable.", " :set_readable(who,boolean)", " change the readability of the current editing session.", " This is used by the publish/perish verbs.", "", "We also provide", "", " :invoke(...)", " If the player has a previous unsaved (i.e., :changed()!=0)", " session, we return to it, moving the player to the editor. ", " If the player is already in the editor, this has no effect other", " than to print a few nasty messages. In any case a :changed()", " session must be aborted or set_changed(,0) before anything else ", " can be started", "", " Otherwise, we pass the arguments (which are assumed to be the", " result of some munging of the command line) to :parse_invoke(),", " move the player to the editor and load whatever parse_invoke()", " specified. The only interpretation the generic editor makes on", " the arguments is that if the boolean value of the first is true,", " this indicates that the player wanted to load something as", " opposed to resume a previous session. Usually a command calling", " :invoke will have a true (i.e., nonzero number, nonempty list or", " string) first arg iff the command line is nonempty, in which case ", " 'args' works fine for this purpose.", "", " If the command parses sucessfully (:parse_invoke() returns a list),", " we move the player to the editor if necessary and then call ", " :init_session() to set things up.", "", "The child editor is assumed to provide", "", " :parse_invoke(...)", " given :invoke()'s arguments, determines what the player wants to edit.", " It either returns 0 and reports syntax errors to player,", " or it returns some list that :init_session() will understand.", "", " :init_session(who,@spec)", " where spec is something that was returned by :parse_invoke().", " Loads the text and sets the stateprops (below) to indicate that ", " we are working on whatever it is we're suppose to be working on.", "", " :working_on(who) ", " returns a string X as in \"You are working on X.\"", " This is called by the 'w*hat' command, among other things.", "", "Child editors may have their own properties giving state information for the various editing sessions. The value of each such property will be a list giving a value for each player in the editor. For each such property, you should, once the editor object has been created, initialize the property to {} and do one of", "", " @stateprop <propname> for <editor>", " @stateprop <propname>=<default-value> for <editor>", " (0 is the default <default-value>)", "", "Henceforth, adding and deleting new editing sessions will amend the list held by the given property. The value of the property for a given session can be obtained via this.<propname>[player in this.active] and can be changed with a corresponding listset() call. The usual idiom for an editor command is", "", " if(!(who=this:loaded(player)))", " player:tell(nothing_loaded_msg());", " else", " ... various references to this.<propname>[who] ...", " endif", "", "To remove such a property from the list of such state properties:", "", " @rmstateprop <propname> from <editor>", "", "Note that you can only do this with properties defined on the child editor itself. ", "", "Sometimes you may wish to @stateprop a new property on an editor where active editing sessions exist. @stateprop will fail if the property in question does not hold a list of the correct length (== length(editor.active); one value for each editing session). You need to either give the @flush command to clear out all sessions and boot all players currently in the editor or somehow manually initialize the property to a list of appropriate values and pray that nobody enters/exits the editor between the property initialization and the @stateprop command --- this problem can be avoided by doing an eval() that does all of the initializations (beware of suspends()) and calls :set_stateprops directly.", "", "Incidentally, the @flush command may be used at any time to clean out the editor or to remove all sessions older than a given date.", "", "There are also numerous _msg properties that may be customized", "", " @depart announced at the origin when :invoke() is called. ", " @return announced at the origin the player is returned there.", " @nothing_loaded printed when user attempts editing ", " before anything has been loaded.", " @no_text response to 'list' when :text()=={}", " @no_change printed by 'what' when :changed()==0", " @change printed by 'what' when :changed()==1", " @no_littering printed upon leaving the editor with :changed()==1.", " @previous_session printed by :invoke() when player tries to start a ", " new session without aborting or saving the old one", "", "The general procedure for creating a child editor:", "", ". @create $generic_editor named <editor>", "", ". define additional <editor> verbs/properties", " At the very least you need 'edit' and 'save' commands.", " Usually you can get away with just having 'edit' call :invoke();", " Presumably, you'll need at least a command to load text from somewhere", " as well as a command to save it back out.", "", ". define a verb (somewhere) to invoke the editor ", " This could be just a one-liner that calls <editor>:invoke(args,verb).", " Either that or", " . you have to set up an exit somewhere whose destination is <editor>", " . you have to advertise the object number so that people can ", " teleport to it.", " ", ". @stateprop x for <editor>", "", ". if you want the 'abort' command to boot the player from the editor do", " <editor>.exit_on_abort = 1;", "", ". set <editor>.commands to be the list of additional commands defined", " by <editor>. ", " Each element of the list is itself a list of the form {name,args}.", " set <editor>.commands2 to be the list of commands that should appear", " in the `look' listing, and should be a list of strings appearing ", " as names in .commands on either <editor> or some editor ancestor.", " look at $verb_editor or $note_editor for an example.", "", ". If you want to have help text for new verbs you define, create a child of ", " $generic_help and add properties to this object for each of the topics ", " that you want to provide help text.", " Finally, set <editor>.help = {this object} so that the help system", " knows to consult this object."} |
$generic_help | #14 | rc | #29 | list of 87{"The Help System", "---------------", "When a player types help, the following list of objects is consulted for .help properties: the player itself, all ancestors of player up to and including $player, and, if the current location is a room, the current location together with all ancestors of the current location back to and including $room. Each help property should have as value either an object or a list of objects (otherwise we just ignore it). These objects are then strung together as a list of `help databases' to be searched in order for the requested topic.", "", "A help database (in the sense of anything that is usable by $player:help()) is any object having the following three verbs:", "", " :find_topics([string])", " where string is a supposed help topic, returns a list of strings,", " i.e., actual help topics that this db knows about, or some boolean ", " false value in the event that this db is clueless...", " If no arguments are given, this should return a list of all topics", " in the db", "", " :get_topic(string)", " given one of the strings returned by :find_topics this either", " returns a list of strings (text to be spewed to the player) or", " returns 1 to indicate that it has already taken care of printing", " information to the player.", "", " :dump_topic(string)", " like get_topic, but instead returns the raw text of a help topic", " as a (download/upload) script", "", "In short if :find_topic reports that a particular db knows about a given topic", "it returns the full topic name, so that :get_topic may be called on it later.", ":dump_topic is used by maintainers (see $wiz:@gethelp) to edit help topics.", "", "$generic_help and $help", "-----------------------", "The Generic Help Database, $generic_help, is the parent class of a particular kind of help database of which $help is an instance. On help databases of this type, every help topic has a corresponding property, interpreted as follows:", "", " this.(topic) = string ", " one-line help text.", "", " this.(topic) = {\"*<verb>*\",@args}", " call this:<verb>(args,dblist) to get text where dblist is the list of ", " help objects that would have been consulted had the topic not been found ", " on this object.", "", " this.(topic) = other list of strings ", " multi-line help text", "", "For the {\"*<verb>*\",...} form, the current verbs available are", "", " {\"*forward*\", topic, @rest} ", " - get help text for topic and then append the lines of `rest'. ", " rest may, in turn, begin with a \"*<verb>*\"...", "", " {\"*pass*\", topic, @rest} ", " - get help text for topic from the first help database after this one", " that actually has help text for topic, and then append lines of `rest'.", " As with \"*forward*\" rest may, in turn, begin with a \"*<verb>*\"...", "", " {\"*subst*\", @lines} ", " - All occurences of %[exp] in lines are replaced with the value of exp", " which is assumed to evaluate to a string. ", " All lines beginning with %;exp are replaced with the value of exp ", " which is assumed to evaluate to a list of strings.", " Evaluation is done using $no_one's permissions so exp in either case", " can only refer to public information.", "", " {\"*index*\", title}", " - returns a list of all topics in this database, arranged in columns.", " title is used as a heading for this index.", "", " In order for your help database to appear in the list presented", " by 'help index', your db object must be set to +r.", "", " {\"*objectdoc*\", object}", " - gets the documentation for the given object (i.e., object:help_msg())", " N.B. as with all other *verb* arguments, object must be a string.", "", " {\"*verbdoc*\", object, verbname}", " - gets the documentation for the named verb on the given object", " (i.e., any strings at the beginning of said verbcode)", "", "Individual help dbs are free to define additional verbs that may be used in this context. $help itself defines the following additional such verbs:", "", " {\"*index_list*\"}", " - returns a list of all index topics in all databases in the search list.", " An index topic is one whose actual text is {\"*index*\", something}.", " When creating a help db, you should be sure to make an index topic.", "", " {\"*full_index*\"}", " - prints indices for all help databases in the search list.", "", "It should be noted (once again) that help databases need not be children of $generic_help, so long as they have :find_topics/:get_topic/:dump_topic working as specified above."} |
$generic_options | #14 | rc | #29 | list of 62{"Generic Option Package", "----------------------", "It occasionally happens that one has a command or set of commands for which one wishes to provide several options/flags that a player can set to customize the command's behavior for him/herself. Making each option a separate property is a bit expensive, especially when the option in question is merely a boolean flag that gets set to false in most cases. This package provides an alternative, as well as providing a uniform set of commands for setting these flags/options and checking that the values given are of appropriate types.", "", "Instead of needing several properties, only one is required to store a list containing values for all of the options. An \"option package\" (pkg, below) is then an object of this class, which provides routines for manipulating such lists.", "", "The set of option names is divided into a set of \"real\" options, those whose names will actually appear in a given list, and \"extras\" which are either synonyms for or represent combinations of real options.", "", " pkg:add_name(name) adds name to .names (remove it from .extras if there)", " pkg:add_name(name,1) adds name to .extras (remove it from .names if there)", " => 1 - ok, 0 - already added, E_INVARG - illegal name, E_PERM", "", " pkg:remove_name(name) remove name from either .names or .extras", " => 1 - ok, 0 - not present, E_PERM", "", "For setting or retrieving values we have", "", " pkg:get(options,name) ", " => value (or 0 if name isn't a real option)", " pkg:set(options,name,value)", " => revised options (or string error message if something goes wrong)", "", "By default, a given option can only be a boolean flag, having one of the values 0 (absent from the list), or 1 (present in the list). :set translates 0/\"\"/{} to 0 and any other non-object value to 1.", "", "One may however designate a wider range of possible values for an option \"foo\" by either installing one of", "", " pkg.type_foo", " -- list of allowed types, ", " e.g., {NUM,STR} => must be a number or a string", " e.g., {OBJ,{OBJ}} => must be an object or a list of objects", " for anything fancier use:", "", " pkg:check_foo(value)", " => string error message or {value munged as desired}", "", "In general, the only restriction on option values is that 0 is the only false value; setting an option to \"\" or {} sets it to 0. Every option defaults to 0, and no matter what you install as .type_foo or :check_foo(), 0 will always be a legal value for option \"foo\".", "", "When presented with an option that is in .extras, :set will typecheck the value as described, however, then :actual(name, value) will be called to obtain a list of {name-of-real-option, value} pairs indicating which combination of real options should be set.", "", "Other verbs", " pkg:parse(args,...)", " parses the command line arguments of a @whatever_option command", " => {optionname, value} if the player wants to set an option", " => {optionname} if the player wants to view an option", " => string error message otherwise", "", " one may install pkg:parse_foo to parse arguments for option \"foo\" ", " !foo => {\"foo\",0} (:parse_foo not called)", " foo= => {\"foo\",0} (:parse_foo not called)", " -foo => {\"foo\",0} (:parse_foo not called)", " +foo => pkg:parse_foo(\"foo\",1)", " foo=word => pkg:parse_foo(\"foo\",\"word\")", " foo word1 word2 => pkg:parse_foo(\"foo\",{\"word1\",\"word2\"})", " foo is word1 word2 => pkg:parse_foo(\"foo\",{\"word1\",\"word2\"})", "", " pkg:show(options,name|list of names)", " => list of strings describing the current value of the named option(s).", " calls pkg:show_foo(options,list of names) or", " refers to pkg.show_foo", " to describe option \"foo\"", "", "(see sources for details... at some point I'll finish writing this... --Rog)"} |
MR-sequences | #14 | rc | #29 | list of 24{"Message Sequences", "-----------------", "A \"message sequence\" is a handle by which one may refer to a particular subset of a mail recipient's (player or $mail_recipient-descendant) saved messages. Routines like rcpt:display_seq_headers or rcpt:display_seq_full need to be supplied with message-sequence arguments to deterimine which headers or full-messages to display.", "", "Message sequences can in turn be obtained from routines like rcpt:parse_message_seq, which takes a command-line description of a message sequence on that particular recipient and returns the corresponding message sequence handle.", "", "The actual form of a message sequence (though you shouldn't actually need to make use of this) is that of a set of integers in the format used by $seq_utils (see `help $seq_utils'). It should however be noted that these integers are *not* themselves message numbers, but rather indices into the list of saved messages. For example, if a particular recipient holds 5 messages numbered 1,3,5,7,9. Then the message sequence handle representing messages 3,5,7 collectively, would be {2,5} which is $seq_utils-ese for the range 2..4, namely the second, third and fourth messages saved on that recipient.", "", "The following verbs are available for obtaining indices to use in message sequences", "", " :length_all_msgs() => total number of messages, or equivalently,", " => index of last message", " :length_num_le(n) => number of messages numbered <= n, or equivalently,", " => index of highest numbered message <= n", " :exists_num_eq(n) => 0 unless there exists a message numbered n in which", " case we return the index of that message.", " :length_date_le(date) => number of messages dated <= date, or equivalently,", " => index of most recent message dated <= date", "", " :length_date_gt(date) => number of messages dated > date", "", "Note that r:length_date_gt(date) == r:length_all_msgs()-r:length_date_le(date).", "The only reason :length_date_gt is provided as a separate routine is in order ", "to do quick checks for the existence of new mail (as @rn needs to do)."} |
MR-reading | #14 | rc | #29 | list of 24{"Read verbs", "----------", "The following verbs may be used to extract headers/messages from readable mail recipients/players;", "", ":display_seq_headers (message sequence, current message number, last_read_date)", " Does a @mail listing of the given message sequence. If current message", " number is given and the sequence includes it, we mark it with a `>'.", " Likewise if the sequence includes any new messages (i.e., dated after ", " last_read_date), these are also indicated as such.", "", "display_seq_full (message sequence, preamble)", " Does a @read listing of the given message sequence. Each message is preceded", " by preamble.", " => {new current message number, new last_read_date}", "", ":messages_in_seq (index)", " => {n, msg}", ":messages_in_seq (message sequence)", " => {{n_1,msg_1},{n_2,msg_2},...}", " where the n_i are message numbers and the msg_i are messages in transmission", " format (see `help mail-format')", "", ":list_rmm ()", " Does an `@unrmm list' listing of messages in .messages_going"} |
MR-writing | #14 | rc | #29 | list of 17{"Write verbs", "-----------", "The following verbs can be used to manipulate writable mail recipients/players:", "", ":rm_message_seq (message sequence)", " Does an @rmmail. Messages in message sequence are removed from this ", " recipient's saved .messages and written to .messages_going.", "", ":undo_rmm ()", " Does an @unrmm. Messages in .messages_going are copied back to .messages.", "", ":expunge_rmm ()", " Does an @unrmm expunge. Blows away .messages_going.", "", ":renumber ()", " Does a @renumber.", ""} |
MR-searching | #14 | rc | #29 | list of 25{"Search verbs", "------------", "The following verbs can be used on a readable mail-recipient/player to search for messages with fields matching a given pattern.", "", "from_msg_seq (objectid or list [,mask])", " => message sequence: messages from (one of) the given objectid(s)", "", "%from_msg_seq (string or list [,mask])", " => message sequence: messages with (one of) the given string(s)", " in the From: line", "", "to_msg_seq (objectid or list [,mask])", " => message sequence: messages to (one of) the given objectid(s)", "", "%to_msg_seq (string or list [,mask])", " => message sequence: messages with (one of) the given string(s)", " in the To: line", "", "subject_msg_seq (string [,mask])", " => message sequence: messages with given string occurring in Subject:", "", "body_msg_seq (string [,mask])", " => message sequence: messages with given string occurring in body of message", "", "In all cases `mask' is a message sequence which one may supply to limit the range of the search. One way of looking at it is that the message sequence to be returned is first intersected with mask."} |
$housekeeper | #14 | rc | #29 | list of 43{"The housekeeper is an object that can help keep other objects where they belong. New MOOs may want to add their own user interface for the housekeeper; here is some information that may be helpful.", "", "To indicate what objects should be cleaned:", "", " :add_cleanup(object[, requestor[, where]])", " Ask the housekeeper to clean 'object' for 'requestor' to 'where'.", " Requestor defaults to 'player'.", " Where defaults to object.location.", "", " :remove_cleanup(what[, requestor])", " Remove 'what' from the cleanup list at 'requestor's request.", " Will remove it only if 'requestor' made the original request and owns", " the object or the destination.", "", "To actually get the housekeeper to clean stuff up:", "", " :cleanup([insist])", " Clean up player's objects. Argument is 'up' or 'up!' for manually", " requested cleanups. 'up!' means to clean things even if it's against", " the housekeeper's better judgement.", "", " :replace(object[, insist])", " Clean up the indicated object. 'insist' is as in :cleanup.", "", " :continuous()", " Starts the housekeeper cleaning continuously, killing any previous", " continuous task. This should be called only when starting up a new MOO,", " or if something has gone wrong, as normally it will just keep going", " without any help.", "", " :litterbug()", " Clean up all the places in housekeeper.public_places by getting rid of", " all contents not in their .residents lists. This is called by", " :continuous, so it doesn't need to be called directly.", "", "To find out what's being cleaned to where for whom:", "", " :cleanup_list([whom])", " Show 'player' the personal cleanup list for 'whom', or the housekeeper's", " complete list if no argument is given.", "", " :clean_status()", " Show 'player' a brief summary of eir personal cleanup list."} |
$recycler | #14 | r | #361 | list of 28{"$recycler", "=========", "", "Rather than having the server built-in recycle() and create() functions handle the creation and destruction of objects, a recycling center has been created to simulate these actions by changing objects that would have been recycled into children of $garbage (The Generic Garbage Object) and making them owned by Hacker, and then when they're needed again, to avoid a raw create() command, those objects are given to whoever's asking for them.", "", "Most Useful Verbs", "-----------------", "", "$recycler:_recycle( object )", " This will effectively recycle an object. (As a point of fact, it changes ownership of the object to Hacker and makes the object a child of $garbage.) It handles .ownership_quota and .owned_objects properly. Generally, use this instead of a recycle() in your verbs.", "", "$recycler:_create( parent object [ , new owner object ] )", " This effectively creates an object (with the specified parent, if possible, and with the specified owner, if possible; these are the same restrictions as on the server create() builtin). This is what should generally be used instead of create() in your programming.", "", "$recycler:valid ( object )", " This is a variant of the server built-in valid() except that it handles the $garbage objects as well. It returns a 1 if the object specified -is- valid and is -not- a $garbage object.", "", "Other Notes", "-----------", "", "request <object> from <recycler>", " This is not an internal verb (it's !x). It is, however, a command-line verb that can be used to request a specific object from the recycler. It's also useful for the creation of objects like a Magic Number Repository. When the object is removed from the recycler, the .announce_removal_msg is announced to the room if it's set (it's piped through $string_utils for pronoun substitution).", "", "show-history <recycler>", " This is a wizardly verb which allows wizards to check the `history list' of the recycler. The history maintains the latest ($recycler.nhist) entries.", "", "$recycler.orphans", " This maintains a list of objects for which the recreation process got mangled. It ought to be checked every once in a while to see what's up."} |
$error | #14 | r | #361 | list of 10{"$error", "======", "", "The Error Generator, $error, may be used to automatically generate errors. This is particularly useful if you are working in a !d verb but have occasion to -want- to crash with traceback. To raise a specific error, use $error:raise(error type) -- for example, $error:raise(E_PERM) will produce traceback resulting from a Permission Denied error.", "", "Random notes about $error:", "", "+ The complete list of errors is stored in $error.names.", "+ The seemingly useless :accept() verb on $error is so that $error:E_RECMOVE and $error:E_NACC will be guaranteed success (success meaning, of course, a termination by traceback).", "+ There is, unfortunately, no way to raise the error E_NONE."} |
$biglist | #14 | r | #29 | list of 72{"Generic BigList Utilities", "----------------------------", "$biglist is a collection of routines for maintaining huge persistent (sorted) lists in a format that is less likely to spam the server (which runs into a certain amount of trouble dealing with long ordinary lists --- btw we use `biglist' to refer to the huge data structure we're about to describe and `list' to refer to ordinary MOO lists {...}). The biglist in question lives on a particular object, to which we will refer in the discussion below as the `home' object, and its various elements appear as leaves of a tree whose nodes are kept in properties of the home object. It should be noted that the home object does not need to be (and in fact should *not* be) a descendant of $biglist one; $biglist merely provides utilities for manipulating the properties on the home object that are used in a particular biglist manipulation. ", "", "All of the utilities below refer to `caller' to locate the home object. Thus verbs to manipulate a given biglist must be located on or inherited by its home object itself. The home object needs to define the following verbs", "", " :_make(@args) => new property on home object with value args", " :_kill(prop) delete a given property that was created by :_make", " :_get(prop) => home.prop", " :_put(prop,@args) set home.prop = args", " :_ord(element) given something that is of the form of a biglist element", " return the corresponding ordinal (for sorting purposes).", " If you never intend to use :find_ord, then this can be a ", " routine that always returns 0 or some other random value.", "", "See $generic_biglist_home or $big_mail_recipient for examples.", "", "Those of the following routines that take a biglist argument are expecting", "either {} (empty biglist) or some biglist returned by one of the other routines", "", " :length(biglist) => length(biglist) (i.e., number of elements)", " :find_nth(biglist,n) => biglist[n]", " :find_ord(biglist,k,comp) => n where n is", " the largest such that home:(comp)(k,home:_ord(biglist[n])) is false, or", " the smallest such that home:(comp)(k,home:_ord(biglist[n+1])) is true.", " Always returns a value between 0 and length(biglist) inclusive.", " This assumes biglist to be sorted in order of increasing :_ord values ", " with respect to home:(comp)().", " Standard situation is :_ord returns a number and comp is a < verb.", "", " :start(biglist,s,e) => {biglist[s..?],@handle} or {}", " :next(@handle) => {biglist[?+1..??],@newhandle} or {}", " These two are used for iterating over a range of elements of a biglist", " The canonical incantation for doing", " for elt in (biglist[first..last])", " ...", " endfor", " is", " handle = :start(biglist,first,last);", " while(handle)", " for elt in (handle[1])", " ...", " endfor", " handle = :next(@listdelete(handle,1));", " endwhile", "", "The following all destructively modify their biglist argument(s) L (and M).", "", " :set_nth(L,n,value) => L[n] = value", " replaces the indicated element", "", " :insert_before(L,M,n) => {@L[1..n-1],@M,@L[n..length(L)]}", " :insert_after (L,M,n) => {@L[1..n], @M,@L[n+1..length(L)]}", " takes two distinct biglists, inserts one into the other at the given point", " returns the resulting consolidated biglist", "", " :extract_range(L,m,n) => {{@L[1..m-1],@L[n+1..]}, L[m..n]} ", " breaks the given biglist into two distinct biglists.", "", " :delete_range(L,m,n[,leafkiller]) => {@L[1..m-1],@L[n+1..]}", " :keep_range (L,m,n[,leafkiller]) => L[m..n]", " like extract_range only we destroy what we don't want.", "", " :insertlast(L,value) => {@L,value}", " inserts a new element at the end of biglist. ", " If find_ord is to continue to work properly, it is assumed that the ", " home:_ord(elt) is greater (comp-wise) than all of the :_ord values", " of elements currently in the biglist.", "", " :kill(L[,leafkiller]) ", " destroys all nodes used by biglist. ", " Calls home:leafkiller on each element."} |
$guest_log | #14 | rc | #29 | list of 17{"$guest_log", "", "records guest connect/disconnect events.", "", ".max_events -- maximum number of connect/disconnect events kept", ".connections -- actual list of events, the most recent ones first", " each element is of the form", " {object, is_connect, time, site}", " object is the particular guest that (dis)connected", " is_connect 1 or 0 according as this is a connect or not.", "", ":find(who,when)", " => site name of WHO at the particular time", " (or 0 if WHO was not logged in then)", "", ":last(n) ", " prints a listing of the last n events"} |
mail-resolution | #14 | rc | #29 | {"*forward*", "mail-resolve"} |
$news | #14 | rc | #29 | list of 32{"*subst*", "$news", "-----", "This object is a mail_recipient like any other (see `help $mail_recipient'). One may send messages to it and use the usual recipient manipulation commands (@mail, @read, @rmm,...). ", "", "Selected messages on this recipient are ordered in reverse date order (i.e., most recent first) and concatenated to produce the \"news\" that is printed in response to the player `news' command. Each news item is thus a distinct message. The default $player:confunc checks to see if any new messages have been selected for inclusion in the \"news\" since the player last read the news.", "", "The property $news.current_news holds the message sequence of messages currently considered as comprising \"the news\". The following commands are used to change .current_news:", "", " @addnews <message-seq> to %[$news]", " @rmnews <message-seq> from %[$news]", " @setnews %[$news] to <message-seq>", "", "@addnews includes the specified messages, @rmnews excludes the specified messages, and @setnews changes .current_news to be the given message sequence. Note that these ONLY change whether a given message is marked as being \"in the news\" and do not actually add or remove messages from the mail recipient $news.", "", "The procedure for adding a news article is", "", " Send a mail message to %[$mail_agent:name($news)]", " @addnews last to %[$news]", " This marks the message as belonging to the current newspaper.", " This also announces to any player who have not yet read this message ", " that there is a new version of the newspaper.", "", "The preferred method for updating a news items is to send a new version of the item, @rmnews the old version and @addnews the new one.", "", "The following ordinary mail commands behave differently", " @rmm removes any reference to message from .current_news ", " in addition to removing the message itself from .messages", " @unrmm completely undoes the effect of the previous @rmm; ", " this includes restoring .current_news.", "", "By default, the newspaper is moderated, however there is the possibility of unmoderating it (see `help MR-access'), letting arbitrary players send mail to it; administrators could then @addnews those items deemed worthy."} |
matching | #14 | rc | #29 | {"*forward*", "object-matching"} |
MR-expiration | #14 | rc | #29 | list of 32{"The mail messages stored in mail recipients may be removed automatically by a weekly expiration task. New core owners who wish to turn this feature on and cut down on the db space used by mail recipients (Remember, players are mail recipients too) should start this task:", "", " $wiz_utils:expire_mail_weekly", "", "When this task runs, it searches through all mail recipients and checks their .expire_period property. This property contains a time, in seconds, that messages should expire after. If this property is set to 0, then no expiration will take place from that recipient. The task, then, will compile a list of messages that are older than the expire period (e.g., if the property is set to 30 days, messages older than 30 days from the current date will expire). The default expiration period for mail recipients is 30 days.", "", "Normally, when the mail messages are expired from the recipient they are deleted. However, the owner of the recipient may elect to have the messages mailed to an email address prior to their erasure. There are two methods for doing this, one for players and one for children of $mail_recipient.", "", "Players:", "", " Players may completely turn off mail expiration by setting the mail option `expire' off. If it is on, then $mail_agent.player_expire_time is the expire period used for mail on players. ", " If a player has a registered email address, he may simply turn the mail option `no_auto_forward' off in order to have the expired messages sent to his email address before they are deleted. (The reversed logic saves on db space). See `help mail-options' and `help @registerme'.", "", "Mail Recipients:", "", " The command to set the expiration period of a mail recipient is:", "", " @set_expire <recipient> to <time>", "", "The <time> specified can be in english format (30 days, 60 days, etc.). If left off (the owner types `@set_expire <recipient> to'), the command will print out the current expiration information for that recipient. A list owner may set the expiration period up to a maximum of 180 days.", "", " Similar to players, the owner of a mail recipient may have the mail sent to either his registered email address or to any other address he specifies before it expires. To prevent unsolicited email from going to a random address, confirmation must be made before the owner may set the address to something other than his registered address.", "", " The command is:", "", " @register <recipient> to <address>", "", "If the owner leaves off the <address>, the current registered address (if any) and expiration period will be returned. Again, if the address specified is the player's registered address, nothing more need be done. If it is not, then an email message will be sent to that address containing a password. Presumably, the owner can retrieve that password and then log back into the MOO and type:", "", " @validate <recipient> with <password>", "", "which will enable the mail forwarding before expiration."} |
mail-expiration | #14 | rc | #29 | {"*forward*", "MR-expiration"} |
$big_mail_recipient | #14 | rc | #29 | list of 41{"Generic Large Capacity Mail Recipient", "-------------------------------------", "Since any modifications to large lists entail copying the entire list over, operations on ordinary mail recipients having large numbers of messages, that actually change the content of .messages will take inordinately long. Thus we have this version which makes use of the $biglist package, scattering the messages onto numerous properties so that write operations involving only a few messages will not require recopying of the entire list.", "", "In nearly all respects it behaves as the ordinary Mail Recipient, except that it is faster for certain kinds of operations.", "", "Certain unimplemented verbs, like :date_sort(), and :messages() currently return E_VERBNF.", "", "To convert an existing $mail_recipient-child (call it #MR) into a $big_mail_recipient-child the basic procedure is", "", " ;;something.foo= #MR:messages();", " @rmm 1-$ from #MR", " @unrmm expunge", " @chparent #MR to $big_mail_recipient", " ;#MR:receive_batch(@something.foo);", "", "Reconstructing Damaged Big Mail Recipients", "------------------------------------------", "On rare occasions, the tree structure created by $biglist can be corrupted (this can happen on lists sufficiently large that a list-modification operation (e.g., @rmm, @renumber) runs out of ticks/seconds). In the vast majority of such cases, your messages are all still there; it's simply that the tree we use for finding/searching them is messed up.", "", "To recover messages from a damaged big mail recipient (#DBMR)", " --- read to the end before you start typing any commands ---", "", "create a fresh $big_mail_recipient (#NEWBMR) and then do the following:", "", " ;#NEWBMR:restore_from(#DBMR)", "", "When this finishes, #NEWBMR will contain all of the mail messages we were able to find. (note that this will include messages that you had deleted from #DBMR but not expunged). #NEWMBR should thenceforth be useable in place of #DBMR, however if #DBMR contains custom verbs and non-clear properties, these will also need to be copied over.", "", "Alternatively, one may do", "", " @copyobject #DBMR to #TEMPBMR", " ;#DBMR:restore_from(#TEMPBMR)", "", "to rebuild #DBMR in place. This, however, will take about twice as long.", "", "oooooooooooooooooooooooooooooooo", "WARNING!!! WARNING!!! WARNING!!!", "oooooooooooooooooooooooooooooooo", "", "Calling #OBJ:restore_from(...) COMPLETELY AND IRREVOCABLY REMOVES ALL MESSAGES from the object that it is run on (#OBJ); you MUST be sure to EITHER have made a copy of #OBJ OR be doing the restore to a DIFFERENT object."} |
index | #24 | rc | #29 | <clear> |
index_cache | #24 | r | #29 | {"core-index"} |
aliases | #1 | rc | #29 | {"Core Utility Help"} |
description | #1 | rc | #29 | "Help database for LambdaCore utility objects and generics." |
object_size | #1 | r | #29 | {95298, 1298433815} |
hidden_verbs | #1 | rc | #29 | <clear> |
phelp_msg | #1 | rc | #29 | <clear> |
weight | #1 | rc | #29 | <clear> |
owner_verbs | #1 | rc | #29 | <clear> |
plural_name | #1 | rc | #29 | <clear> |
client_image | #1 | rc | #29 | <clear> |
listening | #1 | rc | #29 | <clear> |
Ancestry
Ancestors (nearest first): #24 Generic Help Database → #1 root
Children: none
Call graph
Source
find_topics
Referenced by
none
Source
1if (!args) 2l = {}; 3for p in (properties(#0)) 4if ((p[max(1, $ - 5)..$] == "_utils") && `#0.(p):help_msg() ! ANY') 5l = {@l, "$" + p}; 6endif 7endfor 8return {@pass(@args), @l}; 9elseif (ts = pass(@args)) 10return ts; 11elseif ((what = args[1])[1] != "$") 12return {}; 13elseif (ts = pass("$generic_" + what[2..$])) 14return ts; 15elseif ((r = rindex(w = strsub(what[2..$], "-", "_"), "_utils")) && ((r == (length(w) - 5)) && (`valid(#0.(w)) ! ANY' && `#0.(w):help_msg() ! ANY'))) 16return {what}; 17else 18return {}; 19endif
get_topic
Referenced by
none
Source
1topic = args[1]; 2if ((topic == (("$" + topic[2..$ - 5]) + "utils")) && (valid(#0.(w = strsub(topic[2..$], "-", "_"))) && (uhelp = #0.(w):description()))) 3return {tostr("General information on $", w, ":"), "----", @(typeof(uhelp) == STR) ? {uhelp} | uhelp}; 4else 5return pass(@args); 6endif
dump_topic
Referenced by
none
Source
1if ((E_PROPNF != (text = pass(@args))) || ((args[1][1] != "$") || ((!((uprop = args[1][2..$]) in properties(#0))) || (typeof(uobj = #0.(uprop)) != OBJ)))) 2return text; 3else 4udesc = uobj.description; 5return {tostr(";;$", uprop, ".description = $command_utils:read_lines()"), @$command_utils:dump_lines((typeof(udesc) == LIST) ? udesc | {udesc})}; 6endif