Public Broadcast System #143

Parent #74Owner #36Flags Source RPG Core/rpgcore-patched.db

Aliases: Public Broadcast System, yack, pbs

10 verbs · 30 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
init_for_corethis none thisrxd#1436
cb public pub staff stf help!any any anyrxd#14357
broadcastthis none thisrxd#14311
sign_onthis none thisrxd#1437
sign_offthis none thisrxd#1438
show_whothis none thisrxd#14310
get_parsedthis none thisrxd#14335
pub-ban un-pub-banany none nonerxd#14310
get_channelthis none thisrxd#1439
pub_titlethis none thisrxd#1432

Properties

PropertyDefinerFlagsOwnerValue
public#143rc#36{}
HELP!#143rc#36{}
staff#143rc#36{}
KMOO#143rc#36{}
banned#143c#36{}
licensed#143rc#36{}
warehouse#74r#36<clear>
help_msg#74rc#36""
feature_verbs#74r#36{"cb", "pub-ban"}
feature_ok#74r#36<clear>
drop_failed_msg#5rc#36<clear>
drop_succeeded_msg#5rc#36<clear>
odrop_failed_msg#5rc#36<clear>
odrop_succeeded_msg#5rc#36<clear>
otake_succeeded_msg#5rc#36<clear>
otake_failed_msg#5rc#36<clear>
take_succeeded_msg#5rc#36<clear>
take_failed_msg#5rc#36<clear>
value_base#102r#2<clear>
damage_base#102r#2<clear>
x_loc#102r#361
y_loc#102r#361
ansi_title#102r#36<clear>
obvious#102r#36<clear>
build_help#102rc#36<clear>
key#1c#360
aliases#1rc#36{"Public Broadcast System", "yack", "pbs"}
description#1rc#36"A feature object for public brodcast channels"
object_size#1r#36{8909, -1090650497}
html#1rc#36<clear>

Ancestry

Ancestors (nearest first): #74 Generic Feature Object#5 generic thing#102 subthing#1 Root Class

Children: none

Call graph

calls n143_0 #143:init_for_core n74_8 #74:init_for_core n143_0->n74_8 n143_1 #143:cb n52_5 #52:isa n143_1->n52_5 n6_18 #6:tell n143_1->n6_18 n59_39 #59:argstr n143_1->n59_39 n143_2 #143:broadcast n143_1->n143_2 n143_8 #143:get_channel n143_1->n143_8 n143_9 #143:pub_title n143_1->n143_9 n143_6 #143:get_parsed n143_1->n143_6 n143_5 #143:show_who n143_1->n143_5 n143_3 #143:sign_on n143_1->n143_3 n143_4 #143:sign_off n143_1->n143_4 n6_79 #6:tell_lines n143_1->n6_79 n143_2->n6_18 n55_16 #55:slice n143_9->n55_16 n20_9 #20:trim n143_6->n20_9 n20_73 #20:get_say_verb n143_6->n20_73 n20_56 #20:first_word n143_6->n20_56 n20_20 #20:match_player n143_6->n20_20 n20_72 #20:get_say_verb_prep n143_6->n20_72 n143_5->n6_18 n143_5->n143_9 n143_5->n6_79 n20_4 #20:columnize n143_5->n20_4 n143_3->n6_18 n143_3->n143_2 n143_3->n143_9 n143_4->n6_18 n143_4->n143_2 n143_4->n143_9 n143_7 #143:pub-ban n143_7->n20_20 n98_12 #98:person_match_failed n143_7->n98_12 n6_10 #6:notify n143_7->n6_10

Source

init_for_core

Spec this none thisFlags rxdOwner #36Definer #143

Referenced by

none

Source

1if (caller_perms().wizard)
2for p in (properties(this))
3this.(p) = {};
4endfor
5pass(@args);
6endif

cb public pub staff stf help!

Spec any any anyFlags rxdOwner #36Definer #143

Referenced by

none

Source

1"* Public channels are HELP! and public/pub/cb";
2"* Restricted channels are staff/stf and KMOO";
3" -sample commands-";
4"cb on                        = Join the channel";
5"cb off                       = Leave the channel";
6"cb who                       = Who is monitoring the channel";
7"cb help                      = displays this help info";
8"cb <message>                 = broadcast <message>";
9"cb -<player name> <message>  = direct <message> to <player name>";
10"cb :<emote phrase>           = like regular emote";
11if ((caller != player) && (caller != $guest))
12return;
13endif
14if ((verb in {"staff", "stf"}) && (!$object_utils:isa(player, $frand_class)))
15return player:tell("Sorry. The 'staff' channel is not open to you.");
16elseif (player in this.banned)
17return player:tell("Sorry. You have been temporarily censored.");
18endif
19argstr = $code_utils:argstr(verb, args, argstr);
20if (!argstr)
21return this:broadcast(this:get_channel(verb), tostr("(", this:pub_title(player), ")"));
22endif
23mumbles = this:get_parsed(argstr);
24if ((mumbles[1] == "") && (mumbles[3] != ""))
25return player:tell(mumbles[3], " is not connected.");
26endif
27if (mumbles[2] == "")
28if (mumbles[1] == "who")
29return this:show_who(this:get_channel(verb));
30elseif (mumbles[1] == "on")
31return this:sign_on(this:get_channel(verb));
32elseif (mumbles[1] == "off")
33return this:sign_off(this:get_channel(verb));
34elseif (mumbles[1] in {"help", "?"})
35player:tell_lines({"---", @this.help_msg, "---"});
36return;
37endif
38endif
39if (mumbles[3] != "")
40if (mumbles[1] == ":")
41lead = tostr("[", mumbles[3], "] ", this:pub_title(player), " ");
42else
43lead = tostr(this:pub_title(player), " ", $gender_utils:get_conj(mumbles[1], player), mumbles[3]);
44endif
45else
46if (mumbles[1] == ":")
47lead = tostr(this:pub_title(player), " ");
48else
49lead = tostr(this:pub_title(player), " ", $gender_utils:get_conj(mumbles[1], player));
50endif
51endif
52if (mumbles[1] == ":")
53blabber = tostr(lead, mumbles[2]);
54else
55blabber = tostr(lead, ", \"", mumbles[2], "\"");
56endif
57this:broadcast(this:get_channel(verb), blabber);

broadcast

Spec this none thisFlags rxdOwner #36Definer #143

Referenced by

Source

1if ((caller == this) || (caller in this.licensed))
2group = args[1];
3if ((caller == this) && (group == "KMOO"))
4return player:tell("That is a commercial broadcast channel.");
5endif
6for x in (connected_players())
7if (x in this.(group))
8x:tell("[bold]<", group, ">[unbold] ", args[2]);
9endif
10endfor
11endif

sign_on

Spec this none thisFlags rxdOwner #36Definer #143

Referenced by

Source

1group = args[1];
2if (player in this.(group))
3player:tell("You're already monitoring that channel.");
4else
5this.(group) = setadd(this.(group), player);
6this:broadcast(group, tostr(this:pub_title(player), " signs on..."));
7endif

sign_off

Spec this none thisFlags rxdOwner #36Definer #143

Referenced by

Source

1group = args[1];
2if (player in this.(group))
3this.(group) = setremove(this.(group), player);
4this:broadcast(group, tostr(this:pub_title(player), " signs off..."));
5player:tell("You are no longer monitoring the \"", group, "\" channel.");
6else
7player:tell("You were not monitoring the \"", group, "\" channel.");
8endif

show_who

Spec this none thisFlags rxdOwner #36Definer #143

Referenced by

Source

1nerds = {};
2group = args[1];
3for person in (connected_players())
4(ticks_left() < 5000) && suspend(0);
5if (person in this.(group))
6nerds = {@nerds, this:pub_title(person)};
7endif
8endfor
9player:tell("These connected players are listening to the \"", group, "\" channel:");
10return player:tell_lines($string_utils:columnize(nerds, 3));

get_parsed

Spec this none thisFlags rxdOwner #36Definer #143

Referenced by

Source

1"USAGE: get_parsed(argstr) => {action-STRING,words-STRING,target-STRING}";
2if (caller == this)
3su = $string_utils;
4words = su:trim(args[1]);
5action = "";
6target = "";
7"test for on/off/who";
8if (words in {"on", "off", "who", "help", "?"})
9return {words, "", ""};
10endif
11"test for emote";
12if (words[1] == ":")
13action = ":";
14words = words[2..length(words)];
15endif
16"test for smileys and punctuation, but only if spoken";
17if (action != ":")
18action = su:get_say_verb(words);
19endif
20"test for directed speech";
21if (words[1] == "-")
22{target, words} = su:first_word(words[2..length(words)]);
23targobj = su:match_player(target);
24if (targobj in {$failed_match, $ambiguous_match, $nothing})
25words = tostr("-", target, " ", words);
26target = "";
27elseif (targobj in connected_players())
28target = tostr(su:get_say_verb_prep(action), targobj:title());
29else
30return {"", "", targobj:title()};
31endif
32endif
33return {action, words, target};
34endif
35return {"", "", ""};

pub-ban un-pub-ban

Spec any none noneFlags rxdOwner #36Definer #143

Referenced by

none

Source

1"WIZ-ONLY! pub-ban <person>";
2"          un-pub-ban <person>";
3if (caller.wizard || (caller == this.owner))
4jerk = $string_utils:match_player(dobjstr);
5if (!$rp_regulator:person_match_failed(jerk, dobjstr))
6this.public = setremove(this.public, dobj);
7this.banned = (verb == "pub-ban") ? setadd(this.banned, dobj) | setremove(this.banned, dobj);
8player:notify("Done.");
9endif
10endif

get_channel

Spec this none thisFlags rxdOwner #36Definer #143

Referenced by

Source

1if (args[1] in {"public", "pub", "cb"})
2return "public";
3elseif (args[1] in {"staff", "stf"})
4return "staff";
5elseif (args[1] == "help!")
6return "HELP!";
7else
8return "KMOO";
9endif

pub_title

Spec this none thisFlags rxdOwner #36Definer #143

Referenced by

Source

1{person, name} = `{args[1], args[1].name} ! ANY => {player, player.name}';
2return (x = name in $list_utils:slice(person.ansi_title, 1)) ? person.ansi_title[x][2] | name;