mud/lib/cmds/creators/realms.c
2020-09-06 05:43:07 -07:00

39 lines
1.2 KiB
C

/* /cmds/creators/realms.c
* from the Dead Souls Library
* created by Blitz@Dead Souls
*/
static mapping Stats = ([ ]);
int sortFunction(string a, string b) {
if( Stats[a]["moves"] > Stats[b]["moves"] ) return -1;
else if( Stats[a]["moves"] < Stats[b]["moves"] ) return 1;
else return 0;
}
mixed cmd(string str) {
string *names, *text;
Stats = author_stats();
names = sort_array(keys(Stats), (: sortFunction :));
text = ({ "\t[ %^CYAN%^Creator Area Statistics...%^RESET%^ ]" });
text += ({ "Creator Moves Size Errors Objs HBs" });
text += ({ "-----------------------------------------------------" });
foreach(string name in names) {
mapping foo = Stats[name];
text += ({ sprintf("%-14s %-8d %-8d %-8d %-6d %d", name,
foo["moves"], foo["array_size"], foo["errors"],
foo["objects"], foo["heart_beats"]) });
}
this_player()->eventPage(text);
return 1;
}
string GetHelp() {
return ("Syntax: realms\n\n"
"A creator command that displays individual author "
"statistics relative to the \"areas\" found within "
"their directories.\n"
"See also: man author_stats");
}