Help Entries starting with 'E'
@ealias
- @ealias <object>=<enteralias>
This allows a player to type the enter alias instead of "enter <object>" If you have a chair, you could "@ealias chair = sit down" and then just type "sit down" instead of "enter chair" - using the object name is not necessary. Note that the enter alias is checked after normal exits. Like an exit, it may have a semicolon separated list of words, i.e. sit down;sit;sit on chair
@edit
- @edit[/first][/check] <object>/<pattern>=<search>,<replace>
- @edit[/check] <object>/<pattern>=$,<stringtoappend>
- @edit[/check] <object>/<pattern>=^,<stringtoprepend>
This is useful when you don't want to have to retype those obnoxiously long descriptions just to make one little change. Instead, search and replace via @edit.
<pattern> is a pattern, optionally containing wildcards, for the attribute names you wish to edit. Only attributes already defined on <object> may be edited. <search> and <replace> are two strings. It's also possible to use "$" and "^" to signal appending and prepending text, respectively.
If the text contains commas, percent signs, or similar special characters, it usually must be enclosed in curly braces.
If the /first switch is used, only the first occurrence of <search> is replaced.
If the /check switch is used, the editing is not actually done, but the results are shown to you (with changes hilighted) as if a normal @edit was performed.
See also ATTRIBUTES, edit()
@efail
@efail <object> = <message> This is the message shown to the player who fails to enter the object.
@elock
@elock <object> = <key> Enter-locks an object, restricting who is allowed to enter it. Special lock types are supported (see "help @lock" for details). Only objects which are ENTER_OK may be entered, regardless of the key.
Rooms don't use ENTER_OK or @elock; they use @lock/teleport instead. Only people who pass the room's teleport lock, are wizards or royalty, or control the room, will be allowed to @teleport into the room. (Note that this is different from NO_TEL, which prevents people from teleporting out of a room). The teleport lock is evaluated even if the room is JUMP_OK - in other words, if you are trying to teleport into a room you don't control, the room must be JUMP_OK, and you must pass the teleport lock.
@emit
@emit[/<switch>] [<message>] \<message>
This sends <message> to every person in the current room. However, no identifier marking it as being sent by you is shown. For example, @emit foo would show 'foo' to every object in the room.
The /room switch makes this command equivalent to "@lemit".
The /silent switch in combination with /room suppresses the
@lemit confirmation. It has no effect without /room.
The /noeval switch prevents the MUSH from evaluating the message.
The /spoof switch causes nospoof notifications to show the enactor's
dbref instead of the executor's dbref, and requires control over
the enactor or the Can_nspemit power.
@emit can be abbreviated "\"
See also @pemit, @remit, @oemit, @lemit, NOSPOOF and SPOOFING.
@enable
- @enable <option>
- @disable <option>
These wizard-only commands allow for any boolean @config options to be changed (see "help @config paramaters" for a list).
@enable <option> is the same thing as @config/set <option>=yes @disable <option> is the same thing as @config/set <option>=no
@enter
- @enter <object>=<message>
This sets the message that is displayed to anyone entering the object. Works just as @success on an exit does.
Example:
@enter Chair = You sit down on the comfy chair.
enter chair
> You sit down on the comfy chair.
@entrances
- @entrances[/<switch>] <object>[=<begin>,<end>]
This command will show you all exits linked to the object you use the command on, as well as where the exit originates. This command is computationally expensive and costs the same as @find. You can limit the range of the dbrefs searched by specifying <begin> and <end>.
It takes four switches:
/exits show only exits linked to <object>
/things show only things which have their homes in <object>
/players show only players who have their homes in <object>
/rooms show only rooms which have a drop-to of <object>
@eunlock
Enter-unlocks an object, in a fashion similar to @unlock. For anyone
to be able to enter an object, it must be both @eunlocked and ENTER_OK.
You can also simply type
@lock/enter <object>
to unlock an object.
@exitformat
- @exitformat <object>[=<format>].
Replaces the usual "Obvious Exits:" format when an object is looked at, by a player-specified exits format. This is evaluated as if it were a description or similar message on the room. The objects that the looker would normally be able to see is passed as a dbref list in %0; all exits can be acquired through 'lexits(me)'.
One could change the format to 'Exits: Exit1 Exit2 Exit3' through '@exitformat here = Exits: [iter(%0,name(##))]', for example.
E()
Returns the value of "e" (2.71828182845904523536, rounded to the game's float_precision setting).
EDEFAULT()
- edefault([<obj>/]<attr>, <default case>)
This function returns the evaluated value of <obj>/<attr>, as if retrieved via the get_eval() function, if the attribute exists and is readable by you. Otherwise, it evaluates the default case, and returns that. The default case is only evaluated if the attribute does not exist or cannot be read.
Example:
> &TEST me=You have lost [rand(10)] marbles.
> say edefault(me/Test,You have no marbles.)
You say "You have lost 6 marbles."
> &TEST me
> say edefault(me/Test,You have no marbles.)
You say "You have no marbles."
EDIT()
- edit(<string>, <search>, <replace>[, ... , <searchN>, <replaceN>])
This functions in a similar way to the @edit command; instead of taking an attribute from an object, it takes an arbitrary string. It searches the string for <search> and replaces with <replace>, then repeats the process if additional search-replace pairs are given.
If <search> is a caret (^), <replace> is prepended. If <search> is a dollar sign ($), <replace> is appended. If <search> is an empty string, <replace> is inserted between every character, and before the first and after the last. If <replace> is an empty string, <search> is deleted from the string.
Example:
> say [edit(this is a test,^,I think%b,$,.,a test,an exam)]
You say "I think this is an exam."
edit() can not replace a literal single ^ or $. Use regedit() for that.
ELEMENT()
- element(<list>, <item>,<single-character separator>)
This returns the position of <item> in <list>, where <list>'s items are separated by <separator>. A wildcard match is done, so this function behaves much like MATCH(), except its separator argument is required, not optional.
Example:
> say [element(this|is|a|test|string,is,|)]
You say, "2"
ELEMENTS()
- elements(<list of words>, <list of numbers>[,<delim>[, <osep>]])
This function returns the words in <list of words> that are in the positions specified by <list of numbers>. Optionally, a list delimiter other than a space can be used.
Example:
> say elements(Foo Ack Beep Moo Zot,2 4)
You say "Ack Moo"
> say elements(Foof|Ack|Beep|Moo,3 1,|)
You say "Beep|Foof"
ELOCK()
- elock(<object>[/<locktype>], <victim>)
elock() returns 1 if the <victim> would pass the lock on <object>, and 0 if it would fail. You must control <object>.
You can also provide a switch after <object> if you wish to check something other than the basic lock. This can be used to test user-defined locks. elock() can take as many switches as @lock.
Example:
@lock/drop Dancing Slippers=#0
think elock(Dancing Slippers/drop, Princess)
> 0
EMIT()
- emit(<message>)
- nsemit(<message>)
Sends a message to the room, as per @emit.
nsemit() is a wizard-only variation that works like @nsemit.
empty
The empty command attempts to move all the contents of <object> to <object>'s location. You must either be holding <object> (in which case the command is like getting <object>'s <item> for each item) or be in the same location as <object> (in which case the command is like getting <object>'s <item> and dropping it).
The empty command assumes that all <object>'s items pass through the hands of the player running the command. Therefore, the same kinds of locks and messages that are applied in a possessive get (and, possibly, a drop) are applied to each item in <object>. It is therefore possible to fail to empty an object for many reasons, even when you could do so using "extraphysical" methods (teleporting items, forcing the object to drop them, or forcing the items to leave the object.)
ENCRYPT()
encrypt(<string>, <password>)
Returns an encrypted string produced by a simple password-based encrypted algorithm. Good passwords are long passwords. This is not high-security encryption.
ENDTAG()
Function: endtag(<name>)
This will output an end tag 'name'.
Example: [endtag(IMG)]
Will output (in HTML): </IMG>
enter
Used to enter a thing or player. You can only enter an object if you own it or if it is set ENTER_OK. You must also pass the enter-lock, if it is set. Entering an object triggers is @enter/@oenter/@oxenter messages and its @aenter actions. If you fail the enter-lock, the object's @efail/@oefail/@aefail messages and actions are triggered.
Insides of objects are best used for vehicles, or storage spaces when you don't have a home. You can describe the interior of an object differently from its exterior by using @idescribe.
See: @enter, @oenter, @oxenter, @aenter, leave, @lock, @idesc, INTERIORS
ENTER_OK
Flag: ENTER_OK (all types)
If an object or person is ENTER_OK, other players may enter the object or person by using 'enter <object/person>'. Only objects which are ENTER_OK may be entered, regardless of the enter lock. Players must also have the ENTER_OK flag set if they wish to be able to receive things given to them by other players via the command 'give <player> = <object>'.
This flag has no effect on rooms.
ENTRANCES()
- entrances([<object> [,<type>[, <begin>[, <end>]]]])
With no arguments, the entrances() function returns a list of all
exits, things, players, and rooms linked to your location, like
@entrances. You can specify an object other than your current location
with <object>. You can limit the type of objects found by specifying
<type> as follows:
a all (default)
e exits
t things
p players
r rooms
You can also limit the range of the dbrefs searched by giving <begin>
and <end>.
This function is computationally expensive and costs the same as @find. You must control the object in order to perform entrances() on it.
EQ()
Takes two numbers, and returns 1 if they are equal, 0 otherwise.
ESCAPE()
The ESCAPE() function "escapes out" potentially "dangerous" characters, preventing function evaluation in the next pass of the parser. It returns <string> after adding the escape character ('\') at the beginning of the string, and before the following characters: % ; [ ] { } \ ( ) , ^ $
This function prevents strings entered by players from causing side effects, such as performing an unintended GET() of an attribute. It is only needed when the resulting string will be passed through @force or used as an attribute for an object (like the description of a mail message object). Since the function preserves the original string, it is, in most cases, a better choice than SECURE().
ETIMEFMT()
- etimefmt(<format>, <secs>)
This function is similar to timestring() - it formats an elapsed time into days, hours, minutes and seconds. However, its formatting is much more versatile than timestring(), as well as being more complex.
Escape codes in <format> are replaced by the proper values, and other characters are left unchanged.
A list of all codes is in HELP ETIMEFMT2
Example:
> say etimefmt(I have been connected for $2H:$2M., conn(%#))
You say, "I have been connected for 01:32."
> think etimefmt($2mm $2ss, 500) - [timestring(500)]
8m 20s - 8m 20s
ETIMEFMT2
etimefmt()'s escape codes are similar to timefmt()'s. The time is broken up into days, hours, minutes, and seconds, and each value replaces the matching code.
$s - The number of seconds. $h - The number of hours.
$S - The number of seconds, $H - The number of hours,
left-padded with 0. left-padded with 0.
$m - The number of minutes. $d - The number of days.
$M - The number of minutes, $D - The number of days,
left-padded with 0. left-padded with 0.
$$ - A literal $.
You can also put a number between the $ and letter to specify a minimum width for the expanded code. The capital letter codes are the same as the lower case codes if you don't provide a width. An 'x' before the code (But after any number) will automatically add a d, h, m, or s suffix to the time, and a 'z' will not display anything if the field's value is 0. x and z can be combined.
Continued in HELP ETIMEFMT3
ETIMEFMT3
Some examples:
Example:
> think etimefmt($2h:$2M, 3700)
1:01
> think etimefmt(You have $m minutes and $s seconds to go, 78)
You have 1 minutes and 18 seconds to go
> think squish(etimefmt(Connected for $zxd $xzh $zxm $xzs, conn(me)))
Connected for 5h 24m 45s
EVAL()
- eval(<object>, <attribute>)
- get_eval(<object>/<attribute>)
Eval() works the same way as xget(), except that it performs %-substitutions and function evaluation on the attribute before returning the value. eval() does not modify the stack (%0-%9), so the attribute being evaled sees the same values for them that the calling code does. Unless you need this behavior, it is better to use u() instead, which hides the caller's stack.
Example:
&TEST me=%B%B%B-[name(me)]
think xget(me,test)
> %B%B%B-[name(me)]
think eval(me,test)
> -Shalott
Get_eval() does the same thing, except it uses the format of get() instead of xget() -- using a slash rather than a comma to separate the object from the attribute. It is included for TinyMUSH 2.x compatibility.
EVALUATION ORDER
Whenever some text is entered by an object or thing, the MUSH program attempts to match it against a valid game command in the following order of possible commands:
Special game commands: WHO, QUIT, etc.
Single-token commands: ", :, ;, +, \, #
Exits in the room
@-commands and &attribute setting
Regular game commands: get, inventory, etc.
Enter aliases
Leave aliases
User-defined commands on nearby objects. All such $commands are matched
and executed.
If there are no user-defined commands nearby:
If the zone of the player's location is a zone master room,
Zone master room exits
Zone master room user-defined commands
Else
User-defined commands on the zone of the player's location
(continued in help evaluation2)
EVALUATION2
If still nothing is matched:
User-defined commands on the player's personal zone
If nothing, including zone commands, has been matched:
Global exits
Global user-defined commands: all $commands in the Master Room are
matched. Local commands are always checked first and ALWAYS negate
global commands.
Because local commands overrule global commands, you can easily prevent a global command from working in a specific room by setting a copy of the global command in that room. Alternatively, if a global command is oddly not working in a room, you should check for copies of the command word in the room (using @scan).
events
events [<topic>] rules [<topic>]
These commands, like news, work the same way as the help command, except that the information provided in them is specific to this particular MUSH. Not all MUSHes will have both or either of these commands enabled.
examine
examine[/<switch>] <object>[/<attribute>]
Displays all available information about <object>. <object> may be an object, 'me' or 'here'. You must control the object to examine it. If you do not own the object, or it is not visible, you will just see the name of the object's owner. May be abbreviated 'ex <object>'. If the attribute parameter is given, you will only see that attribute (good for looking at code). You can also wild-card match on attributes. The * wildcard matches any number of characters except a backtick (`). The ? wildcard matches a single character except a backtick (`). The ** wildcard matches any number of characters, including backticks. For example. to see all the attributes that began with a 'v' you could do ex <object>/v**
The /brief switch is equivalent to the 'brief' command.
The /debug switch is wizard-only and shows raw values for certa
in fields in an object.
The /mortal switch shows an object as if you were a mortal other than
the object's owner and is primarily useful to admins. This switch
ignores the object's VISUAL flag (but not its attribute flags)
The /parent switch show attributes that would be inherited from the
object's parents, if you have permission to examine the attributes
on the parent.
The /all switch shows the values of VEILED attributes.
EXIT()
Returns the dbref of the first exit in a room.
You can get the complete exit list of any room you may examine, regardless of whether or not exits are dark. You can get the partial exit list (obeying DARK/LIGHT/etc.) of your current location or the enactor (%#). You CANNOT get the exit list of anything else, regardless of whether or not you have objects in it.
EXITS
An exit is a one-way link that takes you from its source room to its destination room. To open an exit from a room, you must control that room. To open an exit to a room, you must either control the room or it must be set LINK_OK. If an exit is set DARK is will not show up in the list of obvious exits in a room.
If an exit is set TRANSPARENT, someone who looks at the exit will also see the description and contents of the destination room. If an exit is set CLOUDY, someone who looks at the exit will also see the contents of the room beyond, but not its description. If an exits is set -both- CLOUDY and TRANSPARENT, the description but not the contents will be seen.
If you have code on an exit (In an @asuccess or the like), note that [loc(exit)] is the exit's destination, and [home(exit)] is the exit's starting point. If an exit @emit's something, it will be heard in the source room.
(continued in exits2)
EXITS2
You can create an exit that sends those who go through it to their homes by typing '@link <EXIT>=home'.
Starting with PennMUSH version 1.50p10, exits can have more than one destination. To make an exit with a variable destination, open the exit (using @open), then type '@link <EXIT>=variable'. Finally, add an attribute named 'DESTINATION' to the exit (&destination <EXIT>), which will be evaluated for the dbref # of the destination room when the exit is used.
Example:
@open South <S>;s;south
@link s=variable
&destination s=[switch(rand(3),0,#100,1,#101,2,#102)]
This exit would take you to either room #100, #101, or #102 depending on the random number.
Anyone can create variable exits, but the destinations must be to places that the exit can normally @link to.
EXP()
Returns e to the power of <number>.
EXTRACT()
- extract(<list>[, <first>[, <length>[,<delimiter>]]])
This function returns <length> elements of a list, counting from the <first> element. If <length> is not specified, the default is 1, so extract(list,3) acts like elements(list,3). If <first> is not specified, the default is the 1, so extract(list) acts like first(list).
Example:
think extract(This is a test string,3,2)
> a test
Generated at Mon Jul 2 00:35:04 2007