@prog wizwall.muf 1 999 d 1 i : prop "_wizwall" ; : say me @ swap notify ; : dropdup ( dN ... d1 N -- dN ... d1 N ) (me @ ".ww-debug" prop-exists? if depth "dd entry" pstack then) ( replaces second and later copies of duplicates with #-1. ) dup 2 < if exit then 2 over 1 for ( dN ... d1 N x ) dup 2 + pick ( dN ... d1 N x dx ) swap 1 - 1 -1 for ( dN ... d1 N dx y ) dup 3 + pick ( dN ... d1 N dx y dy ) 3 pick dbcmp if #-1 swap 2 + put else pop then loop pop loop (me @ ".ww-debug" prop-exists? if depth "dd exit" pstack then) ; : doloop ( args uN ... u1 N fn -- args ) ( fn is args x1 ... xN N x -- args x1 ... xN N ) over 1 -1 for ( args uN ... u1 N fn x ) 2 + pick ( args uN ... u1 N fn ux ) dup true-wizard? if dup prop prop-exists? not else 0 then if 3 pick 2 + swap 3 pick execute then pop loop pop 1 -1 for pop pop loop ; : prefix prog "_prefix" getpropstr ; : pfxsay prefix swap strcat say ; : do-wall over 3 + pick notify ; : do-tellme dup name "(#" strcat over int intostr strcat swap flagstr strcat ")" strcat say ; : tell-all-listeners online dropdup 'do-wall doloop pop ; : do-%qoff me @ prop prop-exists? if "You are already not listening." pfxsay else me @ prop "" 0 addprop "You are now not listening." pfxsay then ; : do-%qon me @ prop prop-exists? if me @ prop remove_prop "You are now listening." pfxsay else "You are already listening." pfxsay then ; : do-%off me @ prop prop-exists? if "You are already not listening." pfxsay else prefix "[" me @ name " stops listening.]" 4 "" rimplode tell-all-listeners me @ prop "" 0 addprop "You are now not listening." pfxsay then ; : do-%on me @ prop prop-exists? if me @ prop remove_prop "You are now listening." pfxsay prefix "[" me @ name " resumes listening.]" 4 "" rimplode tell-all-listeners else "You are already listening." pfxsay then ; : do-%who online dropdup 'do-tellme doloop ; : do-%help "%off - keep you from getting wizwall messages" say "%on - cancels a previous %off" say "%qoff - like %off, but doesn't announce it" say "%qon - like %on, but doesn't announce it" say "%who - get a list of everyone who's receiving wizwalls" say "%help - print this list" say ; : choose-format dup ":" 1 strncmp over ";" 1 strncmp and not if 1 strcut swap pop prog "_pose-nospace" getpropstr over 1 strcut pop instr not if " " swap strcat then me @ name swap strcat exit then dup "^" 1 strncmp not if 1 strcut swap pop exit then me @ "_wwsayformat" getpropstr dup not if pop me @ "_sayformat" getpropstr then dup not if pop "says, \"%m\"" then swap "%m" subst me @ name " " strcat swap strcat ; : make-message choose-format prefix swap strcat me @ prop prop-exists? if me @ "NOTE: You are currently set %off" notify then ; : main me @ true-wizard? not if pop "Nice try." say exit then dup "%off" stringcmp not if pop do-%off exit then dup "%on" stringcmp not if pop do-%on exit then dup "%qoff" stringcmp not if pop do-%qoff exit then dup "%qon" stringcmp not if pop do-%qon exit then dup "%who" stringcmp not if pop do-%who exit then dup "%help" stringcmp not if pop do-%help exit then make-message tell-all-listeners ; . c q