* small .def update * misc, minor changes to some functions * added a few more DefScript functions (and, or, xor, GetObjectType, ObjectKnown)
38 lines
691 B
Modula-2
38 lines
691 B
Modula-2
#permission=0
|
|
|
|
// purpose: pseuwow uptime counter
|
|
// args: none
|
|
// usage: - load the script to register the uptime counter
|
|
// - call the script to say the uptime formatted in hours, mins & secs
|
|
// returns: uptime formatted as 0h 0m 0s
|
|
|
|
#onload
|
|
set,#uptime 0
|
|
removeevent event_{${@myname}}
|
|
addevent,event_{${@myname}},1000 add,#uptime 1
|
|
#endonload
|
|
|
|
set,s ${#uptime}
|
|
|
|
set,h ${s}
|
|
div,h 3600
|
|
toint,h ${h}
|
|
mod,s 3600
|
|
|
|
set,m ${s}
|
|
div,m 60
|
|
toint,m ${m}
|
|
mod,s 60
|
|
toint,s ${s}
|
|
set,str ${h}h ${m}m ${s}s
|
|
out UPTIME: ${#uptime} secs = ${str}
|
|
|
|
if ${@inworld}
|
|
say UPTIME: ${h} hours, ${m} minutes, ${s} seconds
|
|
endif
|
|
|
|
unset h
|
|
unset m
|
|
unset s
|
|
|
|
return ${str} |