View/Edit #12:@quota @@quota

Switch to edit mode.

Name(s): @quota @@quota
1:  "Written by Daryl (#3887) Jun 26 00:17:47 1998"
2:  if (caller != this)
3:    return $msg:mtell("huh")
4:  elseif (dobjstr == "")
5:    dobj = this
6:  elseif ($command_utils:player_match_failed(dobj = this:match_entity(dobjstr), dobjstr))
7:    return
8:  endif
9:  "Initializes a few necessary variables."
10: total = {dobj:_get_max_obj(), dobj:_get_max_vm() / $kb, dobj:_get_max_fs() / $kb}
11: free = {dobj:free_objects(), dobj:free_bytes() / $kb, dobj:free_dbytes() / $kb}
12: type = {"Object: ", "Byte:   ", "Disk:   "}
13: unit = {"  (objects)", "(kilobytes)", "(kilobytes)"}
14: "Prints the formated quota statistics"
15: player:tell("@quota info for ", $su:nn(dobj))
16: for i in [1..length(total)]
17:   player:tell(free[i] < 0 ? " *" | "  ", type[i], " ", $su:left(tostr(total[i] - free[i], " of ", total[i]), 15), unit[i])
18: endfor
19: "Displays the contributions."
20: if (verb[2] != "@" && dobj.quota_contribs)
21:   type = {"Byte", "Object", "Disk"}
22:   actions = {"Contributed", "Received"}
23:   headers = {"Who", "What", "Type", "Amount"}
24:   data = {}
25:   for i in (dobj.quota_contribs)
26:     for n in [2..4]
27:       data = i[n] != 0 ? {@data, {$su:nn(i[1]), actions[(i[n] < 0) + 1], type[n - 1], n in {2, 4} ? $quota:kb_string(abs(i[n])) | abs(i[n])}} | data
28:     endfor
29:   endfor
30:   player:tell("")
31:   if (data)
32:     player:tellColumns({1, 1, 1, 1}, headers, @data)
33:   endif
34: endif
35: "Last modified by Dax (#789) on Thu Apr 15 09:13:12 1999 MDT."

Verb arguments: any none none
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Daryl (#3887)

You are not logged in.

[home | help | who | search | setup | code]