@lock mirror = #0
This just uses the "basic lock" to lock the mirror against database object #0 (the initial room). Since it is very unlikely that the player will be or carry that room, the lock always fails, thus the object cannot be taken.
@lock north = sex:f*
This checks the attribute "sex" to be anything that starts with "f".
@lock north = sex:m*|sex:f*
By using the "or" symbol ("|") you can check for one attribute or another.
@lock out = desc:*
This uses a "wildcard" character ("*") to ensure that the attribute "DESC" is not empty.
@lock out = desc:*&(sex:m*|sex:f*)
This uses the "and" symbol ("&") in addition to the "or" symbol, as well as parentheses to group the "sex" check.
@lock purse = me
This is useful for locking your possesions.
@lock south = Iswizard/1
&Iswizard south = [hasflag(%#, WIZARD)]
This uses an "evaluation lock" to evaluate an attribute "Iswizard". This attribute checks to see if the player attempting to pass the lock ("%#") has the flag "wizard". If so, it returns "1". This is then checked for in the lock.
@lock south = Iswizard/1&sex:m*
&Iswizard south = [hasflag(%#, WIZARD)]
This uses the "and" operator to combine an evaluation lock with an attribute lock.
@lock me = me
Without this lock, other players can pick you up and take you places.
@lock/page me = !*Bozo
This prevents player Bozo from paging you.
You can lock yourself against all pages by using:
@lock/page me = #0
Another method of avoiding all pages is to set the "haven" flag on yourself, ie.
@set me = haven
@lock/speech here = !*Bozo
This prevents player Bozo from speaking in this room. Note that this lock does not affect wizards.
@lock west = +key
Players must be carrying "key" to go west.
@lock north = desc:*&(sex:m*|sex:f*)
@lock south = @north
@lock east = @north
@lock west = @north
By using an "indirect lock" (indicated by the "@" character) you only need to type in a complex lock once, and then lock other things "indirectly" against that lock.
This not only saves you typing the lock over and over again, but makes it easier to change the lock. If you need to change the lock, you only need to change it once.
Comments to Gammon Software support
Page updated on Wednesday, 15 December 2004