# [1.8.0alpha2] Bug! (3)

Ahn Jin-su (jsahn@ee.snu.ac.kr)
Wed, 13 Dec 1995 18:34:55 PST

- Messages sorted by:[ date ][ thread ][ subject ][ author ]

    >
    > Hmm..Maybe it's a bug..but... can we see that line? :)
    >
    > Greetings,
    >
    > Gio.
    >

    Here it is.

    >> ; #62.object_size = {0, 0}
    => {0, 0}
    [used 2 ticks, 0 seconds.]
    >> @measure new hacker
    Measuring the sizes of Hacker's recently created objects...
    #4:@measure (this == #2), line 31:  Permission denied
    (End of traceback)
    >> @measure object #62
    Checking size of Recycling Center (#62)...
    #4:@measure (this == #2), line 14:  Permission denied
    (End of traceback)
    >> @list #4:@measure
    #4:@measure   any any any
     1:  "Syntax:";
     2:  "  @measure object <object name>";
     3:  "  @measure summary [player]";
     4:  "  @measure new [player]";
     5:  "  @measure breakdown <object name>";
     6:  if (length(args) < 1)
     7:    player:tell_lines($code_utils:verb_documentation());
     8:    return;
     9:  endif
    10:  if (index("object", args[1]) == 1)
    11:    "Object.";
    12:    what = player.location:match_object(name = $string_utils:from_list(args[
     2..length(args)], " "));
    13:    if (!valid(what))
    14:      player:tell("Sorry, I didn't understand `", name, "'");
    15:    else
    16:      player:tell("Checking size of ", what.name, " (", what, ")...");
    17:      player:tell("Size of ", what.name, " (", what, ") is ",
     object_bytes(what), " bytes.");
    18:    endif
    19:  elseif (index("summary", args[1]) == 1)
    20:    "Summarize player.";
    21:    if (length(args) == 1)
    22:      what = player;
    23:    else
    24:      what = $string_utils:match_player(name = $string_utils:from_list(args[
     2..length(args)], " "));
    25:    endif
    26:    if (!valid(what))
    27:      player:tell("Sorry, I don't know who you mean by `", name, "'");
    28:    else
    29:      $byte_quota_utils:do_summary(what);
    30:    endif
    31:  elseif (index("new", args[1]) == 1)
    32:    if (length(args) == 1)
    33:      what = player;
    34:    elseif (!valid(what = $string_utils:match_player(name =
     $string_utils:from_list(args[2..length(args)], " "))))
    35:      return $command_utils:player_match_failed(what, name);
    36:    endif
    37:    player:tell("Measuring the sizes of ", what.name, "'s recently created
     objects...");
    38:    total = 0;
    39:    for x in (what.owned_objects)
    40:      if (!x.object_size[1])
    41:        player:tell("Measured ", $string_utils:nn(x), ":  ", size =
     object_bytes(x), " bytes.");
    42:        total = total + size;
    43:      endif
    44:      $command_utils:suspend_if_needed(5);
    45:    endfor
    46:    player:tell("Total bytes used in new creations: ", total, ".");
    47:  elseif (index("breakdown", args[1]) == 1)
    48:    what = player.location:match_object(name = $string_utils:from_list(args[
     2..length(args)], " "));
    49:    if (!valid(what))
    50:      player:tell("Sorry, I didn't understand `", name, "'");
    51:    elseif (!$byte_quota_utils:can_peek(player, what.owner))
    52:      return player:tell("Sorry, you don't control ", what.name, " (",
     what, ")");
    53:    else
    54:      if (mail = $command_utils:yes_or_no("This might be kinda long.  Want
     me to mail you the result?"))
    55:        player:tell("Result will be mailed.");
    56:      endif
    57:      info = $byte_quota_utils:do_breakdown(what);
    58:      if (typeof(info) == ERR)
    59:        player:tell(info);
    60:      endif
    61:      if (mail)
    62:        $mail_agent:send_message($byte_quota_utils.owner, {player},
     tostr("Object breakdown of ", what.name, " (", what, ")"), info);
    63:      else
    64:        player:tell_lines_suspended(info);
    65:      endif
    66:    endif
    67:  else
    68:    player:tell("Not a sub-command of @measure: ", args[1]);
    69:    player:tell_lines($code_utils:verb_documentation());
    70:  endif

    -----
    Ahn, Jin-su    				email:	jsahn@ee.snu.ac.kr
    School of Electrical Engineering	LambdaMOO: Deedlit(#103811)
    Seoul National University, Korea