From TinyMUX
Revision as of 23:20, 5 December 2005 by Tsal (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Command.gif @lock is used to lock objects and attributes to restrict how they can be interacted with.


Syntax: @lock[/<whichlock>] <object>=<key>

@lock <object>/<attrib>

The first form locks <object> to a specific key(s).

<whichlock> indicates which lock you want to set on the object. If you don't specify one, you set the Default lock.

The second form locks the indicated attribute of the named object, so that when the object is @chowned, the attribute will remain owned by you. It may also be used when you own an attribute on an object that you do not own, in this case it prevents the object's owner from @chowning the attribute to himself, and prevents anyone from modifying or removing the attribute.


Each lock has a key of one of the following types: Normal, Is, Carry, Ownership, Indirect, Attribute, Evaluation, or Compound. See @lock keys for details on the key types.


You can set the following locks:

Exits: controls who may traverse the exit to its destination.
Rooms: controls whether the player sees the SUCC or FAIL message for the room following the room description when looking at the room.
Players/Things: controls who may GET the object.
Players/Things: controls who may ENTER the object if the object is ENTER_OK. Also, the enter lock of an object being used as a Zone Master Object determines control of that zone.
All but Exits: controls who may gets things from a given location.
Players/Things: controls who may give the object.
Players/Things: controls who may LEAVE the object.
All but Exits: controls who may link to the location if the location is LINK_OK (for linking exits or setting drop-tos) or ABODE (for setting homes)
Players: controls who may @mail the player.
Players: controls who may page the player.
All: controls who may make @parent links to the object.
Players/Things: controls who may give things to the object.
All but Exits: controls who may speak in that location (only checked if AUDITORIUM flag is set on that location)
All but Exits: controls who may teleport out of the location.
Rooms/Things: controls who may teleport there if the location is JUMP_OK.
All but Exits: controls who may USE the object, GIVE the object money and have the PAY attributes run, have their messages heard and possibly acted on by LISTEN and AxHEAR, and invoke $-commands stored on the object.
All but rooms: controls who may drop that object.
All: Not used by MUX, is intended to be used in MUX programming where a user-defined lock is needed.

Note: If a player fails the UseLock on a parent of an object being searched for $-commands, then the search for attributes stops and the parent chain is not searched further for matches.

Server differences

Other MUSH servers may have a different set of key expressions and/or locktypes. For example, PennMUSH supports flag^<flag>, type^<type>, power^<power>, and channel^<channel> keys (for flag status, object type, power status, and channel membership respectively), and lock types including Listen, Command, Control, Follow, Forward, Examine, Chzone, Dropto, Destroy, and Interact. PennMUSH also provides the notion of "lock flags" that control visibility, inheritance, and modifiability of a given lock on a given object, via the @lset command.


See also: @chown, @unlock.

Relevant help files: help @lock, help @lock keys, help @lock locks, help @lock locks2