: tr trigger @ location ; : ssay "The scribe says, " swap .quote strcat tr location #-1 rot notify_except ; : say me @ swap notify ; : all tr location #-1 rot notify_except ; : tonews tr "_total" getpropstr "_tmp-" 3 pick strcat tr over getpropstr tr rot remove_prop "_" rot strcat "-" strcat rot strcat tr swap rot 0 addprop ; : do_help "If you would like to know what current news is being reported " "on by the Herald, please ask me for a list of topics. " "If you would like to get all the details about a specific " "item of news being reported on, please ask me to 'relate' " "the information on your 'topic'. " "If you would like to 'add' a topic for the crier to report " "on, please ask me to do so and I would be happy to make " "note of your request." strcat strcat strcat strcat strcat strcat strcat ssay ; : iftopic "_" swap intostr strcat "-t" strcat tr swap prop-exists? ; : topic "_" swap intostr strcat "-t" strcat tr swap getpropstr ; : do_list "The herald is currently relating the following topics: " 1 begin dup iftopic while dup topic rot swap ", " strcat strcat swap 1 + loop dup 1 = if pop pop "The herald is currently without news." ssay exit else pop dup strlen 2 - strcut pop "." strcat "The scribe peruses his list..." all 2 sleep ssay then ; : find_topic 0 tr "_total" getpropstr atoi dup not if pop exit then 1 swap 1 for tr "_" 3 pick intostr strcat "-s" strcat getpropstr tolower 4 pick instr if swap pop else pop then loop swap pop ; : pad60 dup strlen 60 > if 60 strcut pop " |" strcat else dup strlen " " dup strcat swap strcut swap pop strcat " |" strcat then ; : do_topic dup "topic" instr not if pop "Please include the word 'topic' just before " "your reference to the topic so I can be sure of " "what information you desire." strcat strcat ssay exit then dup "topic " instr 5 + strcut swap pop "" "\"" subst find_topic dup not if pop pop "The herald has no news on that topic." ssay exit then "The scribe pulls out a scroll and holds it up for %x to read." dup me @ name "%x" subst loc @ me @ rot notify_except "you" "%x" subst say " _____________________________________________________________" say "@_____________________________________________________________)" say "| Subject: " tr "_" 4 pick intostr strcat "-s" strcat getpropstr strcat pad60 say "| Decreed: " tr "_" 4 pick intostr strcat "-d" strcat getpropstr atoi ctime strcat pad60 say "| By Whom: " tr "_" 4 pick intostr strcat "-a" strcat getpropstr atoi dbref name strcat pad60 say "| |" say 1 begin tr "_" 4 pick intostr strcat "-" strcat 3 pick intostr strcat prop-exists? while tr "_" 4 pick intostr strcat "-" strcat 3 pick intostr strcat getpropstr "| " swap strcat pad60 say 1 + loop "|____________________________________________________________|" say "@_____________________________________________________________)" say swap pop 2 * sleep "The scribe rolls up the scroll neatly and tucks it away." loc @ #-1 rot notify_except ; : do_delete : main dup "The scribe" 10 strncmp not if pop exit then tolower dup "scribe" instr not if pop exit then dup "help" instr if pop do_help exit then dup "add" instr if pop me @ "newsadd" force exit then dup "delete" instr over "remove" instr or if do_delete then dup "relate" instr if do_topic exit then dup dup "list" instr swap "topics" instr or if pop do_list exit then ;