Locks
@lock-simple
Section titled “@lock-simple”SIMPLE LOCKS
You can lock an object in several different ways. The simplest lock is one that always succeeds (#true) or always fails (#false), or that matches a specific object by prefixing it with an ”=”:
> @lock My Toy = #falseThis lock will always fail.
> @lock My Toy = =meThis locks the object “My Toy” to you and you alone. It is recommended that you @lock me = =me in order to prevent anyone else from picking you up. The two = signs are NOT a typo! The first is part of the @lock syntax (as shown at the top of LOCKING) the second is a lock key that means “only this exact object”.
For backwards compatibility, OBJID^<object> is an alias for =<object>.
@lock-owner
Section titled “@lock-owner”Owner Lock
Section titled “Owner Lock”An “owner” lock allows you to lock something to anything owned by the same player:
@lock Box = $My ToyThis locks “Box” to anything owned by the owner of “My Toy” (since players own themselves, that includes the owner as well).
Carry Lock
Section titled “Carry Lock”You can lock an object to something that has to be carried:
@lock Door = +Secret Door KeyThis locks the exit “Door” to someone carrying the object “Secret Door Key”. Anyone carrying that object will be able to go through the exit.
You can lock an object to -either- an object or to someone carrying the object with:
@lock Disneyworld Entrance = ChildThis locks the exit “Disneyworld Entrance” to either the object “Child” -or- to someone carrying the object “Child”. (OK, so it’s a weird example.)
This is the same as @lock Entrance=+Child|=Child.
@lock-attribute
Section titled “@lock-attribute”Attribute Locks
Section titled “Attribute Locks”You can lock an object to an attribute on the person trying to pass the lock (as long as the object can “see” that attribute):
@lock <object>=<attribute>:<value>
For example:
@lock Men's Room = sex:m*This would lock the exit “Men’s Room” to anyone with a SEX attribute starting with the letter “m”.
@lock A-F = icname:<gThis would lock the exit “A-F” to anyone with a ICNAME attribute starting with a letter “less than” the letter “g”. This assumes that ICNAME is visual or the object with the lock can see it.
@lock-name
Section titled “@lock-name”Name Locks
Section titled “Name Locks”You can test for objects matching a given name by using the below format:
@lock <object>=name^<pattern>
It is similar to performing strmatch(%n,
For example, to lock “Bob’s Tools” to only people with a name beginning with Bob:
@lock/use Bob's Tools=name^bob*@lock-bit
Section titled “@lock-bit”Bit Locks
Section titled “Bit Locks”You can test for set flags, powers, roles, permissions, or object types in a lock directly, without using an evaluation lock, with these formats:
@lock <object>=flag^<flag>
@lock <object>=power^<power>
@lock <object>=type^<type>
These locks act like the object the lock is on does a hasflag(%#,
For example:
@lock/use Admin Commands=flag^wizard|flag^royaltyTo test for a role or a permission (see roles):
@lock <object>=role^<role>
@lock <object>=perm^<permission>
role^<role> passes when the object trying the lock holds the role, its own or its account’s, as hasrole() reports. perm^<permission> passes when it holds the permission, as permission() reports.
@lock/use Staff Board=role^moderator|perm^players.moderateYou can also test for channel membership with:
@lock <object>=channel^<channel>
@lock-dbreflist
Section titled “@lock-dbreflist”List Lock
Section titled “List Lock”You can test to see if the enactor is a member of a space-separated list of dbrefs or objids on an attribute on the object, with:
@lock <object>=dbreflist^<attributename>
For example:
&allow Commands = #1 #7 #23 #200:841701384&deny commands = #200 #1020@lock/use commands = !dbreflist^deny & dbreflist^allow@lock-indirect
Section titled “@lock-indirect”Indirect Locks
Section titled “Indirect Locks”An “indirect” lock allows you to lock something to the same thing as another object (very useful in setting channel locks; see @CHANNEL CLOCK):
@lock Second Puppet=@First PuppetThis locks the object “Second Puppet” to whatever the object “First Puppet” is locked to. Normally, the lock type that is checked is the same as the lock on the first. You can specify a different lock type with @object/LOCKNAME. For example:
@lock Second Puppet = @First Puppet/UseSecond Puppet’s basic lock now checks First Puppet’s use lock.
@lock-host
Section titled “@lock-host”Host Locks
Section titled “Host Locks”You can check to make sure an object is owned by a player connected from a specific host or IP address using the following:
@lock <object>=ip^<ipaddress>
@lock <object>=hostname^<hostname>