"Beginning installation of cmd-page... @prog cmd-page 1 99999 d 1 i ( cmd-page: $Date: 2004/04/13 17:19:23 $ $Revision: 1.3 $ ) ( Author: Foxen ) ( Contributors: Pakrat, Artie, Andy, Maddax, Feaelin ) ( Dependencies: lib-glow, lib-strings, lib-showlist, lib-userprop ) ( --------------------------------------------------------------------------- ) ( Coding: Pak, Artie & Co. -- Original MufPage by Foxen ) ( Hi's to everyone who doesn't hate me! :-> -- makes it simple doesn't it? ) ( Here is what I added: Idle time is now dependent on idletime sysparm. This ) ( is to create a consistant idletime throughout the muck. ) ( ~Maddax ) ( $Log: cmd-page,v $ Revision 1.3 2004/04/13 17:19:23 feaelin Added the appropiate _defs/ props so that you can make library calls to $cmd/page. Revision 1.2 2004/03/26 03:19:50 feaelin Doc cleanup Revision 1.1 1999/04/18 22:04:50 feaelin Initial revision ) lvar dept $include $lib/glow $include $lib/strings $include $lib/showlist $include $lib/userprop $def sizelimit 2500 $def daysold 9999 $def maildir "mail#" $def omaildir "omail#" $def wizard? .mage? $def tell me @ swap .wrapnotify $def strip-leadspaces striplead $def strip-trailspaces striptail $def stripspaces strip $def strftime swap timefmt $def split .split2 $def scn over stringcmp not $def Uenvprop Uenvpropstr swap pop $def descr_idle descrcon conidle ( : popn dup if 1 - popn then pop ; ) $ifdef NOSORTPRIM : SSort ( {s} --- {s} ) .sort ; $else : SSort 3 sort ; $endif : fillspace swap strlen - " " ( 40 spaces ) dup strcat ( 80 spaces now ) swap strcut pop ; : sort-stringwords-reassemble ({strrange} -- string) dup 1 <= if pop exit then 1 - swap " " strcat rot strcat swap sort-stringwords-reassemble ; : sort-stringwords (str -- str') stripspaces dup " " instr if " " explode SSort sort-stringwords-reassemble stripspaces then ; : fake_format? (default string -- string' TRUE ... or -- default FALSE ) "%n" me @ name subst dup "%n" instr not if "%n " swap strcat then dup "%n whispers, \"%m\"" stringcmp not over "%n whispers \"%m\"" stringcmp not or over "%n shouts, \"%m\"" stringcmp not or over "%n shouts \"%m\"" stringcmp not or over "%n %m" stringcmp not or if pop 0 else swap pop 1 then ; : UGetPageProp (playerdbref propname -- str) over over Ugetpropstr dup not if pop swap over Uenvprop dup not if pop trig swap Ugetpropstr else swap pop then else rot rot pop pop then ; : getignorestr (playerdbref -- ignorestr) prog "ignore#" rot int intostr strcat Ugetpropstr dup if "^^" "^" subst then ; : setignorestr (ignorestr playerdbref -- ) int intostr trig getlink "ignore#" rot strcat rot Usetpropstr ; : getprioritystr (playerdbref -- prioritystr) prog "priority#" rot int intostr strcat Ugetpropstr dup if "^^" "^" subst then ; : setprioritystr (prioritystr playerdbref -- ) int intostr trig getlink "priority#" rot strcat rot Usetpropstr ; : getlastpager (playerdbref -- string) "lastpager" Ugetpropstr ; : setlastpager (string playerdbref -- ) "lastpager" rot Usetpropstr ; : getlastpagers (playerdbref -- string) "lastpagers" Ugetpropstr ; : setlastpagers (string playerdbref -- ) "lastpagers" rot Usetpropstr ; : getlastpaged (playerdbref -- string) "lastpaged" Ugetpropstr ; : setlastpaged (string playerdbref -- ) "lastpaged" rot Usetpropstr ; : getlastpagedgroup (playerdbref -- string) "lastpagedgroup" Ugetpropstr ; : setlastpagedgroup (string playerdbref -- ) "lastpagedgroup" rot Usetpropstr ; : set_page_standard (valstr -- ) me @ "standard?" rot Usetpropstr ; : page_standard? (playerdbref -- bool) "standard?" Ugetpropstr dup "yes" stringcmp not if pop 2 exit then "prepend" stringcmp not if 1 exit then 0 ; : set_page_echo (valstr -- ) me @ "echo?" rot Usetpropstr ; : page_echo? ( -- bool) me @ "echo?" Ugetpropstr "no" stringcmp not not ; : set_page_inform (valstr -- ) me @ "inform?" rot Usetpropstr ; : page_inform? (playerdbref -- bool) "inform?" Ugetpropstr "yes" stringcmp not ; : get-curr-format ( -- formatname ) me @ "curr_format" Ugetpropstr dup not if pop "page" then ; : set-curr-format ( formatname -- ) me @ "curr_format" rot Usetpropstr ; : set-format-prop ( playerdbref formatname format -- ) rot rot "formats/" swap strcat rot Usetpropstr ; : get-format-prop ( playerdbref formatname -- format ) "formats/" swap strcat over swap UGetPageProp dup not if pop "formats/page" UGetPageProp else swap pop then dup not if pop "You page, \"%m\" to %n." then ; : set-oformat-prop ( playerdbref formatname format -- ) rot rot "formats/o" swap strcat rot Usetpropstr ; : get-oformat-prop ( playerdbref formatname -- format ) "formats/o" swap strcat over swap UGetPageProp dup not if pop "formats/opage" UGetPageProp else swap pop then "%n pages, \"%m\" to %t." swap dup if fake_format? then pop ; : get_opose ( -- oposeformat) me @ "formats/opose" over swap UGetPageProp dup not if pop "formats/opage" UGetPageProp else swap pop then "In a page-pose to %t, %n %m" swap dup if fake_format? then pop ; : set-standard (stdformat playerdbref -- ) "stdf" rot Usetpropstr ; : get-standard (playerdbref -- stdformat) "stdf" Ugetpropstr dup not if pop "%n pages: %m" "stdf" trig swap Ugetpropstr dup if swap then pop then "" "%l" subst dup if "^^" "^" subst then ; : set-prepend (prepformat playerdbref -- ) "prepf" rot Usetpropstr ; : get-prepend (playerdbref -- prepformat) "prepf" Ugetpropstr dup not if pop "%n pages: " "prepf" trig swap Ugetpropstr dup if swap then pop then "" "%l" subst dup if "^^" "^" subst then ; : get-multimax (playerdbref -- int) "multimax" Ugetpropstr atoi dup not if pop 8888 then ; : set-multimax (int playerdbref -- ) "multimax" rot intostr Usetpropstr ; : get-sleepmsg (dbref -- string) "sleepmsg" Ugetpropstr dup if "^^" "^" subst then ; : set-sleepmsg (string dbref -- ) "sleepmsg" rot Usetpropstr ; : get-havenmsg (dbref -- string) "havenmsg" Ugetpropstr dup if "^^" "^" subst then ; : set-havenmsg (string dbref -- ) "havenmsg" rot Usetpropstr ; : get-ignoremsg (dbref -- string) "ignoremsg" Ugetpropstr dup if "^^" "^" subst then ; : set-ignoremsg (string dbref -- ) "ignoremsg" rot Usetpropstr ; : get-idlemsg (dbref -- string) "idlemsg" Ugetpropstr dup if "^^" "^" subst then ; : set-idlemsg (string dbref -- ) "idlemsg" rot Usetpropstr ; : get-idletime (dbref -- int) "idletime" Ugetpropval dup not if pop "idletime" sysparm atoi then ; : set-idletime (int dbref -- ) "idletime" rot Usetpropval ; : get-awaymsg (dbref -- string) "awaymsg" Ugetpropstr dup if "^^" "^" subst then ; : set-awaymsg (string dbref -- ) "awaymsg" rot Usetpropstr ; : get-g-aliases ( -- aliasesstr) prog "G-A" Ugetpropstr ; : set-g-aliases (aliasesstr -- ) sort-stringwords prog "G-A" rot Usetpropstr ; : set-p-aliases (aliasesstr -- ) sort-stringwords me @ "P-A" rot Usetpropstr ; : get-p-aliases ( -- aliasesstr) me @ "P-A" Ugetpropstr dup if exit then pop prog me @ int intostr "P-A" strcat Ugetpropstr dup set-p-aliases prog me @ int intostr "P-A" strcat Uremove_prop ; : set-personal-alias (aliasname aliasstr -- ) swap tolower dup strlen 10 > if 10 strcut pop then swap get-p-aliases " " swap over strcat strcat over if dup 4 pick " " swap over strcat strcat instr not if " " strcat 3 pick strcat then "Personal alias set." tell else 3 pick " " swap over strcat strcat split " " swap strcat strcat stripspaces "Personal alias cleared." tell then stripspaces set-p-aliases "P-A-" rot strcat me @ swap rot Usetpropstr ; : get-personal-alias (aliasname playerdbref -- aliasstr) over over "P-A-" rot strcat Ugetpropstr dup if rot rot pop pop exit then pop over over int intostr "P-A" swap strcat "-" strcat swap strcat prog swap over over Ugetpropstr dup not if pop pop pop pop pop "" exit then rot rot Uremove_prop swap pop over swap set-personal-alias ; : get-global-alias (aliasname -- aliasstr) prog "G-A-" rot strcat Ugetpropstr ; : set-global-alias (aliasname aliasstr -- ) over get-global-alias me @ wizard? not and me @ prog owner dbcmp not and "G-O-" 4 pick strcat prog swap Ugetpropstr me @ int intostr stringcmp and if "Permission denied." tell pop pop exit then (aliasname aliasstr) dup not if "G-O-" 3 pick strcat prog swap Uremove_prop then (aliasname aliasstr) swap tolower dup strlen 10 > if 10 strcut pop then swap get-g-aliases " " swap over strcat strcat over if ( Line #888 in pre-cpp source ) dup 4 pick " " swap over strcat strcat instr not if " " strcat 3 pick strcat then "Global alias set." tell else 3 pick " " swap over strcat strcat split " " swap strcat strcat stripspaces "Global alias cleared." tell then stripspaces set-g-aliases "G-O-" 3 pick strcat prog swap me @ int intostr Usetpropstr "G-A-" rot strcat prog swap rot Usetpropstr ; : get-alias (aliasname playerdbref -- aliasstr) over swap get-personal-alias dup not if pop get-global-alias else swap pop then ; : getday ( -- int) systime dup 86400 % 86400 + time 60 * + 60 * + - 86400 % - 86400 / ; : gettime ( -- int ) time 60 * + 60 * + ; : get-timestr ( -- timestr) time rot pop ":" rot dup intostr swap 10 < if "0" swap strcat then strcat over 11 > if "pm" strcat swap 12 - swap else "am" strcat then swap dup not if pop 12 then intostr swap strcat ; ( alias listing stuff ) : list-p-aliases-loop (playerdbref aliasesstr -- ) dup not if pop pop exit then " " split swap dup 4 pick get-personal-alias " -- " swap strcat over 10 fillspace swap strcat strcat tell list-p-aliases-loop ; : list-personal-aliases ( - ) " Personal Aliases List" tell "Alias Name -- Alias Expansion" tell me @ get-p-aliases sort-stringwords list-p-aliases-loop ; : list-g-aliases-loop (aliasesstr -- ) dup not if pop exit then " " split swap dup get-global-alias " -- " swap strcat over 10 fillspace swap strcat strcat tell list-g-aliases-loop ; : list-global-aliases ( - ) " Global Aliases List" tell "Alias Name -- Alias Expansion" tell get-g-aliases sort-stringwords list-g-aliases-loop ; : list-matching-aliases-loop (matchstr aliasesstr -- ) dup not if pop exit then " " split swap dup me @ get-alias " -- " swap strcat over 10 fillspace swap strcat strcat dup " " swap over strcat strcat tolower 4 pick " " swap over strcat strcat instr not if pop else tell then list-matching-aliases-loop ; : list-matching-aliases (namestr -- ) "Aliases containing the name \"" over strcat "\"" strcat tell "Alias Name -- Alias Expansion" tell tolower get-g-aliases " " strcat get-p-aliases strcat sort-stringwords list-matching-aliases-loop pop ; : single-space (s -- s') dup " " instr not if exit then " " " " subst single-space ; : comma-format (string -- formattedstring) stripspaces single-space ", " " " subst .cleancommas ; : stringmatch? (str cmpstr #charsmin-- bool) rot " " split pop rot rot swap over strcut swap 4 rotate 4 rotate strcut rot rot stringcmp if pop pop 0 exit then swap over strlen strcut pop stringcmp not ; : player-match? (playername -- [dbref] succ?) .pmatch dup if 1 else pop 0 then ; : partial-match ( playername -- [dbref] succ? ) part_pmatch dup player? if 1 else pop 0 then ; : cull-loop (strings count nullstr -- string') over not if swap pop exit then over 6 > if rot pop swap 1 - swap cull-loop exit then rot dup if " " strcat strcat else pop then swap 1 - swap cull-loop ; : cullto5words (string -- string') single-space stripspaces " " explode "" cull-loop ; : match-lastpagers (partname playerdbref -- [dbref] success?) over strlen 3 < if pop pop 0 exit then getlastpagers stripspaces " " swap strcat dup tolower " " 4 rotate strcat tolower instr dup not if pop pop 0 exit then strcut swap pop " " split pop player-match? ; : update-lastpagers (fullname playerdbref -- ) dup getlastpagers stripspaces " " swap over strcat strcat " " 4 rotate over strcat strcat over tolower over tolower instr not if 1 strcut swap pop strcat cullto5words swap setlastpagers else pop pop pop then ; : extract-player-loop ( str playername -- string) 3 pick not if pop swap pop exit then 4 rotate dup if over over stringcmp not if pop else rot dup if " " strcat then swap strcat swap then else pop then rot 1 - rot rot extract-player-loop ; : extract-player (playername string -- string') single-space " " explode dup 2 + rotate "" swap extract-player-loop ; : remember-pager (playerdbref -- ) me @ name over setlastpager me @ name over update-lastpagers me @ getlastpaged over name swap extract-player swap setlastpagedgroup ; : remember-pagee (player[s] -- player[s]) dup not if pop me @ getlastpaged else single-space then ; : ignored? (playerdbref -- ignored?) getignorestr me @ int intostr " " strcat " #" swap strcat instr ; : ignoring? (playerdbref -- ignored?) int intostr " " strcat me @ getignorestr " #" rot strcat instr ; : ignore-dbref (dbref -- ) int intostr " " strcat " #" swap strcat me @ getignorestr swap over over instr not if strcat else pop then me @ setignorestr ; : unignore-dbref (dbref -- ) int intostr " " strcat " #" swap strcat me @ getignorestr swap split strcat me @ setignorestr ; : check-ignored-dbref (dbref -- player?) dup player? not if unignore-dbref 0 else pop 1 then ; : list-ignored-loop (str ignorestr -- str) dup not if pop sort-stringwords " " strcat exit then " " split swap 1 strcut swap pop atoi dbref dup check-ignored-dbref if name " " strcat rot strcat swap else pop then list-ignored-loop ; : list-ignored ( -- string) "" me @ getignorestr stripspaces single-space list-ignored-loop comma-format ; : priority? (playerdbref -- priority?) getprioritystr me @ int intostr " " strcat " #" swap strcat instr ; : priority-dbref (dbref -- ) int intostr " " strcat " #" swap strcat me @ getprioritystr swap over over instr not if strcat else pop then me @ setprioritystr ; : unpriority-dbref (dbref -- ) int intostr " " strcat " #" swap strcat me @ getprioritystr swap split strcat me @ setprioritystr ; : check-priority-dbref (dbref -- player?) dup player? not if unpriority-dbref 0 else pop 1 then ; : list-priority-loop (str prioritystr -- str) dup not if pop sort-stringwords " " strcat exit then " " split swap 1 strcut swap pop atoi dbref dup check-priority-dbref if name " " strcat rot strcat swap else pop then list-priority-loop ; : list-priority ( -- string) "" me @ getprioritystr stripspaces single-space list-priority-loop comma-format ; : havened? (playerdbref -- haven?) "haven" flag? ; : noguest? (playerdbref -- noguest?) "noguest" Ugetpropstr ; : nomail? (playedbref -- noguest?) "~/ban/mail" \getpropstr ; : pagepose? (string -- bool) dup strlen 1 > if 2 strcut pop dup ":" 1 strncmp not over ";" 1 strncmp not or if 1 strcut swap pop " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz,':*" swap instr else pop 0 then else pop 0 then ; : page-me-inform (message -- ) page_echo? if tell else pop "Your message has been sent." tell then ; : page-them-inform (message dbref format to -- ) 3 pick name "you" swap subst -4 rotate over page_standard? dup 1 = if pop over get-prepend over over strlen strcut pop stringcmp if over get-prepend " " strcat swap strcat then else 2 = if get_opose over stringcmp if pop dup get-standard else pop dup get-standard "%n %m" "%m" subst then then then 3 pick " " split pop 1 strcut strlen 3 < over not if swap pop " " swap then ".,?!:' " rot instr and if "%n%m" "%n %m" subst then me @ name "%n" subst me @ location name "%l" subst 4 rotate "%t" subst dup "%w" instr if get-timestr "%w" subst then "%%m" "%m" subst "%%m" "%M" subst me @ swap pronoun_sub rot dup if "^^" "^" subst then get-curr-format "pose" stringcmp if "^YELLOW^" swap strcat "^GREEN^" strcat then "%m" subst "^GREEN^" swap strcat .wrapnotify ; : get-playerdbrefs (count nullstr playersstr -- dbref_range unrecstr) dup not if pop sort-stringwords exit then " " split swap dup "(" 1 strncmp not if " " strcat swap strcat ")" split swap pop stripspaces get-playerdbrefs exit then dup "#" 1 strncmp not if dup 1 strcut swap pop dup number? if atoi dbref dup ok? if dup player? if swap pop 4 rotate 1 + -4 rotate -4 rotate get-playerdbrefs exit else pop then else pop then else pop then then dup "*" 1 strncmp not if 1 strcut swap pop me @ get-alias " " strcat swap strcat single-space get-playerdbrefs exit then dup player-match? dup -1 = if pop pop pop stripspaces exit then 0 > if swap pop 4 rotate 1 + -4 rotate -4 rotate else dup me @ get-alias dup if swap pop " " strcat swap strcat single-space else pop dup partial-match dup -1 = if pop pop pop stripspaces exit then if swap pop 4 rotate 1 + -4 rotate -4 rotate else "\"" swap strcat "\" " strcat rot swap strcat swap then then then get-playerdbrefs ; : refs2names (dbrefrange count nullstr -- dbrefrange namestr) over not if swap pop sort-stringwords exit then 3 pick 3 + rotate dup -5 rotate name strcat " " strcat swap 1 - swap refs2names ; : unwrapwrap (s--) ( Multi-line tell ) dup "}{" instr dup if 1 - strcut swap tell 2 strcut swap pop unwrapwrap else pop dup " " strcmp if tell else pop then then ; : mailstr ( i s -- s ) swap dup 0 = if "no" else dup intostr then " " strcat rot strcat " mail message" strcat swap 1 = not if "s" strcat then ; : unwrap (s--) ( Multi-line tell with checks for forwarding parens ) dup "(" 1 strncmp not over " (" 2 strncmp not or if dup ")" instr 1 + strcut swap tell unwrap else dup "}{" instr if unwrapwrap else .wrap then then ; : title (--) ( Mail title ) "Mail v1.3 by PakRat and Company" tell " " tell ; : mail_echo? (--bool) me @ "echo?" Ugetpropstr "no" stringcmp ; : get-forward (pdb--s) "forward" Ugetpropstr ; : set-forward (s--) me @ "forward" rot Usetpropstr ; : mail-count (pdb sprop--count) Ugetpropstr atoi ; : mail-setmsg (num txt pdb sprop--) "/" 5 rotate intostr strcat strcat rot Usetpropstr ; : mail-addmsg (txt pdb sprop--) over over mail-count 1 + intostr ( msg pdb sprop scount+1 ) 3 pick 3 pick ( msg pdb sprop scount+1 pdb sprop ) 3 pick Usetpropstr ( msg pdb sprop scount+1 ) rot rot "/" strcat rot strcat rot Usetpropstr ; : mail-getmsg (num pdb sprop--msg) "/" strcat rot intostr strcat Ugetpropstr ; : mail-delmsg-loop (pdb sprop curnum top--) over over = if "" 5 rotate 5 rotate mail-setmsg pop exit then over 1 + ( pdb sprop curnum top curnum+1 ) 5 pick 5 pick mail-getmsg 3 pick swap 6 pick 6 pick mail-setmsg ( pdb sprop curnum top ) swap 1 + swap mail-delmsg-loop ; : mail-delmsg (num pdb sprop--) rot (pdb sprop num) 3 pick 3 pick mail-count 4 pick 4 pick ( pdb sprop num top pdb sprop ) 4 rotate 4 rotate mail-delmsg-loop (pdb sprop--) swap dup ( sprop pdbprop pdb ) 3 pick mail-count 1 - intostr ( sprop pdbprop scount-1 ) rot swap Usetpropstr ; : mail-getdel (pdb sprop--msg) ( mail-getmsg + mail-delmsg ) over over mail-count rot rot ( count pdb sprop ) 3 pick 3 pick 3 pick mail-getmsg -4 rotate ( txt count pdb sprop ) mail-delmsg ; : mail-erase-loop (proploc count--proploc count) dup not if exit then over maildir mail-getdel dup " " split pop 1 strcut swap pop atoi dbref me @ dbcmp not if rot rot 1 - mail-erase-loop else pop exit then over 4 rotate ( fix --> ) swap maildir mail-addmsg ; : mail-erase (pdb--erased?) dup maildir mail-count mail-erase-loop swap pop ; : sysfix (iday--isystime) ( This is that magical hack, I was so amazed when it worked ) getday - 86400 * systime 86400 / 86400 * + ; : mail-unparse-mesg ( msg:"#dbref day@hh:mm:ss Amesg" -- name time msg ) " " split swap dup "#" 1 strncmp not if 1 strcut swap pop atoi dbref dup ok? if name else pop "*TOAD*" then swap "@" split swap atoi dup getday swap - dup not if pop "Today, " else dup 1 = if pop "Yesterday, " else intostr " days ago, " strcat then then swap sysfix "%b %e, " strftime strcat swap " " split rot rot ":" split swap atoi dup 11 > if 12 - " PM" else " AM" then rot swap strcat swap dup not if pop 12 then intostr ":" strcat swap strcat strcat swap dup "A" 1 strncmp not if 1 strcut swap pop then else swap 3 strcut swap pop ") -- " split swap ":" split swap atoi dup 11 > if 12 - " PM" else " AM" then rot swap strcat swap dup not if pop 12 then intostr ":" strcat swap strcat "Unknown day at " swap strcat swap then ; : list-message (s--) mail-unparse-mesg rot "=====" tell "From: " swap strcat tell swap "Date: " swap strcat tell "-----" tell unwrap " " tell ; : mail-read-loop (--) me @ maildir mail-count 0 > if me @ maildir mail-getdel mail-read-loop dup list-message "Save this mail message? (y/n)" tell read "n" 1 strncmp not if pop "Message tossed." else me @ omaildir mail-addmsg "Message saved." then tell " " tell then "Done." tell ; : mail-send (msg pdb--) dup maildir mail-count 50 > if name "'s mailbox is full." strcat tell pop else dup "You have new mail from " me @ name strcat ". Type 'mail read' to read it." strcat notify "#" me @ int intostr strcat " " strcat getday intostr strcat "@" strcat time intostr ":" strcat swap dup intostr ":" strcat swap 10 < if "0" swap strcat then strcat swap dup intostr swap 10 < if "0" swap strcat then strcat strcat (msg p s) " A" strcat ( over int 4 rotate crypt2 ) rot strcat swap maildir mail-addmsg then ; : remove-sleepers (dbrefrange count nullstr -- dbrefrange sleeperstr) over not if swap pop sort-stringwords exit then 3 pick 3 + rotate dup awake? if -4 rotate else dup get-sleepmsg dup if "^GREEN^Sleeping message for " rot name strcat ": " strcat swap dup if "^^" "^" subst then strcat tell else pop name " " strcat strcat then rot 1 - rot rot then swap 1 - swap remove-sleepers ; : remove-nopagers (dbrefrange count nullstr -- dbrefrange nopagestr) over not if swap pop sort-stringwords exit then 3 pick 3 + rotate dup havened? not over priority? or if -4 rotate else dup page_inform? if dup "^GREEN^You sense that " me @ name strcat " tried to page you, but you are set havened." strcat .wrapnotify then dup get-havenmsg dup if "^GREEN^Haven message for " rot name strcat ": " strcat swap dup if "^^" "^" subst then strcat tell else pop name " " strcat strcat then rot 1 - rot rot then swap 1 - swap remove-nopagers ; : remove-ignoring (dbrefrange count nullstr -- dbrefrange ignoringstr) over not if swap pop sort-stringwords exit then 3 pick 3 + rotate dup ignored? not if -4 rotate else dup page_inform? if dup "^GREEN^" me @ name strcat " tried to page you, but you are ignoring them." strcat .wrapnotify then dup get-ignoremsg dup if "^GREEN^Ignore message for " rot name strcat ": " strcat swap dup if "^^" "^" subst then strcat tell else pop name " " strcat strcat then rot 1 - rot rot then swap 1 - swap remove-ignoring ; : remove-maxers (dbrefrange count count nullstr -- dbrefrange ignoringstr) over not if swap pop swap pop sort-stringwords exit then 4 pick 4 + rotate dup get-multimax 5 pick < not over priority? or if -5 rotate else dup page_inform? if dup "^GREEN^" me @ name strcat " tried to include you in too large of a multi-page." strcat .wrapnotify then name " " strcat strcat 4 rotate 1 - -4 rotate then swap 1 - swap remove-maxers ; : remove-noguest (dbrefrange count nullstr -- dbrefrange sleeperstr) over not if swap pop sort-stringwords exit then 3 pick 3 + rotate dup noguest? not or if -4 rotate else name " " strcat strcat rot 1 - rot rot then swap 1 - swap remove-noguest ; : remove-nomail (dbrefrange count nullstr -- dbrefrange sleeperstr) over not if swap pop sort-stringwords exit then 3 pick 3 + rotate dup nomail? not over .guest? not and if -4 rotate else name " " strcat strcat rot 1 - rot rot then swap 1 - swap remove-nomail ; : remove-non-erasees (drange count ""--drange non-erasestr) over not if swap pop sort-stringwords exit then 3 pick 3 + rotate dup mail-erase if -4 rotate else name " " strcat strcat rot 1 - rot rot then swap 1 - swap remove-non-erasees ; : list-ignored-pagees (dbrefrange count nullstr -- dbrefrange ignoringstr) over not if swap pop sort-stringwords exit then 3 pick 3 + rotate dup ignoring? not if -4 rotate else dup -5 rotate name " " strcat strcat then swap 1 - swap list-ignored-pagees ; : do-getplayers (players -- dbrefrange) stripspaces single-space remember-pagee 0 "" rot get-playerdbrefs dup if comma-format dup " " instr "I don't recognize the player" swap if "s" strcat then " named " strcat swap strcat tell else pop then ; : do-sleepers (dbrefrange -- dbrefrange') dup "" remove-sleepers dup if comma-format dup " " instr if " are " else " is " then "currently asleep." strcat strcat tell "You can leave page-mail with 'mail ='" tell else pop then ; : do-nopagers (dbrefrange -- dbrefrange') dup "" remove-nopagers dup if comma-format dup " " instr if " are " else " is " then "currently not accepting pages." strcat strcat tell else pop then ; : do-ignoring (dbrefrange -- dbrefrange') dup "" remove-ignoring dup if comma-format dup " " instr if " are " else " is " then "currently ignoring you." strcat strcat tell else pop then ; : do-noguest (dbrefrange -- dbrefrange') dup "" remove-noguest dup if comma-format " do" over " " instr not if "es" strcat then " not wish to be paged by guests." strcat strcat tell else pop then ; : do-nomail (dbrefrange -- dbrefrange') dup "" remove-nomail dup if comma-format " cannot receive mail." strcat tell else pop then ; : do-maxers ( dbrefrange -- dbrefrange' ) dup dup "" remove-maxers dup if comma-format dup " " instr if " don't " else " doesn't " then "want to be included in multi-pages to that many people." strcat strcat tell else pop then ; : do-erasees (drange--drange') dup "" remove-non-erasees dup if comma-format " didn't have any mail messages from you." strcat tell else pop then ; : do-list-ignored-pagees (dbrefrange -- dbrefrange') dup "" list-ignored-pagees dup if comma-format dup " " instr if " are " else " is " then "currently ignored by you." strcat strcat tell else pop then ; (********* ADDED BY RISS *********) : list-ineditor (lists folks in I mode) begin over while 3 pick 3 + rotate dup "I" flag? not if -4 rotate else dup -5 rotate name " " strcat strcat then swap 1 - swap repeat swap pop sort-stringwords ; : do-interactive (added by riss) dup "" list-ineditor dup if comma-format dup " " instr if " are editing a program or file and might not respond quickly." else " is editing a program or file and might not respond quickly." then strcat tell else pop then ; (******* END ADDED BY RISS *******) : away? (dbref -- bool) "away" Ugetpropstr ; : idle-length (dbref -- int) dup player? if descriptors dup not if pop -1 exit then 1 - swap descr_idle begin over while swap 1 - swap rot descr_idle over over > if swap then pop repeat swap pop else timestamps pop swap pop swap pop systime swap - then ; : idle? (dbref -- bool) idle-length "idletime" sysparm atoi >= ; : do-list-away (refrange -- refrange') dup "" begin over while swap 1 - swap over 4 + pick dup away? not over "I" flag? or if pop continue then dup get-awaymsg dup if "Away message for " rot name strcat ": " strcat swap strcat tell else pop name " " strcat strcat then repeat swap pop sort-stringwords dup if comma-format dup " " instr if " are " else " is " then "currently away and may not get back to you soon." strcat strcat tell else pop then ; : do-list-idle (refrange -- refrange') dup "" begin over while swap 1 - swap over 4 + pick dup idle? not over away? or over "I" flag? or if pop continue then dup get-idlemsg dup if "Idle message for " 3 pick name strcat ": " strcat swap strcat else pop dup name " is currently %i idle and may not get back to you soon." strcat then swap idle-length dup 3600 > if 3600 / " hour" else dup 60 > if 60 / " minute" else " second" then then over 1 = not if "s" strcat then swap intostr swap strcat "%i" subst tell repeat swap pop sort-stringwords dup if comma-format dup " " instr if " are " else " is " then "currently idle and may not get back to you soon." strcat strcat tell else pop then ; : do-warn-away () me @ away? if "You are currently marked as being away." tell then ; : get-valid-pagees (players -- dbrefrange players') do-getplayers do-sleepers me @ .guest? if do-noguest then do-nomail do-nopagers do-ignoring do-maxers do-interactive (ADDED BY RISS *******) do-list-away do-list-idle do-list-ignored-pagees dup "" refs2names ; : page-toeach (dbrefrange to message -- ) 3 pick not if pop pop pop exit then 3 pick 3 + rotate over swap (refrange to mesg mesg dbref) dup remember-pager get-curr-format me @ swap get-oformat-prop (refrange to mesg mesg dbref format) 5 pick page-them-inform rot 1 - rot rot page-toeach ; : summon-toeach (dbrefrange -- ) dup not if pop exit then dup 1 + rotate dup remember-pager "You sense that " me @ name strcat " is looking for you in " strcat me @ location name strcat over me @ location owner dbcmp if me @ location intostr "(#" swap strcat ")" strcat strcat then "." strcat "^GREEN^" swap strcat .wrapnotify 1 - summon-toeach ; : mail-toeach (drange msg--) over not if pop pop exit then over 2 + rotate over swap mail-send swap 1 - swap mail-toeach ; : ignore-each (dbrefrange -- ) dup not if pop exit then swap ignore-dbref 1 - ignore-each ; : unignore-each (dbrefrange -- ) dup not if pop exit then swap unignore-dbref 1 - unignore-each ; : priority-each (dbrefrange -- ) dup not if pop exit then swap priority-dbref 1 - priority-each ; : unpriority-each (dbrefrange -- ) dup not if pop exit then swap unpriority-dbref 1 - unpriority-each ; : multi-page (message player -- ) get-valid-pagees dup if (message dbrefrange playerstr) dup me @ setlastpaged comma-format (message dbrefrange playerstr) over 3 + rotate (dbrefrange playerstr message) dup me @ get-curr-format (derefrange plyrstr mesg mesg formatname) get-format-prop (derefrange plyrstr mesg mesg format) over " " split pop 1 strcut strlen 3 < over not if swap pop " " swap then ".,?!:' " rot instr and if "%i%m" "%i %m" subst then (derefrange plyrstr mesg mesg format) 4 pick "%n" subst (derefrange plyrstr mesg mesg format) dup "%w" instr if get-timestr "%w" subst then me @ name "%i" subst (derefrange plyrstr mesg mesg format) swap dup if "^^" "^" subst then get-curr-format "pose" stringcmp if "^YELLOW^" swap strcat "^GREEN^" strcat then "%m" subst "^GREEN^" swap strcat (derefrange plyrstr mesg format) page-me-inform page-toeach me @ havened? if "You are currently set haven." tell then else pop pop pop then ; : multi-summon (player -- ) get-valid-pagees dup if dup me @ setlastpaged comma-format "You sent your summons to " swap strcat "." strcat page-me-inform summon-toeach me @ havened? if "You are currently set haven." tell then else pop pop then ; : multi-ping (player -- ) get-valid-pagees dup if dup me @ setlastpaged comma-format "You can page to " swap strcat "." strcat page-me-inform popn me @ havened? if "You are currently set haven." tell then else pop pop then ; : mail-do-forwards (drange msg--) over not if pop pop exit then swap 1 - swap over 3 + rotate dup get-forward dup if do-getplayers dup if dup "" remove-ignoring pop dup 2 + rotate name "(Orig. to " swap strcat ") " strcat over 3 + pick strcat else pop 1 3 pick then else pop 1 3 pick then mail-toeach mail-do-forwards ; : check-each (drange--) dup not if pop exit then dup 1 + rotate dup me @ dbcmp not if dup name " has " strcat else "You have " then over maildir mail-count "unread" mailstr strcat " and " strcat over omaildir mail-count "saved" mailstr strcat "." strcat tell dup maildir mail-count if "-- Oldest unread mail is dated " over maildir "/1" strcat Ugetpropstr mail-unparse-mesg pop swap pop strcat "." strcat tell then pop 1 - check-each ; : multi-send (msg names--) over not if pop pop "No mail message sent." tell exit then do-getplayers me @ .guest? if do-noguest then do-ignoring dup "" refs2names (msg {drange} names) dup if over 3 + rotate dup pagepose? if 1 strcut swap pop dup " " split pop 1 strcut strlen 3 < over not if swap pop " " swap then ".?!,': " rot instr and not if " " swap strcat then me @ name swap strcat then swap comma-format "Message sent to " over strcat "." strcat .wrap dup " " instr if "(to " swap strcat ")" strcat strcat else pop then mail-do-forwards else pop pop pop "There's noone to send the message to." tell then ; : multi-check do-getplayers check-each ; : multi-erase (sps--) do-getplayers do-erasees dup "" refs2names dup if comma-format "You erased your last mail message to " swap strcat "." strcat tell popn else pop pop then ; : multi-ignore (players -- ) do-getplayers dup "" refs2names comma-format dup if "Adding " swap strcat " to your ignore list." strcat else pop "Noone added." then tell ignore-each ; : multi-unignore (players -- ) do-getplayers dup "" refs2names comma-format dup if "Removing " swap strcat " to your ignore list." strcat else pop "Noone removed." then tell unignore-each ; : multi-priority (players -- ) do-getplayers dup "" refs2names comma-format dup if "Added " swap strcat " to your priority list." strcat else pop "Noone added." then tell priority-each ; : multi-unpriority (players -- ) do-getplayers dup "" refs2names comma-format dup if "Removing " swap strcat " to your priority list." strcat else pop "Noone removed." then tell unpriority-each ; : show-help prog "_help1" .showlist ; : show-help2 prog "_help2" .showlist ; : show-help3 prog "_help3" .showlist ; : show-help4 prog "_help4" .showlist ; : show-hints prog "_hint1" .showlist ; : show-hints2 prog "_hint2" .showlist ; : Do-Help (s--) title pop prog "_helpm" .showlist ; : show-who-info ( -- ) "You last paged " me @ getlastpaged comma-format dup not if pop "no one" then strcat "." strcat tell "The last 6 people to page you were " me @ getlastpagers comma-format dup not if pop "no one" then strcat " (who paged last)." strcat tell me @ getlastpagedgroup comma-format dup if "The last group page also included " swap strcat "." strcat tell else pop then "You are receiving pages in " me @ page_standard? dup 1 = if pop "prepended" else 2 = if "forced standard" else "regular formatted" then then strcat " form." strcat tell me @ get-multimax dup 888 < if "You accept pages including up to " over intostr strcat swap 1 > if " people." else " player." then strcat tell else pop then "You are ignoring " list-ignored dup not if pop "no one" then strcat "." strcat tell "You are giving priority to " list-priority dup not if pop "no one" then strcat "." strcat tell me @ havened? if "You are currently set haven, so no one can page you." tell then me @ noguest? if "You are currently set to block guests, so no guests can page you." tell then ; : Valid? (i sprop--i) over 0 > me @ rot mail-count rot >= and ; : Wipe-Saved (i--) dup if dup "" me @ omaildir mail-setmsg 1 - Wipe-Saved else me @ omaildir Uremove_prop pop then ; : Del-All (--) "Are you sure you want to delete ALL of your saved mail?" tell "(This won't affect any unread mail.)" tell " " tell me @ omaildir mail-count "You have " over "saved" mailstr strcat "." strcat tell "Delete all? (y/n)" tell read "y" strcmp if "Aborted." tell pop exit then Wipe-Saved "All saved mail deleted. Thank you for helping us save diskspace!" tell ; : Do-Del (s--) ( Main routine to delete messages, takes a number or 'all' ) dup not if pop "Usage: mail del msgnum" tell " or: mail del all -- deletes all your saved mail at once" tell me @ omaildir mail-count "You have " swap "saved" mailstr strcat "." strcat tell else dup "all" strcmp not if pop Del-All else atoi dup omaildir Valid? not if "Invalid saved mail message number." tell pop else "Saved mail message " over intostr strcat " of " strcat me @ omaildir mail-count intostr strcat ":" strcat tell dup me @ omaildir mail-getmsg list-message "Delete this saved mail message? (y/n)" tell read "y" strcmp not if me @ omaildir mail-delmsg "Deleted." else pop "Spared." then tell then then then ; : EM-Loop (s--s) read dup "." strcmp not if pop exit then dup "XXX" stringcmp not if pop pop "" exit then strcat "}{" strcat dup strlen dup sizelimit > if "Maximum mail message size reached, truncating and sending." tell pop sizelimit strcut pop exit then dup sizelimit 500 - > if sizelimit swap - intostr " letters left before mail message is full, please finish soon." strcat tell else pop then EM-Loop ; : Edit-Mail (--s) ( This is my cheapo editor, no frills :) "Enter the subject for this letter:" tell read "Re: " swap strcat "}{" strcat " " tell "A single period on a line saves/sends the mail message." tell "XXX on a line nukes the mail message, nothing gets sent." tell " " tell " <<< Mail Editor >>> Enter message here:" tell " " tell EM-Loop ; : Do-Send (s--) ( Main routine to send mail, calls MEdit if no =msg part to argument ) dup if dup "=" instr dup if 1 - strcut 1 strcut swap pop swap multi-send else pop Edit-Mail swap multi-send then else "Usage: mail send playernames=message" tell " " tell "Omit the '=message' to use the new PakMail editor. Use the" tell "editor if you want to send a mail message of more than one line." tell then ; : Do-Kill (s--) ( Main routine to remove a message sent to someone else by mistake ) dup if multi-erase else pop "Usage: mail kill playernames" tell " " tell "Wipes out the latest mail message you sent to each player in the list." tell then ; : Do-PurgeOldMail (--) 0 me @ omaildir mail-count begin dup while dup me @ omaildir mail-getmsg ( numpurged curnum msg ) dup " " instr dup if strcut swap then pop dup "@" instr dup if 1 - strcut then pop atoi GetDay daysold - < if dup me @ omaildir mail-delmsg swap 1 + swap then 1 - repeat pop dup if dup "saved" mailstr " cleaned out." strcat tell then pop ; : Do-Check (s--) ( Main routine to see if others have mail waiting for them ) ( This also puts up a help message if you check yourself, ) ( It's the same as just typing 'mail' ) dup not if pop me @ name then multi-check ; : List-Msgs (topnum pdb sprop--) rot ( Support routine for Do-List, shows a message ) (pdb sprop topnum) dup if dup 1 - swap dup intostr "> " strcat ( pdb sprop i-1 i "i> " ) swap 5 pick swap ( pdb sprop i-1 "i> " pdb i ) swap 5 pick mail-getmsg mail-unparse-mesg ( pdb sprop i-1 "i> " "name" "time" "msg" ) " from " 4 rotate strcat ": " strcat ( pdb sprop i-1 "i> " "time" "msg" " from name: " ) swap strcat strcat strcat dup "}{" instr dup if 1 - strcut then pop 80 strcut pop ( pdb sprop i-1 msg ) swap 4 rotate 4 rotate List-Msgs tell else pop pop pop then ; : Do-ListOld (pdb--) ( Routine to show an old mail message ) dup omaildir mail-count dup not if pop pop "You have no saved mail messages." tell else "Summary of your saved mail:" tell " " tell swap omaildir List-Msgs then ; : Do-ListNew (pdb--) dup maildir mail-count dup not if pop pop "You have no new mail." tell else "Summary of your Un-Read mail:" tell " " tell swap maildir List-Msgs then ; : mail-read-all (--) me @ maildir mail-count dup 0 <= if pop "No new mail." tell else "Reading " swap "new" mailstr strcat ":" strcat tell mail-read-loop then ; : Do-For (s--) ( Main routine to forward old mail to new recipients ) ( Invaluable for harrassing page #mail ) " to " split dup not if pop pop "Usage: mail forward msgnum to people" tell else swap atoi dup omaildir Valid? not if pop "Invalid saved mail message number." tell else me @ omaildir mail-getmsg mail-unparse-mesg rot "(Orig. from " swap strcat ", " strcat rot strcat ") " strcat swap strcat swap multi-send then then ; : Do-New (s--) ( Main routine to browse new mail before actually reading it ) dup not if pop me @ Do-ListNew " " tell "mail new msgnumber -- Peek at a new message." tell "mail read msgnumber -- Read and save or toss a new message." tell else atoi dup maildir Valid? not if "Invalid unread mail message number." tell pop else "New mail message " over intostr strcat " of " strcat me @ maildir mail-count intostr strcat ":" strcat tell me @ maildir mail-getmsg list-message then then ; : Do-Read (s--) ( Main routine to read your new messages and save or toss them ) dup not if pop mail-read-all else atoi dup maildir Valid? not if "Invalid unread mail message number." tell pop else "Reading new mail message " over intostr strcat " of " strcat me @ maildir mail-count intostr strcat ":" strcat tell dup me @ maildir mail-getmsg swap me @ maildir mail-delmsg dup list-message "Save this mail message? (y/n)" tell read "n" 1 strncmp not if pop "Message tossed." else me @ omaildir mail-addmsg "Message saved." then tell then then ; : Do-Old (s--) Do-PurgeOldMail ( Read one old message or browse all of them ) dup not if pop me @ Do-ListOld " " tell "mail old msgnumber -- Read a saved mail message in full." tell "mail del msgnumber -- Delete a saved mail message." tell "mail del all -- Discard ALL saved messages at once." tell else atoi dup omaildir Valid? not if "Invalid saved mail message number." tell pop else "Saved mail message " over intostr strcat " of " strcat me @ omaildir mail-count intostr strcat ":" strcat tell me @ omaildir mail-getmsg list-message then then ; : Do-Set (s--) ( Main routine to set your forwarding address to someone else. ) dup not if pop "Usage: mail set PlayerName" tell " or: mail set clear -- Remove your forwarding address." tell me @ get-forward dup not if pop "You aren't forwarding your mail." else "Your mail is being forwarded to " swap strcat "." strcat then tell else dup "clear" stringcmp not if pop "" then dup set-forward if "set." else "cleared." then "Mail forwarding address " swap strcat tell then ; : mail-main ( s -- ) dup not if Do-PurgeOldMail pop me @ 1 check-each " " tell "Type 'mail read' to read new mail, or 'mail new' to peek at it." tell "Use 'mail old' to read saved mail, 'mail help' for help." tell exit then dup " " instr dup if 1 - strcut 1 strcut swap pop swap else pop "" swap then "help" scn if pop Do-Help exit then "to" scn if pop Do-Send exit then "send" scn if pop Do-Send exit then me @ .guest? not if "read" scn if pop Do-Read exit then "new" scn if pop Do-New exit then "old" scn if pop Do-Old exit then "check" scn if pop Do-Check exit then "del" scn if pop Do-Del exit then "forward" scn if pop Do-For exit then "kill" scn if pop Do-Kill exit then "erase" scn if pop Do-Kill exit then "set" scn if pop Do-Set exit then "clear" scn if swap pop Do-Set exit then then " " strcat swap strcat dup "=" instr if Do-Send exit then pop "Hmm? You probably forgot to use 'mail to person'." tell "Type 'mail help' for examples of how to use mail." tell ; : page-main ( s -- ) stripspaces dup not if pop "#help" then dup "&" 1 strncmp not if 1 strcut swap pop "=" strcat me @ getlastpaged strcat "#alias " swap strcat then dup "#R" 2 strncmp not if 2 strcut swap pop me @ getlastpagedgroup " " strcat swap strcat "#r" swap strcat then dup "#r" 2 strncmp not if 2 strcut swap pop me @ getlastpager " " strcat swap strcat then dup "#" 1 strncmp not if dup "#who" 2 stringmatch? if pop show-who-info exit then dup "#help" 2 stringmatch? if pop show-help exit then dup "#help2" stringcmp not if pop show-help2 exit then dup "#help3" stringcmp not if pop show-help3 exit then dup "#help4" stringcmp not if pop show-help4 exit then dup "#hints" 3 stringmatch? if pop show-hints exit then dup "#hints2" stringcmp not if pop show-hints2 exit then me @ .guest? if pop "Permission denied." tell exit then dup "#!haven" 3 stringmatch? if pop me @ "!haven" set "Haven bit reset." tell exit then dup "#!noguest" 3 stringmatch? if pop me @ "noguest" Uremove_prop "Guests can page you now." tell exit then dup "#!away" 3 stringmatch? if pop me @ "away" Uremove_prop "Away flag reset." tell exit then dup "#echo" 2 stringmatch? if pop "" set_page_echo "Pages now echoed." tell exit then dup "#!echo" 3 stringmatch? if pop "no" set_page_echo "Pages now not echoed." tell exit then dup "#inform" 3 stringmatch? if pop "yes" set_page_inform "You will now be informed of ignored page attempts." tell exit then dup "#!inform" 4 stringmatch? if pop "" set_page_inform "You will no longer be informed of ignored page attempts." tell exit then dup " " instr if " " split swap dup "#mail" 2 stringmatch? if pop mail-main exit then dup "#old" 2 stringmatch? if pop "old " swap strcat mail-main exit then dup "#del" 2 stringmatch? if pop "del " swap strcat mail-main exit then dup "#check" 3 stringmatch? if pop "check " swap strcat mail-main exit then dup "#haven" 3 stringmatch? if pop stripspaces dup "#clear" stringcmp not if pop "" then me @ set-havenmsg me @ "haven" set "Haven message and haven bit are now set." tell exit then dup "#away" 3 stringmatch? if pop stripspaces dup "#clear" stringcmp not if pop "" then me @ set-awaymsg me @ "away" "yes" Usetpropstr "Away message and away flag are now set." tell exit then dup "#sleepmsg" 3 stringmatch? if pop stripspaces dup "#clear" stringcmp not if pop "" then me @ set-sleepmsg "Sleep message is set." tell exit then dup "#idlemsg" 3 stringmatch? if pop stripspaces dup "#clear" stringcmp not if pop "" then me @ set-idlemsg "Idle message is set." tell exit then dup "#idletime" 6 stringmatch? if pop stripspaces dup "#off" stringcmp not if pop 88888888 else dup number? if atoi else pop -1 then then dup 0 > if 60 * me @ set-idletime "Idle timeout is set." tell else pop "page: #idletime: timeout must be a positive number." tell then exit then dup "#ignore" 2 stringmatch? if pop stripspaces dup "=" instr if "=" split stripspaces swap stripspaces swap me @ set-ignoremsg "Ignore message is set." tell then single-space multi-ignore exit then dup "#!ignore" 3 stringmatch? if pop stripspaces single-space multi-unignore exit then dup "#priority" 2 stringmatch? if pop stripspaces single-space multi-priority exit then dup "#!priority" 3 stringmatch? if pop stripspaces single-space multi-unpriority exit then dup "#format" 2 stringmatch? if pop dup "=" instr if "=" split stripspaces swap stripspaces single-space "_" " " subst me @ swap rot set-format-prop "Format set." tell else stripspaces dup me @ swap get-format-prop swap "' set to \"" strcat swap strcat "\"" strcat "Format '" swap strcat tell then exit then dup "#oformat" 3 stringmatch? if pop dup "=" instr if "=" split stripspaces swap stripspaces single-space "_" " " subst me @ swap rot set-oformat-prop "Oformat set." tell else stripspaces dup me @ swap get-oformat-prop swap "' set to \"" strcat swap strcat "\"" strcat "Oformat '" swap strcat tell then exit then dup "#alias" 2 stringmatch? if pop dup "=" instr if "=" split single-space stripspaces swap stripspaces single-space dup not if "page: #alias: Alias name cannot be null" tell pop pop exit then "_" " " subst swap set-personal-alias else stripspaces dup me @ get-alias "Alias \"" rot strcat "\" expands to \"" strcat swap strcat "\"" strcat tell then exit then dup "#global" 2 stringmatch? if pop "=" split stripspaces single-space swap stripspaces single-space dup not if "page: #global: Alias name cannot be null" tell pop pop exit then "_" " " subst swap set-global-alias exit then dup "#lookup" 3 stringmatch? if pop single-space stripspaces list-matching-aliases "Done." tell exit then dup "#forward" 4 stringmatch? if pop dup "#" strcmp not if pop "clear" then "set " swap strcat mail-main exit then dup "#erase" 4 stringmatch? if pop "erase " swap strcat mail-main exit then dup "#multimax" 3 stringmatch? if pop stripspaces atoi me @ set-multimax "Multi-max set." tell exit then dup "#standard" 3 stringmatch? if pop me @ set-standard "yes" set_page_standard "Page standard format set." tell exit then dup "#prepended" 3 stringmatch? if pop me @ set-prepend "prepend" set_page_standard "Page prepend format set." tell exit then dup "#ping" 3 stringmatch? if pop stripspaces multi-ping exit then pop else dup "#mail" 2 stringmatch? if pop "" mail-main exit then dup "#old" 2 stringmatch? if pop "old" mail-main exit then dup "#del" 2 stringmatch? if pop "del" mail-main exit then dup "#check" 3 stringmatch? if pop "check " me @ name strcat mail-main exit then dup "#haven" 3 stringmatch? if pop me @ "haven" set "Haven bit set." tell "Your haven message is \"" me @ get-havenmsg strcat "\"" strcat tell exit then dup "#noguest" 3 stringmatch? if pop me @ "noguest" "yes" Usetpropstr "Guests can no longer page you." tell exit then dup "#away" 3 stringmatch? if pop me @ "away" "yes" Usetpropstr "Away flag set." tell "Your away message is \"" me @ get-awaymsg strcat "\"" strcat tell exit then dup "#sleepmsg" 3 stringmatch? if pop "Your sleep message is \"" me @ get-sleepmsg strcat "\"" strcat tell exit then dup "#idlemsg" 3 stringmatch? if pop "Your idle message is \"" me @ get-idlemsg strcat "\"" strcat tell exit then dup "#idletime" 6 stringmatch? if pop "Your idle timeout is " me @ get-idletime 60 / intostr strcat " minutes." strcat tell exit then dup "#ignore" 2 stringmatch? if "You are currently ignoring " list-ignored dup not if pop "no one" then strcat "." strcat tell pop "Your ignore message is \"" me @ get-ignoremsg strcat "\"" strcat tell exit then dup "#!ignore" 3 stringmatch? if pop "" me @ setignorestr "You are now ignoring no one." tell exit then dup "#priority" 2 stringmatch? if "You are currently prioritizing " list-priority dup not if pop "no one" then strcat "." strcat tell pop exit then dup "#!priority" 3 stringmatch? if pop "" me @ setprioritystr "You are now prioritizing no one." tell exit then dup "#time" 2 stringmatch? if pop "The time is: " get-timestr strcat tell exit then dup "#alias" 2 stringmatch? if pop list-personal-aliases "Done." tell exit then dup "#global" 2 stringmatch? if pop list-global-aliases "Done." tell exit then dup "#lookup" 3 stringmatch? if pop "Syntax: page #lookup " tell exit then dup "#formatted" 3 stringmatch? if pop "" set_page_standard "Pages now received in formatted form." tell exit then dup "#multimax" 3 stringmatch? if pop me @ get-multimax "You currently accept pages including up to " over intostr strcat swap 1 > if " people." else " player." then strcat tell exit then dup "#oformat" 3 stringmatch? if pop "Bad #oformat syntax. Type 'page #help3' for more help." tell exit then dup "#forward" 4 stringmatch? if pop "set" mail-main exit then dup "#standard" 3 stringmatch? if pop "yes" set_page_standard "Pages now received in the standard form '" me @ get-standard strcat "'" strcat tell exit then dup "#prepended" 3 stringmatch? if pop "prepend" set_page_standard "Pages now received prepended with '" me @ get-prepend strcat "'" strcat tell exit then dup "#setup" 3 stringmatch? if trig "formats/page" "You page, \"%m\" to %n." Usetpropstr trig "formats/opage" "%n pages, \"%m\" to %t." Usetpropstr trig "formats/pose" "You page-pose, \"%i %m\" to %n" Usetpropstr trig "formats/opose" "In a page-pose to %t, %n %m" Usetpropstr "Setup done." tell pop exit then then "page: Syntax error: " swap strcat tell "Type \"page #help\" for help." tell exit then dup "=" instr not if stripspaces single-space me @ .guest? if dup " " instr if " " split pop "Guests are not allowed to use multi-page." tell then then multi-summon (do a summons page) else "=" split stripspaces dup pagepose? if 1 strcut swap pop "pose" set-curr-format else "page" set-curr-format then swap stripspaces single-space dup "!" 1 strncmp not if " " split swap 1 strcut swap pop dup not if pop "page" then set-curr-format then me @ .guest? if dup " " instr if " " split pop "Guests are not allowed to use multi-page." tell then then multi-page then ; : page page-main ; : mail mail-main ; : check ( d -- ) Do-PurgeOldMail 1 check-each ; public get-playerdbrefs ( 0 "" namestr -- dbreflist nomatchstr ) public page public mail public check : main "me" match dup me ! location loc ! trig trigger ! UPrivilege? not if pop "I have no UserPropDir." tell exit then me @ player? not if pop exit then me @ .guest? not if depth 1 = if dup string? if dup "Connect" strcmp not if me @ check exit then then then then command @ 1 strcut pop "m" stringcmp if page-main else mail-main then ; : do-debug depth dept ! main depth dept @ 1 - = not if "* Please tell PakRat you saw this line and what you typed to get it." tell .debug-line then ; . c q @register cmd-page=cmd/mail @register cmd-page=cmd/page @register cmd-page=lib/page @register #me cmd-page=tmp/prog1 @set $cmd/page=L @set $cmd/page=V @set $cmd/page=W @set $cmd/page=/_/de:@$cmd/page #help @set $cmd/page=/_defs/PAGEcheck:"$lib/page" match "check" call @set $cmd/page=/_defs/PAGEmail:"$lib/page" match "mail" call @set $cmd/page=/_defs/PAGEpage:"$lib/page" match "page" call @set $cmd/page=/_help1#:22 @set $cmd/page=/_help1#/1:MUFpage v2.5 by Foxen, feeped by Artie & Maddax Updated 04/18/1999 Page1 @set $cmd/page=/_help1#/2: @set $cmd/page=/_help1#/3:To give your location to another player: 'page ' @set $cmd/page=/_help1#/4:To send a message to another player: 'page = ' @set $cmd/page=/_help1#/5:To send a pose style page to a player: 'page = :' @set $cmd/page=/_help1#/6:To page multiple people: 'page [= ]' @set $cmd/page=/_help1#/7:To send another mesg to the last players: 'page = ' @set $cmd/page=/_help1#/8:To send your loc to the last players paged: 'page' @set $cmd/page=/_help1#/9:To send a message in a different format: 'page ! = ' @set $cmd/page=/_help1#/10:To reply to a page sent to you: 'page #r [= ]' @set $cmd/page=/_help1#/11:To reply to all the people in a multi-page: 'page #R [= ]' @set $cmd/page=/_help1#/12:To leave a page-mail message for someone: 'page #mail =' @set $cmd/page=/_help1#/13:To leave a multi-line message for someone: 'page #mail to ' @set $cmd/page=/_help1#/14:To list page-mail messages left for you: 'page #mail' @set $cmd/page=/_help1#/15:To read page-mail messages left for you: 'page #mail read' @set $cmd/page=/_help1#/16:To list old saved page-mail messages: 'page #old' @set $cmd/page=/_help1#/17:To read old saved page-mail messages: 'page #old ' @set $cmd/page=/_help1#/18:To delete old saved page-mail messages: 'page #del ' @set $cmd/page=/_help1#/19:To erase a message you sent to a player: 'page #erase ' @set $cmd/page=/_help1#/20:To list who you last paged and other info: 'page #who' @set $cmd/page=/_help1#/21:To display the next help screen: 'page #help2' @set $cmd/page=/_help1#/22:-- Words in <> are parameters. Parameters in [] are optional. -- @set $cmd/page=/_help2#:24 @set $cmd/page=/_help2#/1:MUFpage v2.5 by Foxen, feeped by Artie & Maddax Updated 04/18/1999 Page2 @set $cmd/page=/_help2#/2: @set $cmd/page=/_help2#/3:To test if you can page a player: 'page #ping ' @set $cmd/page=/_help2#/4:To refuse pages from specific players: 'page #ignore ' @set $cmd/page=/_help2#/5:To set the mesg all ignored players see: 'page #ignore []=' @set $cmd/page=/_help2#/6:To accept pages from a player again: 'page #!ignore ' @set $cmd/page=/_help2#/7:To let players page you despite haven: 'page #priority ' @set $cmd/page=/_help2#/8:To remove players from your priority list: 'page #!priority ' @set $cmd/page=/_help2#/9:To page a group of people in an alias: 'page * = ' @set $cmd/page=/_help2#/10:To set a personal page alias: 'page #alias =' @set $cmd/page=/_help2#/11:To clear a personal page alias: 'page #alias =' @set $cmd/page=/_help2#/12:To list who is in an alias: 'page #alias ' @set $tmp/prog1=/_help2#/13:To list all your personal aliases: 'page #alias' @set $cmd/page=/_help2#/14:To set an alias to the players last paged: 'page &' @set $cmd/page=/_help2#/15:To make an alias that everyone can use: 'page #global =' @set $cmd/page=/_help2#/16:To clear a global page alias: 'page #global =' @set $cmd/page=/_help2#/17:To list all the global aliases: 'page #global' @set $cmd/page=/_help2#/18:To list all aliases with a player in them: 'page #lookup ' @set $cmd/page=/_help2#/19:To see the time (useful with %w subs): 'page #time' @set $cmd/page=/_help2#/20:To set the max# of plyrs in a page to you: 'page #multimax ' @set $cmd/page=/_help2#/21:To see your multimax setting: 'page #multimax' @set $cmd/page=/_help2#/22:To set the your 'Sleeping' message: 'page #sleepmsg ' @set $cmd/page=/_help2#/23:To clear the your 'Sleeping' message: 'page #sleepmsg #clear' @set $cmd/page=/_help2#/24:To display the third help screen: 'page #help3' @set $cmd/page=/_help3#:23 @set $cmd/page=/_help3#/1:MUFpage v2.5 by Foxen, feeped by Artie & Maddax Updated 04/18/1999 Page3" @set $cmd/page=/_help3#/2: @set $cmd/page=/_help3#/3:To haven yourself so you are unpagable: 'page #haven'" @set $cmd/page=/_help3#/4:To set your 'havened' message: 'page #haven '" @set $cmd/page=/_help3#/5:To clear your 'havened' message: 'page #haven #clear'" @set $cmd/page=/_help3#/6:To unhaven yourself so you can be paged: 'page #!haven'" @set $cmd/page=/_help3#/7:To set yourself so guests can't page you: 'page #noguest' @set $cmd/page=/_help3#/8:To allow guests to page you again: 'page #!noguest' @set $cmd/page=/_help3#/9:To turn on echoing of your message: 'page #echo'" @set $cmd/page=/_help3#/10:To turn off echoing of your message: 'page #!echo'" @set $cmd/page=/_help3#/11:To be informed when a page to you fails: 'page #inform'" @set $cmd/page=/_help3#/12:To be turn off failed-page informing: 'page #!inform'" @set $cmd/page=/_help3#/13:To see another player's formatted pages: 'page #formatted'" @set $cmd/page=/_help3#/14:To prepend a format string to other's pages: 'page #prepend'" @set $cmd/page=/_help3#/15:To set your prepended format string: 'page #prepend '" @set $cmd/page=/_help3#/16:To force other's pages to a standard format: 'page #standard'" @set $cmd/page=/_help3#/17:To set the standard format you receive in: 'page #standard '" @set $cmd/page=/_help3#/18:To set a format that you see when paging: 'page #format ='" @set $cmd/page=/_help3#/19:To set a format that others receive: 'page #oformat ='" @set $cmd/page=/_help3#/20:To display the fourth help screen: 'page #help4' @set $cmd/page=/_help4#:15 @set $cmd/page=/_help4#/1:MUFpage v2.5 by Foxen, feeped by Artie & Maddax Updated 04/18/1999 Page4" @set $cmd/page=/_help4#/2: @set $cmd/page=/_help4#/3:To mark yourself away: 'page #away' @set $cmd/page=/_help4#/4:To set your away flag and message: 'page #away ' @set $cmd/page=/_help4#/5:To clear your away message: 'page #away #clear' @set $cmd/page=/_help4#/6:To reset your away flag: 'page #!away' @set $cmd/page=/_help4#/7:To set your idle message: 'page #idlemsg ' @set $cmd/page=/_help4#/8:To clear your idle message: 'page #idlemsg #clear' @set $cmd/page=/_help4#/9:To view what your current idle timeout is: 'page #idletime' @set $cmd/page=/_help4#/10:To set how long your idle timeout is: 'page #idletime ' @set $cmd/page=/_help4#/11:To turn off your idle messages: 'page #idletime #off' @set $cmd/page=/_help4#/12:To forward page-mail to another player: 'page #forward '" @set $cmd/page=/_help4#/13:To stop forwarding page-mail: 'page #forward #'" @set $cmd/page=/_help4#/14:To see who page-mail to you is forwarded to: 'page #forward'" @set $cmd/page=/_help4#/15:To see if page-mail is waiting for a player: 'page #check [players]'" @set $cmd/page=/_helpm#:19 @set $cmd/page=/_helpm#/1:Command -- Usage -- Type 'mail ' then the command below to use it. @set $cmd/page=/_helpm#/2:~~~~~~~ ~~~~~ @set $cmd/page=/_helpm#/3:Sending You send mail using one of two ways: (send and to are the same) @set $cmd/page=/_helpm#/4:Mail: The first way is just like page mail: 'mail PakRat=hi!' @set $cmd/page=/_helpm#/5:Use The second way is using the Multi-Line editor in Mail, @set $cmd/page=/_helpm#/6:'send' type 'mail to PakRat' and the editor comes up. @set $cmd/page=/_helpm#/7:or Now type in your message, (hit return after each line) @set $cmd/page=/_helpm#/8:'to' then send it with a '.' alone on a line, or 'XXX' to nuke it. @set $cmd/page=/_helpm#/9: You can use more than one name to send with both methods. @set $cmd/page=/_helpm#/10: @set $cmd/page=/_helpm#/11:help -- This help screen @set $cmd/page=/_helpm#/12:read -- Read your new mail and save important or harrassing mail @set $cmd/page=/_helpm#/13:new -- Peek at your new mail before actually reading it @set $cmd/page=/_helpm#/14:old -- List or read your saved mail @set $cmd/page=/_helpm#/15:forward -- Forward a saved message to others, ie 'mail forward 1 to PakRat' @set $cmd/page=/_helpm#/16:set -- Set your forwarding address, ie 'mail set Artie' @set $cmd/page=/_helpm#/17:del -- Delete a saved message @set $cmd/page=/_helpm#/18:kill -- Delete the newest message you sent to a person or people @set $cmd/page=/_helpm#/19:check -- See how many new & saved messages someone has @set $cmd/page=/_hint1#:19 @set $cmd/page=/_hint1#/1:MUFpage v2.5 by Foxen, feeped by Artie & Maddax Updated 04/18/1999 Hints1" @set $cmd/page=/_hint1#/2: @set $cmd/page=/_hint1#/3:All page commands can be used abbreviated to unique identifiers." @set $cmd/page=/_hint1#/4: For example: 'page #gl' is the same as 'page #global'" @set $cmd/page=/_hint1#/5:If you page to a name it doesn't recognize, it will check to see if it is" @set $cmd/page=/_hint1#/6: a personal alias. If it isn't, it checks to see if it is a global alias." @set $cmd/page=/_hint1#/7: For example: If there is a global alias 'tyg' defined as 'Tygryss', then" @set $cmd/page=/_hint1#/8: 'page tyg=test' will page 'test' to Tygryss." @set $cmd/page=/_hint1#/9:In format strings, %n will be replaced by the name of the player(s) receiv-" @set $cmd/page=/_hint1#/10: ing the page. %m will be replaced by the message. %i will be replaced" @set $cmd/page=/_hint1#/11: by your name. %w gets replaced by the time. These messages are what are" @set $cmd/page=/_hint1#/12: shown to you when you page to someone." @set $cmd/page=/_hint1#/13:In oformat strings, %n will be replaced by your name, %m by the message," @set $cmd/page=/_hint1#/14: and %l by your location. %t will be replaced with the names of all the" @set $cmd/page=/_hint1#/15: people in a multi-page. %w will be replaced with the current time." @set $cmd/page=/_hint1#/16: These messages are what is shown to the player you are paging." @set $cmd/page=/_hint1#/17:If you have a #prepend or #standard format with a %w, it shows you the time" @set $cmd/page=/_hint1#/18: when a player paged you." @set $cmd/page=/_hint1#/19:Use 'page #hints2' to show the next hints screen." @set $cmd/page=/_hint2#:15 @set $cmd/page=/_hint2#/1:MUFpage v2.5 by Foxen, feeped by Artie & Maddax Updated 06/09/98 Hints2 @set $cmd/page=/_hint2#/2: @set $cmd/page=/_hint2#/3:There are two standard formats with page: the 'page' format, and the 'pose' @set $cmd/page=/_hint2#/4: format. There are matching #oformats to go with them as well. @set $cmd/page=/_hint2#/5:If you really dislike having your pages that begin with colon's parsed as @set $cmd/page=/_hint2#/6: page-poses, then you can 'page #oformat pose=%n pages: :%m' @set $cmd/page=/_hint2#/7: or alternately, you can simply use 'page ! =' @set $cmd/page=/_hint2#/8:One good way to have all the pages to you beeped and hilighted is to do: @set $cmd/page=/_hint2#/9: 'page #prepend ##page>' and then set up the this trigger in tinyfugue: @set $cmd/page=/_hint2#/10: '/def -p15 -fg -t\"##page> *\" = /beep 3%;/echo %e[7m%-1%e[0m' @set $cmd/page=/_hint2#/11: If you want bold hilites instead, use '%e[1m' instead of '%e[7m' @set $cmd/page=/_hint2#/12: This only works if you have version 1.5.0 or later of tinyfugue and a @set $cmd/page=/_hint2#/13: vt100 terminal type. @set $cmd/page=/_hint2#/14:TinyTalk users, to make your pages always beep, use 'page #standard' @set $cmd/page=/_hint2#/15: Then all pages to you will be in standard page format. @action page;p;mail;m;pag;pa;mai;ma=here=tmp/exit1 @link $tmp/exit1=$cmd/page @set $tmp/exit1=M3 @set $tmp/exit1=/@u/p/formats/opage:%n pages, "%m" to %t. @set $tmp/exit1=/@u/p/formats/opose:In a page-pose to %t, %n %m @set $tmp/exit1=/@u/p/formats/page:You page, "%m" to %n. @set $tmp/exit1=/@u/p/formats/pose:You page-pose, "%i %m" to %n @set $tmp/exit1=/_/de:@$cmd/page #help @set $cmd/page=/_version:2.5FM$Revision: 1.3 $ "Installation of cmd-page complete.