@lock

From TinyMUX
Jump to navigation Jump to search

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

Usage

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.

Keys

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.

Locks

You can set the following locks:

DefaultLock
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.
EnterLock
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.
GetFromLock
All but Exits: controls who may gets things from a given location.
GiveLock
Players/Things: controls who may give the object.
LeaveLock
Players/Things: controls who may LEAVE the object.
LinkLock
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)
MailLock
Players: controls who may @mail the player.
PageLock
Players: controls who may page the player.
ParentLock
All: controls who may make @parent links to the object.
ReceiveLock
Players/Things: controls who may give things to the object.
SpeechLock
All but Exits: controls who may speak in that location (only checked if AUDITORIUM flag is set on that location)
TeloutLock
All but Exits: controls who may teleport out of the location.
TportLock
Rooms/Things: controls who may teleport there if the location is JUMP_OK.
UseLock
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.
DropLock
All but rooms: controls who may drop that object.
UserLock
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.

References

See also: @chown, @unlock.

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