Difference between revisions of "Category:Variables"
From SphereWiki
MrSugarCube (talk | contribs) (Created page with ' ==References== The following table lists all object references that are available from any script. {| border="1" cellspacing="4" cellpadding="4" | '''Name''' || '''Read/Write'...') |
MrSugarCube (talk | contribs) |
||
| Line 1: | Line 1: | ||
| − | |||
| − | |||
==References== | ==References== | ||
The following table lists all object references that are available from any script. | The following table lists all object references that are available from any script. | ||
| Line 34: | Line 32: | ||
| [[ASC]] ''text'' || R || Converts ''text'' into a series of ASCII values. | | [[ASC]] ''text'' || R || Converts ''text'' into a series of ASCII values. | ||
|- | |- | ||
| − | | [[BETWEEN]] ''min, max, | + | | [[BETWEEN]] ''min, max, numerator, denominator'' || R || Returns the value that's ''numberator/denominator'' between ''min'' and ''max'' |
|- | |- | ||
| − | | [[BETWEEN2]] ''min, max, | + | | [[BETWEEN2]] ''min, max, numerator, denominator'' || R || Returns the value that's ''numberator/denominator'' between ''max'' and ''min'' |
|- | |- | ||
| [[CHR]] ''ascii_code'' || R || Returns the character represented by the given ASCII code. | | [[CHR]] ''ascii_code'' || R || Returns the character represented by the given ASCII code. | ||
| Line 46: | Line 44: | ||
| [[D]]''property_or_function'' || R || Forces a property or function to return a decimal value. | | [[D]]''property_or_function'' || R || Forces a property or function to return a decimal value. | ||
|- | |- | ||
| − | | [[DEFMSG]] || W || | + | | [[DEFMSG]]''.name'' || W || Sets the value of a DEFMESSAGE. (see sphere_msgs.scp) |
|- | |- | ||
| [[EXPLODE]] ''separators'', ''text'' || R || Splits ''text'' by the given separator characters. | | [[EXPLODE]] ''separators'', ''text'' || R || Splits ''text'' by the given separator characters. | ||
| Line 113: | Line 111: | ||
|- | |- | ||
| [[SYSSPAWN]] ''command, arg1, arg2...'' || R || Executes a system command on the server and does not wait for it to complete.<br />'''Note:''' Requires OF_FileCommands to be enabled in Sphere.ini | | [[SYSSPAWN]] ''command, arg1, arg2...'' || R || Executes a system command on the server and does not wait for it to complete.<br />'''Note:''' Requires OF_FileCommands to be enabled in Sphere.ini | ||
| + | |- | ||
| + | | [[UVAL]] ''expression'' || R || Evaluates an expression and returns the result as an unsigned integer. | ||
|- | |- | ||
| [[VAR]]''.name'' || RW || Gets or sets the value of a VAR. | | [[VAR]]''.name'' || RW || Gets or sets the value of a VAR. | ||
| − | |||
| − | |||
|} | |} | ||
Revision as of 19:56, 8 June 2009
References
The following table lists all object references that are available from any script.
| Name | Read/Write | Description |
| DB | R | Gets the server's database object. |
| FILE | R | Gets the server's file object. |
| I | R | Gets the current object. |
| LIST | R | Gets the server's list object. |
| NEW | RW | Gets or sets the last character or item created on the server. |
| OBJ | RW | Gets or sets a reference to a character or item |
| SRC | R | Gets the source character of an event. |
| UID.object_uid | R | Gets a reference to the character or item with the specified UID. |
Properties and Functions
The following table lists all properties and functions that are available from any script.
| Name | Read/Write | Description |
| ASC text | R | Converts text into a series of ASCII values. |
| BETWEEN min, max, numerator, denominator | R | Returns the value that's numberator/denominator between min and max |
| BETWEEN2 min, max, numerator, denominator | R | Returns the value that's numberator/denominator between max and min |
| CHR ascii_code | R | Returns the character represented by the given ASCII code. |
| CLEARVARS prefix | W | Removes all server VARs whose name start with prefix. |
| CLRBIT value, bit | R | Returns the value of value with bit not set. |
| Dproperty_or_function | R | Forces a property or function to return a decimal value. |
| DEFMSG.name | W | Sets the value of a DEFMESSAGE. (see sphere_msgs.scp) |
| EXPLODE separators, text | R | Splits text by the given separator characters. |
| EVAL expression | R | Evaluates an expression and returns the result as an integer. |
| FEVAL expression | R | Evaluates an expression and returns the result as an integer, supports floating point values. |
| FEVAL expression | R | Evaluates an expression and returns the result as a hexadecimal value, supports floating point values. |
| FLOATVAL expression | R | Evaluates an expression and returns the result as a floating point value. |
| FVAL expression | R | Evaluates an expression and formats the result with a single decimal point. ("1000" becomes "100.0") |
| ref.GETREFTYPE | R | Returns a code representing what type of object ref is. |
| HVAL expression | R | Evaluates an expression and returns the result as a hexadecimal value. |
| ISBIT value, bit | R | Returns non-zero if bit is set in value. |
| ISEMPTY value | R | Returns 1 if value is empty/blank text. |
| ISNUM value | R | Returns 1 if value is a numeric value. |
| LISTCOL | R | Returns the alternating colour in webpage tables. |
| MD5HASH text | R | Returns an MD5 hash for text. |
| MULDIV num, mul, div | R | Returns (num * mul) / div. |
| NEWDUPE object_uid | W | Clones the character or item with the specified UID. |
| NEWITEM item_defname, amount, container, equip | W | Creates a new item. |
| NEWNPC character_defname | W | Creates a new character. |
| QVAL expression? value_true:value_false | R | Evaluates an expression and returns value_true if the result is true, otherwise returns value_false. |
| Rx | R | Returns a random number between 0 and x - 1. |
| Rx, y | R | Returns a random number between x and y. |
| SETBIT value, bit | R | Returns the value of value with bit set. |
| SHOW property_or_function | W | Displays the returned value from a property or function to SRC. |
| STRARG text | R | Returns the first word from text. |
| STREAT text | R | Removes the first word from text and returns the remaining text. |
| STRPOS position character text | R | Returns the position of a character within the text, starting from position. |
| STRREGEXNEW pattern, text | R | Returns 1 if text matches a regular expression pattern. |
| STRREVERSE text | R | Returns text, after reversing its characters. |
| STRSUB position, count, text | R | Extracts count characters from text, starting from position. |
| STRTOLOWER text | R | Returns text in lowercase. |
| STRTOUPPER text | R | Returns text in uppercase. |
| STRTRIM text | R | Removes whitespace (i.e. spaces, tabs) from the start and end of text. |
| SYSCMD command, arg1, arg2... | R | Executes a system command on the server and waits for it to complete. Note: Requires OF_FileCommands to be enabled in Sphere.ini |
| SYSSPAWN command, arg1, arg2... | R | Executes a system command on the server and does not wait for it to complete. Note: Requires OF_FileCommands to be enabled in Sphere.ini |
| UVAL expression | R | Evaluates an expression and returns the result as an unsigned integer. |
| VAR.name | RW | Gets or sets the value of a VAR. |
This category currently contains no pages or media.