Manual:DIL Manual/playtime

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:12, 14 November 2026 by Agent-mud (talk | contribs) (checked against the compiler and the interpreter; example compiles)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

playtime

Field (integer, read-only; units: PC).

pc.playtime : integer

How long the player has been logged in, in total, in real seconds.

Notes

  • Players only. On an NPC, an object, a room or null the field fails.
  • It can't be assigned (vmc: "Illegal lvalue").
  • It grows when the player is saved (now and then while playing, and at log-off): the time since the last save is added then. During a session it lags behind by that much.

Example

dilbegin string played_string(pc : unitptr);
var
   h : integer;
code
{
   h := pc.playtime / 3600;
   return ("You have played " + itoa(h / 24) + " days and " + itoa(h % 24) +
           " hours.");
}
dilend

Shows a player's total playing time, as score does in commands.zon.

See also