wristpad #130

Parent #5Owner #361Flags read, fertileSource hellcore/hellcore.db

Aliases: wristpad

24 verbs · 42 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
initthis none nonerxd#13010
_pagethis none thisrxd#13034
_receivethis none thisrxd#13034
match_wristpadthis none thisrxd#13014
throw tossthis any anyrxd#1301
stashthis none nonerxd#1301
switchthis at/to anyrxd#13010
ignore unignoreany on top of/on/onto/upon thisrxd#13027
ignorednone on top of/on/onto/upon thisrxd#1309
movetothis none thisrxd#1305
look_selfthis none thisrxd#13020
alarmthis is anyrxd#13015
alarm_checkthis none thisrxd#13013
radioany any anyrxd#13048
radio_receivethis none thisrxd#1306
givethis at/to anyrxd#1301
add_transactionthis none thisrxd#13012
check*bookthis none nonerxd#1302
historyany any anyrxd#13045
can_send_long_messagethis none thisrxd#13013
_initthis none thisrxd#1303
_do_checkthis none thisrxd#13016
check*bookthis for/about anyrxd#1307
on_spawnthis none thisrxd#1301

Properties

PropertyDefinerFlagsOwnerValue
page_msg#130rc#361"%N taps on %p %t."
page_receive_msg#130rc#361"From your %t: %n pages, '%message'"
registered_user#130rc#361#-1
page_send_msg#130rc#361"You tap your text message to %dn into your %t."
mode#130rc#3610
ignore#130rc#361{}
toggle_msg#130rc#361"%N toggles a switch on %p %t."
transactions#130rc#361{}
history_on#130rc#3610
history_max#130rc#36110
history#130c#361{}
max_transactions#130rc#361100
handed#5rc#361<clear>
wield_msg#5rc#361"%DN extends %p wrist to look at %p %t."
unwield_msg#5rc#361<clear>
size#5rc#361<clear>
look_place_msg#5rc#361<clear>
value#5rc#3610
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{"wristpad"}
description#1rc#361"A thick wristwatch with an integrated keyboard, speaker, and mini-LCD. A Freedom City credit chip is attached to the left side of the watch, with a few wires leading into your bare skin. You've had it your whole life, so you never really noticed until just now how disturbing and occasionally itchy that is."
object_size#1r#29{20772, 1298433815}
hidden_verbs#1rc#361<clear>
phelp_msg#1rc#361
list of 5{"This wristpad is what you use to page messages to other players and talk on comm nets such as chatnet. It's not foolproof -- in some areas (like prison) the signal is blocked.", "", "To page another player, simply: 'page <person> <some text>'", "", "See also: 'help radio', 'help communication'"}
weight#1rc#36110
owner_verbs#1rc#361<clear>
plural_name#1rc#361<clear>
client_image#1rc#361<clear>
listening#1rc#361<clear>

Ancestry

Ancestors (nearest first): #5 generic thing#1 root

Children: none

Call graph

calls n130_0 #130:init n107_43 #107:tell n130_0->n107_43 n1_31 #1:dname n130_0->n1_31 n1_39 #1:dnamec n130_0->n1_39 n130_1 #130:_page n20_5 #20:from_list n130_1->n20_5 n20_77 #20:escape n130_1->n20_77 n1_30 #1:name n130_1->n1_30 n130_19 #130:can_send_long_message n130_1->n130_19 n20_34 #20:pronoun_sub n130_1->n20_34 n130_2 #130:_receive n130_2->n107_43 n130_3 #130:match_wristpad n20_20 #20:match_player n130_3->n20_20 n103_17 #103:match_wristpad n130_3->n103_17 n130_4 #130:throw n130_4->n107_43 n130_5 #130:stash n130_5->n107_43 n130_6 #130:switch n130_6->n107_43 n130_6->n20_34 n1_66 #1:announce_action_text n130_6->n1_66 n130_7 #130:ignore n130_7->n107_43 n130_7->n20_20 n130_8 #130:ignored n130_8->n107_43 n130_9 #130:moveto n1_13 #1:moveto n130_9->n1_13 n130_10 #130:look_self n130_10->n107_43 n1_9 #1:look_self n130_10->n1_9 n112_1 #112:ctime n130_10->n112_1 n112_3 #112:day_segment n130_10->n112_3 n227_4 #227:lagstr n130_10->n227_4 n112_9 #112:holiday_today n130_10->n112_9 n20_26 #20:group_number n130_10->n20_26 n130_11 #130:alarm n130_11->n107_43 n130_11->n1_66 n6_169 #6:dnamec n130_11->n6_169 n130_12 #130:alarm_check n130_12->n112_1 n130_13 #130:radio n130_13->n107_43 n130_13->n20_34 n285_2 #285:tune_out n130_13->n285_2 n285_1 #285:tune_in n130_13->n285_1 n130_14 #130:radio_receive n130_14->n1_30 n20_112 #20:encrypt n130_14->n20_112 n130_15 #130:give n130_15->n107_43 n130_15->n1_30 n130_17 #130:check*book n130_21 #130:_do_check n130_17->n130_21 n130_21->n107_43 n20_1 #20:left n130_21->n20_1 n112_7 #112:duration n130_21->n112_7 n130_18 #130:history n130_18->n107_43 n35_19 #35:longdate n130_18->n35_19 n35_2 #35:ampm n130_18->n35_2 n130_22 #130:check*book n130_22->n107_43 n130_22->n130_21

Source

init

Spec this none noneFlags rxdOwner #361Definer #130

Referenced by

none

Source

1"Lock this wristpad to yourself, if it's not already.";
2if (this.location != player)
3player:tell("You're not holding ", this:dname(), ".");
4elseif ((this.registered_user == player) && (player.wristpad == this))
5player:tell(this:dnamec(), " is already initialized to you.");
6else
7player:tell("You run the initialization sequence on ", this:dname(), " and set it up as your primary comm device.");
8this.registered_user = player;
9player.wristpad = this;
10endif

_page

Spec this none thisFlags rxdOwner #361Definer #130

Referenced by

none

Source

1who = args[1];
2user = this.registered_user;
3if (length(args) > 1)
4msg = $su:from_list(args[2..$], " ");
5else
6msg = "BEEP";
7endif
8msg = $su:escape(msg);
9if (is_a(who, $wristpad))
10who:_receive(player, msg);
11return;
12endif
13if (is_player(who) && (!valid(who.wristpad)))
14user:tell("Your ", this:name(), " responds: 'Cannot connect to user.'");
15else
16if (is_player(who))
17if (is_a(who.wristpad, $wristpad))
18if ((length(msg) > 250) && (!this:can_send_long_message(user, who)))
19msg = msg[1..250];
20user:tell("Your page exceeded safety limits and has been downsized.");
21endif
22who.wristpad:_receive(user, msg);
23else
24user:tell("Hmmm.  ", who:dnamec(), " seems completely absent from the comm network.");
25endif
26else
27`who:page_receive(user, msg) ! E_VERBNF => 0';
28endif
29user:tell(((("You text '" + $ansi.bold_on) + msg) + $ansi.reset) + "' to ", who.name, " on your ", this.name, ".");
30if ((this.page_msg && (!who.programmer)) && (random(100) < 10))
31argstr = "naughty naughty";
32user.location:announce($su:ps(this.page_msg, user, this));
33endif
34endif

_receive

Spec this none thisFlags rxdOwner #361Definer #130

Referenced by

none

Source

1{sender, text} = args;
2if ((this.mode > 0) || (player in this.ignore))
3"Filtering is on";
4if (!player.programmer)
5fork (1)
6player:tell("Your wristpad beeps. ", this.registered_user.name, " must be busy.");
7endfork
8return;
9endif
10endif
11m = this.page_receive_msg;
12m = strsub(m, "%t", this.name);
13if (is_a(sender, #109))
14m = strsub(m, "%n", sender:real_name());
15else
16m = strsub(m, "%n", sender:dname());
17endif
18m = strsub(m, "%message", ($ansi.bold_on + text) + $ansi.reset);
19if (valid(this.location))
20this.location:tell(m);
21if (this.history_on)
22this.history = {{sender, text, time()}, @this.history};
23if (length(this.history) > this.history_max)
24this.history = this.history[1..this.history_max];
25endif
26endif
27if (is_player(this.location) && (!(this.location in connected_players())))
28if (is_a(sender, $player))
29sender:tell("Your wristpad buzzes: Target is asleep.  Please try another time.");
30endif
31elseif ((!is_a(sender, $immortal)) && is_a(this.location, $immortal))
32sender:tell("Your wristpad buzzes: Target is asleep.  Please try another time.");
33endif
34endif

match_wristpad

Spec this none thisFlags rxdOwner #361Definer #130

Referenced by

none

Source

1name = args[1];
2if (name == "help")
3return $rpg.help_wristpad;
4endif
5if (name == "fcpd")
6return $rpg.fcpd_wristpad;
7endif
8if (valid(who = $su:match_player(name)))
9return who;
10elseif (valid(who = $rpg:match_wristpad(name, player)))
11return who;
12else
13return #-1;
14endif

throw toss

Spec this any anyFlags rxdOwner #361Definer #130

Referenced by

none

Source

1player:tell("You can't throw your wristpad.  Sorry.");

stash

Spec this none noneFlags rxdOwner #361Definer #130

Referenced by

none

Source

1player:tell("You can't stash your wristpad.  Sorry.");

switch

Spec this at/to anyFlags rxdOwner #361Definer #130

Referenced by

none

Source

1"Switch between 'normal' and 'filter'";
2modenumber = iobjstr in {"normal", "filter"};
3if (!modenumber)
4player:tell("Valid options are 'normal' and 'filter");
5return;
6endif
7"I am dumb and made the modes zero-indexed.";
8modenumber = modenumber - 1;
9this.mode = modenumber;
10player:aat($su:ps(this.toggle_msg));

ignore unignore

Spec any on top of/on/onto/upon thisFlags rxdOwner #361Definer #130

Referenced by

none

Source

1"Add or remove a specific player from your wristpad's ignore list.";
2who = $su:match_player(dobjstr);
3if (!valid(who))
4player:tell(verb, " who?");
5return;
6endif
7if (who.programmer)
8player:tell("You cannot ignore ", who.name, ".");
9return;
10endif
11if (verb == "ignore")
12if (who in this.ignore)
13player:tell("You are already ignoring pages from ", who.name, ".");
14return;
15else
16this.ignore = setadd(this.ignore, who);
17player:tell(who:dnamec(), " added to ignore list.");
18endif
19else
20if (!(who in this.ignore))
21player:tell("You are not ignoring pages from ", who.name, ".");
22return;
23else
24this.ignore = setremove(this.ignore, who);
25player:tell(who:dnamec(), " removed from ignore list.");
26endif
27endif

ignored

Spec none on top of/on/onto/upon thisFlags rxdOwner #361Definer #130

Referenced by

none

Source

1"List currently ignored players.";
2if (length(this.ignore) > 0)
3player:tell("Your wristpad lists the following ignored people:");
4for p in (this.ignore)
5player:tell(p.name);
6endfor
7else
8player:tell("You are not ignoring anyone.");
9endif

moveto

Spec this none thisFlags rxdOwner #361Definer #130

Referenced by

none

Source

1where = args[1];
2if (is_a(this.registered_user, $player) && (where != this.registered_user))
3return 0;
4endif
5return pass(@args);

look_self

Spec this none thisFlags rxdOwner #361Definer #130

Referenced by

none

Source

1pass(@args);
2player:tell("A small glyph on the LCD shows the time: ", $ansi.bold_on, $time:ctime(), $ansi.bold_off, ".  It is ", $time.day_segments[$time:day_segment()], ".");
3player:tell("In a corner of the clock readout, a tiny meter shows ", $ansi.bold_on, "lag: ", $ansi.reset, $flywheel:lagstr(), ".");
4if (this.alarm_time)
5player:tell("The alarm is set for ", $ansi.bold_on, $ansi.red, this.alarm_time, $ansi.reset, ".");
6endif
7if (this.radio_on)
8player:tell("The radio is on, tuned to code channel #", this.frequency, ".");
9else
10player:tell("The radio is off.");
11endif
12if (this.history_on)
13player:tell("The page history is on.");
14else
15player:tell("The page history is off.");
16endif
17if (valid(hol = $time:holiday_today()))
18player:tell("Oh hey -- it's ", hol.name, ".  ", hol.description);
19endif
20player:tell("The credit chip's tiny display reads: ", $ansi.green, "$", $su:group_number(this.registered_user.credit), $ansi.reset, ".");

alarm

Spec this is anyFlags rxdOwner #361Definer #130

Referenced by

none

Source

1"Set an alarm in hh:mm 24-hour format.";
2ctim = iobjstr;
3if (((i = index(ctim, ":")) && (i > 1)) && (length(ctim) > i))
4hh = toint(ctim[1..i - 1]);
5mm = toint(ctim[i + 1..$]);
6ctim = (hh > 9) ? "" | "0";
7ctim = (ctim + tostr(hh)) + ":";
8ctim = ctim + ((mm > 9) ? "" | "0");
9ctim = ctim + tostr(mm);
10this.alarm_time = ctim;
11player:tell("You set your wristpad's alarm for ", $ansi.bold_on, $ansi.red, ctim, $ansi.reset, ".");
12player:aat(player:dnamec(), " taps a button on ", player.pp, " wristpad.");
13return;
14endif
15player:tell("Huh?  Try giving a time in hh:mm 24-hour format (like 16:00 for 4pm).");

alarm_check

Spec this none thisFlags rxdOwner #361Definer #130

Referenced by

none

Source

1hhmm = $time:ctime()[12..15];
2if (hhmm == this.alarm_time[1..$ - 1])
3if (valid(this.location))
4this.registered_user:tell("");
5this.registered_user:tell($ansi.bold_on, "Your wristpad vibrates and beeps loudly.  It's ", $ansi.red, this.alarm_time, $ansi.white, ".", $ansi.reset);
6endif
7who = this.registered_user;
8if (is_a(who.body, $body))
9who = who.body;
10endif
11valid(who.location) && who.location:announce_all_but({who}, ((who:dnamec() + "'s ") + this.name) + " beeps loudly.");
12this.alarm_time = "";
13endif

radio

Spec any any anyFlags rxdOwner #361Definer #130

Referenced by

none

Source

1"Configure the radio, eg. 'radio on', 'radio off', 'radio <frequency>', or 'radio key=mysecretkey'.";
2if (prepstr == "on")
3if (this.radio_on)
4player:tell("It's already on.");
5else
6this.radio_on = 1;
7player:tell("You turn on the radio on your wristpad.");
8endif
9elseif (prepstr == "off")
10if (!this.radio_on)
11player:tell("It's already off.");
12else
13this.radio_on = 0;
14player:tell("You turn off your wristpad radio.");
15endif
16elseif ((channel = toint(dobjstr)) > 0)
17if (!this.radio_on)
18player:tell("Your wristpad radio isn't turned on.");
19return;
20endif
21player:tell("You tune your wristpad radio to channel #", channel, ".");
22$radio:tune_out(this, this.frequency);
23this.frequency = channel;
24$radio:tune_in(this, channel);
25elseif ((length(argstr) >= 4) && (argstr[1..4] == "key="))
26key = argstr[5..$];
27if (!key)
28player:tell($su:ps("You remove the decryption key configuration from your %t."));
29else
30player:tell($su:ps("You set the decryption key on your %t to '"), key, "'.");
31endif
32this.key = key;
33elseif (!dobjstr)
34if (!this.radio_on)
35player:tell("Your wristpad radio is off.  Use 'radio on' to turn it on.");
36else
37player:tell("Your wristpad radio is tuned to frequency ", this.frequency, ".");
38if (this.key)
39player:tell("The decryption key is set to '", this.key, "'.");
40else
41player:tell("No decryption key is set.");
42endif
43endif
44else
45player:tell("Usage:  radio <on|off>   Turn the radio on or off.");
46player:tell("        radio <freq>     Tune the radio to a specific frequency.");
47player:tell("        radio key=<key>  Tune the radio to a specific encryption key.");
48endif

radio_receive

Spec this none thisFlags rxdOwner #361Definer #130

Referenced by

none

Source

1{freq, msg} = args;
2if (this.radio_on && valid(this.location))
3if (freq == this.frequency)
4this.registered_user:tell("On your ", this:name(), " radio: ", $ansi.cyan, $su:decrypt(msg, this.key), $ansi.reset);
5endif
6endif

give

Spec this at/to anyFlags rxdOwner #361Definer #130

Referenced by

none

Source

1return player:tell("You can't give your ", this:name(), " away.");

add_transaction

Spec this none thisFlags rxdOwner #361Definer #130

Referenced by

none

Source

1{amount, target} = args;
2if (!gamevalid(target))
3target_name = "unknown";
4"return;";
5else
6target_name = strsub(target:iname(), "generic ", "");
7endif
8this.transactions = {@this.transactions, {amount, target_name, time()}};
9n = this.max_transactions;
10if (length(this.transactions) > n)
11this.transactions = this.transactions[$ - (n - 1)..$];
12endif

check*book

Spec this none noneFlags rxdOwner #361Definer #130

Referenced by

none

Source

1"List your 10 most recent credit transactions. Use 'check wrist for <number>' for more than 10.";
2this:_do_check(10);

history

Spec any any anyFlags rxdOwner #361Definer #130

Referenced by

none

Source

1"Toggle or view the page history, eg. 'history on', 'history off', 'history clear', or 'history'.";
2if (prepstr == "on")
3if (this.history_on)
4player:tell("Page history is already on.");
5else
6this.history_on = 1;
7player:tell("You turn on the page history on your wristpad.");
8endif
9elseif (prepstr == "off")
10if (!this.history_on)
11player:tell("Page history is already off.");
12else
13this.history_on = 0;
14player:tell("You turn off the page history on your wristpad.");
15endif
16elseif (dobjstr == "clear")
17if (!this.history)
18player:tell("Your wristpad page history is already empty.");
19return;
20endif
21this.history = {};
22player:tell("You clear the page history on your wristpad.");
23elseif (!dobjstr)
24if (!this.history_on)
25player:tell("Your wristpad page history is off.  Use 'history on' to turn it on.");
26endif
27if (!this.history)
28player:tell("Your wristpad page history is empty.");
29else
30player:tell("You check the page history on your wristpad.");
31for h in (this.history)
32if (length(h) > 2)
33ts = tostr($time_utils:longdate(h[3]), " ", $time_utils:ampm(h[3]));
34ts = tostr($ansi.cyan, ts, $ansi.reset);
35else
36ts = " unknown                         ";
37endif
38player:tell("[", ts, "] ", h[1].name, ": ", $ansi.bold_on, h[2], $ansi.reset);
39endfor
40endif
41else
42player:tell("Usage:  history <on|off>   Turn the page history on or off.");
43player:tell("        history clear      Erase all saved pages.");
44player:tell("        history            View your page history.");
45endif

can_send_long_message

Spec this none thisFlags rxdOwner #361Definer #130

Referenced by

Source

1{from, to} = args;
2if ((!is_player(from)) || (!is_player(to)))
3return 1;
4elseif (from.programmer || to.programmer)
5return 1;
6elseif (from in to.friends)
7return 1;
8elseif ((is_a(from.party, $party) && is_a(to.party, $party)) && (from.party == to.party))
9return 1;
10elseif ((is_a(from.employer, $biz) && is_a(to.employer, $biz)) && (from.employer == to.employer))
11return 1;
12endif
13return 0;

_init

Spec this none thisFlags rxdOwner #361Definer #130

Referenced by

none

Source

1{who} = args;
2this.registered_user = who;
3who.wristpad = this;

_do_check

Spec this none thisFlags rxdOwner #361Definer #130

Referenced by

Source

1{n} = args;
2player:tell($ansi.bold_on, "Most recent ", n, " credit transactions:", $ansi.reset);
3player:tell($ansi.bg_blue, $ansi.white, $ansi.bold_on, $ansi.underline_on, "Amount     To                            When          ", $ansi.reset);
4txns = this.transactions[max(1, $ - (n - 1))..$];
5for x in (txns)
6{amt, who, t} = x;
7if (amt < 0)
8amt = ((($ansi.red + $ansi.bold_on) + "$") + $su:left(tostr(amt), -10)) + $ansi.reset;
9else
10amt = ((($ansi.green + $ansi.bold_on) + "$") + $su:left(tostr(amt), -10)) + $ansi.reset;
11endif
12who = (typeof(who) == OBJ) ? who:iname() | who;
13who = ($ansi.bold_on + $su:left(who, -30)) + $ansi.reset;
14t = $time:duration((time() - t) * 8) + " ago";
15player:tell(amt, who, t);
16endfor

check*book

Spec this for/about anyFlags rxdOwner #361Definer #130

Referenced by

none

Source

1"List a specific number of transactions.";
2n = toint(iobjstr);
3if ((n < 1) || (n > this.max_transactions))
4player:tell("Usage: check [<n>]  -- n, if present, must be a number between 1 and ", this.max_transactions, ".");
5return;
6endif
7this:_do_check(n);

on_spawn

Spec this none thisFlags rxdOwner #361Definer #130

Referenced by

none

Source

1"lol";