wh me=Beginning installation of cmd-laston... @prog cmd-laston 1 99999 d 1 i ( cmd-laston: $Date: 2006/07/12 18:58:12 $ $Revision: 1.4 $ ) ( 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/strings $include $lib/match $def BLOCKPROP "_prefs/block/last-on" $def CONPROP "@/lc" $def DISPROP "@/ld" $def OCONPROP "_/lc" $def ODISPROP "_/ld" : Last-Title me @ " " ansi_notify me @ "^YELLOW^Last-On Info: ^BLUE^Muck Local Time (CST)" ansi_notify me @ "^RED^~~~~~~~~~~~~" ansi_notify ; : Last-Help Last-Title me @ "^BROWN^Usage: ^YELLOW^@last names ^AQUA^-- ^CYAN^Shows when player last connected" ansi_notify me @ " ^YELLOW^@last #help ^AQUA^-- ^CYAN^Shows help screen" ansi_notify me @ " ^YELLOW^@last #block ^AQUA^-- ^CYAN^Blocks others from seeing your @last" ansi_notify me @ " ^YELLOW^@last #unblock ^AQUA^-- ^CYAN^Restores it so others can see it" ansi_notify ; : Last-Block ( -- ) me @ BLOCKPROP "yes" 0 addprop me @ "^GREEN^Only you and wizards can see your Last-On information now." ansi_notify ; : Last-Unblock ( -- ) me @ BLOCKPROP remove_prop me @ "^GREEN^Anyone can now see your Last-On information now." ansi_notify ; : 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 STR-cleancommas ; : Last-Check ( d -- ) dup awake? if name " is online now." strcat "^YELLOW^" swap strcat me @ swap ansi_notify exit then dup BLOCKPROP getpropstr 1 strcut pop "y" strcmp not if dup me @ dbcmp me @ "MAGE" flag? or not if name " wishes to keep their Last-On information private." strcat "^RED^" swap strcat me @ swap ansi_notify 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 me @ swap ansi_notify ( 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 me @ swap ansi_notify else ( d i i ) pop pop pop then else pop name " hasn't been on for a while." strcat "^YELLOW^" swap strcat me @ swap ansi_notify then ; : aliasmatch ( s -- {d} ) "$cmd/page" match dup if 0 "" 4 rotate 4 rotate "get-playerdbrefs" call pop else MATCH-noisy_pmatch dup if 1 else pop 0 then then ; ( These aren't used yet ) : Set-Connect-Systime ( -- ) me @ CONPROP systime setprop ; : Set-Disconnect-Systime ( -- ) me @ DISPROP systime setprop ; : Last-Main ( s -- ) dup "Connect" strcmp not if pop Set-Connect-Systime exit then dup "Disconnect" strcmp not if pop Set-Disconnect-Systime exit then dup if me @ dup "guest" flag? swap "mage" flag? not and if me @ "^FAIL^This command is unavailable to guests." ansi_notify pop exit then 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 STR-cleancommas dup " and " instr if " are." else " is." then strcat "I don't know who " swap strcat "^RED^" swap strcat me @ swap ansi_notify else pop then else me @ dup "guest" flag? swap "mage" flag? not and if me @ "^FAIL^This command is unavailable to guests." ansi_notify pop exit then 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.4 $ wh me=Installation of cmd-laston complete.