@prog chime.muf 1 999 d 1 i ( Doorbell program, also useful for other things. This is designed to be put in the @succ/@fail/@drop of an exit. It sends a message to other rooms. The configuration is built around a dbref that holds all the necessary information in properties. This dbref's number is expected on the stack, in the form of a string, on entry; this is most easily done by putting it after the program dbref in an exit message. For example, if the program is object #1234, and the dbref with all the properties is #4321, then you might do @succ =@1234 4321 The message sent is stored on the configuration object in the form of properties _chime-msg-1, _chime-msg-2, etc. Each property is one line of the message and is sent with a notify_except call. Where the messages are sent is controlled by _chime-dst- properties: _chime-dst-1, _chime-dst-2, etc. Each property must contain the number of a room dbref. The message is sent to this room and all of its descendant rooms [its children, their children, etc]. Unless the trigger is owned by a wizard, destinations not owned by the same player as the trigger will not normally receive messages; however, if the destination has a _chime-permit-: property, where is either the dbref of the trigger or the dbref of the trigger's owner, the message is sent. This check is done only for the specified destination; when walking the descendants of a room, the child rooms are normally not checked. However, a _chime-deny- property on the configuration object will cause the check to be made as normal for room . The sending and propagation of a message [from a room to its decendants] can be modified by properties. [These properties are, like all except the _chime-permit- properties, on the configuration object.] A _chime-quiet- property, where is the dbref of a room, means that the message will not be sent to that room. _chime-prune- means that descendants of the room will not be examined or sent to. These function independently of one another; quieting a room does not necessarily imply pruning it, and vice versa. ) : msg-n intostr "_chime-msg-" swap strcat ; : dst-n intostr "_chime-dst-" swap strcat ; : quiet-n intostr "_chime-quiet-" swap strcat ; : prune-n intostr "_chime-prune-" swap strcat ; : deny-n intostr "_chime-deny-" swap strcat ; : permit-n intostr "_chime-permit-" swap strcat ; : tell-ok? (room -- room ok?) dup owner trigger @ owner dbcmp if 1 exit then trigger @ owner wizard? if 1 exit then dup trigger @ int permit-n prop-exists? if 1 exit then dup trigger @ owner int permit-n prop-exists? if 1 exit then 0 ; : tell-it dup room? if swap #-1 swap notify_except exit then dup player? if swap notify exit then pop pop ; : tell-1room (holder room -- holder room) dup int quiet-n 3 pick swap prop-exists? if exit then swap 1 begin over over msg-n over over prop-exists? while getpropstr 4 pick tell-it 1 + loop pop pop pop swap ; : tell-room (holder room force-ok? -- ) not if tell-ok? not if pop pop exit then then tell-1room dup room? not if pop pop exit then dup int prune-n 3 pick swap prop-exists? if pop pop exit then contents begin dup while dup room? if over over dup int deny-n 3 pick swap prop-exists? not tell-room then next loop pop pop ; : main dup atoi dbref dup 1 msg-n prop-exists? not if trigger @ owner "#" trigger @ int intostr strcat "'s use of #" strcat prog int intostr strcat " is not set up correctly." strcat notify pop exit then dup me @ int quiet-n prop-exists? if pop exit then 1 begin over over dst-n over over prop-exists? while getpropstr atoi dup if dbref 3 pick swap 0 tell-room else pop then 1 + loop pop pop pop pop ; . c q