Public Broadcast System #143
Aliases: Public Broadcast System, yack, pbs
10 verbs · 29 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
init_for_core | this none this | rxd | #143 | 6 |
cb public pub staff stf help! | any any any | rxd | #143 | 57 |
broadcast | this none this | rxd | #143 | 11 |
sign_on | this none this | rxd | #143 | 7 |
sign_off | this none this | rxd | #143 | 8 |
show_who | this none this | rxd | #143 | 10 |
get_parsed | this none this | rxd | #143 | 35 |
pub-ban un-pub-ban | any none none | rxd | #143 | 10 |
get_channel | this none this | rxd | #143 | 9 |
pub_title | this none this | rxd | #143 | 2 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
public | #143 | rc | #36 | {} |
HELP! | #143 | rc | #36 | {} |
staff | #143 | rc | #36 | {} |
KMOO | #143 | rc | #36 | {} |
banned | #143 | c | #36 | {} |
licensed | #143 | rc | #36 | {} |
warehouse | #74 | r | #36 | <clear> |
help_msg | #74 | rc | #36 | "" |
feature_verbs | #74 | r | #36 | {"cb", "pub-ban"} |
feature_ok | #74 | r | #36 | <clear> |
drop_failed_msg | #5 | rc | #36 | <clear> |
drop_succeeded_msg | #5 | rc | #36 | <clear> |
odrop_failed_msg | #5 | rc | #36 | <clear> |
odrop_succeeded_msg | #5 | rc | #36 | <clear> |
otake_succeeded_msg | #5 | rc | #36 | <clear> |
otake_failed_msg | #5 | rc | #36 | <clear> |
take_succeeded_msg | #5 | rc | #36 | <clear> |
take_failed_msg | #5 | rc | #36 | <clear> |
value_base | #102 | r | #2 | <clear> |
damage_base | #102 | r | #2 | <clear> |
x_loc | #102 | r | #36 | 1 |
y_loc | #102 | r | #36 | 1 |
ansi_title | #102 | r | #36 | <clear> |
obvious | #102 | r | #36 | <clear> |
build_help | #102 | rc | #36 | <clear> |
key | #1 | c | #36 | 0 |
aliases | #1 | rc | #36 | {"Public Broadcast System", "yack", "pbs"} |
description | #1 | rc | #36 | "A feature object for public brodcast channels" |
object_size | #1 | r | #36 | {8909, -1090650497} |
Ancestry
Ancestors (nearest first): #74 Generic Feature Object → #5 generic thing → #102 subthing → #1 Root Class
Children: none
Call graph
Source
init_for_core
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!
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
Referenced by
- #143:cb line 21:
this:broadcast - #143:cb line 57:
this:broadcast - #143:sign_on line 6:
this:broadcast - #143:sign_off line 4:
this:broadcast
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
Referenced by
- #143:cb line 31:
this:sign_on
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
Referenced by
- #143:cb line 33:
this:sign_off
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
Referenced by
- #143:cb line 29:
this:show_who
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
Referenced by
- #143:cb line 23:
this:get_parsed
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
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
Referenced by
- #143:cb line 21:
this:get_channel - #143:cb line 29:
this:get_channel - #143:cb line 31:
this:get_channel - #143:cb line 33:
this:get_channel - #143:cb line 57:
this:get_channel
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
Referenced by
- #143:cb line 21:
this:pub_title - #143:cb line 41:
this:pub_title - #143:cb line 43:
this:pub_title - #143:cb line 47:
this:pub_title - #143:cb line 49:
this:pub_title - #143:sign_on line 6:
this:pub_title - #143:sign_off line 4:
this:pub_title - #143:show_who line 6:
this:pub_title
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;