@program #2788 1 1000 d i ( lst-broadcast WhiteFire / Peter A. Torkelson 1992 kinomon@glia.biostr.washington.edu #17 on Tapestries Muck Version 1.1.0, Nov 23, 1992 This program broadcasts everything done in one room to another. Usage: @set =_listen:17 @set =_broadcast/rooms:#[ #...] This will echo anything done in the to all the rooms listed in "_broadcast/rooms" in the format: "In : " So you might get: "In stage: WhiteFire says, "Test"". You can change the message by setting the : @set =_broadcast/message: %room is replaced with the room name, %m with the message [pose, say, spoof, whatever] To allow broadcast to one of your rooms from someone elses, you may set a property _broadcast/fromrooms: with the dbref of each room you expect to recieve from, or simply "any". Also you may use this to select which room to listen to. [ Properties on source room. ] _listen:17 _broadcast/rooms:dbref of destination[s] _broadcast/message:message [%m, %room] [ Properties on destination room. ] _broadcast/fromrooms:dbref of source[s] ) : split swap over over swap instr dup not if pop swap pop "" else 1 - strcut rot strlen strcut swap pop then ; var message : is-ok-room? ( d -- i ) dup "_broadcast/fromrooms" getpropstr dup if dup "Any" stringcmp 0 = if pop pop 1 else " " strcat loc @ int intostr "#" swap strcat " " strcat instr not not swap pop then else pop owner loc @ owner dbcmp then ; : rooms-loop ( rooms-str -- ) dup not if pop exit then " " split swap 1 strcut swap pop atoi dbref dup ok? if dup room? if dup is-ok-room? if #-1 message @ ansi_notify_except else pop then then else pop then rooms-loop ; : main ( ONLY on rooms. ) trigger @ room? not if exit then ( set message ) message ! loc @ "_broadcast/message" getpropstr dup not if pop "In %room: %m" then loc @ name "%room" subst message @ "%m" subst message ! ( get the rooms prop ) loc @ "_broadcast/rooms" getpropstr dup not if exit then rooms-loop ; . c q