who commands #318

Parent #68Owner #361Flags readSource hellcore/hellcore.db

Aliases: who commands, who, whofo

6 verbs · 41 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
wh*o cwh*oany any anyrxd#31871
whosymbolthis none thisrxd#31828
wholocationthis none thisrxd#31819
_whothis none thisrxd#318157
testwho testcwhoany any anyrxd#3181
corpwh*oany any anyrxd#3181

Properties

PropertyDefinerFlagsOwnerValue
normal_widths#318rc#361{1, 20, 6, 4, 15, 28}
verbose_widths#318rc#361{6, 20, 6, 4, 15, 23}
headers#318rc#361{"Symbol", "Player", "Corp", "Idle", "Area", "Doing"}
colors#318rc#361
list of 17{9, {"header", "~1b[44m~1b[1m"}, 0, 0, {"active_player", "~1b[1m", "corp2", "~1b[33m~1b[1m"}, 0, {"idle_player", ""}, 0, {"symbol", "~1b[32m"}, {"doing", ""}, {"corp1", "~1b[33m"}, {"footer", "~1b[34m~1b[1m"}, 0, {"area", "~1b[33m"}, 0, 0, 0}
normal_widths_no_area#318rc#361{1, 20, 6, 4, 44}
verbose_widths_no_area#318rc#361{1, 20, 6, 4, 39}
headers_no_area#318rc#361{"Symbol", "Player", "Corp", "Idle", "Doing"}
warehouse#68r#29<clear>
help_msg#68rc#361<clear>
feature_verbs#68r#29{}
feature_ok#68r#29<clear>
handed#5rc#361<clear>
wield_msg#5rc#361<clear>
unwield_msg#5rc#361<clear>
size#5rc#361<clear>
look_place_msg#5rc#361<clear>
value#5rc#361<clear>
get_msg#5rc#361<clear>
drop_msg#5rc#361<clear>
get_fail_msg#5rc#361<clear>
junk_ok#5rc#361<clear>
floats#5rc#361<clear>
long_name_msg#5rc#361<clear>
article#5rc#361<clear>
setup_list#5rc#361<clear>
health#5rc#361<clear>
health_max#5rc#361<clear>
min_skill#5rc#361<clear>
skill#5rc#361<clear>
recipe_for#5rc#361<clear>
carried_msg#5rc#361<clear>
aliases#1rc#361{"who commands", "who", "whofo"}
description#1rc#361<clear>
object_size#1r#29{13508, 1298434457}
hidden_verbs#1rc#361<clear>
phelp_msg#1rc#361<clear>
weight#1rc#361<clear>
owner_verbs#1rc#361<clear>
plural_name#1rc#361<clear>
client_image#1rc#361<clear>
listening#1rc#361<clear>

Ancestry

Ancestors (nearest first): #68 Generic Feature Object#5 generic thing#1 root

Children: none

Call graph

calls n318_0 #318:wh*o n107_43 #107:tell n318_0->n107_43 n318_3 #318:_who n318_0->n318_3 n47_0 #47:make n318_0->n47_0 n20_6 #20:english_list n318_0->n20_6 n20_20 #20:match_player n318_0->n20_20 n6_54 #6:check_pref n318_0->n6_54 n318_3->n6_54 n318_1 #318:whosymbol n318_3->n318_1 n20_77 #20:escape n318_3->n20_77 n103_24 #103:report_error n318_3->n103_24 n20_1 #20:left n318_3->n20_1 n318_2 #318:wholocation n318_3->n318_2 n47_23 #47:sort_alist n318_3->n47_23 n112_5 #112:short_duration n318_3->n112_5 n20_2 #20:right n318_3->n20_2

Source

wh*o cwh*o

Spec any any anyFlags rxdOwner #361Definer #318

Referenced by

none

Source

1if (index(verb, "cwh"))
2if (!args)
3if (player.programmer)
4player:tell("Use 'pwho' to see just players. To look at a specific corp or corps use 'cwho <corp> [<corp> <corp> ...]");
5return;
6endif
7corp = player.employer;
8if (!valid(corp))
9player:tell("Have you thought about becoming a corporate whore?");
10return;
11endif
12return this:_who({}, {corp}, 1);
13else
14corps = $lu:make(length(args), #-1);
15for c in (children($biz))
16if (idx = c.symbol in args)
17corps[idx] = c;
18endif
19endfor
20to_list = {};
21crap = {};
22for i in [1..length(corps)]
23c = corps[i];
24if (!valid(c))
25crap = {@crap, tostr("\"", args[i], "\"")};
26elseif (`c.hide_biz ! ANY')
27"nothin";
28else
29to_list = {@to_list, c};
30endif
31endfor
32if (crap)
33many = length(crap) > 1;
34player:tell("I don't know what ", $su:english_list(crap, "", "or"), many ? " are." | " is.");
35endif
36if (!to_list)
37player:tell("No corps found to list!");
38return;
39endif
40return this:_who({}, to_list, player.programmer);
41endif
42else
43to_list = {};
44if (args)
45potentials = $su:match_player(args);
46to_list = {};
47crap = {};
48for i in [1..length(potentials)]
49p = potentials[i];
50if (!valid(p))
51crap = {@crap, tostr("\"", args[i], "\"")};
52elseif (p.programmer && (!player.programmer))
53"nothin";
54else
55to_list = {@to_list, p};
56endif
57endfor
58if (crap)
59many = length(crap) > 1;
60player:tell("I don't know who ", $su:english_list(crap, "", " or "), many ? " are." | " is.");
61endif
62if (!to_list)
63player:tell("No players found to list!");
64return;
65endif
66endif
67if ((!to_list) && player:check_pref("minimalwho"))
68return this:_who({}, {}, -1);
69endif
70return this:_who(to_list, {}, player.programmer);
71endif

whosymbol

Spec this none thisFlags rxdOwner #361Definer #318

Referenced by

Source

1{p, ?show_detail = 0, ?verbose = 0} = args;
2"if (show_detail && (!p.programmer))";
3"  c = p.employer;";
4"  if (!valid(c))";
5"    \"nothing\";";
6"  elseif (p in c.ranks[\"holders\"])";
7"    return verbose ? \"holder\" | \"$\";";
8"  elseif (p in c.ranks[\"board\"])";
9"    return verbose ? \"board\" | \"%\";";
10"  elseif (p in c.ranks[\"managers\"])";
11"    return verbose ? \"mgmt\" | \"&\";";
12"  endif";
13"endif";
14if (p in $rpg.bots)
15return verbose ? "bot" | "B";
16elseif (is_a(p, $wiz))
17return verbose ? "wizard" | "!";
18elseif (p.programmer)
19if (`p.chillmin ! ANY')
20return verbose ? "chillmin" | "c";
21endif
22return verbose ? "admin" | "*";
23"elseif (valid(p.employer) && (p in p.employer.ranks[\"holders\"]))";
24"  return verbose ? \"holder\" | \"$\";";
25"elseif (p.xp_total < $rpg.newbie_xp)";
26"  return verbose ? \"newbie\" | \"N\";";
27endif
28return "";

wholocation

Spec this none thisFlags rxdOwner #361Definer #318

Referenced by

Source

1{p, ?use_body = 1, ?from_region = #-1} = args;
2if (gamevalid(p.body) && use_body)
3area = area(p.body);
4else
5area = area(p);
6endif
7if (!valid(area))
8return "";
9endif
10region = area:region();
11if (valid(from_region) && (region == from_region))
12return area:who_name();
13elseif (!valid(region))
14return "";
15elseif (is_a(player, $builder))
16return tostr("(", region:abbreviated_name(), ") ", area:who_name());
17else
18return region:who_name();
19endif

_who

Spec this none thisFlags rxdOwner #361Definer #318

Referenced by

Source

1"Copied from Frankenthrope (#142):_who Fri Oct 29 16:16:14 2010 CDT";
2"Copied from who commands (#217820):_who by Ragabash (#45093) Fri Oct 29 16:03:42 2010 CDT";
3{?targets = {}, ?corps = {}, ?show_detail = 0} = args;
4do_fullcount = 0;
5if (!targets)
6do_fullcount = 1;
7targets = connected_players();
8endif
9"collect data";
10data = {};
11datacolors = {};
12verbose_symbols = player:check_pref("verbosewho");
13show_admins = player.programmer;
14colors = $whofo.colors;
15hide_corps = 0;
16count = 0;
17admincount = 0;
18fullcount = 0;
19if (show_detail == -1)
20hide_corps = 1;
21show_detail = player.programmer;
22endif
23if (show_detail)
24widths = verbose_symbols ? $whofo.verbose_widths | $whofo.normal_widths;
25headers = $whofo.headers;
26cols = 6;
27else
28widths = verbose_symbols ? $whofo.verbose_widths_no_area | $whofo.normal_widths_no_area;
29headers = $whofo.headers_no_area;
30cols = 5;
31endif
32if (show_detail)
33player_region = `area(player):region() ! E_INVIND => #-1';
34use_body = !player.programmer;
35endif
36for p in (targets)
37if ((!show_admins) && p.programmer)
38if (do_fullcount)
39admincount = admincount + 1;
40endif
41continue;
42endif
43if (do_fullcount)
44fullcount = fullcount + 1;
45endif
46employer = #-1;
47"employer = p.programmer ? #-1 | p.employer;";
48if (corps)
49if (!(employer in corps))
50continue;
51endif
52endif
53symb = $whofo:whosymbol(p, show_detail, verbose_symbols);
54idle = `idle_seconds(p) ! E_INVARG => -1';
55idlecolor = ((idle >= 0) && (idle < 600)) ? colors["active_player"] | colors["idle_player"];
56try
57doing = $su:escape(p:who_doing_msg());
58except e (ANY)
59$rpg:report_error(e);
60doing = "";
61endtry
62name = tostr(idlecolor, $su:left(p.name, widths[2] * -1), $ansi.reset);
63empl = "";
64if (symb == "B")
65empl = $ansi.green + "bot";
66elseif (p.programmer)
67if (`p.chillmin ! ANY')
68empl = $ansi.cyan + "chill";
69else
70empl = $ansi.magenta + "admin";
71endif
72else
73empl = valid(employer) ? employer.symbol | "";
74endif
75if (show_detail)
76loc = $whofo:wholocation(p, use_body, player_region);
77data = {@data, {symb, name, empl, idle, loc, doing}};
78else
79data = {@data, {symb, name, empl, idle, doing}};
80endif
81count = count + 1;
82endfor
83"sort here";
84data = $lu:sort_alist(data, 4);
85if (show_detail && player:check_pref("whosortbyarea"))
86data = $lu:sort_alist(data, 5);
87elseif (!player:check_pref("whosortbytime"))
88data = $lu:sort_alist(data, 3);
89endif
90"show data!";
91suspend(0);
92if (!verbose_symbols)
93headers[1] = "";
94endif
95headcol = colors["header"];
96line = headcol;
97for i in [1..cols]
98if (hide_corps && (i == 3))
99continue;
100endif
101line = tostr(line, $ansi.underline_on, $su:left(headers[i], widths[i]), $ansi.reset, (i == cols) ? "" | (headcol + " "));
102endfor
103notify(player, line);
104lastcorp = "";
105usealtcolor = 0;
106if (show_detail)
107colcolors = {colors["symbol"], "", colors["corp1"], "", colors["area"], colors["doing"]};
108else
109colcolors = {colors["symbol"], "", colors["corp1"], "", colors["doing"]};
110endif
111for d in (data)
112line = "";
113if (!hide_corps)
114if (d[3] != lastcorp)
115usealtcolor = !usealtcolor;
116lastcorp = d[3];
117colcolors[3] = usealtcolor ? colors["corp2"] | colors["corp1"];
118endif
119endif
120d[4] = (d[4] < 0) ? "off" | $time:short_duration(d[4]);
121for i in [1..cols]
122if (hide_corps && (i == 3))
123continue;
124endif
125if (i != 2)
126line = tostr(line, colcolors[i], $su:left(d[i], -widths[i]), $ansi.reset, (i == cols) ? "" | " ");
127else
128line = tostr(line, colcolors[i], d[i], $ansi.reset, (i == cols) ? "" | " ");
129endif
130endfor
131notify(player, line);
132endfor
133if (player:check_pref("wholegend"))
134if (show_detail)
135leg = tostr($ansi.green, "$ ", $ansi.reset, $ansi.bold_on, "holder. ", $ansi.reset, $ansi.green, " % ", $ansi.reset, $ansi.bold_on, "board member. ", $ansi.reset, $ansi.green, " & ", $ansi.reset, $ansi.bold_on, "manager.", $ansi.reset);
136notify(player, leg);
137endif
138leg = tostr($ansi.green, " N ", $ansi.reset, $ansi.bold_on, "newbie. ", $ansi.reset, $ansi.green, " $ ", $ansi.reset, $ansi.bold_on, "corp holder.", $ansi.reset, $ansi.green, " B ", $ansi.reset, $ansi.bold_on, "bot. ", $ansi.reset);
139notify(player, leg);
140endif
141if (do_fullcount)
142if (admincount)
143msg = tostr(fullcount, " players and ", admincount, " admins connected (total: ", fullcount + admincount, ".)");
144else
145msg = tostr(fullcount, " players and admins connected.");
146endif
147msg = (colors["footer"] + $su:right(msg, -79)) + $ansi.reset;
148notify(player, msg);
149if ((fullcount + admincount) >= $login.highest_connected_players)
150msg = (colors["footer"] + $su:right("A new record!", -79)) + $ansi.reset;
151notify(player, msg);
152endif
153else
154msg = tostr(count, " players.");
155msg = (colors["footer"] + $su:right(msg, -79)) + $ansi.reset;
156notify(player, msg);
157endif

testwho testcwho

Spec any any anyFlags rxdOwner #361Definer #318

Referenced by

none

Source

1return this:(verb[5..$])(@args);

corpwh*o

Spec any any anyFlags rxdOwner #361Definer #318

Referenced by

none

Source

1return this:cwho(@args);