Changeset 1289
- Timestamp:
- 09/24/08 01:15:45 (2 months ago)
- Files:
-
- 1.8.3/trunk/game/txt/hlp/pennfunc.hlp (modified) (249 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
1.8.3/trunk/game/txt/hlp/pennfunc.hlp
r1288 r1289 343 343 after(<string1>, <string2>) 344 344 345 Returns the portion of <string1> that occurs after <string2>. 346 If<string2> isn't in <string1>, the function returns a null string.345 Returns the portion of <string1> that occurs after <string2>. If 346 <string2> isn't in <string1>, the function returns a null string. 347 347 This is case-sensitive. 348 348 … … 361 361 for easy creation of book pages, newsletters, or the like. 362 362 363 <widths> is a space-separated list of column widths. '10 10 10' for the 364 widths argument specifies that there are 3 columns, each 10 spaces wide. 365 < before a number causes the field to be left-aligned (the default). A 366 '-' causes it to be centered, and '>' makes it right-aligned. 367 A '.' after the number implies the column is to be repeated for as long 368 as there is text remaining in a non-repeating column. A ` (left tick) 369 after the number implies that if the column runs out of text, it should 370 merge with the next leftmost column (making that column flow around). 371 A ' (right tick) after the number implies that if the column runs out 372 of text, it should merge with the next rightmost column. 363 <widths> is a space-separated list of column widths. '10 10 10' for 364 the widths argument specifies that there are 3 columns, each 10 365 spaces wide. < before a number causes the field to be left-aligned 366 (the default). A '-' causes it to be centered, and '>' makes it 367 right-aligned. A '.' after the number implies the column is to be 368 repeated for as long as there is text remaining in a non-repeating 369 column. A ` (left tick) after the number implies that if the column 370 runs out of text, it should merge with the next leftmost column 371 (making that column flow around). A ' (right tick) after the number 372 implies that if the column runs out of text, it should merge with 373 the next rightmost column. 373 374 374 375 <filler> is a single character that, if given, is the character used 375 376 to fill empty columns and remaining spaces. <colsep>, if given, is 376 377 inserted between every column, on every row. <rowsep>, if given, is 377 inserted between every line. By default, <filler> and <colsep> are 378 aspace, and <rowsep> is a newline.378 inserted between every line. By default, <filler> and <colsep> are a 379 space, and <rowsep> is a newline. 379 380 380 381 Continued in HELP ALIGN2 … … 403 404 allof(<expr1>[, ... , <exprN>],<osep>) 404 405 405 Evaluates every expression argument (including side-effects) and returns406 the results of those which are true, in a list separated by osep. The407 o utput separator argument is required and must be a single character,408 or can be left empty, in which case a space will be used to separate the409 results by default.406 Evaluates every expression argument (including side-effects) and 407 returns the results of those which are true, in a list separated by 408 osep. The output separator argument is required and must be a 409 single character, or can be left empty, in which case a space will 410 be used to separate the results by default. 410 411 411 412 The meaning of true or false depends on configuration options as … … 424 425 425 426 Takes any number of arguments, and returns the word which is 426 lexicographically biggest. I.e., which word would be last in 427 lexicographically biggest. I.e., which word would be last in 427 428 alphabetical order. 428 429 … … 439 440 cand(<boolean value 1>, <boolean value 2>[, ... , <boolean value N>]) 440 441 441 Takes boolean values, and returns 1 if all of them are equivalent 442 t o true(1). and() always evaluates all arguments (including side442 Takes boolean values, and returns 1 if all of them are equivalent to 443 true(1). and() always evaluates all arguments (including side 443 444 effects), while cand() stops evaluation after the first argument 444 445 that evaluates to false. … … 454 455 455 456 Thus, ANDFLAGS(me,WD) would return 1 if I was set WIZARD and DARK. 456 ANDFLAGS(me,W!Dc) would return 1 if I was set WIZARD, not DARK, 457 andCONNECTED.458 459 If a letter does not correspond to any flag, <object> doesn't have it,460 so the function returns 0. There can be an arbitrary number of flags. Do461 not put spaces between flag letters.457 ANDFLAGS(me,W!Dc) would return 1 if I was set WIZARD, not DARK, and 458 CONNECTED. 459 460 If a letter does not correspond to any flag, <object> doesn't have 461 it, so the function returns 0. There can be an arbitrary number of 462 flags. Do not put spaces between flag letters. 462 463 & ANDLFLAGS() 463 464 andlflags(<object>, <list of flags>) … … 472 473 473 474 If a name does not correspond to any flag, <object> doesn't have it, 474 so the function returns 0. There can be an arbitrary number of flags. 475 so the function returns 0. There can be an arbitrary number of 476 flags. 475 477 & ANDLPOWERS() 476 478 andlpowers(<object>, <list of powers>) … … 518 520 aposs(<object>) 519 521 520 Returns the absolute possessive pronoun - his/hers/its/theirs - 521 foran object. The %a substitution returns the absolute possessive522 Returns the absolute possessive pronoun - his/hers/its/theirs - for 523 an object. The %a substitution returns the absolute possessive 522 524 pronoun of the enactor. 523 525 & ART() 524 526 art(<string>) 525 527 526 This function returns the proper article, "a" or "an", based on whether527 or not <string> begins with a vowel.528 This function returns the proper article, "a" or "an", based on 529 whether or not <string> begins with a vowel. 528 530 & ASIN() 529 531 asin(<sine>[,<angle type>]) … … 576 578 band(<integer1>, <integer2>[, ... , <integerN>]) 577 579 578 Does a bitwise AND of all its arguments, returning the result 579 (Anumber with only the bits set in every argument set in it).580 Does a bitwise AND of all its arguments, returning the result (A 581 number with only the bits set in every argument set in it). 580 582 & BASECONV() 581 583 baseconv(<number>, <from base>, <to base>) … … 592 594 beep([<number>]) 593 595 594 Sends <number> "alert" bell characters. <number> must be in the range595 1 to 5, or, if unspecified, defaults to 1.596 This function may only be used by royalty and wizards.596 Sends <number> "alert" bell characters. <number> must be in the 597 range 1 to 5, or, if unspecified, defaults to 1. This function may 598 only be used by royalty and wizards. 597 599 598 600 & BEFORE() 599 601 before(<string1>, <string2>) 600 602 601 Returns the portion of <string1> that occurs before <string2>. 602 If <string2> isn't in <string1>, <string1> is returned.603 This iscase-sensitive.603 Returns the portion of <string1> that occurs before <string2>. If 604 <string2> isn't in <string1>, <string1> is returned. This is 605 case-sensitive. 604 606 605 607 Examples: … … 613 615 brackets([<string>]) 614 616 615 Returns a count of the number of left and right square brackets, 617 Returns a count of the number of left and right square brackets, 616 618 parentheses, and curly braces in the string, in that order, as a 617 space-separated list of numbers. This is useful for finding missing 618 or extra brackets in MUSH code. 619 space-separated list of numbers. This is useful for finding missing 620 or extra brackets in MUSH code. 619 621 620 622 Example: … … 640 642 bound(<number>, <lower bound>, <higher bound>) 641 643 642 bound() returns <number> if it is between <lower bound> and 643 <higher bound>. If it's lower than the lower bound, the lower644 bound is returned. If it's higher than the higher bound,645 the higher bound isreturned.644 bound() returns <number> if it is between <lower bound> and <higher 645 bound>. If it's lower than the lower bound, the lower bound is 646 returned. If it's higher than the higher bound, the higher bound is 647 returned. 646 648 647 649 See also: ceil(), floor(), round(), trunc() … … 655 657 656 658 Returns <string> with the first character capitalized. 659 657 660 Example: capstr(foo bar baz) returns "Foo bar baz" 658 661 … … 661 664 cat(<string1>[, ... , <stringN>]) 662 665 663 cat() concatenates strings, separating each string by a space. 664 So"[cat(one, two)]" will return 'one two'.666 cat() concatenates strings, separating each string by a space. So 667 "[cat(one, two)]" will return 'one two'. 665 668 666 669 See also: strcat() … … 674 677 center(<string>, <width>[, <fill>[, <rightfill>]]) 675 678 676 This function will center <string> within a field <width> characters wide,677 using the <fill> string for padding on the left side of the string,678 and <rightfill> for padding on the right side. <rightfill> defaults679 to the mirror-image of <fill> if not specified. <fill> defaults to680 a space if neither <fill> nor <rightfill> are specified.681 682 If <string> divides <width> into uneven portions, the left side 683 willbe one character shorter than the right side.679 This function will center <string> within a field <width> characters 680 wide, using the <fill> string for padding on the left side of the 681 string, and <rightfill> for padding on the right side. <rightfill> 682 defaults to the mirror-image of <fill> if not specified. <fill> 683 defaults to a space if neither <fill> nor <rightfill> are specified. 684 685 If <string> divides <width> into uneven portions, the left side will 686 be one character shorter than the right side. 684 687 685 688 Examples: … … 697 700 checkpass(<player>, <string>) 698 701 699 Returns 1 if <string> matches the player's password otherwise 0. 700 If<player> has no password, this function will always return 1.702 Returns 1 if <string> matches the player's password otherwise 0. If 703 <player> has no password, this function will always return 1. 701 704 <player> should be specified as a dbref or *<name>. 702 705 … … 708 711 ord(<character>) 709 712 710 ord() returns the numerical value of the given character. 711 chr()returns the character with the given numerical value.713 ord() returns the numerical value of the given character. chr() 714 returns the character with the given numerical value. 712 715 713 716 Examples: … … 719 722 clone(<object>) 720 723 721 This function clones <object>, and returns the dbref number of the clone. 724 This function clones <object>, and returns the dbref number of the 725 clone. 722 726 723 727 This is a side-effect function and may not be enabled on some MUSHes. … … 726 730 727 731 Returns the number of commands issued by a player during this 728 connection as indicated by WHO. 732 connection as indicated by WHO. 729 733 730 734 The caller can use the function on himself, but using on any other … … 736 740 737 741 Returns the number of characters sent by a player during this 738 connection as indicated by SESSION. 742 connection as indicated by SESSION. 739 743 740 744 The caller can use the function on himself, but using on any other … … 746 750 747 751 Returns the number of characters received by a player during this 748 connection as indicated by SESSION. 752 connection as indicated by SESSION. 749 753 750 754 The caller can use the function on himself, but using on any other … … 756 760 757 761 Comp compares two values. It returns 0 if they are the same, -1 if 758 value1 is less than/precedes alphabetically value2, and 1 759 otherwise. 762 value1 is less than/precedes alphabetically value2, and 1 otherwise. 760 763 761 764 By default the comparison is a case-sensitive lexicographic (string) 762 comparison. By giving the optional <type>, the comparison can 763 be specified: 765 comparison. By giving the optional <type>, the comparison can be 766 specified: 767 764 768 <type> Comparison 765 769 A Maybe case-sensitive lexicographic (default) … … 769 773 F Floating point numbers 770 774 771 Whether or not the a sort type is case-sensitive or not depends 772 onthe particular mush and its environment.775 Whether or not the a sort type is case-sensitive or not depends on 776 the particular mush and its environment. 773 777 & CON() 774 778 con(<object>) … … 792 796 ncondall(<cond1>, <expr1>, [<condN>, <exprN>], ...[<default>]) 793 797 794 cond() evaluates <cond>s until one returns a boolean true value. Should 795 none return true, <default> is returned. 796 797 condall() returns all <expr>s for those <cond>s that evaluate to true. 798 799 ncond() and ncondall() are identical to cond(), except it returns <expr>s 800 for which <cond>s evaluate to false. 798 cond() evaluates <cond>s until one returns a boolean true 799 value. Should none return true, <default> is returned. 800 801 condall() returns all <expr>s for those <cond>s that evaluate to 802 true. 803 804 ncond() and ncondall() are identical to cond(), except it returns 805 <expr>s for which <cond>s evaluate to false. 801 806 802 807 Examples: … … 813 818 config(<option>) 814 819 815 With no arguments, this function returns a list of config option names.816 Given a config option name, this function returns its value.820 With no arguments, this function returns a list of config option 821 names. Given a config option name, this function returns its value. 817 822 Boolean configuration options will return values of "Yes" or "No". 818 823 … … 822 827 conn(<player|descriptor>) 823 828 824 This function returns the number of seconds a player has been connected. 825 <player name> must be the full name of a player, or a player's dbref. 826 Players who are not connected have a conn value of "-1", as do dark 827 wizards, when conn() is used on them by a non-priv'ed player. 829 This function returns the number of seconds a player has been 830 connected. <player name> must be the full name of a player, or a 831 player's dbref. Players who are not connected have a conn value of 832 "-1", as do dark wizards, when conn() is used on them by a 833 non-priv'ed player. 828 834 829 835 See also: CONNECTED … … 832 838 833 839 With no <attribute>, this function returns 1 if <object> controls 834 <victim>, or 0, if it does not. With an <attribute>, it will return 1 835 if <object> could successfully set <attribute> on <victim> (or alter 836 <attribute>, if it already exists). If one of the objects does not exist, 837 it will return #-1 ARGN NOT FOUND (where N is the argument which is the 838 invalid object). If <attribute> is not a valid attribute name, it will 839 return #-1 BAD ATTR NAME. You must control <object> or <victim>, or have 840 the See_All power, to use this function. 840 <victim>, or 0, if it does not. With an <attribute>, it will return 841 1 if <object> could successfully set <attribute> on <victim> (or 842 alter <attribute>, if it already exists). If one of the objects does 843 not exist, it will return #-1 ARGN NOT FOUND (where N is the 844 argument which is the invalid object). If <attribute> is not a valid 845 attribute name, it will return #-1 BAD ATTR NAME. You must control 846 <object> or <victim>, or have the See_All power, to use this 847 function. 841 848 842 849 See also: CONTROL … … 849 856 This function converts seconds to a time string, based on how many 850 857 seconds the number is after Jan 1, 1970 UTC. Because it's based on 851 UTC, but returns local time, convsecs(0) is not going to be 852 "Thu Jan1 00:00:00 1970" unless you're in the UTC (GMT) timezone.858 UTC, but returns local time, convsecs(0) is not going to be "Thu Jan 859 1 00:00:00 1970" unless you're in the UTC (GMT) timezone. 853 860 854 861 convutcsecs() and convsecs() with a second argument of 'utc' return … … 867 874 convtime(<time string>) 868 875 869 This functions converts a time string (in the local time zone) to the870 number of seconds since Jan 1, 1970 GMT. A time string is of the876 This functions converts a time string (in the local time zone) to 877 the number of seconds since Jan 1, 1970 GMT. A time string is of the 871 878 format: Ddd MMM DD HH:MM:SS YYYY where Ddd is the day of the week, 872 879 MMM is the month, DD is the day of the month, HH is the hour in … … 876 883 877 884 If the extended convtime() is supported (See @config compile), more 878 formats for the date are enabled, including ones missing the day 879 ofweek and year, and a 'Month Day Year' format.885 formats for the date are enabled, including ones missing the day of 886 week and year, and a 'Month Day Year' format. 880 887 881 888 Example: … … 890 897 891 898 Returns the cosine of <angle>. Angle must be in the given angle 892 type, or radians by default. 899 type, or radians by default. 893 900 894 901 Examples: … … 908 915 create(<object>, <cost>) 909 916 910 This function creates an object with name <object> for <cost> pennies, 911 and returns the dbref number of the created object. 912 913 This is a side-effect function and may not be enabled on some MUSHes. 917 This function creates an object with name <object> for <cost> 918 pennies, and returns the dbref number of the created object. 919 920 This is a side-effect function and may not be enabled on some 921 MUSHes. 914 922 & CTIME() 915 923 & CSECS() … … 917 925 csecs(<objecct>) 918 926 919 If creation times are enabled, this function will return the 920 date and time that the object was created. If the optional <utc>921 argument is true, the time is returned for the UTC time zone, if922 false orpresent, for the local time zone.927 If creation times are enabled, this function will return the date 928 and time that the object was created. If the optional <utc> argument 929 is true, the time is returned for the UTC time zone, if false or 930 present, for the local time zone. 923 931 924 932 csecs() returns the time as the number of seconds since the epoch. … … 930 938 ctu(<angle>,<from>,<to>) 931 939 932 Converts between the different ways to measure angles. 933 <from> controls what the angle is treated as, and <to> what form934 it is turned into. They can be 'd' for degrees, or 'r' for radians.935 Thereis also a third way to measure angle, 'g' for gradians, but it's not940 Converts between the different ways to measure angles. <from> 941 controls what the angle is treated as, and <to> what form it is 942 turned into. They can be 'd' for degrees, or 'r' for radians. There 943 is also a third way to measure angle, 'g' for gradians, but it's not 936 944 used often and is only included for completeness. 937 945 … … 945 953 dec(<string-ending-in-integer>) 946 954 947 Dec returns the integer minus 1. If given a string that ends in an integer,948 i t decrements only the final integer portion. That is:955 Dec returns the integer minus 1. If given a string that ends in an 956 integer, it decrements only the final integer portion. That is: 949 957 950 958 > think dec(3) … … 964 972 decompose(<string>) 965 973 966 decompose() works like escape() with the additional caveat that it inserts967 parse-able characters to recreate <string> exactly after one parsing. It968 takes care of multiple spaces, '%r's, and '%t's.974 decompose() works like escape() with the additional caveat that it 975 inserts parse-able characters to recreate <string> exactly after one 976 parsing. It takes care of multiple spaces, '%r's, and '%t's. 969 977 970 978 See also: @decompile2, escape(), secure() … … 994 1002 is readable by you. Otherwise, it evaluates the default case, and 995 1003 returns that. Note that the default case is only evaluated if the 996 attribute does not exist or cannot be read. Note further than an empty 997 attribute counts as an existing attribute. 998 999 This is useful for code that needs to return the value of an attribute, 1000 or an error message or default case, if that attribute does not exist. 1004 attribute does not exist or cannot be read. Note further than an 1005 empty attribute counts as an existing attribute. 1006 1007 This is useful for code that needs to return the value of an 1008 attribute, or an error message or default case, if that attribute 1009 does not exist. 1001 1010 1002 1011 Examples: … … 1014 1023 1015 1024 Return a modified <string>, with <len> characters starting after the 1016 character at position <first> deleted. In other words, it copies <first>1017 characters, skips <len> characters>, and then copies the remainder of1018 the string. If <len> is negative, deletes characters leftwards from <first>.1019 Characters are numbered starting at 0.1025 character at position <first> deleted. In other words, it copies 1026 <first> characters, skips <len> characters>, and then copies the 1027 remainder of the string. If <len> is negative, deletes characters 1028 leftwards from <first>. Characters are numbered starting at 0. 1020 1029 1021 1030 Examples: … … 1032 1041 number of sides, a certain number of times, and sums the results. 1033 1042 For example, DIE(2, 6) would roll "2d6" - two six-sided dice, 1034 generating a result in the range 2-12. The maximum number of 1035 dice this function will roll in a single call is 20. 1036 If a third argument is given and it's a true value, the result will 1037 be a space-seperated list of the individual rolls rather than their 1038 sum. 1043 generating a result in the range 2-12. The maximum number of dice 1044 this function will roll in a single call is 20. If a third argument 1045 is given and it's a true value, the result will be a space-seperated 1046 list of the individual rolls rather than their sum. 1039 1047 1040 1048 Examples: … … 1046 1054 dig(<name>[, <exit to>[, <exit from>]]) 1047 1055 1048 This function digs a room called <name>, and optionally opens and links1049 <exit to> and <exit from>, like the normal @dig command. It returns1050 the dbref number of the new room.1056 This function digs a room called <name>, and optionally opens and 1057 links <exit to> and <exit from>, like the normal @dig command. It 1058 returns the dbref number of the new room. 1051 1059 1052 1060 This is a side-effect function and may not be enabled on some MUSHes. … … 1060 1068 md2 md4 md5 sha sha1 dss1 mdc2 ripemd160 1061 1069 1062 Without SSL, only the sha algorithm is enabled. In both cases, sha returns1063 the same thing as the sha0() function.1070 Without SSL, only the sha algorithm is enabled. In both cases, sha 1071 returns the same thing as the sha0() function. 1064 1072 1065 1073 See also: sha0() … … 1082 1090 divided by the second number. Floordiv returns the largest integer 1083 1091 less than or equal to the quotient of the first number divided by 1084 the second. For positive numbers, these are the same thing, but 1085 fornegative numbers they may be different:1092 the second. For positive numbers, these are the same thing, but for 1093 negative numbers they may be different: 1086 1094 1087 1095 div(13,4) ==> 3 and floordiv(13,4) ==> 3 … … 1151 1159 1152 1160 This returns the position of <item> in <list>, where <list>'s items 1153 are separated by <separator>. A wildcard match is done, so this 1154 function behaves much like MATCH(), except its separator argument 1155 isrequired, not optional.1161 are separated by <separator>. A wildcard match is done, so this 1162 function behaves much like MATCH(), except its separator argument is 1163 required, not optional. 1156 1164 1157 1165 Example: … … 1164 1172 1165 1173 This function returns the words in <list of words> that are in the 1166 positions specified by <list of numbers>. Optionally, a list delimiter1167 other than a space can be used.1174 positions specified by <list of numbers>. Optionally, a list 1175 delimiter other than a space can be used. 1168 1176 1169 1177 Examples: … … 1210 1218 1211 1219 Returns an encrypted string produced by a simple password-based 1212 encrypted algorithm. Good passwords are long passwords. 1213 This is nothigh-security encryption.1214 1215 If the optional <encode> argument is true, the resulting string 1216 isfurther encoded in base 64 so that it only contains alphanumeric1220 encrypted algorithm. Good passwords are long passwords. This is not 1221 high-security encryption. 1222 1223 If the optional <encode> argument is true, the resulting string is 1224 further encoded in base 64 so that it only contains alphanumeric 1217 1225 characters. 1218 1226 … … 1223 1231 With no arguments, the entrances() function returns a list of all 1224 1232 exits, things, players, and rooms linked to your location, like 1225 @entrances. You can specify an object other than your current location 1226 with <object>. You can limit the type of objects found by specifying 1227 <type> as follows: 1233 @entrances. You can specify an object other than your current 1234 location with <object>. You can limit the type of objects found by 1235 specifying <type> as follows: 1236 1228 1237 a all (default) 1229 1238 e exits … … 1231 1240 p players 1232 1241 r rooms 1233 You can also limit the range of the dbrefs searched by giving <begin> 1234 and <end>. 1242 1243 You can also limit the range of the dbrefs searched by giving 1244 <begin> and <end>. 1235 1245 & EQ() 1236 1246 eq(<number1>, <number2>) … … 1242 1252 escape(<string>) 1243 1253 1244 The ESCAPE() function "escapes out" potentially "dangerous" characters, 1245 preventing function evaluation in the next pass of the parser. It 1246 returns <string> after adding the escape character ('\') at the 1247 beginning of the string, and before the following characters: 1254 The ESCAPE() function "escapes out" potentially "dangerous" 1255 characters, preventing function evaluation in the next pass of the 1256 parser. It returns <string> after adding the escape character ('\') 1257 at the beginning of the string, and before the following characters: 1258 1248 1259 % ; [ ] { } \ ( ) , ^ $ 1249 1260 1250 This function prevents strings entered by players from causing side 1261 This function prevents strings entered by players from causing side 1251 1262 effects, such as performing an unintended GET() of an attribute. It 1252 is only needed when the resulting string will be passed through @force 1253 or used as an attribute for an object (like the description of a mail 1254 message object). Since the function preserves the original string, 1255 it is, in most cases, a better choice than SECURE(). 1263 is only needed when the resulting string will be passed through 1264 @force or used as an attribute for an object (like the description 1265 of a mail message object). Since the function preserves the 1266 original string, it is, in most cases, a better choice than 1267 SECURE(). 1256 1268 1257 1269 See also: decompose(), secure() … … 1276 1288 > -Shalott 1277 1289 1278 Get_eval() does the same thing, except it uses the format of get() instead 1279 of xget() -- using a slash rather than a comma to separate the object from 1280 the attribute. It is included for TinyMUSH 2.x compatibility. 1290 Get_eval() does the same thing, except it uses the format of get() 1291 instead of xget() -- using a slash rather than a comma to separate 1292 the object from the attribute. It is included for TinyMUSH 2.x 1293 compatibility. 1281 1294 1282 1295 See also: get(), u(), xget() … … 1287 1300 1288 1301 You can get the complete exit list of any room you may examine, 1289 regardless of whether or not exits are dark. You can get the partial1290 exit list (obeying DARK/LIGHT/etc.) of your current location or the1291 enactor (%#). You CANNOT get the exit list of anything else,1302 regardless of whether or not exits are dark. You can get the 1303 partial exit list (obeying DARK/LIGHT/etc.) of your current location 1304 or the enactor (%#). You CANNOT get the exit list of anything else, 1292 1305 regardless of whether or not you have objects in it. 1293 1306 … … 1300 1313 extract(<list>[, <first>[, <length>[,<delimiter>]]]) 1301 1314 1302 This function returns <length> elements of a list, counting 1303 from the <first> element. If <length> is not specified, the1304 default is 1, so extract(list,3) acts like elements(list,3).1305 If <first> is not specified, the default is the 1, so1306 extract(list) acts likefirst(list).1315 This function returns <length> elements of a list, counting from the 1316 <first> element. If <length> is not specified, the default is 1, so 1317 extract(list,3) acts like elements(list,3). If <first> is not 1318 specified, the default is the 1, so extract(list) acts like 1319 first(list). 1307 1320 1308 1321 For example: … … 1314 1327 fdiv(<numerator>, <denominator>) 1315 1328 1316 Returns the quotient of the two numbers. Note that the DIV() and MOD()1317 functions cannot be used on floating point numbers.1329 Returns the quotient of the two numbers. Note that the DIV() and 1330 MOD() functions cannot be used on floating point numbers. 1318 1331 1319 1332 See also: div() … … 1323 1336 filterbool([<obj>]/<attr>, <list>[,<delimiter>[, <osep>]]) 1324 1337 1325 This function returns the elements of <list> for which a user-defined1326 function evaluates to "1", or to a boolean true value if filterbool()1327 i s used. That function is specified by the first argument (just as1328 with the ufun() function), and the element of the list being tested is1329 passed to that user-defined function as %0.1330 1331 Thus, "filter(obj/attr, x1 x2 x3)" is nearly equivalent to 1332 "iter(x1 x2 x3, switch(ufun(obj/attr, ##),1,##,))"1333 though the iter versionmay have extra blank spaces.1338 This function returns the elements of <list> for which a 1339 user-defined function evaluates to "1", or to a boolean true value 1340 if filterbool() is used. That function is specified by the first 1341 argument (just as with the ufun() function), and the element of the 1342 list being tested is passed to that user-defined function as %0. 1343 1344 Thus, "filter(obj/attr, x1 x2 x3)" is nearly equivalent to "iter(x1 1345 x2 x3, switch(ufun(obj/attr, ##),1,##,))" though the iter version 1346 may have extra blank spaces. 1334 1347 1335 1348 Example: … … 1343 1356 findable(<object>, <victim>) 1344 1357 1345 This function returns 1 if <object> can locate <victim>, or 0, if 1346 it cannot. If one of the objects does not exist, it will return1347 #-1ARGN NOT FOUND (where N is the argument which is the invalid1358 This function returns 1 if <object> can locate <victim>, or 0, if it 1359 cannot. If one of the objects does not exist, it will return #-1 1360 ARGN NOT FOUND (where N is the argument which is the invalid 1348 1361 object). 1349 1362 … … 1357 1370 firstof(<expr1>, <expr2>[, ... , <exprN>]) 1358 1371 1359 Returns the first evaluated expression that is true. If no arguments1360 ar e true, then the last argument, <exprN>, is returned as the default1361 expression, whether it is true or false.1372 Returns the first evaluated expression that is true. If no 1373 arguments are true, then the last argument, <exprN>, is returned as 1374 the default expression, whether it is true or false. 1362 1375 1363 1376 The meaning of true or false is dependent on configuration options … … 1383 1396 flags() 1384 1397 1385 Flags returns a string consisting of the flags attached to the 1398 Flags returns a string consisting of the flags attached to the 1386 1399 object or the attribute on the object. The string is a single word 1387 1400 made up of all the appropriate flag letters. 1388 1401 1389 Given no arguments, this function returns a string consisting of 1390 all the flag letters of all the flags the server knows. Note that1391 some flags may not have flag letters, and multiple flags may have1392 thesame letter (and will appear twice).1402 Given no arguments, this function returns a string consisting of all 1403 the flag letters of all the flags the server knows. Note that some 1404 flags may not have flag letters, and multiple flags may have the 1405 same letter (and will appear twice). 1393 1406 1394 1407 See also: lflags() … … 1398 1411 lflags() 1399 1412 1400 Lflags returns a space-separated list consisting of the names of flags1401 attached to the object or the attribute on the object.1402 1403 Given no arguments, this function returns a space-separated list 1404 ofall flag names known to the server.1413 Lflags returns a space-separated list consisting of the names of 1414 flags attached to the object or the attribute on the object. 1415 1416 Given no arguments, this function returns a space-separated list of 1417 all flag names known to the server. 1405 1418 1406 1419 See also: flags() … … 1435 1448 fold([<obj>/]<attr>, <list>[, <base case>[,<delimiter>]]) 1436 1449 1437 This function "folds" a list through a user-defined function, specified1438 by the first argument to fold(), which is analogous to ufun()'s first1439 argument.1440 1441 If no base case is provided, fold() passes the first element of <list>1442 as %0, and the second element of <list> as %1, to the user-defined1443 function. The user-defined function is then called again, with the1444 result of the first evaluation being %0, and the next (third) element1445 of the list as %1. This is repeated until all the elements of the1446 list have been used.1447 1448 If a base case is provided, it is passed as %0, and the first element1449 of list is passed as %1, to the user-defined function. The process for1450 the no-base-case fold() is then used.1450 This function "folds" a list through a user-defined function, 1451 specified by the first argument to fold(), which is analogous to 1452 ufun()'s first argument. 1453 1454 If no base case is provided, fold() passes the first element of 1455 <list> as %0, and the second element of <list> as %1, to the 1456 user-defined function. The user-defined function is then called 1457 again, with the result of the first evaluation being %0, and the 1458 next (third) element of the list as %1. This is repeated until all 1459 the elements of the list have been used. 1460 1461 If a base case is provided, it is passed as %0, and the first 1462 element of list is passed as %1, to the user-defined function. The 1463 process for the no-base-case fold() is then used. 1451 1464 1452 1465 See 'help FOLD2' for examples. … … 1482 1495 Maps a function onto a string. 1483 1496 1484 Each character in <string> has the user-defined function of the first1485 argument performed on it; the character is passed to the function as1486 %0, and its position in the string as %1 (the first character has1487 position 0). The results are concatenated. If a start character is given,1488 everything before that character is copied without passing it to the1489 function, and everything after it until the end of the string or an end1490 character is passed to the function. Anything left after the end character1491 is also copied unevaluated. The start and end characters themselves are1492 not copied.1497 Each character in <string> has the user-defined function of the 1498 first argument performed on it; the character is passed to the 1499 function as %0, and its position in the string as %1 (the first 1500 character has position 0). The results are concatenated. If a start 1501 character is given, everything before that character is copied 1502 without passing it to the function, and everything after it until 1503 the end of the string or an end character is passed to the 1504 function. Anything left after the end character is also copied 1505 unevaluated. The start and end characters themselves are not copied. 1493 1506 1494 1507 Continued in HELP FOREACH2 … … 1512 1525 fraction(<number>) 1513 1526 1514 This function returns a fraction representing the floating-point <number>.1515 Since not all numbers can be expressed as a fraction, dividing the1516 numerator by the denominator of the results will not always return the1517 original <number>, but something close to it.1527 This function returns a fraction representing the floating-point 1528 <number>. Since not all numbers can be expressed as a fraction, 1529 dividing the numerator by the denominator of the results will not 1530 always return the original <number>, but something close to it. 1518 1531 1519 1532 Examples: … … 1528 1541 1529 1542 Fullname() returns the name of object <object>. It is identical to 1530 name() except that for exits, fullname() returns the complete 1531 exitname, including all aliases.1543 name() except that for exits, fullname() returns the complete exit 1544 name, including all aliases. 1532 1545 1533 1546 >"[fullname(south)] … … 1544 1557 get(<object>/<attribute>) 1545 1558 1546 The get() function returns the string stored in an object's attribute.1547 You may get the attributes of objects you control, the attributes you1548 own on other objects, and publicly accessible attributes.1549 1559 The get() function returns the string stored in an object's 1560 attribute. You may get the attributes of objects you control, the 1561 attributes you own on other objects, and publicly accessible 1562 attributes. 1550 1563 & GRAB() 1551 1564 & REGRAB() … … 1555 1568 regrabi(<list>, <regexp>[,<delimiter>]) 1556 1569 1557 This function returns the first word in list which matches the pattern.1558 For grab(), the pattern is specified as in match(); i.e., it1559 can contain wildcards. For regrab(), the pattern is a regular expression.1560 regrabi() is case-insensitive.1561 1562 Basically, this is a much more efficient way to do: 1563 extract(list, match(list, pattern, delimiter), 1, delimiter) or1564 the regularexpression variation thereof.1570 This function returns the first word in list which matches the 1571 pattern. For grab(), the pattern is specified as in match(); i.e., 1572 it can contain wildcards. For regrab(), the pattern is a regular 1573 expression. regrabi() is case-insensitive. 1574 1575 Basically, this is a much more efficient way to do: extract(list, 1576 match(list, pattern, delimiter), 1, delimiter) or the regular 1577 expression variation thereof. 1565 1578 1566 1579 See also: match(), extract(), element(), elements(), index(), regmatch(), … … 1573 1586 regraballi(<list>, <regexp>[,<delim>[, <output separator>]]) 1574 1587 1575 These functions work identically to the grab() and regrab()/regrabi()1576 functions, save that they return all matches, not just the first: They1577 return all words in the <list> which match <pattern>.1578 If none match, an empty string is returned.1588 These functions work identically to the grab() and 1589 regrab()/regrabi() functions, save that they return all matches, not 1590 just the first: They return all words in the <list> which match 1591 <pattern>. If none match, an empty string is returned. 1579 1592 1580 1593 Examples: … … 1602 1615 1603 1616 These functions return a list of attributes on <object> containing 1604 <substring>, matching the wildcard <pattern>, or matching the regular1605 expression <regexp>. <attrs> is a wildcard pattern for attribute1606 names to search.1617 <substring>, matching the wildcard <pattern>, or matching the 1618 regular expression <regexp>. <attrs> is a wildcard pattern for 1619 attribute names to search. 1607 1620 1608 1621 Parsing _does_ occur before this function is invoked. Therefore, 1609 "special" characters will need to be escaped out. 1622 "special" characters will need to be escaped out. 1610 1623 1611 1624 grep()/wildgrep()/regrep() are case-sensitive. … … 1635 1648 is present and 0 if it is not. 1636 1649 1637 hasattr() returns 1 if the object has the attribute, 0 if it doesn't. 1650 hasattr() returns 1 if the object has the attribute, 0 if it 1651 doesn't. 1638 1652 1639 1653 hasattrp() also checks for attributes inherited from parent objects. … … 1643 1657 hasattrpval() is hasattrval() but checks parents. 1644 1658 1645 All four functions will also work with one argument in the form 1646 of<object>/<attribute>.1659 All four functions will also work with one argument in the form of 1660 <object>/<attribute>. 1647 1661 1648 1662 & HASFLAG() … … 1663 1677 HASTYPE() function. 1664 1678 1665 If an attribute is given, checks to see if the attribute has the 1666 given attribute flag. See 'help attribute flags' for attribute flag names. 1679 If an attribute is given, checks to see if the attribute has the 1680 given attribute flag. See 'help attribute flags' for attribute flag 1681 names. 1667 1682 1668 1683 See also: orlflags(), andlflags(), orflags(), andflags() … … 1671 1686 1672 1687 Returns 1 if the object has the named power, and 0 if it does not. 1673 If the object does not exist, #-1 will be returned. 1674 1675 You may or may not have to be able to examine the object to use this. 1688 If the object does not exist, #-1 will be returned. 1689 1690 You may or may not have to be able to examine the object to use 1691 this. 1676 1692 & HASTYPE() 1677 1693 hastype(<object>, <type list>) 1678 1694 1679 Returns 1 if the object is of the named type, otherwise 0. 1680 Valid types are: ROOM, EXIT, PLAYER, THING, GARBAGE. You can1681 test to seeif the object is one of a number of types by using a space-1682 separated list of types. 1683 If an invalid type is given, #-1 NO SUCHTYPE is returned.1695 Returns 1 if the object is of the named type, otherwise 0. Valid 1696 types are: ROOM, EXIT, PLAYER, THING, GARBAGE. You can test to see 1697 if the object is one of a number of types by using a space- 1698 separated list of types. If an invalid type is given, #-1 NO SUCH 1699 TYPE is returned. 1684 1700 & HIDDEN() 1685 1701 hidden(<player|descriptor>) … … 1691 1707 home(<object>) 1692 1708 1693 Returns the object's 'home'. This is the home for a player or thing,1694 th e drop-to of a room, or source of an exit.1709 Returns the object's 'home'. This is the home for a player or 1710 thing, the drop-to of a room, or source of an exit. 1695 1711 & HOST() 1696 1712 & HOSTNAME() … … 1698 1714 hostname(<player|descriptor>) 1699 1715 1700 Returns the hostname of a player as indicated by WHO. This may 1701 be more reliable that get(<player>/lastsite) if the player has1702 multple connections from different locations, and the function1703 is calledwith a descriptor argument.1716 Returns the hostname of a player as indicated by WHO. This may be 1717 more reliable that get(<player>/lastsite) if the player has multple 1718 connections from different locations, and the function is called 1719 with a descriptor argument. 1704 1720 1705 1721 The caller can use the function on himself, but using on any other … … 1713 1729 1714 1730 This function returns the number of seconds a player has been idle, 1715 much as WHO does. <player name> must be the full name of a player, or 1716 a player's dbref. Players who are not connected have an idlesecs of "-1", 1717 as do dark wizards, when idle() is used on them by a non-priv'ed player. 1731 much as WHO does. <player name> must be the full name of a player, 1732 or a player's dbref. Players who are not connected have an idlesecs 1733 of "-1", as do dark wizards, when idle() is used on them by a 1734 non-priv'ed player. 1718 1735 1719 1736 & IF() … … 1722 1739 ifelse(<condition>, <true expression>, <false expression>) 1723 1740 1724 These functions evaluate the <condition> and return <true expression>1725 if the <condition> is true, or <false expression> (if provided) if the1726 <condition> is false.1741 These functions evaluate the <condition> and return <true 1742 expression> if the <condition> is true, or <false expression> (if 1743 provided) if the <condition> is false. 1727 1744 1728 1745 See also: BOOLEAN VALUES, switch() … … 1742 1759 inc(<string-ending-in-integer>) 1743 1760 1744 Inc returns the integer plus 1. If given a string that ends in an integer,1745 i t increments only the final integer portion. That is:1761 Inc returns the integer plus 1. If given a string that ends in an 1762 integer, it increments only the final integer portion. That is: 1746 1763 1747 1764 > think inc(3) … … 1763 1780 This function is similar to EXTRACT(), except that it requires four 1764 1781 arguments, while EXTRACT() uses defaults for its arguments if they 1765 aren't given. The function returns <length> items starting from 1766 the <first> position. Trailing spaces are trimmed. The comma cannot1767 be used as the <character> separator unless it's escaped with a \.1782 aren't given. The function returns <length> items starting from the 1783 <first> position. Trailing spaces are trimmed. The comma cannot be 1784 used as the <character> separator unless it's escaped with a \. 1768 1785 1769 1786 Examples: … … 1785 1802 1786 1803 That means that <new item> then becomes the <position>th element of&n
