@verb #3512:"@on*line @time on*line" any any any rxdo #6319 @program #3512:"@on*line @time on*line" any any any "@on*line " "" "Gives a breakdown of the time a player has spent online in the last week." "" "Programmed by Manta (#7165), and hacked by Raptor (#6319), using a bit of code written by Dizzy_Devil (#9299). ...Whew!" this:update_usage("online", player) if (!args) if (caller == this) return player:tell("You might want to include the name of a player.") endif dest = player elseif ($command_utils:player_match_failed(dest = `$string_utils:match_local_player(args[1]) ! ANY => #-3', args[1])) return endif caller == this && player:tell("
")
player:tell(dest:title(), " has spent: ")
time = 0
x = $list_utils:assoc(dest, #2735.users)
x == {} && (x = {dest, 0, 0})
if (x[1] == dest)
  day = 0
  for y in (listdelete(x, 1))
    day = day + 1
    t = y * 300
    "    if (ctime()[5..10] == \"Apr  1\")"
    "      \"April Fool's hack!\";"
    "      t = t * 5;"
    "      time = time + (y * 5);"
    "    else"
    time = time + y
    "    endif"
    y == 0 || player:tell("   " + ($time_utils:english_time(t) + " online " + {"today", "yesterday", "on " + ctime(time() - 172800)[1..10], "on " + ctime(time() - 259200)[1..10], "on " + ctime(time() - 345600)[1..10], "on " + ctime(time() - 432000)[1..10], "on " + ctime(time() - 518400)[1..10]}[day]) + ".")
  endfor
  player:tell($time_utils:english_time(time * 300) + " online in the last " + (day == 1 ? "day." | tostr(day) + " days."))
  timestr = tostr(tofloat(time * 300) / 604800.0 * 100.0)
  use = timestr[1..min(index(timestr, ".") + 2, $)]
  player:tell(dest:title(), " has spent ", use, "% of the last 7 days online.")
  caller == this && player:tell("
") endif "Last modified by Lao-Tzu (#8084) on Mon Apr 1 15:31:40 2002 MST." .