https://wiki.tinymux.org/index.php?title=Ampersand&feed=atom&action=historyAmpersand - Revision history2024-03-29T02:08:48ZRevision history for this page on the wikiMediaWiki 1.41.0https://wiki.tinymux.org/index.php?title=Ampersand&diff=3408&oldid=prevMark: Add note on setting permissions with underscore. Updated related.2007-07-11T22:40:49Z<p>Add note on setting permissions with underscore. Updated related.</p>
<p><b>New page</b></p><div>[[Category:Commands]]<br />
<br />
The ampersand symbol (&) is a special shorthand for the [[attribute]]-setting form of [[@set]] with some magical behavior.<br />
<br />
It is typically used to set user-defined attributes on [[object|objects]], like this:<br />
<br />
: &TEMPERATURE reactor = cool<br />
<br />
The Temperature [[attribute]] on the reactor [[object]] is set to the value ''cool''.<br />
<br />
& behaves differently than @set when it is typed by a [[player]] directly through their socket (as opposed to run by a player or other object through the MUSH's [[queue]]). In this case, the value on the right-hand side of the equal sign is stored without any [[evaluation]]. These examples illustrate the difference:<br />
<br />
: &SUM calculator = [add(1,1)]<br />
:<br />
: (''calculator/SUM now contains '[add(1,1)]' '')<br />
:<br />
: @set calculator = SUM:[add(1,1)] <br />
:<br />
: (''calculator/SUM now contains '2' '')<br />
<br />
<br />
The ampersand symbol is also used to generate compound [[@lock|locks]] as the AND operator.<br />
For example, an unpassable default lock.<br />
[[@lock]] [[me]]=me&[[exclamation|!]]me<br />
<br />
{{Note|There is a simple way to create attributes that have both 'wizard' and 'hidden' attribute permission. Prefix the attribute name with an underscore (_) and the attribute can only be seen or edited by wizards.}}<br />
<br />
== Related Topics ==<br />
<br />
[[@set]], [[@attribute]], [[attr_access]], [[attr_alias]], [[attribute permissions]]</div>Mark