The RPG-O-Meter Feature Object #12631

Parent Owner Flags Source rpg_march_2006/Features/The RPG-O-Meter Feature Object.txt

Aliases: The RPG-O-Meter Feature Object, rpg-o-meter

4 verbs · 6 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
@RPG-O-Meter @meternone none nonerxd#1263124
_who's_gamingnone none nonerxd#1263127
usagethis none thisrx#1263122
_who's_starredthis none this#1263118

Properties

PropertyDefinerFlagsOwnerValue
help_msg#12631
value (226 chars)"The RPG-O-Meter defines verbs which help track the usage of the RPG. The @RPG-O-Meter verb displays a usage graph, and the _who's_gaming verb (which requires the Who's Feature, #22822,) shows who's currently in an RPG room."
feature_verbs#12631{"@meter", "_who's_gaming", "_who's_starred"}
key#12631not readable (E_PERM)
aliases#12631{"The RPG-O-Meter Feature Object", "rpg-o-meter"}
description#12631"The RPG-O-Meter is a collection of verbs to help you watch how people are using the LambdaMOO RPG."
object_size#12631{5631, 1141286586}

Ancestry

Ancestors (nearest first): none

Children: none

Call graph

calls n12631_0 #12631:@RPG-O-Meter n12631_2 #12631:usage n12631_0->n12631_2 n12631_1 #12631:_who's_gaming n46_12 #46:is_rpg_room n12631_1->n46_12

Source

@RPG-O-Meter @meter

Spec none none noneFlags rxdDefiner #12631

Referenced by

none

Source

1"The @RPG-O-Meter (or @meter) verb is used to track usage in the RPG.";
2"Ever wonder just how many people are using that big huge thing with the";
3"monsters?  Well, this'll tell you, in some sense.  The @meter verb draws";
4"a bar graph showing the .last_action property of players' voodoo dolls";
5"against time (the last day, week, month, and three months.)";
6"Whether this provides any useful information is up to you to decide.";
7"Note that the verb may take quite a while to run, as it suspends for";
8"10 seconds at a time, in an effort to reduce spam.";
9sum = 0;
10usage = this:usage();
11labels = {"1 day    ", "1 week   ", "1 month  ", "3 months ", ">3 months"};
12player:tell("Recent RPG usage");
13player:tell("----------------");
14for i in (usage)
15  sum = sum + i;
16  bar = "";
17  for k in [1..i / 10]
18    bar = bar + "#";
19  endfor
20  player:tell(((labels[i in usage] + ":") + (((i % 10) >= 5) ? bar + "=" | bar)) + ((((" (" + tostr(i)) + " [") + tostr((i * 100) / ($local.petitions_core.signature_threshold * 20))) + "%])"));
21endfor
22player:tell("----------------");
23player:tell("Each hash mark represents 10 players whose .last_action property was set in the period shown.");
24player:tell(((("There are currently " + tostr(sum)) + " active RPG players and about ") + tostr($local.petitions_core.signature_threshold * 20)) + " voting players on LambdaMOO.");

_who's_gaming

Spec none none noneFlags rxdDefiner #12631

Referenced by

none

Source

1"Indicate, in some vague sense, who's playing the RPG.  The only measure here is whether the player is in a child of the generic RPG room.  This verb requires #22822, the who's feature.";
2where = args[1];
3who = args[2];
4no_one = "No one seems to be gaming.";
5someone = iobjstr ? "%w %a gaming %l." | "%w %a gaming.";
6if (where == player.location)
7  where_name = "here";
8else
9  where_name = "in " + where.name;
10endif
11who_all = {};
12gms = home = 0;
13for thing in (iobjstr ? $set_utils:intersection(connected_players(), where.contents) | connected_players())
14  $command_utils:suspend_if_needed(0);
15  if (#46:is_rpg_room(thing.location))
16    who_all = {@who_all, thing};
17    if (thing.location == thing.home)
18      home = home + 1;
19    endif
20    if (thing in $local.rpg.gms)
21      gms = gms + 1;
22    endif
23  endif
24endfor
25who_all = setremove(who_all, who);
26player:tell(#22822:("who's_substitute")(who_all ? someone | no_one, $list_utils:map_arg(#22822, "who's_title", who_all), where_name));
27player:tell((gms ? tostr(gms) + ((gms == 1) ? " is a gamemaster" | " are gamemasters") | "") + (home ? (((gms ? ", and " | "") + tostr(home)) + ((home == 1) ? " is " | " are ")) + "at home." | (gms ? "." | "")));

usage

Spec this none thisFlags rxDefiner #12631

Referenced by

Source

1tm = time();
2dy = wk = mt = m3 = m6 = 0;
3h = 3 * (m = 4 * (w = 7 * (d = (24 * 60) * 60)));
4foo = children(#74);
5for bar in (foo)
6  $command_utils:suspend_if_needed(10);
7  if (is_player(bar.character))
8    t = tm - #24874:last_action(bar);
9    if (t <= d)
10      dy = dy + 1;
11    elseif (t <= w)
12      wk = wk + 1;
13    elseif (t <= m)
14      mt = mt + 1;
15    elseif (t <= h)
16      m3 = m3 + 1;
17    else
18      m6 = m6 + 1;
19    endif
20  endif
21endfor
22return {dy, wk, mt, m3, m6};

_who's_starred

Spec this none thisDefiner #12631

Referenced by

none

Source

1"Who's got silly cruft after their name?  Requires #22822.";
2who_star = who_cruft = {};
3alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
4for foo in (connected_players())
5  if (foo.name[length(foo.name)] == "*")
6    who_star = {@who_star, foo};
7  elseif (!index(alpha, foo.name[length(foo.name)]))
8    who_cruft = {@who_cruft, foo};
9  endif
10endfor
11if (who_star)
12  player:tell(($string_utils:english_list($list_utils:map_arg(#22822, "who's_title", who_star)) + ((length(who_star) == 1) ? " is" | " are")) + " connected.");
13else
14  player:tell("No one is starred right now.");
15endif
16if (who_cruft)
17  player:tell(((who_star ? "In addition" | "However") + ", ") + (((($string_utils:english_list($list_utils:map_arg(#22822, "who's_title", who_cruft)) + ((length(who_cruft) == 1) ? " has" | " have")) + " extra cruft after ") + ((length(who_cruft) == 1) ? who_cruft[1].pp | "their")) + ((length(who_cruft) == 1) ? " name." | " names.")));
18endif