"Beginning installation of cmd-laston... @prog cmd-laston 1 99999 d 1 i ( cmd-laston: $Date: 2000/01/27 20:00:55 $ $Revision: 1.2 $ ) ( Author: PakRat ( New Global @last by PakRat -- stores disconnects and connects on the ) ( connection system programs, this way people can't be shown as online ) ( when they were actually just swept to another room. ) ( *** SETUP *** ) ( @reg #program=cmd/laston ) ( @set $cmd/laston=2 [ May need W bit ] ) ( @set $cmd/laston=L ) ( @set #0=/~connect/laston:$cmd/laston ) ( @set #0=/~disconnect/laston:$cmd/laston ) ( @action @last;last;@laston;laston=#0 ) ( @link @last=$cmd/laston ) ( @desc @last=@$cmd/laston -help ) $include $lib/glow $def BLOCKPROP "_prefs/block/last-on" $def CONPROP "@/lc" $def DISPROP "@/ld" $def OCONPROP "_/lc" $def ODISPROP "_/ld" $def a me @ swap ansi_notify : Last-Title " " .tell "^YELLOW^Last-On Info: ^BLUE^Muck Local Time (CST)" a "^RED^~~~~~~~~~~~~" a ; : Last-Help Last-Title "^BROWN^Usage: ^YELLOW^@last names ^AQUA^-- ^CYAN^Shows when player last connected" a " ^YELLOW^@last #help ^AQUA^-- ^CYAN^Shows help screen" a " ^YELLOW^@last #block ^AQUA^-- ^CYAN^Blocks others from seeing your @last" a " ^YELLOW^@last #unblock ^AQUA^-- ^CYAN^Restores it so others can see it" a ; : Last-Block ( -- ) me @ BLOCKPROP "yes" 0 addprop "^GREEN^Only you and wizards can see your Last-On information now." a ; : Last-Unblock ( -- ) me @ BLOCKPROP remove_prop "^GREEN^Anyone can now see your Last-On information now." a ; : AddNum ( s i s i -- s i ) dup intostr rot strcat swap ( s i s i ) dup 1 = not if swap "s" strcat swap then 0 = if pop "" then ( s i s ) dup if ", " strcat then rot swap strcat swap ; : Tell-Time ( i -- s ) "" swap ( s i ) dup 2419200 / " moon" swap AddNum 2419200 % dup 86400 / " day" swap AddNum 86400 % over "moon" instr not if dup 3600 / " hour" swap AddNum 3600 % over "day" instr not if dup 60 / " min" swap AddNum 60 % over "hour" instr not if dup " sec" swap AddNum then then then pop .cleancommas ; : Last-Check ( d -- ) dup awake? if name " is online now." strcat "^YELLOW^" swap strcat a exit then dup BLOCKPROP getpropstr .yes? if dup me @ dbcmp me @ .mage? or not if name " wishes to keep their Last-On information private." strcat "^RED^" swap strcat a exit then then dup DISPROP getpropval dup not if pop dup ODISPROP getpropval then dup if ( d i ) "%I:%M%p" over timefmt tolower dup 1 strcut pop "0" strcmp not if 1 strcut swap pop then " on %A, %b " 3 pick timefmt strcat "%e, %Y." 3 pick timefmt striplead strcat over systime swap - Tell-Time " ago at " strcat swap strcat 3 pick name " left " strcat swap strcat "^AQUA^" swap strcat a ( d i ) over CONPROP getpropval dup not if pop over OCONPROP getpropval then dup 3 pick 3 pick > and if - ( d i ) Tell-Time swap "%s" pronoun_sub 1 strcut swap toupper swap strcat "-- " swap strcat " was online for " strcat swap strcat "." strcat "^YELLOW^" swap strcat a else ( d i i ) pop pop pop then else pop name " hasn't been on for a while." strcat "^YELLOW^" swap strcat a then ; : aliasmatch ( s -- {d} ) "$cmd/page" match dup if 0 "" 4 rotate 4 rotate "get-playerdbrefs" call pop else .pmatch dup if 1 else pop 0 then then ; : Last-Main ( s -- ) dup if .noguest dup "#" 1 strncmp not if 1 strcut swap pop ( com ) dup "help" stringcmp not if pop Last-Help exit else dup "block" stringcmp not if pop Last-Block exit else dup "unblock" stringcmp not if pop Last-UnBlock exit then then then then Last-Title " " "," subst striplead striptail begin dup " " instr while " " " " subst repeat " " explode "" ( s1 s2 ... si i failstr ) begin over while swap 1 - swap rot dup aliasmatch dup if begin dup while 1 - swap Last-Check repeat pop pop else pop " " swap strcat "," strcat strcat then repeat swap pop dup if .cleancommas dup " and " instr if " are." else " is." then strcat "I don't know who " swap strcat "^RED^" swap strcat a else pop then else .noguest pop Last-Help then ; . c q @register cmd-laston=cmd/laston @register #me cmd-laston=tmp/prog1 @set $tmp/prog1=L @set $tmp/prog1=V @set $tmp/prog1=W3 @action @last;last;@laston;laston;lastlog;ll=here=tmp/exit1 @link $tmp/exit1=$tmp/prog1 @set $tmp/exit1=M1 @set $tmp/exit1=/_/de:@$cmd/laston @set $tmp/prog1=_version:FM$Revision: 1.2 $ "Installation of cmd-laston complete.