From 42ece53b69df9082d898f9b2e6e18b5b23abf7d9 Mon Sep 17 00:00:00 2001 From: Rick Bird Date: Fri, 25 Mar 2011 13:02:52 -0400 Subject: [PATCH] PennMUSH Incorproation. Applied patch 181p10, and updated cobra_func.hlp to mirror PennMUSH functions upto this patchlevel. --- game/txt/hlp/cobra_cmd.hlp | 7 +- game/txt/hlp/cobra_func.hlp | 1146 +++++++++++++++++++++-------------- game/txt/hlp/cobratop.hlp | 7 +- hdrs/htab.h | 6 +- src/attrib.c | 5 + src/bsd.c | 12 +- src/command.c | 1 + src/conf.c | 4 + src/db.c | 62 +- src/extchat.c | 4 +- src/flags.c | 43 +- src/function.c | 76 +-- src/funstr.c | 7 +- src/help.c | 10 +- src/htab.c | 3 +- src/lock.c | 3 +- src/look.c | 4 +- src/plyrlist.c | 57 +- src/sig.c | 8 + src/sql.c | 2 +- src/utils.c | 2 +- 21 files changed, 887 insertions(+), 582 deletions(-) diff --git a/game/txt/hlp/cobra_cmd.hlp b/game/txt/hlp/cobra_cmd.hlp index 93af391..e5d6715 100644 --- a/game/txt/hlp/cobra_cmd.hlp +++ b/game/txt/hlp/cobra_cmd.hlp @@ -1119,11 +1119,6 @@ See also: @poll, WHO, DOING into a room you don't control, the room must be JUMP_OK, and you must pass the teleport lock. - Note that the enter lock of an object or room being used as a Zone - Master Object determines control of that zone. Please note that if - you're using a room as a ZMO (i.e. as a zone master room), only the - controllers of that zone will be able to teleport into that room - (which is a good thing for security). & @emit & \ @emit[/] [] @@ -2664,7 +2659,7 @@ See also @emit, @oemit, @remit, NOSPOOF, and SPOOFING. See also: @doing, WHO, DOING & @poor @poor . - This is a Director only command. It sets every player's money supply to + This is a God only command. It sets every player's money supply to value. See also: MONEY diff --git a/game/txt/hlp/cobra_func.hlp b/game/txt/hlp/cobra_func.hlp index 36886f8..3e2474b 100644 --- a/game/txt/hlp/cobra_func.hlp +++ b/game/txt/hlp/cobra_func.hlp @@ -5,8 +5,8 @@ The brackets are used to delimit and force evaluation of the function (or nested functions). The brackets can also be used to group functions for the purposes of string concatenation. In general, more than one pair - of brackets is not required, but liberal use of them makes code easier to - read. You can nest an arbitrary number of brackets. + of brackets is not required, but you can nest an arbitrary number of + brackets. Examples: > say [first(rest(This is a nice day))] @@ -25,12 +25,13 @@ A list of available built-in functions can be obtained via the command "@config/functions". In the help text, the list is under the topic "FUNCTION LIST". - + In addition to these built-in functions are MUSH-defined "global user - functions." These are defined by objects with the "GFuncs" power, via + functions." These are defined by objects with the "GFuncs" power, via the "@function" command. To the user, they act just like the built-in g ame functions. For details on global user functions, see "help @function". - + + See also: MUSHCODE & FUNCTION LIST Several major variants of functions are available. The help topics @@ -60,14 +61,14 @@ defined via the @function command. & Attribute functions - All these functions access attributes on an object. + The primary purpose of these functions is to access information + stored in attributes on objects. - aposs() apply() default() edefault() eval() - filter() filterbool() fold() foreach() get() - grep() grepi() lattr() nattr() obj() - poss() regrep() regrepi() subj() udefault() - ufun() uldefault() ulocal() v-function xget() - zfun() + aposs() attrib_set() default() edefault() eval() + get() grep() grepi() lattr() nattr() + obj() poss() regrep() regrepi() subj() + udefault() ufun() uldefault() ulocal() v-function + wildgrep() wildgrepi() xget() zfun() See also: ATTRIBUTES, NON-STANDARD ATTRIBUTES & Bitwise functions @@ -100,43 +101,41 @@ to an object or objects. cemit() emit() lemit() nsemit() nslemit() - nsoemit() nspemit() nsremit() nszemit() oemit() - pemit() remit() zemit() + nsoemit() nspemit() nsprompt() nsremit() nszemit() + oemit() pemit() prompt() remit() zemit() & Connection functions Connection functions return information about the connections open on a game, or about specific connections. cmds() conn() doing() height() hostname() - hidden() idle() ipaddr() lports() lwho() - mwho() ports() pueblo() recv() sent() - ssl() terminfo() width() idle_average() + hidden() idle() ipaddr() lports() lwho() + lwhoid() mwho() mwhoid() nmwho() nwho() + ports() pueblo() recv() sent() ssl() + terminfo() width() xmwho() xmwhoid() xwho() + xwhoid() zmwho() zwho() & Dbref functions Dbref functions return a dbref or list of dbrefs related to some value on an object. - children() con() entrances() - exit() followers() following() - home() lcon() lexits() - loc() locate() lparent() - lplayers() lsearch() lvcon() - lvexits() lvplayers() namelist() - next() num() owner() - parent() pmatch() rloc() - rnum() room() where() - zone() - + children() con() entrances() exit() followers() + following() home() lcon() lexits() loc() + locate() lparent() lplayers() lsearch() lvcon() + lvexits() lvplayers() namelist() next() nextdbref() + num() owner() parent() pmatch() rloc() + rnum() room() where() zone() + See also: DBREF & Information functions Information functions return values related to objects or the game. - andflags() andlflags() config() controls() ctime() - elock() findable() flags() fullname() hasattr() - hasattrp() hasflag() haspower() hastype() iname() - lflags() lock() lstats() money() mtime() - mudname() name() nattr() nearby() objid() - objmem() orflags() orlflags() playermem() poll() - powers() quota() restarts() type() version() - visible() + alias() andflags() andlflags() config() controls() + ctime() elock() findable() flags() fullalias() + fullname() hasattr() hasattrp() hasflag() haspower() + hastype() iname() lflags() lock() lstats() + money() mtime() mudname() name() nattr() + nearby() objid() objmem() orflags() orlflags() + playermem() poll() powers() quota() restarts() + type() version() visible() & List functions List functions take at least one list of elements and return transformed @@ -144,13 +143,15 @@ can take an arbitrary argument to specify what delimits list elements; if none is provided, a space is used by default. - element() elements() extract() first() grab() - graball() index() insert() itemize() items() - iter() last() ldelete() map() match() - matchall() member() mix() munge() remove() + element() elements() extract() filter() filterbool() + first() fold() grab() graball() index() + insert() itemize() items() iter() last() + ldelete() map() match() matchall() member() + mix() munge() namegrab() namegraball() remove() replace() rest() revwords() setdiff() setinter() - setunion() shuffle() sort() sortby() splice() - step() table() wordpos() words() + setunion() shuffle() sort() sortby() sortkey() + splice() step() table() unique() wordpos() + words() See also: LISTS & Math functions @@ -159,10 +160,10 @@ abs() acos() add() asin() atan() atan2() bound() ceil() cos() ctu() dist2d() dist3d() e() exp() fdiv() - floor() fmod() fraction() ln() lmath() - log() max() mean() median() min() + floor() fmod() fraction() ln() lmath() + log() max() mean() median() min() mul() pi() power() root() round() - sign() sin() sqrt() stddev() sub() + sign() sin() sqrt() stddev() sub() tan() trunc() val() These functions operate only on integers (if passed floating point @@ -172,7 +173,7 @@ These functions operate on n-dimensional vectors. A vector is a delimiter-separated list of numbers (space-separated, by default): - vadd() vcross() vdim() vdot() vmag() + vadd() vcross() vdim() vdot() vmag() vmax() vmin() vmul() vsub() vunit() & Regular expression functions These functions take a regular expression (regexp, or re) and match @@ -199,13 +200,14 @@ before() brackets() capstr() case() caseall() cat() center() comp() chr() decrypt() delete() digest() edit() encrypt() escape() - if() ifelse() lcstr() left() lit() - ljust() merge() mid() ord() pos() - regedit() lpos() regmatch() repeat() reverse() - right() rjust() scramble() secure() sha0() - space() spellnum() squish() strcat() strinsert() - stripaccents()stripansi() strlen() strmatch() strreplace() - switch() trim() ucstr() wrap() + if() ifelse() foreach() lcstr() left() + lit() ljust() merge() mid() ord() + ordinal() pos() regedit() lpos() regmatch() + repeat() reverse() right() rjust() scramble() + secure() sha0() space() spellnum() squish() + strcat() strinsert() stripaccents()stripansi() strlen() + strmatch() strreplace() switch() trim() ucstr() + wrap() See also: STRINGS & Time functions @@ -213,24 +215,24 @@ convsecs() convutcsecs() convtime() ctime() etimefmt() isdaylight() mtime() restarttime() secs() starttime() - stringsecs() time() timefmt() timestring() utctime() + stringsecs() time() timefmt() timestring() utctime() & Utility functions These functions don't quite fit into any other category. - allof() ansi() atrlock() atrmodtime() beep() - break() checkpass() clone() create() die() - dig() firstof() functions() isdbref() isint() - isnum() isword() localize() link() list() - lnum() null() objeval() open() pcreate() - r-function rand() s-function scan() set() - setq() setr() soundex() soundslike() tel() - textfile() valid() wipe() @@() + allof() ansi() atrlock() beep() checkpass() + clone() create() die() dig() firstof() + functions() isdbref() isint() isnum() isword() + localize() link() list() lnum() null() + numversion() objeval() open() pcreate() r-function + rand() s-function scan() set() setq() + setr() soundex() soundslike() speak() tel() + textentries() textfile() valid() wipe() @@() & @@() & NULL() @@() - null([,,...]) + null([, ... , ]) The @@() function does nothing and returns nothing. It could be used for commenting, perhaps. It does not evaluate its argument. @@ -312,15 +314,22 @@ > think accent(Khazad ai-menu!, Khaz^d ai-m^nu!) Khaz(a-with-^)d ai-m(e-with-^)nu! +& ACCNAME() + accname() + + accname() returns the name of object , applying the object's + @nameaccent, if any. + + Related functions: NAME(), FULLNAME(), INAME() & ACOS() - acos([, ]) + acos([,]) Returns the angle that has the given (arc-cosine), with the angle expressed in the given angle type, or radians by default. See HELP CTU() for more on the angle type. & ADD() - add(,,...) + add(, [, ... , ]) Returns the sum of some numbers. & AFTER() @@ -337,7 +346,7 @@ r baz & ALIGN() - align(,,..,[,[,[,]) + align(,,...,[,[,[,]]]) Creates columns of text, each column designated by . Each column is individually wrapped inside its own column, allowing @@ -380,7 +389,7 @@ +----------------------------------------+ & ALLOF() - allof([, ...,], ) + allof([, ... , ],) Evaluates every expression argument (including side-effects) and returns the results of those which are true, in a list separated by osep. The @@ -400,14 +409,14 @@ See also: firstof(), BOOLEAN VALUES & ALPHAMAX() - alphamax(, , , ...) + alphamax([, ... , ]) Takes any number of arguments, and returns the word which is lexicographically biggest. I.e., which word would be last in alphabetical order. & ALPHAMIN() - alphamin(, , , ...) + alphamin([, ... , ]) Takes any number of arguments, and returns the word which is lexicographically smallest: the word that would be first in @@ -415,8 +424,8 @@ & AND() & CAND() - and(,[, ... , ]) - cand(,[, ... , ]) + and(, [, ... , ]) + cand(, [, ... , ]) Takes boolean values, and returns 1 if all of them are equivalent to true(1). and() always evaluates all arguments (including side @@ -432,28 +441,28 @@ letter standing for each flag, like the output of the FLAGS() function. A '!' preceding a flag letter means "not flag". - Thus, ANDFLAGS(me,WD) would return 1 if I was set WIZARD and DARK. - ANDFLAGS(me,W!Dc) would return 1 if I was set WIZARD, not DARK, - and CONNECTED. + Thus, ANDLFLAGS(me,haven dark) would return 1 if I was set HAVEN + and DARK. ANDFLAGS(me,haven !Dark connected) would return 1 if I + was set HAVEN, not DARK, and CONNECTED. If a letter does not correspond to any flag, doesn't have it, so the function returns 0. There can be an arbitrary number of flags. Do not put spaces between flag letters. & ANDLFLAGS() - andlflags(,) + andlflags(, ) This function returns 1 if has all the flags in a specified list, and 0 if it does not. The list is a space-separated list of flag names. A '!' preceding a flag name means "not flag". - Thus, ANDLFLAGS(me,haven dark) would return 1 if I was set HAVEN - and DARK. ANDFLAGS(me,haven !Dark connected) would return 1 if I - was set HAVEN, not DARK, and CONNECTED. + Thus, ANDLFLAGS(me,wizard dark) would return 1 if I was set WIZARD + and DARK. ANDFLAGS(me,wizard !Dark connected) would return 1 if I + was set WIZARD, not DARK, and CONNECTED. If a name does not correspond to any flag, doesn't have it, so the function returns 0. There can be an arbitrary number of flags. & ANSI() - ansi(,) + ansi(, ) This allows you to highlight a string using ANSI terminal effects. The codes are: @@ -476,11 +485,7 @@ For example, "ansi(fc, Test)" would hilight "Test" in flashing cyan. See also: ANSI, COLOR -& APOSS() - aposs() - Returns the absolute possessive pronoun - his/hers/its/theirs - - for an object. & APPLY() apply([/], [, ]) @@ -491,13 +496,19 @@ apply(function,1 2 3) is equivalent to ufun(function,1,2,3) See also: ufun() + +& APOSS() + aposs() + + Returns the absolute possessive pronoun - his/hers/its/theirs - + for an object. & ART() art() This function returns the proper article, "a" or "an", based on whether or not begins with a vowel. & ASIN() - asin([, ]) + asin([,]) Returns the angle with the given (arc-sine), with the angle expressed in the given angle type, or radians by default. @@ -505,8 +516,8 @@ See HELP CTU() for more on the angle type. & ATAN() & ATAN2() - atan([, ]) - atan2(, [<, ]) + atan([,]) + atan2(, [,]) Returns the angle with the given (arc-tangent), with the angle expressed in the given angle type, or radians by default. @@ -526,10 +537,12 @@ When given a second argument of "on" (or "off"), attempts to lock (unlock) the specified attribute, as per @atrlock. + & ATRMODTIME() atrmodtime(/) Returns the time that the specified attribute was last modified. + & ATTRIB_SET() attrib_set(/[, ]) @@ -546,9 +559,9 @@ Of course, if the empty_attrs configuration option is turned off, then the above paragraph doesn't apply. See @config attribs. - + & BAND() - band(,,...) + band(, [, ... , ]) Does a bitwise AND of all its arguments, returning the result (A number with only the bits set in every argument set in it). @@ -562,8 +575,7 @@ Sends "alert" bell characters. must be in the range 1 to 5, or, if unspecified, defaults to 1. - - This function may only be used by 'Admin' type players. + This function may only be used by 'Admin' type players. & BEFORE() before(, ) @@ -601,7 +613,7 @@ Returns the bitwise complement of its argument. Every bit set in it is cleared, and every clear bit is set. & BOR() - bor(, , ...) + bor(, [, ... , ]) Does a bitwise OR of all its arguments, returning the result. (A number with a bit set if that bit appears in any of its arguments). @@ -615,7 +627,7 @@ See also: ceil(), floor(), round(), trunc() & BXOR() - bxor(, ,...) + bxor(, [, ... , ]) Does a bitwise XOR of all its arguments, returning the result. (A number with a bit set if it's set in only one of its arguments). @@ -624,8 +636,10 @@ Returns with the first character capitalized. Example: capstr(foo bar baz) returns "Foo bar baz" + + See also: lcstr(), ucstr() & CAT() - cat(,[,,,...]) + cat([, ... , ]) cat() concatenates strings, separating each string by a space. So "[cat(one, two)]" will return 'one two'. @@ -636,8 +650,8 @@ See also: floor(), bound(), round(), trunc() & CENTER() - center(,[,[,]]) - + center(, [, [, ]]) + This function will center within a field characters wide, using the string for padding on the left side of the string, and for padding on the right side. defaults @@ -646,7 +660,7 @@ If divides into uneven portions, the left side will be one character shorter than the right side. - + Example: > say center(X,5,-) You say, "--X--" @@ -658,13 +672,13 @@ You say, "12345hello543215" & CHECKPASS() - checkpass(,) + checkpass(, ) Returns 1 if matches the player's password otherwise 0. If has no password, this function will always return 1. should be specified as a dbref or *. - This function is restricted to Director marked objects. + This function is restricted to wizards. & CHR() & ORD() @@ -702,7 +716,7 @@ connection as indicated by SESSION. The caller can use the function on himself, but using on any other - player requires privileged power such as Wizard, Royalty or SEE_ALL. + player requires special powers. See also: Connection Functions & RECV() @@ -712,11 +726,11 @@ connection as indicated by SESSION. The caller can use the function on himself, but using on any other - player requires privileged power such as Wizard, Royalty or SEE_ALL. + player requires special powers. See also: Connection Functions & COMP() - comp(, [, ]) + comp(, [,]) Comp compares two values. It returns 0 if they are the same, -1 if value1 is less than/precedes alphabetically value2, and 1 @@ -762,11 +776,11 @@ This function returns the number of seconds a player has been connected. must be the full name of a player, or a player's dbref. Players who are not connected have a conn value of "-1", as do dark - directors, when conn() is used on them by a non-priv'ed player. + wizards, when conn() is used on them by a non-priv'ed player. See also: CONNECTED & CONTROLS() - controls(,) + controls(, ) This function returns 1 if controls , or 0, if it does not. If one of the objects does not exist, it will return @@ -820,7 +834,7 @@ See also: convsecs(), time() & COS() - cos([, ]) + cos([,]) Returns the cosine of . Angle must be in the given angle type, or radians by default. @@ -833,7 +847,7 @@ See HELP CTU() for more on the angle type. & PCREATE() - pcreate(,) + pcreate(, ) Creates a player with a given name and password. Wizard-only. @@ -852,7 +866,7 @@ date and time that the object was created, if the player is able to examine the object. & CTU() - ctu(, , ) + ctu(,,) Converts between the different ways to measure angles. controls what the angle is treated as, and what form @@ -891,9 +905,7 @@ parse-able characters to recreate exactly after one parsing. It takes care of multiple spaces, '%r's, and '%t's. - Someday, perhaps, it will also escape ansi() in a nice way. - - See also: @decompile2 + See also: @decompile2, escape(), secure() & DECRYPT() decrypt(, ) @@ -901,14 +913,14 @@ the string and the same password. & DEFAULT() - Function: default([/],[[]/,...]) + default([/][, ... ,[]/], ) This function returns the value of the first possible /, as if retrieved via the get() function, if the attribute exists and is readable by you. Otherwise, it evaluates the default case, and returns that. Note that the default case is only evaluated if the - attribute does not exist or cannot be read. Note further that an - empty attribute counts as an existing attribute. + attribute does not exist or cannot be read. Note further than an empty + attribute counts as an existing attribute. This is useful for code that needs to return the value of an attribute, or an error message or default case, if that attribute does not exist. @@ -930,14 +942,14 @@ character at position deleted. In other words, it copies characters, skips characters>, and then copies the remainder of the string. If is negative, deletes characters leftwards from . - Characters are numbered starting at 0. + Characters are numbered starting at 0. Examples: > say delete(abcdefgh, 3, 2) You say, "abcfgh" > say delete(abcdefgh, 3, -2) You say, "abefgh" - + & DIE() die(, [, ]) @@ -956,7 +968,7 @@ > think die(3, 6, 1) 5 2 1 & DIG() - dig( [, [, ]]) + dig([, [, ]]) This function digs a room called , and optionally opens and links and , like the normal @dig command. It returns @@ -977,19 +989,19 @@ See also: sha0() & DIST2D() - dist2d(x1, y1, x2, y2) + dist2d(, , , ) Returns the distance between two points in the Cartesian - plane that have coordinates (x1, y1) and (x2, y2). + plane that have coordinates (, ) and (, ). & DIST3D() - dist3d(x1, y1, z1, x2, y2, z2) + dist3d(, , , , , ) Returns the distance between two points in space, with - coordinates (x1, y1, z1) and (x2, y2, z2). + coordinates (, , ) and (, , ). & DIV() & FLOORDIV() - div(,) - floordiv(,) + div(, ) + floordiv(, ) Div returns the integer part of the quotient of the first number divided by the second number. Floordiv returns the largest integer @@ -1019,7 +1031,7 @@ Returns the value of "e" (2.71828182845904523536, rounded to the game's float_precision setting). & EDEFAULT() - Function: edefault([/],) + edefault([/], ) This function returns the evaluated value of /, as if retrieved via the get_eval() function, if the attribute exists and @@ -1038,7 +1050,7 @@ See also: get(), eval(), ufun(), default(), udefault() & EDIT() - edit(, , [, , ...]) + edit(, , [, ... , , ]) This functions in a similar way to the @edit command; instead of taking an attribute from an object, it takes an arbitrary string. @@ -1060,7 +1072,7 @@ See also: @edit, regedit() & ELEMENT() - element(,,) + element(, ,) This returns the position of in , where 's items are separated by . A wildcard match is done, so this @@ -1073,7 +1085,7 @@ See also: match(), grab() & ELEMENTS() - elements(,[,][, ]) + elements(, [,[, ]]) This function returns the words in that are in the positions specified by . Optionally, a list delimiter @@ -1103,12 +1115,13 @@ See also: @lock, locktypes & EMIT() +& NSEMIT() emit() nsemit() Sends a message to the room, as per @emit. - nsemit() is a privileged variation that works like @nsemit. + nsemit() is a wizard-only variation that works like @nsemit. & ENCRYPT() encrypt(, ) @@ -1117,7 +1130,7 @@ encrypted algorithm. Good passwords are long passwords. This is not high-security encryption. See also decrypt(). & ENTRANCES() - entrances([ [, [, [,]]]]) + entrances([ [,[, [, ]]]]) With no arguments, the entrances() function returns a list of all exits, things, players, and rooms linked to your location, like @@ -1136,7 +1149,7 @@ @find. You must control the object in order to perform entrances() on it. & EQ() - eq(,) + eq(, ) Takes two numbers, and returns 1 if they are equal, 0 otherwise. @@ -1148,7 +1161,7 @@ preventing function evaluation in the next pass of the parser. It returns 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 @@ -1198,11 +1211,11 @@ Returns e to the power of . & EXTRACT() - extract([,[,[,]]]) + extract([, [, [,]]]) This function returns elements of a list, counting from the element. If is not specified, the - default is 1, so extract(list,3) acts like elements(list,3). + default is 1, so extract(list,3) acts like elements(list,3). If is not specified, the default is the 1, so extract(list) acts like first(list). @@ -1212,7 +1225,7 @@ See also: index(), elements(), grab() & FDIV() - fdiv(,) + fdiv(, ) Returns the quotient of the two numbers. Note that the DIV() and MOD() functions cannot be used on floating point numbers. @@ -1220,8 +1233,8 @@ See also: div() & FILTER() & FILTERBOOL() - filter([/], [,][,]) - filterbool([]/, [, ][,]) + filter([/], [,[, ]]) + filterbool([]/, [,[, ]]) This function returns the elements of for which a user-defined function evaluates to "1", or to a boolean true value if filterbool() @@ -1241,7 +1254,7 @@ See also: anonymous attributes & FINDABLE() - findable(,) + findable(, ) This function returns 1 if can locate , or 0, if it cannot. If one of the objects does not exist, it will return @@ -1255,7 +1268,7 @@ See also: rest(), last() & FIRSTOF() - firstof(, [, ... ,]) + firstof(, [, ... , ]) Returns the first evaluated expression that is true. If no arguments are true, then the last argument, , is returned as the default @@ -1302,7 +1315,7 @@ attached to the object or the attribute on the object. Given no arguments, this function returns a space-separated list - of all flag names know to the server. + of all flag names known to the server. See also: flags() & FLIP() @@ -1319,7 +1332,7 @@ See also: ceil(), bound(), round(), trunc() & FMOD() - fmod(,) + fmod(, ) Identical to mod() but may take floating point arguments. The return value is the (possibly floating point) smallest positive remainder @@ -1330,7 +1343,7 @@ > think fmod(6.1,2.5) 1.1 & FOLD() - fold([/], [, ][,]) + fold([/], [, [,]]) This function "folds" a list through a user-defined function, specified by the first argument to fold(), which is analogous to ufun()'s first @@ -1364,16 +1377,6 @@ You say, "15" See also: anonymous attributes -& FOLDERSTATS() - folderstats() - folderstats(folder#) - folderstats(player) - folderstats(player,folder#) - - FOLDERSTATS() returns the number of read, unread, and cleared messages - in a specific folder, or, if none is given, the player's current - folder. Only Wizards may use forms which get other players' mail - information. & FOLLOWERS() followers() @@ -1385,7 +1388,7 @@ Returns the list of things and players that the object is following. You must control object. & FOREACH() - foreach([/],[,[,]]) + foreach([/], [, [, ]]) Maps a function onto a string. @@ -1416,13 +1419,6 @@ Continued in HELP FOREACH2 See also: anonymous attributes -& ACCNAME() - accname() - - accname() returns the name of object , applying the object's - @nameaccent, if any. - - Related functions: NAME(), FULLNAME(), INAME() & FRACTION() fraction() @@ -1463,9 +1459,9 @@ Continued in HELP FOREACH2 & GRAB() & REGRAB() & REGRABI() - grab(, [, ]) - regrab(, [, ]) - regrabi(, [, ]) + grab(, [,]) + regrab(, [,]) + regrabi(, [,]) This function returns the first word in list which matches the pattern. For grab(), the pattern is specified as in match(); i.e., it @@ -1481,9 +1477,9 @@ Continued in HELP FOREACH2 & GRABALL() & REGRABALL() & REGRABALLI() - graball(,[,][,,[,][,,[,][,, [,[, ]]) + regraball(, [,[, ]]) + regraballi(, [,[, ]]) These functions work identically to the grab() and regrab()/regrabi() functions, save that they return all matches, not just the first: They @@ -1506,12 +1502,12 @@ Continued in HELP FOREACH2 & GREPI() & REGREPI() & WILDGREPI() - grep(,,) - wildgrep(,,) - regrep(,,) - grepi(,,) - regrepi(,,) - wildgrepi(,,) + grep(, , ) + wildgrep(, , ) + regrep(, , ) + grepi(, , ) + regrepi(, , ) + wildgrepi(, , ) These functions return a list of attributes on containing , matching the wildcard , or matching the regular @@ -1519,17 +1515,17 @@ Continued in HELP FOREACH2 names to search. Parsing _does_ occur before this function is invoked. Therefore, - "special" characters will need to be escaped out. + "special" characters will need to be escaped out. - grep()/wildgrep()/regrep() are case-sensitive. + grep()/wildgrep()/regrep() are case-sensitive. grepi()/wildgrepi()/regrepi() are case-insensitive. & GT() - gt(,) + gt(, ) Takes two numbers, and returns 1 if and only if the first is greater than the second, and 0 otherwise. & GTE() - gte(,) + gte(, ) Takes two numbers, and returns 1 if and only if the first is greater than or equal to the second, and 0 otherwise. @@ -1606,7 +1602,7 @@ Continued in HELP FOREACH2 is called with a descriptor argument. The caller can use the function on himself, but using on any other - player requires privileged power such as Wizard, Royalty or SEE_ALL. + player requires special powers. See also: Connection Functions, ipaddr(), ports(), lports() & IDLE() @@ -1617,7 +1613,7 @@ Continued in HELP FOREACH2 This function returns the number of seconds a player has been idle, much as WHO does. must be the full name of a player, or a player's dbref. Players who are not connected have an idlesecs of "-1", - as do dark directors, when idle() is used on them by a non-priv'ed player. + as do dark wizards, when idle() is used on them by a non-priv'ed player. & IF() & IFELSE() @@ -1660,11 +1656,11 @@ Continued in HELP FOREACH2 floating point numbers with inc() and expect it to work like add(). See also: dec() & INDEX() - index(,,,) + index(,, , ) - This function is similar to EXTRACT(), except that it requires a - separator argument, while EXTRACT() uses a space if a separator - isn't given. The function returns items starting from + This function is similar to EXTRACT(), except that it requires four + arguments, while EXTRACT() uses defaults for its arguments if they + aren't given. The function returns items starting from the position. Trailing spaces are trimmed. The comma cannot be used as the separator unless it's escaped with a \. @@ -1680,7 +1676,7 @@ Continued in HELP FOREACH2 See also: extract(), elements(), grab() & INSERT() - insert(,,[,]) + insert(, , [,]) If is a positive integer, this inserts BEFORE the item at from the left in . @@ -1757,8 +1753,8 @@ Continued in HELP FOREACH2 & ITEMIZE() & ELIST() - itemize([,[,[,]]]) - elist([, [, [, [,]]]]) + itemize([,[, [, ]]]) + elist([, [,[, [, ]]]]) These functions take the elements of (separated by or a space by default), and: @@ -1776,8 +1772,8 @@ Continued in HELP FOREACH2 You say, "eggs; bacon; & spam" & ITER() & PARSE() - iter(,[, [,]]) - parse(,[, [,]]) + iter(, [,[, ]]) + parse(, [,[, ]]) This works in a manner very similar to @map, except that it returns a string directly. is a space-separated list of words, and @@ -1829,16 +1825,19 @@ Continued in HELP ITER2 & ILEV() & ITEXT() & INUM() +& %i ilev() itext() + %i inum() These functions, when called within an iter(), return the equivalent of ## (itext) or #@ (inum), with reference to the nth more outermost iter(), where n=0 refers to the current iter(), n=1 to an iter() - in which the current iter() is nested, etc. ilev() will return the - current nesting depth, or -1 if it is outside an iter(). Thus, - itext(ilev()) will return the ## of the outermost iter(). + in which the current iter() is nested, etc. %iX is shorthand for itext(X) + (up to itext(9). ilev() returns the current nesting depth, or -1 + if it is outside an iter(). Thus, itext(ilev()) will return the ## + of the outermost iter(). > say [iter(red blue green,iter(fish shoe, #@:##))] You say, "1:red 1:red 2:blue 2:blue 3:green 3:green" @@ -1849,7 +1848,7 @@ Continued in HELP ITER2 > say [iter(red blue green,iter(fish shoe, [inum(0)]:[itext(0)]))] You say, "1:fish 2:shoe 1:fish 2:shoe 1:fish 2:shoe" - > say [iter(red blue green,iter(fish shoe, [itext(1)]:[itext(0)]))] + > say [iter(red blue green,iter(fish shoe, %i1:%i0))] You say, "red:fish red:shoe blue:fish blue:shoe green:fish green:shoe" & IPADDR() ipaddr() @@ -1860,7 +1859,7 @@ Continued in HELP ITER2 is called with a descriptor argument. The caller can use the function on himself, but using on any other - player requires privileged power such as Wizard, Royalty or SEE_ALL. + player requires special powers. See also: Connection Functions, hostname(), ports(), lports() & LAST() @@ -1870,29 +1869,37 @@ Continued in HELP ITER2 See also: first(), rest() & LATTR() +& LATTRP() lattr([/]) + lattrp([/]) - Returns a space-separated list of the attribute names on the object. - You must either be a Wizard or Royalty, own the object, have the - See_All power, or have the object set VISUAL in order to use this - function on the object. + Returns a space-separated list of the attribute names on the object + that you are permitted to examine. To see the complete list, own the + object, have the See_All power over the object, or have the object set + VISUAL in order to use this function on the object. If a wildcarded attribute pattern is provided, only attribute names matching that pattern will be returned. lattr() uses the same wildcards as examine (?, *, **). + lattrp() also includes attributes inherited from parents. + See also: nattr(), examine & NATTR() +& NATTRP() & ATTRCNT() - nattr() - attrcnt() +& ATTRPCNT() + nattr([/]) + nattrp([/]) + attrcnt([/]) + attrpcnt([/]) This function (known by two names) returns the number of attributes - on the object. You must have permission to examine the object - in order to use this function, but its count may include attributes - that are not visible to you. This function is considerably faster - than words(lattr()) and doesn't suffer from buffer length constraints. - It's designed primarily for statistical purposes. + on the object that you are permitted to examine. This function is + considerably faster than words(lattr()) and doesn't suffer from buffer + length constraints. It's designed primarily for statistical purposes. + + nattrp() and attrpcnt() also count matching attributes on the parent. See also: lattr() & LCON() @@ -1912,8 +1919,10 @@ Continued in HELP ITER2 Returns with all letters converted to lowercase. Example: lcstr(Foo BAR bAz) returns "foo bar baz" + + See also: capstr(), ucstr() & LDELETE() - Ldelete(,[,]) + Ldelete(, [,]) This deletes the item at in the list. If a separator character is not given, a space is assumed. Null items are @@ -1929,13 +1938,14 @@ Continued in HELP ITER2 Returns the first characters from string. +& NSLEMIT() & LEMIT() lemit() nslemit() Sends a message to the outermost room, as per @lemit. - nslemit() is a privileged variation that works like @nslemit. + nslemit() is a wizard-only variation that works like @nslemit. & LEXITS() lexits() @@ -1950,7 +1960,7 @@ Continued in HELP ITER2 See also: lcon(), exit(), next(), lvexits() & LJUST() - ljust(,[,]) + ljust(, [,]) This function pads a string with trailing characters ("left-justifies") so it is long. If is longer than , the @@ -1968,18 +1978,14 @@ Continued in HELP ITER2 01234567" & LINK() - link(, [, ]) + link(, [, ]) This function links object to . While normally used on exits, it has all of the other capabilities of @link as well. - It returns nothing. - - An optional boolean supplied third argument may given indicating - behavior similar to @link/preserve. + It returns nothing. If the optional third argument is true, acts like + @link/preserve. This is a side-effect function and may not be enabled on some MUSHes. - - See Also: @link & LIST() list(