@prog tell.muf 1 999 d 1 i ( This program is designed to be used with metalinks, to notify anyone who happens to be in a location of something that affects it. For example, a switch in one room could raise or lower a gate in another; flipping the switch should produce messages to the room with the gate, descirbing the resulting motion of the gate. To do this, link an exit to this program. When the exit is triggered, messages will be produced based on properties on the exit. The exit must be owned by the same player as all target rooms, unless the exit is owned by a wizard, in which case anything goes. A message is described by a set of properties, one describing where to send it and the rest giving the text to produce. These take the form _loc_N: and _line_N_M:, where N is a number from 1 upward, one per emitted message, and M is a number from 1 upward, one per line of message N. For example, to set up actions "raise gates" and "lower gates" that raise and lower gates in two other rooms, you might do something like this [where >> indicates your input, parens are replaced with brackets, and this does not include setup not relevant to this program, such as state storage or exit locks]: In the control room: >> @dig holder room holder room created with room number #1000, parent #123 >> @action raise gates=here Action created with number #1001 and attached. >> @action lower gates=here Action created with number #1002 and attached. >> @action notify raise=#1000 Action created with number #1003 and attached. >> @action notify lower=#1000 Action created with number #1004 and attached. >> @link #1001=#1003;#... Linked to notify raise[#1003 Me] Linked to ... [the ... represents whatever the exit needs to link to to actually affect whatever is used to store the gate's state, such as an exit that moves a marker object around] >> @link #1002=#1004;... Linked to notify lower[#1004 Me] Linked to ... >> @dig Affected room A Affected room A created with room number #1005, parent #123 >> @dig Affected room B Affected room B created with room number #1006, parent #123 >> @set #1003=_loc_1:1005 Property set. >> @set #1003=_line_1_1:With the soft whir of motors, the gate rises. Property set. >> @set #1003=_line_1_2:The door to the east is now open. Property set. >> @set #1003=_loc_2:1006 Property set. >> @set #1003=_line_2_1:With the soft whir of motors, the gate rises. Property set. >> @set #1003=_line_2_2:The door to the west is now open. Property set. >> @set #1004=_loc_1:1005 Property set. >> @set #1004=_line_1_1:With the soft whir of motors, the gate descends. Property set. >> @set #1004=_line_1_2:The door to the east is now blocked. Property set. >> @set #1004=_loc_2:1006 Property set. >> @set #1004=_line_2_1:With the soft whir of motors, the gate descends. Property set. >> @set #1004=_line_2_2:The door to the west is now blocked. Property set. Notification attempts that violate the ownership restriction described above simply do nothing; in particular, they do not produce errors. ) : string-to-dbref dup 1 strcut swap "#" strcmp if pop atoi else atoi swap pop then dbref ; : main 1 begin "_loc_" over intostr strcat trigger @ swap getpropstr dup while string-to-dbref dup ok? if dup room? if dup owner trigger @ owner dbcmp trigger @ true-wizard? or else 0 then else 0 then (N x ok) (if ok is true, x is a suitably-owned room; if ok is false, x is junk) if (N room) "_line_" 3 pick intostr "_" 3 "" rimplode 1 begin (N room "_line_N_" M) 2 copy intostr strcat trigger @ swap getpropstr dup while (N room "_line_N_" M text) 4 pick #-1 rot notify_except 1 + loop 3 mpop then pop 1 + loop pop pop ; . c q