generic normal player #33

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

Aliases: generic normal player

66 verbs · 173 properties · 2 children

Verbs

VerbSpecFlagsDefinerLines
mail_forwardthis none thisrxd#335
receive_messagethis none thisrxd#3332
display_messagethis none thisrxd#334
parse_message_seq from_msg_seq %from_msg_seq to_msg_seq %to_msg_seq subject_msg_seq body_msg_seq kept_msg_seq unkept_msg_seq display_seq_headers display_seq_full messages_in_seq list_rmm new_message_num length_num_le length_date_le length_date_gt length_all_msgs exists_num_eq msg_seq_to_msg_num_list msg_seq_to_msg_num_string rm_message_seq undo_rmm expunge_rmm renumber keep_message_seqthis none thisrxd#3316
msg_summary_linethis none thisrxd#331
msg_textthis none thisrxd#335
notify_mailthis none thisrxd#3325
current_messagethis none thisrxd#3314
get_current_messagethis none thisrxd#3316
set_current_messagethis none thisrxd#3320
make_current_messagethis none thisrxd#3327
kill_current_messagethis none thisrxd#338
current_folderthis none thisrxd#333
set_current_folderthis none thisrxd#332
parse_folder_specthis none thisrxd#3325
parse_mailread_cmdthis none thisrxd#3348
@mailany any anyrxd#3316
@read @peekany any anyrxd#3322
@next @prevany any anyrxd#338
@rmm*ailany any anyrxd#3319
@renumberany none nonerxd#3321
@unrmm*ailany any anyrxd#3330
@forwardany any anyrxd#3342
@skipany any anyrxd#3321
@subscribe*-quick @unsubscribed*-quickany any anyrxd#3393
mail_catch_upthis none thisrxd#3326
@rn check_mail_lists @subscribed @rn-fullnone none nonerxd#3351
mail_optionthis none thisrxd#337
@unsub*scribeany any anyrxd#3347
send_self_netmailthis none thisrxd#3321
@netforw*ardany any anyrxd#3326
@@sendmailany any anyrxd#3380
@keep-m*ail @keepm*ailany any anyrxd#3335
my_match_recipientthis none thisrxd#3310
expire_old_messagesthis none thisrxd#3326
msg_full_textthis none thisrxd#335
@resendany any anyrxd#3374
make_current_message_newthis none thisrxd#3327
expirable_msg_seqthis none thisrxd#3314
format_for_netforwardthis none thisrxd#3322
format_for_netforward_debugthis none thisrxd#3322
@nnnone none nonerxd#3320
@unreadany any anyrxd#3318
@refile @copym*ailany any anyrxd#3330
@quickr*eply @qreplyany any anyrxd#3341
@mail-all-new*-mailnone none nonerxd#3326
@read-all-new*-mail @ranmany none nonerxd#3346
@quick*send @qsendany any anyrxd#3384
init_for_corethis none thisrxd#334
confuncthis none thisrxd#3315
@add-notifyany at/to anyrxd#3333
mail_notifythis none thisrxd#335
tellthis none thisrxd#331
tell_linesthis none thisrxd#335
dodgenone none nonerxd#3310
autowieldany none nonerxd#330
queue_actionthis none thisrxd#3317
start_fightingthis none thisrxd#3324
readyany none nonerxd#3350
doing_msgthis none thisrxd#335
@randomnone on top of/on/onto/upon anyrxd#3320
last_huhthis none thisrxd#3313
upgrade_to_hashmailthis none thisrxd#330
@stopnone none nonerxd#337
_old_expire_old_messagesthis none thisrxd#3313
pickany none nonerxd#3337

Properties

PropertyDefinerFlagsOwnerValue
_mail_task#33rc#3610
messages_going#33c#361{}
mail_lists#33rc#361{}
mail_notify#33r#361{{}, {}}
mail_forward#33rc#361{}
mail_options#33rc#361{}
message_keep_date#33rc#3610
messages_kept#33rc#361{}
current_message#33c#361{0, 0}
messages#33c#361{}
mail_hack#33rc#3610
barcolor#33rc#361"white"
autowield#33rc#361{}
bug#33rc#361#-1
readied_weapon#33rc#361{}
unread_mail#33rc#361
list of 17{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
features#6r#29<clear>
previous_connection#6#361<clear>
email_address#6#361<clear>
last_disconnect_time#6r#361<clear>
help#6rc#361#85
more_msg#6rc#361<clear>
linetask#6r#29<clear>
linesleft#6r#29<clear>
linebuffer#6#29<clear>
pagelen#6r#29<clear>
owned_objects#6r#361<clear>
linelen#6r#29<clear>
current_folder#6c#361<clear>
all_connect_places#6#361<clear>
last_connect_place#6#361<clear>
lines#6c#361<clear>
page_absent_msg#6rc#361<clear>
page_origin_msg#6rc#361<clear>
page_echo_msg#6rc#361<clear>
edit_options#6rc#361<clear>
last_connect_time#6r#361<clear>
ownership_quota#6#29<clear>
password#6#361<clear>
paranoid#6rc#361<clear>
display_options#6rc#361<clear>
verb_subs#6rc#361<clear>
first_connect_time#6r#361<clear>
size_quota#6#29<clear>
last_password_time#6#361<clear>
last_connect_attempt#6#361<clear>
prefs#6rc#361<clear>
ansi#6rc#361<clear>
last_hit_meter#6rc#361"~1b[1m~1b[37m[~1b[32m||||||~1b[32m************************~1b[37m~1b[1m]~1b[0m"
doing_msg#6rc#361<clear>
xp_total#6rc#361<clear>
party#6rc#361<clear>
rooms#6r#361<clear>
client#6rc#361<clear>
last_death_time#6rc#361<clear>
default_weapon#6rc#361<clear>
thirst#6rc#361<clear>
may_chat#6rc#361<clear>
idlemsg#6rc#361<clear>
eula#6rc#361<clear>
birthdate#6rc#361<clear>
bad_words#6rc#361<clear>
char_start_time#6rc#361<clear>
rumors#6rc#361<clear>
last_broadcast#6rc#361<clear>
ansihack#6rc#361<clear>
last_death_callers#6rc#361<clear>
char_extra_epochs#6rc#361<clear>
code_name#6rc#361<clear>
code_plural#6rc#361<clear>
changeable_properties#6rc#361<clear>
out_of_band_session#6r#29<clear>
private_aliases#6rc#361<clear>
quests_open#6rc#361<clear>
quests#6rc#361<clear>
page_receive_msg#6rc#361<clear>
page_msg#6rc#361<clear>
focus_skills#6rc#361<clear>
skillpoints#100rc#361<clear>
xp#100rc#361<clear>
mutations#100rc#361<clear>
mutation_slots#100rc#361<clear>
char_start_age#100rc#361<clear>
char_extra_age#100rc#361<clear>
hands#107rc#361<clear>
wielding#107rc#361<clear>
health#107rc#36130
unarmed_weapon#107rc#361<clear>
size#107rc#361<clear>
posture#107rc#361"standing"
gender#107rc#361<clear>
respawn#107rc#361<clear>
corpse#107rc#361<clear>
has_proper_name#107rc#361<clear>
die_msg#107rc#361<clear>
body_parts#107rc#361<clear>
wearing#107rc#361<clear>
armor#107rc#361<clear>
last_swing_message#107rc#361<clear>
health_max#107rc#361<clear>
fighting#107rc#361{}
last_dodge_time#107rc#361<clear>
following#107rc#361<clear>
icon#107rc#361<clear>
say_msg#107rc#361<clear>
say_to_msg#107rc#361<clear>
afterlife#107rc#361<clear>
get_msg#107rc#361<clear>
drop_msg#107rc#361<clear>
blood#107rc#361{}
squeals#107rc#361<clear>
prc#107rc#361<clear>
ppc#107rc#361<clear>
poc#107rc#361<clear>
psc#107rc#361<clear>
pr#107rc#361<clear>
pp#107rc#361<clear>
po#107rc#361<clear>
ps#107rc#361<clear>
pq#107rc#361<clear>
pqc#107rc#361<clear>
brief#107rc#361<clear>
knockout#107rc#361<clear>
knockout_msg#107rc#361<clear>
body#107rc#361<clear>
wake_msg#107rc#361<clear>
owake_msg#107rc#361<clear>
oknockout_msg#107rc#361<clear>
friends#107rc#361<clear>
home#107rc#361<clear>
respawn_msg#107rc#361<clear>
move_action#107rc#361<clear>
heart#107rc#3610
last_heartbeat#107rc#361<clear>
dead#107rc#361<clear>
_tohit_next#107rc#361<clear>
last_words_msg#107rc#361<clear>
attacked#107rc#361<clear>
opens_doors#107rc#361<clear>
movable_by_explosion#107rc#361<clear>
obscured#107rc#361<clear>
obscured_desc_msg#107rc#361<clear>
cooldowns#107rc#361<clear>
combat_rounds#107rc#361<clear>
encumbrance#107rc#361<clear>
respawn_handler#107rc#361<clear>
distant_form_msg#107rc#361<clear>
block_msg#107rc#361<clear>
attack_on_block#107rc#361<clear>
last_stunned#107rc#361<clear>
nude_descs#107rc#361<clear>
skills#107rc#361<clear>
explode_msg#107rc#361<clear>
death_listeners#107rc#361<clear>
queue#92r#361<clear>
preemptible#92r#361<clear>
executing#92r#361<clear>
process_queue#92r#361<clear>
help_msg#92rc#361<clear>
last_action#92r#361<clear>
article#92rc#361<clear>
last_last_action#92rc#361<clear>
action_count#92rc#361<clear>
aliases#1r#362{"generic normal player"}
description#1rc#361<clear>
object_size#1r#29{81887, 1298433815}
hidden_verbs#1rc#361{"hkick", "@beh*aviors", "g*et take", "command", "@behaviors", "@setup", "@possess", "chomp"}
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): #6 generic player#100 generic RPG player#154 generic living creature#107 generic creature#92 generic actor#1 root

Children: #31 someone, #89 generic immortal

Call graph

calls n33_0 #33:mail_forward n20_34 #20:pronoun_sub n33_0->n20_34 n33_1 #33:receive_message n42_0 #42:controls n33_1->n42_0 n33_27 #33:mail_option n33_1->n33_27 n38_15 #38:parse_address_field n33_1->n38_15 n33_8 #33:get_current_message n33_1->n33_8 n43_57 #43:fill_string n33_1->n43_57 n6_12 #6:linelen n33_1->n6_12 n33_29 #33:send_self_netmail n33_1->n33_29 n33_3 #33:parse_message_seq n33_1->n33_3 n33_7 #33:current_message n33_1->n33_7 n33_9 #33:set_current_message n33_1->n33_9 n33_27->n42_0 n33_8->n42_0 n47_17 #47:assoc n33_8->n47_17 n33_29->n42_0 n6_9 #6:notify n33_29->n6_9 n33_3->n42_0 n33_7->n42_0 n33_7->n47_17 n33_9->n42_0 n47_18 #47:iassoc n33_9->n47_18 n33_4 #33:msg_summary_line n38_22 #38:msg_summary_line n33_4->n38_22 n33_5 #33:msg_text n38_40 #38:to_text n33_5->n38_40 n33_6 #33:notify_mail n33_6->n42_0 n33_6->n33_27 n45_16 #45:connected n33_6->n45_16 n38_13 #38:name n33_6->n38_13 n20_6 #20:english_list n33_6->n20_6 n33_6->n6_9 n33_52 #33:tell n33_6->n33_52 n33_52->n6_9 n33_10 #33:make_current_message n33_10->n42_0 n33_10->n47_18 n33_11 #33:kill_current_message n33_11->n42_0 n33_11->n47_18 n33_12 #33:current_folder n33_12->n33_27 n33_14 #33:parse_folder_spec n33_14->n33_12 n107_43 #107:tell n33_14->n107_43 n20_5 #20:from_list n33_14->n20_5 n38_11 #38:match_failed n33_14->n38_11 n38_10 #38:match_recipient n33_14->n38_10 n33_15 #33:parse_mailread_cmd n33_15->n33_8 n33_15->n38_13 n33_15->n33_14 n33_15->n107_43 n33_15->n20_5 n38_54 #38:parse_new_mailspec n33_15->n38_54 n45_5 #45:isa n33_15->n45_5 n33_16 #33:@mail n33_16->n33_27 n33_16->n38_13 n33_16->n6_9 n33_16->n33_15 n33_13 #33:set_current_folder n33_16->n33_13 n27_12 #27:size n33_16->n27_12 n48_4 #48:yes_or_no n33_16->n48_4 n33_17 #33:@read n33_17->n33_9 n33_17->n38_13 n33_17->n6_9 n33_17->n107_43 n33_17->n33_15 n33_17->n33_13 n33_17->n27_12 n33_17->n48_4 n33_18 #33:@next n33_18->n6_9 n33_19 #33:@rmm*ail n33_19->n38_13 n33_19->n6_9 n33_19->n33_15 n33_19->n33_13 n33_19->n27_12 n33_19->n48_4 n33_20 #33:@renumber n33_20->n33_7 n33_20->n33_9 n33_20->n38_13 n33_20->n6_9 n33_20->n33_12 n33_20->n38_11 n33_20->n38_10 n33_20->n33_13 n33_21 #33:@unrmm*ail n33_21->n38_13 n33_21->n6_9 n33_21->n33_14 n33_21->n20_5 n33_21->n33_13 n33_21->n27_12 n33_22 #33:@forward n33_22->n38_40 n33_22->n38_13 n33_22->n6_9 n33_22->n38_11 n33_22->n38_10 n33_22->n33_15 n33_22->n33_13 n33_22->n27_12 n20_59 #20:name_and_number n33_22->n20_59 n38_2 #38:send_message n33_22->n38_2

Showing 48 of 140 verbs; 92 not shown.

Source

mail_forward

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

none

Source

1if (typeof(mf = this.(verb)) == STR)
2return $string_utils:pronoun_sub(mf, @args);
3else
4return mf;
5endif

receive_message

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

none

Source

1":receive_message(msg,from)";
2if ((!$perm_utils:controls(caller_perms(), this)) && (caller != this))
3return E_PERM;
4endif
5if (this:mail_option("no_dupcc", args[1][1], args[1][2]))
6"pass to :mail_option the TEXT versions of who the message is from and to";
7recipients = setremove($mail_agent:parse_address_field(args[1][3]), this);
8for x in (recipients)
9if (this:get_current_message(x))
10return 0;
11endif
12endfor
13endif
14if (this:mail_option("netmail"))
15msg = args[1];
16message = {"Forwarded: " + msg[4], "Original-date: " + ctime(msg[1]), "Original-From: " + msg[2], "Original-To: " + msg[3], ((("Reply-To: " + $string_utils:substitute(args[2].name, {{"@", "%"}})) + "@") + $network.moo_name) + ".moo.mud.org"};
17for x in (msg[5..$])
18message = {@message, @$generic_editor:fill_string(x, this:linelen())};
19endfor
20if (this:send_self_netmail(message, @listdelete(args, 1)) == 0)
21return 0;
22endif
23endif
24set_task_perms(this.owner);
25new = this:new_message_num();
26ncur = (new <= 1) ? 0 | min(this:current_message(this), new);
27this:set_current_message(this, ncur);
28new = max(new, ncur + 1);
29this.messages = {@this.messages, {new, args[1]}};
30"... new-mail notification is now done directly by $mail_agent:raw_send";
31"... see :notify_mail...";
32return new;

display_message

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

none

Source

1":display_message(preamble,msg) --- prints msg to player.";
2vb = ((this._mail_task == task_id()) || (caller == $mail_editor)) ? "notify_lines_suspended" | "tell_lines_suspended";
3preamble = args[1];
4player:(vb)({@(typeof(preamble) == LIST) ? preamble | {preamble}, @args[2], $ansi.reset + "--------------------------"});

parse_message_seq from_msg_seq %from_msg_seq to_msg_seq %to_msg_seq subject_msg_seq body_msg_seq kept_msg_seq unkept_msg_seq display_seq_headers display_seq_full messages_in_seq list_rmm new_message_num length_num_le length_date_le length_date_gt length_all_msgs exists_num_eq msg_seq_to_msg_num_list msg_seq_to_msg_num_string rm_message_seq undo_rmm expunge_rmm renumber keep_message_seq

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

Source

1"parse_message_seq(strings,cur)         => msg_seq";
2"messages_in_seq(msg_seq);              => text of messages in msg_seq";
3"display_seq_headers(msg_seq[,current]) :displays summary lines of those msgs";
4"rmm_message_seq(msg_seq)               => string giving msg numbers removed";
5"undo_rmm()    => msg_seq of restored messages";
6"expunge_rmm() => number of messages expunged";
7"list_rmm()    => number of messages awaiting expunge";
8"renumber(cur) => {number of messages in folder, new_cur}";
9"";
10"See the corresponding routines on $mail_agent.";
11if ((caller == $mail_agent) || $perm_utils:controls(caller_perms(), this))
12set_task_perms(this.owner);
13return $mail_agent:(verb)(@args);
14else
15return E_PERM;
16endif

msg_summary_line

Spec this none thisFlags rxdOwner #29Definer #33

Referenced by

none

Source

1return $mail_agent:msg_summary_line(@args);

msg_text

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

none

Source

1":msg_text(@msg) => list of strings.";
2"msg is a mail message (in the usual transmission format) being read BY this player.";
3"The default version of recipient:msg_full_text calls this to obtain the actual list of strings to display.  (this is a badly named verb).";
4"returns the actual list of strings to display.";
5return $mail_agent:to_text(@args);

notify_mail

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

none

Source

1":notify_mail(from,recipients[,msgnums])";
2" used by $mail_agent:raw_send to notify this player about mail being sent";
3" from <from> to <recipients>.  <msgnums> if given gives the message number(s) assigned (in the event that the corresponding recipient actually kept the mail)";
4if (!$object_utils:connected(this))
5return;
6elseif (!((caller in {this, $mail_agent}) || $perm_utils:controls(caller_perms(), this)))
7return E_PERM;
8else
9{from, recipients, ?msgnums = {}} = args;
10from_name = $mail_agent:name(from);
11"... msgnums may be shorter than recipients or may have some slots filled";
12"... with 0's if msg numbers are not available for some recipients.";
13if ((t = this in recipients) && ((length(msgnums) >= t) && msgnums[t]))
14"... you are getting the mail and moreover your :receive_message kept it.";
15namelist = $string_utils:english_list($list_utils:map_arg($mail_agent, "name", setremove(recipients, this)), "");
16this:notify(tostr("You have new mail (", msgnums[t], ") from ", from_name, namelist ? " which was also sent to " + namelist | "", "."));
17if (!this:mail_option("expert"))
18this:notify(tostr("Type `help mail' for info on reading it."));
19endif
20else
21"... vanilla notification; somebody got sent mail and you're finding out.";
22namelist = $string_utils:english_list({@t ? {"You"} | {}, @$list_utils:map_arg($mail_agent, "name", setremove(recipients, this))}, "");
23this:tell(tostr(namelist, (length(recipients) == 1) ? " has" | " have", " just been sent new mail by ", from_name, "."));
24endif
25endif

current_message

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

Source

1":current_message([recipient])";
2" => current message number for the given recipient (defaults to this).";
3" => 0 if we have no record of that recipient";
4"      or current message happens to be 0.";
5"This verb is mostly obsolete; consider using :get_current_message()";
6if ((caller != this) && (!$perm_utils:controls(caller_perms(), this)))
7raise(E_PERM);
8elseif ((!args) || (args[1] == this))
9return this.current_message[1];
10elseif (a = $list_utils:assoc(args[1], this.current_message))
11return a[2];
12else
13return 0;
14endif

get_current_message

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

Source

1":get_current_message([recipient])";
2" => {msg_num, last_read_date} for the given recipient.";
3" => 0 if we have no record of that recipient.";
4if ((caller != this) && (!$perm_utils:controls(caller_perms(), this)))
5raise(E_PERM);
6elseif ((!args) || (args[1] == this))
7if (length(this.current_message) < 2)
8"Whoops, this got trashed---fix it up!";
9this.current_message = {0, time(), @this.current_message};
10endif
11return this.current_message[1..2];
12elseif (a = $list_utils:assoc(args[1], this.current_message))
13return a[2..3];
14else
15return 0;
16endif

set_current_message

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

Source

1":set_current_message(recipient[,number[,date]])";
2"Returns the new {number,last-read-date} pair for recipient.";
3if ((caller != this) && (!$perm_utils:controls(caller_perms(), this)))
4raise(E_PERM);
5endif
6{recip, ?number = E_NONE, ?date = 0} = args;
7cm = this.current_message;
8if (recip == this)
9this.current_message[2] = max(date, cm[2]);
10if (number != E_NONE)
11this.current_message[1] = number;
12endif
13return this.current_message[1..2];
14elseif (i = $list_utils:iassoc(recip, cm))
15return (this.current_message[i] = {recip, (number == E_NONE) ? cm[i][2] | number, max(date, cm[i][3])})[2..3];
16else
17entry = {recip, (number != E_NONE) && number, date};
18this.current_message = {@cm, entry};
19return entry[2..3];
20endif

make_current_message

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

Source

1":make_current_message(recipient[,index])";
2"starts a new current_message record for recipient.";
3"index, if given, indicates where recipient is to be";
4"  placed (n = at or after nth entry in .current_message).";
5recip = args[1];
6cm = this.current_message;
7if (length(args) > 1)
8i = max(2, min(args[2], length(cm)));
9else
10i = 0;
11endif
12if ((caller != this) && (!$perm_utils:controls(caller_perms(), this)))
13raise(E_PERM);
14elseif (recip == this)
15"...self...";
16elseif (j = $list_utils:iassoc(recip, cm))
17"...already present...";
18if (i)
19if (j < i)
20this.current_message = {@cm[1..j - 1], @cm[j + 1..i], cm[j], @cm[i + 1..$]};
21elseif (j > (i + 1))
22this.current_message = {@cm[1..i], cm[j], @cm[i + 1..j - 1], @cm[j + 1..$]};
23endif
24endif
25else
26this.current_message = listappend(cm, {recip, 0, 0}, @i ? {i} | {});
27endif

kill_current_message

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

Source

1":kill_current_message(recipient)";
2"entirely forgets current message for this recipient...";
3"Returns true iff successful.";
4if ((caller != this) && (!$perm_utils:controls(caller_perms(), this)))
5raise(E_PERM);
6else
7return ((recip = args[1]) != this) && ((i = $list_utils:iassoc(recip, cm = this.current_message)) && (this.current_message = listdelete(cm, i)));
8endif

current_folder

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

Source

1":current_folder() => default folder to use, always an object, usually `this'";
2set_task_perms(caller_perms());
3return ((!this:mail_option("sticky")) || this.current_folder) && this;

set_current_folder

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

Source

1set_task_perms(caller_perms());
2return this.current_folder = args[1];

parse_folder_spec

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

Source

1":parse_folder_spec(verb,args,expected_preposition[,allow_trailing_args_p])";
2" => {folder, msg_seq_args, trailing_args}";
3set_task_perms(caller_perms());
4folder = this:current_folder();
5if (!prepstr)
6return {folder, args[2], {}};
7endif
8{verb, args, prep, ?extra = 0} = args;
9p = prepstr in args;
10if (prepstr != prep)
11"...unexpected preposition...";
12if (extra && (!index(prepstr, " ")))
13return {folder, args[1..p - 1], args[p..$]};
14else
15player:tell("Usage:  ", verb, " [<message numbers>] [", prep, " <folder/list-name>]");
16endif
17elseif (!((p < length(args)) && (fname = args[p + 1])))
18"...preposition but no iobj...";
19player:tell(verb, " ", $string_utils:from_list(args, " "), " WHAT?");
20elseif ($mail_agent:match_failed(folder = $mail_agent:match_recipient(fname, this), fname))
21"...bogus mail folder...";
22else
23return {folder, args[1..p - 1], args[p + 2..$]};
24endif
25return 0;

parse_mailread_cmd

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

Source

1":parse_mailread_cmd(verb,args,default,prep[,trailer])";
2"  handles anything of the form  `VERB message_seq [PREP folder ...]'";
3"    default is the default msg-seq to use if none given";
4"    prep is the expected prepstr (assumes prepstr is set), usually `on'";
5"    trailer, if present and true, indicates trailing args are permitted.";
6"  returns {recipient object, message_seq, current_msg,\"...\"} or 0";
7set_task_perms(caller_perms());
8if ((args[2] && (typeof(args[2]) == LIST)) && index(args[2][1], "/"))
9return $mail_agent:parse_new_mailspec(@args[2]);
10endif
11if (!(pfs = this:parse_folder_spec(@listdelete(args, 3))))
12return 0;
13endif
14{verb, args, default, prep, ?extra = 0} = args;
15folder = pfs[1];
16cur = this:get_current_message(folder) || {0};
17if (typeof(pms = folder:parse_message_seq(pfs[2], @cur)) == LIST)
18rest = {@listdelete(pms, 1), @pfs[3]};
19if ((!extra) && rest)
20"...everything should have been gobbled by :parse_message_seq...";
21player:tell("I don't understand `", rest[1], "'");
22return 0;
23elseif (pms[1])
24"...we have a nonempty message sequence...";
25return {folder, pms[1], cur, rest};
26elseif (used = (length(pfs[2]) + 1) - length(pms))
27"...:parse_message_seq used some words, but didn't get anything out of it";
28pms = ("%f %<has> no `" + $string_utils:from_list(pfs[2][1..used], " ")) + "' messages.";
29elseif (typeof(pms = folder:parse_message_seq(default, @cur)) == LIST)
30"...:parse_message_seq used nothing, try the default; wow it worked";
31return {folder, pms[1], cur, rest};
32endif
33elseif (typeof(pms) == ERR)
34player:tell($mail_agent:name(folder), " is not readable by you.");
35if (!$object_utils:isa(folder, $mail_recipient))
36player:tell("Use * to indicate a non-player mail recipient.");
37endif
38return 0;
39endif
40if (folder == this)
41subst = {{"%f's", "Your"}, {"%f", "You"}, {"%<has>", "have"}};
42elseif (is_player(folder))
43subst = {{"%f", folder.name}, {"%<has>", $gender_utils:get_conj("has", folder)}};
44else
45subst = {{"%f", $mail_agent:name(folder)}, {"%<has>", "has"}};
46endif
47player:tell($string_utils:substitute(pms, {@subst, {"%%", "%"}}));
48return 0;

@mail

Spec any any anyFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"@mail <msg-sequence>                --- as in help @mail";
2"@mail <msg-sequence> on <recipient> --- shows mail on mailing list or player.";
3set_task_perms(valid(cp = caller_perms()) ? cp | player);
4if (p = this:parse_mailread_cmd("@mail", args, this:mail_option("@mail") || $mail_agent.("player_default_@mail"), "on"))
5this:set_current_folder(folder = p[1]);
6msg_seq = p[2];
7seq_size = $seq_utils:size(msg_seq);
8if ((lim = player:mail_option("manymsgs")) && ((lim <= seq_size) && (!$command_utils:yes_or_no(tostr("You are about to see ", seq_size, " message headers.  Continue?")))))
9player:notify(tostr("Aborted.  @mailoption manymsgs=", lim));
10return;
11endif
12if (1 != seq_size)
13player:notify(tostr(seq_size, " messages", (folder == this) ? "" | (" on " + $mail_agent:name(folder)), ":"));
14endif
15folder:display_seq_headers(msg_seq, @p[3]);
16endif

@read @peek

Spec any any anyFlags rxdOwner #361Definer #33

Referenced by

Source

1"@read <msg>...                  -- as in help @read";
2"@read <msg>... on *<recipient>  -- reads messages on recipient.";
3"@peek ...                       -- like @read, but don't set current message";
4set_task_perms(valid(cp = caller_perms()) ? cp | player);
5if (p = this:parse_mailread_cmd("@read", args, "", "on"))
6this:set_current_folder(folder = p[1]);
7msg_seq = p[2];
8if (!msg_seq)
9player:tell("Watchu takin bout Willis? [There are no messages matching those options.]");
10return;
11endif
12if ((lim = player:mail_option("manymsgs")) && ((lim <= (seq_size = $seq_utils:size(msg_seq))) && (!$command_utils:yes_or_no(tostr("You are about to see ", seq_size, " messages.  Continue? Remember, you can always use @skip instead.")))))
13player:notify(tostr("Aborted.  @mailoption manymsgs=", lim));
14return;
15endif
16this._mail_task = task_id();
17if (cur = folder:display_seq_full(msg_seq, tostr("Message %d", (folder == this) ? "" | (" on " + $mail_agent:name(folder)), ":")))
18if (verb != "@peek")
19this:set_current_message(folder, @cur);
20endif
21endif
22endif

@next @prev

Spec any any anyFlags rxdOwner #361Definer #33

Referenced by

none

Source

1set_task_perms(player.owner);
2if (dobjstr && (!(n = toint(dobjstr))))
3player:notify(tostr("Usage:  ", verb, "[<number>] [on <recipient>]"));
4elseif (dobjstr)
5this:("@read")(tostr(verb[2..5], n), @listdelete(args, 1));
6else
7this:("@read")(verb[2..5], @args);
8endif

@rmm*ail

Spec any any anyFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"@rmm <message-sequence> [from <recipient>].   Use @unrmm if you screw up.";
2" Beware, though.  @unrmm can only undo the most recent @rmm.";
3set_task_perms(player);
4if (!(p = this:parse_mailread_cmd("@rmm", args, "cur", "from")))
5"...parse failed, we've already complained...";
6elseif ((!prepstr) && ((p[1] != this) && (!$command_utils:yes_or_no(("@rmmail from " + $mail_agent:name(p[1])) + ".  Continue?"))))
7"...wasn't the folder player was expecting...";
8player:notify("@rmmail aborted.");
9else
10this:set_current_folder(folder = p[1]);
11e = folder:rm_message_seq(p[2]);
12if (typeof(e) == ERR)
13player:notify(tostr($mail_agent:name(folder), ":  ", e));
14else
15count = ((n = $seq_utils:size(p[2])) == 1) ? "." | tostr(" (", n, " messages).");
16fname = (folder == this) ? "" | (" from " + $mail_agent:name(folder));
17player:notify(tostr("Deleted ", e, fname, count));
18endif
19endif

@renumber

Spec any none noneFlags rxdOwner #361Definer #33

Referenced by

none

Source

1set_task_perms(player);
2if (!dobjstr)
3folder = this:current_folder();
4elseif ($mail_agent:match_failed(folder = $mail_agent:match_recipient(dobjstr), dobjstr))
5return;
6endif
7cur = this:current_message(folder);
8fname = $mail_agent:name(folder);
9if (typeof(h = folder:renumber(cur)) == ERR)
10player:notify(tostr(h));
11else
12if (!h[1])
13player:notify(tostr("No messages on ", fname, "."));
14else
15player:notify(tostr("Messages on ", fname, " renumbered 1-", h[1], "."));
16this:set_current_folder(folder);
17if (h[2] && this:set_current_message(folder, h[2]))
18player:notify(tostr("Current message is now ", h[2], "."));
19endif
20endif
21endif

@unrmm*ail

Spec any any anyFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"@unrmm [on <recipient>]  -- undoes the previous @rmm on that recipient.";
2set_task_perms(player);
3if (!(p = this:parse_folder_spec("@unrmm", args, "on")))
4return;
5endif
6dobjstr = $string_utils:from_list(p[2], " ");
7keep = 0;
8if ((!dobjstr) || (keep = index("keep", dobjstr) == 1))
9do = "undo_rmm";
10elseif (index("expunge", dobjstr) == 1)
11do = "expunge_rmm";
12elseif (index("list", dobjstr) == 1)
13do = "list_rmm";
14else
15player:notify(tostr("Usage:  ", verb, " [expunge|list] [on <recipient>]"));
16return;
17endif
18this:set_current_folder(folder = p[1]);
19if (msg_seq = folder:(do)(@keep ? {keep} | {}))
20if (do == "undo_rmm")
21player:notify(tostr($seq_utils:size(msg_seq), " messages restored to ", $mail_agent:name(folder), "."));
22folder:display_seq_headers(msg_seq, 0);
23else
24player:notify(tostr(msg_seq, " zombie message", (msg_seq == 1) ? " " | "s ", (do == "expunge_rmm") ? "expunged from " | "on ", $mail_agent:name(folder), "."));
25endif
26elseif (typeof(msg_seq) == ERR)
27player:notify(tostr($mail_agent:name(folder), ":  ", msg_seq));
28else
29player:notify(tostr("No messages to ", (do == "expunge_rmm") ? "expunge from " | "restore to ", $mail_agent:name(folder)));
30endif

@forward

Spec any any anyFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"@forward <msg> [on *<recipient>] to <recipient> [<recipient>...]";
2set_task_perms(valid(cp = caller_perms()) ? cp | player);
3if (!(p = this:parse_mailread_cmd(verb, args, "", "on", 1)))
4"...lose...";
5return;
6elseif ($seq_utils:size(sequence = p[2]) != 1)
7player:notify("You can only forward *one* message at a time.");
8return;
9elseif ((length(p[4]) < 2) || (p[4][1] != "to"))
10player:notify(tostr("Usage:  ", verb, " [<message>] [on <folder>] to <recip>..."));
11return;
12endif
13recips = {};
14for rs in (listdelete(p[4], 1))
15if ($mail_agent:match_failed(r = $mail_agent:match_recipient(rs), rs))
16return;
17elseif (is_a(r, #45) && (!r:is_writable_by(player)))
18player:notify($su:nn(r), " is not writable by you.");
19return E_PERM;
20endif
21recips = {@recips, r};
22endfor
23this:set_current_folder(folder = p[1]);
24m = folder:messages_in_seq(sequence)[1];
25msgnum = m[1];
26msgtxt = m[2];
27from = msgtxt[2];
28if (msgtxt[4] != " ")
29subject = tostr("[", from, ":  ", msgtxt[4], "]");
30elseif ((h = "" in msgtxt) && (h < length(msgtxt)))
31subject = tostr("[", from, ":  `", msgtxt[h + 1][1..min(20, $)], "']");
32else
33subject = tostr("[", from, "]");
34endif
35result = $mail_agent:send_message(player, recips, subject, $mail_agent:to_text(@msgtxt));
36if (!result)
37player:notify(tostr(result));
38elseif (result[1])
39player:notify(tostr("Message ", msgnum, @(folder == this) ? {} | {" on ", $mail_agent:name(folder)}, " @forwarded to ", $mail_agent:name_list(@listdelete(result, 1)), "."));
40else
41player:notify("Message not sent.");
42endif

@skip

Spec any any anyFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"@skip [*<folder/mailing_list>...]";
2"  sets your last-read time for the given lists to now, indicating your";
3"  disinterest in any new messages that might have appeared recently.";
4set_task_perms(player);
5current_folder = this:current_folder();
6for a in (args || {0})
7if (a ? $mail_agent:match_failed(folder = $mail_agent:match_recipient(a), a) | (folder = this:current_folder()))
8"...bogus folder name, done...  No, try anyway.";
9if (this:kill_current_message(this:my_match_object(a)))
10player:notify("Invalid folder, but found it subscribed anyway.  Removed.");
11endif
12else
13lseq = folder:length_all_msgs();
14unread = (n = this:get_current_message(folder)) ? folder:length_date_gt(n[2]) | lseq;
15this:set_current_message(folder, lseq && folder:messages_in_seq({lseq, lseq + 1})[1][1], time());
16player:notify(tostr(unread ? tostr("Ignoring ", unread) | "No", " unread message", (unread != 1) ? "s" | "", " on ", $mail_agent:name(folder)));
17if (current_folder == folder)
18this:set_current_folder(this);
19endif
20endif
21endfor

@subscribe*-quick @unsubscribed*-quick

Spec any any anyFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"@subscribe *<folder/mailing_list> [with notification] [before|after *<folder>]";
2"  causes you to be notified when new mail arrives on this list";
3"@subscribe";
4"  just lists available mailing lists.";
5"@unsubscribed";
6"  prints out available mailing lists you aren't already subscribed to.";
7"@subscribe-quick and @unsubscribed-quick";
8"  prints out same as above except without mail list descriptions, just names.";
9set_task_perms(player);
10quick = 0;
11if (qi = index(verb, "-q"))
12verb = verb[1..qi - 1];
13quick = 1;
14endif
15fname = {@args, 0}[1];
16if (!fname)
17ml = $list_utils:slice(this.current_message[3..$]);
18all_mlists = {@$mail_agent.contents, @this.mail_lists};
19if ((length(all_mlists) > 50) && (!$command_utils:yes_or_no(tostr("There are ", length(all_mlists), " mailing lists.  Are you sure you want the whole list?"))))
20return player:tell("OK, aborting.");
21endif
22all_mlists = $lu:sort_prop(all_mlists, "name");
23for c in (all_mlists)
24$command_utils:suspend_if_needed(0);
25"    if ((c:is_usable_by(this) || c:is_readable_by(this)) && ((verb != \"@unsubscribed\") || (!(c in ml))))";
26if (c:is_readable_by(this) && ((verb != "@unsubscribed") || (!(c in ml))))
27c:look_self(quick);
28endif
29endfor
30player:notify(tostr("-------- end of ", verb, " -------"));
31return;
32elseif (verb == "@unsubscribed")
33player:notify("@unsubscribed does not take arguments.");
34return;
35elseif ($mail_agent:match_failed(folder = $mail_agent:match_recipient(fname), fname))
36return;
37elseif (folder == this)
38player:notify("You don't need to @subscribe to yourself");
39return;
40elseif ($object_utils:isa(folder, $mail_recipient) ? !folder:is_readable_by(this) | (!$perm_utils:controls(this, folder)))
41player:notify("That mailing list is not readable by you.");
42return;
43endif
44notification = this in folder.mail_notify;
45i = 0;
46beforeafter = 0;
47while (length(args) >= 2)
48if (length(args) < 3)
49player:notify(args[2] + " what?");
50return;
51elseif (args[2] in {"with", "without"})
52with = args[2] == "with";
53if (index("notification", args[3]) != 1)
54player:notify(tostr("with ", args[3], "?"));
55return;
56elseif (!$object_utils:isa(folder, $mail_recipient))
57player:notify(tostr("You cannot use ", verb, " to change mail notification from a non-$mail_recipient."));
58elseif ((!with) == (!notification))
59"... nothing to do...";
60elseif (with)
61if (this in folder:add_notify(this))
62notification = 1;
63else
64player:notify("This mail recipient does not allow immediate notification.");
65endif
66else
67folder:delete_notify(this);
68notification = 0;
69endif
70elseif (args[2] in {"before", "after"})
71if (beforeafter)
72player:notify((args[2] == beforeafter) ? tostr("two `", beforeafter, "'s?") | "Only use one of `before' or `after'");
73return;
74elseif ($mail_agent:match_failed(other = $mail_agent:match_recipient(args[3]), args[3]))
75return;
76elseif (other == this)
77i = 2;
78elseif (!(i = $list_utils:iassoc(other, this.current_message)))
79player:notify(tostr("You aren't subscribed to ", $mail_agent:name(other), "."));
80return;
81endif
82beforeafter = args[2];
83i = i - (beforeafter == "before");
84if (this:mail_option("rn_order") != "fixed")
85player:notify("Warning:  Do `@mail-option rn_order=fixed' if you do not want your @rn listing reordered when you next login.");
86endif
87endif
88args[2..3] = {};
89endwhile
90this:make_current_message(folder, @i ? {i} | {});
91len = folder:length_all_msgs();
92player:notify(tostr($mail_agent:name(folder), " has ", len, " message", (len == 1) ? "" | "s", ".", notification ? "  You will be notified immediately when new messages are posted." | "  Notification of new messages will be printed when you connect."));
93this:set_current_folder(folder);

mail_catch_up

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

Source

1set_task_perms((caller == this) ? this.owner | caller_perms());
2this:set_current_folder(this);
3dates = new_cm = head = {};
4sort = this:mail_option("rn_order") || "read";
5for n in (this.current_message)
6$command_utils:suspend_if_needed(0);
7if (typeof(n) != LIST)
8head = {@head, n};
9elseif ($object_utils:isa(folder = n[1], $mail_recipient) && folder:is_readable_by(this))
10"...set current msg to be the last one you could possibly have read.";
11if (n[3] < folder.last_msg_date)
12i = folder:length_date_le(n[3]);
13n[2] = i && folder:messages_in_seq(i)[1];
14endif
15if (sort == "fixed")
16new_cm = {n, @new_cm};
17elseif (sort == "send")
18j = $list_utils:find_insert(dates, folder.last_msg_date - 1);
19dates = listinsert(dates, folder.last_msg_date, j);
20new_cm = listinsert(new_cm, n, j);
21else
22new_cm = listappend(new_cm, n, $list_utils:iassoc_sorted(n[3] - 1, new_cm, 3));
23endif
24endif
25endfor
26this.current_message = {@head, @$list_utils:reverse(new_cm)};

@rn check_mail_lists @subscribed @rn-full

Spec none none noneFlags rxdOwner #361Definer #33

Referenced by

Source

1set_task_perms((caller == this) ? this.owner | caller_perms());
2which = {};
3cm = this.current_message;
4cm[1..2] = ((verb == "@rn") || (verb == "@rn-full")) ? {{this, @cm[1..2]}} | {};
5all = verb == "@subscribed";
6fast = this:mail_option("fast_check") && (verb != "@rn-full");
7for n in (cm)
8rcpt = n[1];
9if (rcpt == $news)
10"... $news is handled separately ...";
11elseif ($mail_agent:is_recipient(rcpt))
12if (fast)
13if (rcpt == this)
14nmsgs = ((m = this.messages) && (m[length(m)][2][1] > n[3])) ? $maxint | 0;
15else
16try
17nmsgs = (n[1].last_msg_date > n[3]) ? $maxint | 0;
18except (E_PERM, E_PROPNF)
19player:notify(tostr("Bogus recipient ", rcpt, " removed from .current_message."));
20this.current_message = setremove(this.current_message, n);
21nmsgs = 0;
22endtry
23endif
24else
25nmsgs = n[1]:length_date_gt(n[3]);
26endif
27if (nmsgs || all)
28which = {@which, {n[1], nmsgs}};
29endif
30else
31player:notify(tostr("Bogus recipient ", rcpt, " removed from .current_message."));
32this.current_message = setremove(this.current_message, n);
33endif
34$command_utils:suspend_if_needed(0);
35endfor
36if (which)
37player:notify(tostr((verb == "@subscribed") ? "You are subscribed to the following" | "There is new activity on the following", (length(which) > 1) ? " lists:" | " list:"));
38for w in (which)
39name = (w[1] == this) ? " me" | $mail_agent:name(w[1]);
40player:notify(tostr($string_utils:left("    " + name, 40), " ", (w[2] == $maxint) ? "has" | w[2], " new message", (w[2] == 1) ? "" | "s"));
41$command_utils:suspend_if_needed(0);
42endfor
43if (verb != "check_mail_lists")
44player:notify("-- End of listing");
45endif
46elseif ((verb == "@rn") || (verb == "@rn-full"))
47player:notify("No new activity on any of your lists.");
48elseif (verb == "@subscribed")
49player:notify("You aren't subscribed to any mailing lists.");
50endif
51return which;

mail_option

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

Source

1":mail_option(name)";
2"Returns the value of the specified mail option";
3if ((caller in {this, $mail_editor, $mail_agent}) || $perm_utils:controls(caller_perms(), this))
4return $mail_options:get(this.mail_options, args[1]);
5else
6return E_PERM;
7endif

@unsub*scribe

Spec any any anyFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"@unsubscribe [*<folder/mailing_list> ...]";
2"entirely removes the record of your current message for the named folders,";
3"indicating your disinterest in anything that might appear there in the future.";
4set_task_perms(player);
5unsubscribed = {};
6current_folder = this:current_folder();
7for a in (args || {0})
8if (a != 0)
9folder = $mail_agent:match_recipient(a);
10if (folder == $failed_match)
11folder = this:my_match_object(a);
12endif
13else
14folder = current_folder;
15endif
16if (!valid(folder))
17"...bogus folder name...  try removing it anyway.";
18if (this:kill_current_message(folder))
19this:notify("Invalid folder, but found it subscribed anyway.  Removed.");
20else
21$mail_agent:match_failed(folder, a);
22endif
23elseif (folder == this)
24this:notify(tostr("You can't ", verb, " yourself."));
25else
26if (!this:kill_current_message(folder))
27this:notify(tostr("You weren't subscribed to ", $mail_agent:name(folder)));
28if ($object_utils:isa(folder, $mail_recipient))
29result = folder:delete_notify(this);
30if ((typeof(result) == LIST) && (result[1] == this))
31this:notify("Removed you from the mail notifications list.");
32endif
33endif
34else
35unsubscribed = {@unsubscribed, folder};
36if ($object_utils:isa(folder, $mail_recipient))
37folder:delete_notify(this);
38endif
39endif
40endif
41endfor
42if (unsubscribed)
43this:notify(tostr("Forgetting about ", $string_utils:english_list($list_utils:map_arg($mail_agent, "name", unsubscribed))));
44if (current_folder in unsubscribed)
45this:set_current_folder(this);
46endif
47endif

send_self_netmail

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

Source

1":send_self_netmail(msg [ ,from ])";
2"return 0 if successful, otherwise error.";
3if (!$perm_utils:controls(caller_perms(), this))
4return E_PERM;
5elseif (error = $network:invalid_email_address($wiz_utils:get_email_address(this)))
6return "Invalid email address: " + error;
7else
8msg = args[1];
9if (length(args) > 1)
10from = args[2];
11this:notify(tostr("Receiving mail from ", from:title(), " (", from, ") and forwarding it to your .email_address."));
12endif
13oplayer = player;
14player = this;
15error = $network:sendmail($wiz_utils:get_email_address(this), @msg);
16if (error && (length(args) > 1))
17this:notify(tostr("Mail sending failed: ", error));
18endif
19player = oplayer;
20return error;
21endif

@netforw*ard

Spec any any anyFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"@netforward <msg>...                  -- as in help on @netforward";
2"@netforward <msg>... on *<recipient>  -- netforwards messages on recipient.";
3"This command forwards mail-messages to your registered email-address.";
4if (player != this)
5return player:tell(E_PERM);
6endif
7if (reason = $network:email_will_fail(email = $wiz_utils:get_email_address(player)))
8return player:notify(tostr("Cannot forward mail to your email address: ", reason));
9endif
10set_task_perms(valid(cp = caller_perms()) ? cp | player);
11if (p = player:parse_mailread_cmd(verb, args, "", "on"))
12player:set_current_folder(folder = p[1]);
13msg_seq = p[2];
14folderstr = (folder == player) ? "" | tostr(" from ", $mail_agent:name(folder));
15if ((!this:mail_option("expert_netfwd")) && (!$command_utils:yes_or_no(tostr("You are about to forward ", seq_size = $seq_utils:size(msg_seq), " message(s)", folderstr, " to your registered email-address, ", email, ".  Continue?"))))
16player:notify(tostr("@Netforward cancelled."));
17return;
18endif
19player:notify("Attempting to send network mail...");
20player._mail_task = task_id();
21multiple_vals = this:format_for_netforward(folder:messages_in_seq(msg_seq), folderstr);
22netmail = multiple_vals[1];
23header = multiple_vals[2];
24reason = player:send_self_netmail({header, @netmail});
25player:notify((reason == 0) ? tostr("@netforward of ", header, " completed.") | tostr("@netforward failed: ", reason, "."));
26endif

@@sendmail

Spec any any anyFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"Syntax: @@sendmail";
2"This is intended for use with client editors.  You probably don't want to try using this command manually.";
3"Reads a formatted mail message, extracts recipients, subject line and/or reply-to header and sends message without going to the mailroom.  Example:";
4"";
5"@@send";
6"To: Rog (#4292)";
7"Subject: random";
8"";
9"first line";
10"second line";
11".";
12"";
13"Currently, header lines must have the same format as in an actual message.";
14set_task_perms(player);
15if (args)
16player:notify(tostr("The ", verb, " command takes no arguments."));
17$command_utils:read_lines();
18return;
19elseif (this != player)
20player:notify(tostr("You can't use ", this.pp, " ", verb, " verb."));
21$command_utils:read_lines();
22return;
23endif
24msg = $command_utils:read_lines();
25end_head = ("" in msg) || (length(msg) + 1);
26from = this;
27subject = "";
28replyto = "";
29rcpts = {};
30body = msg[end_head + 1..$];
31for i in [1..end_head - 1]
32line = msg[i];
33if (index(line, "Subject:") == 1)
34subject = $string_utils:trim(line[9..$]);
35elseif (index(line, "To:") == 1)
36if (!(rcpts = $mail_agent:parse_address_field(line)))
37player:notify("No recipients found in To: line");
38return;
39endif
40elseif (index(line, "Reply-to:") == 1)
41if ((!(replyto = $mail_agent:parse_address_field(line))) && $string_utils:trim(line[10..$]))
42player:notify("No address found in Reply-to: line");
43return;
44endif
45elseif (index(line, "From:") == 1)
46"... :send_message() bombs if designated sender != player ...";
47if (!(from = $mail_agent:parse_address_field(line)))
48player:notify("No sender found in From: line");
49return;
50elseif (length(from) > 1)
51player:notify("Multiple senders?");
52return;
53endif
54from = from[1];
55elseif (i = index(line, ":"))
56player:notify(tostr("Unknown header \"", line[1..i], "\""));
57return;
58else
59player:notify("Blank line must separate headers from body.");
60return;
61endif
62endfor
63if (!rcpts)
64player:notify("No To: line found.");
65elseif (!(subject || body))
66player:notify("Blank message not sent.");
67else
68player:notify("Sending...");
69result = $mail_agent:send_message(from, rcpts, replyto ? subject | {subject, replyto}, body);
70if (e = result && result[1])
71if (length(result) == 1)
72player:notify("Mail actually went to no one.");
73else
74player:notify(tostr("Mail actually went to ", $mail_agent:name_list(@listdelete(result, 1)), "."));
75endif
76else
77player:notify(tostr((typeof(e) == ERR) ? e | ("Bogus recipients:  " + $string_utils:from_list(result[2]))));
78player:notify("Mail not sent.");
79endif
80endif

@keep-m*ail @keepm*ail

Spec any any anyFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"@keep-mail [<msg-sequence>|none] [on <recipient>]";
2"marks the indicated messages as `kept'.";
3set_task_perms(valid(cp = caller_perms()) ? cp | player);
4if (!args)
5return player:notify("Usage:  @keep-mail [<msg-sequence>|none] [on <recipient>]");
6elseif (args[1] == "none")
7args[1..1] = {};
8if (!(pfs = this:parse_folder_spec(verb, args, "on", 0)))
9return;
10elseif (pfs[2])
11player:notify(tostr(verb, " <message-sequence> or `none', but not both."));
12return;
13endif
14this:set_current_folder(folder = pfs[1]);
15if (e = folder:keep_message_seq({}))
16player:notify(tostr("Messages on ", $mail_agent:name(folder), " are no longer marked as kept."));
17else
18player:notify(tostr(e));
19endif
20return;
21elseif (p = this:parse_mailread_cmd(verb, args, "", "on"))
22if ((folder = p[1]) != this)
23"... maybe I'll take this clause out some day...";
24player:notify(tostr(verb, " can only be used on your own mail collection."));
25return;
26endif
27this:set_current_folder(folder);
28if (e = folder:keep_message_seq(msg_seq = p[2]))
29player:notify(tostr("Message", match(e, "[.,]") ? "s " | " ", e, " now marked as kept."));
30elseif (typeof(e) == ERR)
31player:notify(tostr(e));
32else
33player:notify(tostr(((seq_size = $seq_utils:size(msg_seq)) == 1) ? "That message is" | "Those messages are", " already marked as kept."));
34endif
35endif

my_match_recipient

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

none

Source

1":my_match_recipient(string) => matches string against player's private mailing lists.";
2if (!(string = args[1]))
3return $nothing;
4elseif (string[1] == "*")
5string = string[2..$];
6if ((string == "biz") && valid(player.employer))
7return player.employer.forum;
8endif
9endif
10return $string_utils:match(string, this.mail_lists, "aliases");

expire_old_messages

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

none

Source

1has_email = $wiz_utils:get_email_address(this);
2set_task_perms(caller_perms());
3if (!$perm_utils:controls(caller_perms(), this))
4return E_PERM;
5else
6if ($network.active)
7msg_seq = this:expirable_msg_seq();
8if (msg_seq)
9if ((!this:mail_option("no_auto_forward")) && has_email)
10this._mail_task = task_id();
11multiple_vals = this:format_for_netforward(this:messages_in_seq(msg_seq), " expired from " + $string_utils:nn(this));
12netmail = multiple_vals[1];
13header = multiple_vals[2];
14reason = this:send_self_netmail({header, @netmail});
15else
16reason = "auto forwarding disabled.";
17endif
18if (!reason)
19this:rm_message_seq(msg_seq);
20return this:expunge_rmm();
21endif
22else
23return 0;
24endif
25endif
26endif

msg_full_text

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

none

Source

1":msg_full_text(@msg) => list of strings.";
2"msg is a mail message (in the usual transmission format).";
3"display_seq_full calls this to obtain the actual list of strings to display.";
4return player:msg_text(@args);
5"default is to leave it up to the player how s/he wants it to be displayed.";

@resend

Spec any any anyFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"@resend <msg> [on *<recipient>] to <recipient> [<recipient>...]";
2set_task_perms(valid(caller_perms()) ? caller_perms() | player);
3"...";
4"... parse command...";
5"...";
6if (!(p = this:parse_mailread_cmd(verb, args, "", "on", 1)))
7"...lose...";
8return;
9elseif ($seq_utils:size(sequence = p[2]) != 1)
10player:notify("You can only resend *one* message at a time.");
11return;
12elseif ((length(p[4]) < 2) || (p[4][1] != "to"))
13player:notify(tostr("Usage:  ", verb, " [<message>] [on <folder>] to <recip>..."));
14return;
15endif
16recips = {};
17for rs in (listdelete(p[4], 1))
18if ($mail_agent:match_failed(r = $mail_agent:match_recipient(rs), rs))
19return;
20endif
21recips = {@recips, r};
22endfor
23this:set_current_folder(folder = p[1]);
24"...";
25"... retrieve original message...";
26"...";
27{msgnum, msgtxt} = folder:messages_in_seq(sequence)[1];
28if (forward_style = this:mail_option("resend_forw"))
29"...message will be from player...";
30pmh = $mail_agent:parse_misc_headers(msgtxt, "Reply-To", "Original-Date", "Original-From");
31orig_from = pmh[3][3] || msgtxt[2];
32else
33"...message will be from author...";
34pmh = $mail_agent:parse_misc_headers(msgtxt, "Reply-To", "Original-Date", "Original-From", "Resent-By", "Resent-To");
35orig_from = pmh[3][3];
36from = $mail_agent:parse_address_field(msgtxt[2])[1];
37to = $mail_agent:parse_address_field(msgtxt[3]);
38endif
39"...";
40"... report bogus headers...";
41"...";
42if (bogus = pmh[2])
43player:notify("Bogus headers stripped from original message:");
44for b in (bogus)
45player:notify("  " + b);
46endfor
47if (!$command_utils:yes_or_no("Continue?"))
48player:notify("Message not resent.");
49return;
50endif
51endif
52"...";
53"... subject, replyto, original-date, original-from ...";
54"...";
55hdrs = {msgtxt[4], pmh[3][1], {"Original-Date", pmh[3][2] || ctime(msgtxt[1])}, @orig_from ? {{"Original-From", orig_from}} | {}, @pmh[1]};
56"...";
57"... send it ...";
58"...";
59if (forward_style)
60result = $mail_agent:send_message(player, recips, hdrs, pmh[4]);
61else
62"... resend inserts resent-to and resent-by...";
63result = $mail_agent:resend_message(player, recips, from, to, hdrs, pmh[4]);
64endif
65"...";
66"... report outcome...";
67"...";
68if (!result)
69player:notify(tostr(result));
70elseif (result[1])
71player:notify(tostr("Message ", msgnum, @(folder == this) ? {} | {" on ", $mail_agent:name(folder)}, " @resent to ", $mail_agent:name_list(@listdelete(result, 1)), "."));
72else
73player:notify("Message not resent.");
74endif

make_current_message_new

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

none

Source

1":make_current_message(recipient[,index])";
2"starts a new current_message record for recipient.";
3"index, if given, indicates where recipient is to be";
4"  placed (n = at or after nth entry in .current_message).";
5recip = args[1];
6cm = this.current_message;
7if (length(args) > 1)
8i = max(2, min(args[2], length(cm)));
9else
10i = 0;
11endif
12if ((caller != this) && (!$perm_utils:controls(caller_perms(), this)))
13raise(E_PERM);
14elseif (recip == this)
15"...self...";
16elseif (j = $list_utils:iassoc(recip, cm))
17"...already present...";
18if (i)
19if (j < i)
20this.current_message = {@cm[1..j - 1], @cm[j + 1..i], cm[j], @cm[i + 1..$]};
21elseif (j > (i + 1))
22this.current_message = {@cm[1..i], cm[j], @cm[i + 1..j - 1], @cm[j + 1..$]};
23endif
24endif
25else
26this.current_message = listappend(cm, {recip, 0, 0}, @i ? {i} | {});
27endif

expirable_msg_seq

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

Source

1"Return a sequence indicating the expirable messages for this player.";
2set_task_perms(caller_perms());
3if (!$perm_utils:controls(caller_perms(), this))
4return E_PERM;
5elseif (!(curmsg = this:get_current_message(this)))
6"No messages!  Don't even try.";
7return {};
8elseif (0 >= (period = this:mail_option("expire") || $mail_agent.player_expire_time))
9"...no expiration allowed here...";
10return {};
11else
12return $seq_utils:remove(this:unkept_msg_seq(), 1 + this:length_date_le(min(time() - period, curmsg[2] - 86400)));
13"... the 86400 is pure fudge...";
14endif

format_for_netforward

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

Source

1"Takes a message sequence (the actual messages, not just the sequence describing it) and grovels over it filling text etc.  Returns a two valued list: {formatted message, header for same}";
2set_task_perms(caller_perms());
3{message_seq, folderstr} = args;
4netmail = {};
5linelen = this:linelen();
6maxmsg = minmsg = 0;
7for msg in (message_seq)
8minmsg = minmsg ? min(msg[1], minmsg) | msg[1];
9maxmsg = maxmsg ? max(msg[1], maxmsg) | msg[1];
10lines = {tostr("Message ", msg[1], folderstr, ":"), tostr("Date:     ", ctime(msg[2][1])), "From:     " + msg[2][2], "To:       " + msg[2][3], @(length(subj = msg[2][4]) > 1) ? {"Subject:  " + subj} | {}};
11for line in (msg[2][5..$])
12if (typeof(line) != STR)
13"I don't know how this can happen, but apparently non-strings can end up in the mail message.  So, cope.";
14line = tostr(line);
15endif
16lines = {@lines, @$generic_editor:fill_string(line, linelen)};
17$command_utils:suspend_if_needed(0);
18endfor
19netmail = {@netmail, @lines, "", "--------------------------", "", ""};
20endfor
21header = tostr($network.MOO_name, " Message(s) ", minmsg, @(minmsg != maxmsg) ? {" - ", maxmsg} | {}, folderstr);
22return {netmail, header};

format_for_netforward_debug

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"Takes a message sequence (the actual messages, not just the sequence describing it) and grovels over it filling text etc.  Returns a two valued list: {formatted message, header for same}";
2set_task_perms(caller_perms());
3{message_seq, folderstr} = args;
4netmail = {};
5linelen = this:linelen();
6maxmsg = minmsg = 0;
7for msg in (message_seq)
8minmsg = minmsg ? min(msg[1], minmsg) | msg[1];
9maxmsg = maxmsg ? max(msg[1], maxmsg) | msg[1];
10lines = {tostr("Message ", msg[1], folderstr, ":"), tostr("Date:     ", ctime(msg[2][1])), "From:     " + msg[2][2], "To:       " + msg[2][3], @(length(subj = msg[2][4]) > 1) ? {"Subject:  " + subj} | {}};
11for line in (msg[2][5..$])
12if (typeof(line) != STR)
13"I don't know how this can happen, but apparently non-strings can end up in the mail message.  So, cope.";
14line = tostr(line);
15endif
16lines = {@lines, @$generic_editor:fill_string(line, linelen)};
17$command_utils:suspend_if_needed(0);
18endfor
19netmail = {@netmail, @lines, "", "--------------------------", "", ""};
20endfor
21header = tostr($network.MOO_name, " Message(s) ", minmsg, @(minmsg != maxmsg) ? {" - ", maxmsg} | {}, folderstr);
22return {netmail, header};

@nn

Spec none none noneFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"@nn  -- reads the first new message on the first mail_recipient (in .current_message) where new mail exists.";
2set_task_perms(valid(cp = caller_perms()) ? cp | player);
3cm = this.current_message;
4cm[1..2] = {{this, @cm[1..2]}};
5for n in (cm)
6if ($mail_agent:is_recipient(n[1]))
7if (new = n[1]:length_date_gt(n[3]))
8next = (n[1]:length_all_msgs() - new) + 1;
9this:set_current_folder(folder = n[1]);
10this._mail_task = task_id();
11cur = folder:display_seq_full({next, next + 1}, tostr("Message %d", " on ", $mail_agent:name(folder), ":"));
12this:set_current_message(folder, @cur);
13return;
14endif
15else
16player:notify(tostr("Bogus recipient ", n[1], " removed from .current_message."));
17this.current_message = setremove(this.current_message, n);
18endif
19endfor
20player:tell("No News (is good news)");

@unread

Spec any any anyFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"@unread <msg> [on *<recipient>]  -- resets last-read-date for recipient to just before the first of the indicated messages.";
2set_task_perms(player);
3if (p = this:parse_mailread_cmd("@unread", args, "cur", "on"))
4this:set_current_folder(folder = p[1]);
5msg_ord = $seq_utils:first(msg_seq = p[2]);
6msgdate = folder:messages_in_seq(msg_ord)[2][1] - 1;
7if ((!(cm = this:get_current_message(folder))) || (cm[2] < msgdate))
8player:notify("Already unread.");
9else
10if (folder == this)
11this.current_message[2] = msgdate - 1;
12else
13this:kill_current_message(folder);
14this:set_current_message(folder, cm[1], min(cm[2], msgdate));
15endif
16folder:display_seq_headers({msg_ord, msg_ord + 1}, cm[1], msgdate);
17endif
18endif

@refile @copym*ail

Spec any any anyFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"@refile/@copym*ail <msg-sequence> [on <recipient>] to <recipient>";
2"@refile will delete the messages from the source folder.  @copym does not.";
3"I'm not happy with this one, yet...";
4set_task_perms(player);
5if (!(p = this:parse_mailread_cmd("@refile", args, "cur", "on", 1)))
6"...lose...";
7elseif ((length(p[4]) != 2) || (p[4][1] != "to"))
8player:notify(tostr("Usage:  ", verb, " [<message numbers>] [on <folder>] to <folder>"));
9elseif ($mail_agent:match_failed(dest = $mail_agent:match_recipient(p[4][2]), p[4][2]))
10"...bogus destination folder...";
11else
12source = p[1];
13msg_seq = p[2];
14for m in (source:messages_in_seq(msg_seq))
15if (!(e = dest:receive_message(m[2], source)))
16player:notify(tostr("Copying msg. ", m[1], ":  ", e));
17return;
18endif
19$command_utils:suspend_if_needed(0);
20endfor
21if (refile = verb == "@refile")
22if (typeof(e = source:rm_message_seq(msg_seq)) == ERR)
23player:notify(tostr("Deleting from ", source, ":  ", e));
24endif
25endif
26count = tostr(n = $seq_utils:size(msg_seq), " message", (n == 1) ? "" | "s");
27fname = (source == this) ? "" | tostr(is_player(source) ? " from " | " from *", source.name, "(", source, ")");
28suffix = tostr(is_player(dest) ? " to " | " to *", dest.name, "(", dest, ").");
29player:notify(tostr(refile ? "Refiled " | "Copied ", count, fname, suffix));
30endif

@quickr*eply @qreply

Spec any any anyFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"@qreply <msg> [on *<recipient>] [<flags>...]";
2"like @reply only, as in @qsend, we prompt for the message text using ";
3"$command_utils:read_lines() rather than invoking the $mail_editor.";
4set_task_perms(who = valid(cp = caller_perms()) ? cp | player);
5if (!(p = this:parse_mailread_cmd(verb, args, "cur", "on", 1)))
6"...garbled...";
7elseif ($seq_utils:size(p[2]) != 1)
8player:notify("You can only answer *one* message at a time.");
9elseif (LIST != typeof(flags_replytos = $mail_editor:check_answer_flags("noinclude", @p[4])))
10player:notify_lines({tostr("Usage:  ", verb, " [message-# [on <recipient>]] [flags...]"), "where flags include any of:", "  all        reply to everyone", "  sender     reply to sender only", tostr("  include    include the original message in reply (can't do this for ", verb, ")"), "  noinclude  don't include the original in your reply"});
11elseif ("include" in flags_replytos[1])
12player:notify(tostr("Can't include message on a ", verb));
13else
14this:set_current_folder(p[1]);
15if (to_subj = $mail_editor:parse_msg_headers(p[1]:messages_in_seq(p[2])[1][2], flags_replytos[1]))
16player:notify(tostr("To:       ", $mail_agent:name_list(@to_subj[1])));
17if (to_subj[2])
18player:notify(tostr("Subject:  ", to_subj[2]));
19endif
20if (replytos = flags_replytos[2])
21player:notify(tostr("Reply-to: ", $mail_agent:name_list(@replytos)));
22endif
23hdrs = {to_subj[2], replytos || {}};
24player:notify("Enter lines of message:");
25message = $command_utils:read_lines_escape((active = player in $mail_editor.active) ? {} | {"@edit"}, {tostr("You are composing mail to ", $mail_agent:name_list(@to_subj[1]), "."), @active ? {} | {"Type `@edit' to take this into the mail editor."}});
26if (typeof(message) == ERR)
27player:notify(tostr(message));
28elseif (message[1] == "@edit")
29$mail_editor:invoke(1, verb, to_subj[1], @hdrs, message[2]);
30elseif (!message[2])
31player:notify("Blank message not sent.");
32else
33result = $mail_agent:send_message(this, to_subj[1], hdrs, message[2]);
34if (result && result[1])
35player:notify(tostr("Message sent to ", $mail_agent:name_list(@listdelete(result, 1)), "."));
36else
37player:notify("Message not sent.");
38endif
39endif
40endif
41endif

@mail-all-new*-mail

Spec none none noneFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"@mail-all-new-mail";
2" Prints headers for all new mail on every mail-recipient mentioned in .current_message.";
3set_task_perms(valid(cp = caller_perms()) ? cp | player);
4cm = this.current_message;
5cm[1..2] = {{this, @cm[1..2]}};
6this._mail_task = task_id();
7nomail = 1;
8new_cms = {};
9for f in (cm)
10if (!($object_utils:isa(folder = f[1], $player) || $object_utils:isa(folder, $mail_recipient)))
11player:notify(tostr(folder, " is neither a $player nor a $mail_recipient"));
12elseif (typeof(flen = folder:length_all_msgs()) == ERR)
13player:notify(tostr($mail_agent:name(folder), " ", flen));
14elseif (msg_seq = $seq_utils:range(folder:length_date_le(f[3]) + 1, flen))
15nomail = 0;
16player:notify("===== " + $string_utils:left(tostr($mail_agent:name(folder), " (", s = $seq_utils:size(msg_seq), " message", (s == 1) ? ") " | "s) "), 40, "="));
17folder:display_seq_headers(msg_seq, @f[2..3]);
18player:notify("");
19$command_utils:suspend_if_needed(2);
20endif
21endfor
22if (nomail)
23player:notify("You don't have any new mail anywhere.");
24else
25player:notify("===== " + $string_utils:left("End of new mail ", 40, "="));
26endif

@read-all-new*-mail @ranm

Spec any none noneFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"@read-all-new-mail [yes]";
2" Prints all new mail on every mail-recipient mentioned in .current_message";
3" Generally this will spam you into next Tuesday.";
4" You will be queried for whether you want your last-read dates updated";
5"   but you can specify \"yes\" on the command line to suppress this.";
6"   If you do so, last-read dates will be updated after each folder read.";
7set_task_perms(valid(cp = caller_perms()) ? cp | player);
8noconfirm = args && ("yes" in args);
9cm = this.current_message;
10cm[1..2] = {{this, @cm[1..2]}};
11this._mail_task = task_id();
12nomail = 1;
13new_cms = {};
14for f in (cm)
15if (!($object_utils:isa(folder = f[1], $player) || $object_utils:isa(folder, $mail_recipient)))
16player:notify(tostr(folder, " is neither a $player nor a $mail_recipient"));
17elseif (typeof(flen = folder:length_all_msgs()) == ERR)
18player:notify(tostr($mail_agent:name(folder), " ", flen));
19elseif (msg_seq = $seq_utils:range(folder:length_date_le(f[3]) + 1, flen))
20nomail = 0;
21player:notify("===== " + $string_utils:left(tostr($mail_agent:name(folder), " (", s = $seq_utils:size(msg_seq), " message", (s == 1) ? ") " | "s) "), 40, "="));
22player:notify("");
23if (cur = folder:display_seq_full(msg_seq, tostr("Message %d", (folder == this) ? "" | (" on " + $mail_agent:name(folder)), ":")))
24if (noconfirm)
25this:set_current_message(folder, @cur);
26this:set_current_folder(folder);
27else
28new_cms = {@new_cms, {folder, @cur}};
29endif
30player:notify("");
31endif
32endif
33$command_utils:suspend_if_needed(1);
34this._mail_task = task_id();
35endfor
36if (nomail)
37player:notify("You don't have any new mail anywhere.");
38elseif (player:notify("===== " + $string_utils:left("End of new mail ", 40, "=")) || (noconfirm || $command_utils:yes_or_no("Did you get all of that?")))
39for n in (new_cms)
40this:set_current_message(@n);
41this:set_current_folder(n[1]);
42endfor
43player:notify("Last-read-dates updated");
44else
45player:notify("Last-read-dates not updated");
46endif

@quick*send @qsend

Spec any any anyFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"Syntax: @quicksend <recipients(s)> [subj=<text>] [<message>]";
2"Sends the recipients(s) a quick message, wit{out having to go to the mailroom. If there is more than one recipients, place them all in quotes. If the subj contains spaces, place it in quotes.";
3"To put line breaks in the message, use a caret (^).";
4"If no message is given, prompt for lines of message.";
5"Examples:";
6"@quicksend Alice subj=\"Wonderland is neat!\" Have you checked out the Wonderland scenario yet? I think you'd like it!";
7"@quicksend \"Ethel Fred\" Have you seen Lucy around?^--Ricky";
8set_task_perms($object_utils:isa(player, $guest) ? player.owner | player);
9if (!args)
10player:notify(tostr("Usage: ", verb, " <recipients(s)> [subj=<text>] [<message>]"));
11return E_INVARG;
12elseif (this != player)
13player:notify(tostr("You can't use ", this.pp, " @quicksend verb."));
14return E_PERM;
15elseif (!(recipients = $mail_editor:parse_recipients({}, $string_utils:explode(args[1]))))
16return;
17else
18for rc in (recipients)
19if (is_a(rc, #45) && (!rc:is_writable_by(player)))
20player:notify(tostr($su:nn(rc), " is not writable by you."));
21return E_PERM;
22endif
23endfor
24if ((length(args) > 1) && ((eq = index(args[2], "=")) && (index("subject", args[2][1..eq - 1]) == 1)))
25subject = $string_utils:trim(args[2][eq + 1..$]);
26ws = $string_utils:word_start(argstr);
27argstr = argstr[1..ws[1][2]] + argstr[ws[2][2] + 1..$];
28args = listdelete(args, 2);
29else
30subject = "";
31endif
32if (length(args) > 1)
33unbroken = argstr[(argstr[1] == "\"") ? length(args[1]) + 4 | (length(args[1]) + 2)..$] + "^";
34message = {};
35while (unbroken)
36if (i = index(unbroken, "^"))
37message = {@message, unbroken[1..i - 1]};
38endif
39unbroken = unbroken[i + 1..$];
40endwhile
41else
42if (!(subject || player:mail_option("nosubject")))
43player:notify("Subject:");
44subject = $command_utils:read();
45endif
46if (length(subject) > 250)
47message = subject;
48subject = "";
49player:notify("That subject is too long. I'm just going to go ahead and assume it was supposed to be the body of the message.");
50else
51player:notify("Enter lines of message:");
52if (player.programmer)
53message = $command_utils:read_lines_escape((active = player in $mail_editor.active) ? {} | {"@edit"}, {tostr("You are composing mail to ", $mail_agent:name_list(@recipients), "."), @active ? {} | {"Type `@edit' to take this into the mail editor."}});
54if (message[1] == "@edit")
55$mail_editor:invoke(1, verb, recipients, subject, {}, message[2]);
56return;
57endif
58message = message[2];
59else
60message = $command_utils:read_lines();
61endif
62endif
63if (typeof(message) == ERR)
64player:notify(tostr(message));
65return;
66elseif ((!message) && (!subject))
67player:notify("Blank message not sent.");
68return;
69elseif (subject && (!message))
70message = subject;
71subject = "";
72endif
73if ((!is_a(player, $immortal)) && (value_bytes(message) >= 16384))
74player:notify("Sorry, but that message is WAAAAAAY too long. Maximum message limit is 16 kilobytes.");
75return;
76endif
77endif
78result = $mail_agent:send_message(this, recipients, subject, message);
79if (result && result[1])
80player:notify(tostr("Message sent to ", $mail_agent:name_list(@listdelete(result, 1)), "."));
81else
82player:notify("Message not sent.");
83endif
84endif

init_for_core

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

Source

1if (caller_perms().wizard)
2pass();
3this.mail_options = {};
4endif

confunc

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

Source

1if (((valid(cp = caller_perms()) && (caller != this)) && (!$perm_utils:controls(cp, this))) && (caller != #0))
2return E_PERM;
3endif
4nm = this:length_all_msgs() - this:length_date_le(this:get_current_message()[2]);
5if (nm)
6this:notify(tostr("You have new mail (", nm, " message", (nm == 1) ? "" | "s", ").", this:mail_option("expert") ? "" | "  Type 'help mail' for info on reading it."));
7endif
8this:mail_catch_up();
9this:check_mail_lists();
10if (this.programmer)
11fork (0)
12$issue_list:display_assigned_allfolders(this);
13endfork
14endif
15pass(@args);

@add-notify

Spec any at/to anyFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"Ideally, in order for one person to be notified that another person has new mail, both the mail recipient and the notification recipient should agree that this is an OK transfer of information.";
2"Usage:  @add-notify me to player";
3"    Sends mail to player saying that I want to be added to their mail notification property.";
4"Usage:  @add-notify player to me";
5"    Makes sure that player wants to be notified, if so, adds them to my .mail_notify property.  (Deletes from temporary record.)";
6if (this == dobj)
7target = $string_utils:match_player(iobjstr);
8if ($command_utils:player_match_failed(target, iobjstr))
9return;
10elseif (this in target.mail_notify[1])
11player:tell("You already receive notifications when ", target.name, " receives mail.");
12elseif (this in target.mail_notify[2])
13player:tell("You already asked to be notified when ", target.name, " receives mail.");
14else
15$mail_agent:send_message(player, {target}, "mail notification request", {tostr($string_utils:nn(this), " would like to receive mail notifications when you get mail."), "Please type:", tostr("  @add-notify ", this.name, " to me"), "if you wish to allow this action."});
16player:tell("Notifying ", $string_utils:nn(target), " that you would like to be notified when ", target.ps, " receives mail.");
17target.mail_notify[2] = setadd(target.mail_notify[2], this);
18endif
19elseif (this == iobj)
20target = $string_utils:match_player(dobjstr);
21if ($command_utils:player_match_failed(target, dobjstr))
22return;
23elseif (target in this.mail_notify[2])
24this.mail_notify[1] = setadd(this.mail_notify[1], target);
25this.mail_notify[2] = setremove(this.mail_notify[2], target);
26player:tell(target.name, " will be notified when you receive mail.");
27else
28player:tell("It doesn't look like ", target.name, " wants to be notified when you receive mail.");
29endif
30else
31player:tell("Usage:  @add-notify me to player");
32player:tell("        @add-notify player to me");
33endif

mail_notify

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

none

Source

1if ((length(this.mail_notify) > 0) && (typeof(this.mail_notify[1]) == LIST))
2return this.mail_notify[1];
3else
4return this.mail_notify;
5endif

tell

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

Source

1this:notify(tostr(@args));

tell_lines

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

Source

1lines = args[1];
2if (typeof(lines) != LIST)
3lines = {lines};
4endif
5this:notify_lines(lines);

dodge

Spec none none noneFlags rxdOwner #361Definer #33

Referenced by

none

Source

1if (this.fight_style > 4)
2player:tell("You're berserking, baby!  No time for a dodge!  KILL, KILL!");
3return;
4endif
5if (this:is_doing($actions.struggle))
6player:tell("You're a little... tied up at the moment.");
7return;
8endif
9this:cancel_if_possible();
10this:prequeue_action($actions.dodge, {}, 1, "dodge");

autowield

Spec any none noneFlags rxdOwner #361Definer #33

Referenced by

none

Source

No program (verb defined but unprogrammed).

queue_action

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

Source

1action = args[1];
2cargs = args[2];
3if (((this.executing && (this.executing[1] == $actions.attack)) && this.executing[3]) && (!this.queue))
4if ((action == $actions.attack) && `cargs[1] == this.executing[2][1] ! E_RANGE => 0')
5this.executing[3] = 0;
6this:tell($ansi.cyan, "[ Finishing current attack. ]", $ansi.reset);
7return;
8elseif (this.executing[3])
9this:cancel_current_action();
10pass(@args);
11endif
12elseif ((this.executing || this.queue) && (action == $actions.attack))
13pass(@args);
14this.queue[$][3] = 0;
15else
16pass(@args);
17endif

start_fighting

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"Ready all of our weapons.";
2rw = this.readied_weapon;
3for weapon in (rw)
4"If the weapon encountered is the user's .unarmed_weapon, then unwield everything up to that point.";
5if (weapon == this.unarmed_weapon)
6for weapon in (this.wielding)
7if (!(weapon in rw))
8$actions.unwield:_start(this, {weapon});
9endif
10endfor
11break;
12endif
13if (is_a(weapon, $thing))
14if ((weapon.location == this) && (!(weapon in this.wielding)))
15if (r = $actions.wield:_start(this, {weapon}))
16$actions.wield:_finish(this, {weapon}, @r[3..$]);
17endif
18endif
19else
20rw = setremove(rw, weapon);
21endif
22endfor
23this.readied_weapon = rw;
24pass(@args);

ready

Spec any none noneFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"Ready, by itself, will tell you what you have readied, if anything.  'Ready clear' will clear your ready.";
2"Make sure the .readied_weapon is valid.";
3rw = this.readied_weapon;
4for x in (rw)
5if (!is_a(x, $thing))
6rw = setremove(rw, x);
7endif
8endfor
9this.readied_weapon = rw;
10"Check for a few options in the verb.";
11if (dobjstr == "")
12if (!rw)
13return this:tell("You don't have any items readied.");
14else
15weapons = $su:title_list(rw);
16return this:tell("You have ", $su:a_or_an(weapons), " ", weapons, " readied.");
17endif
18elseif (dobjstr == "fists")
19this.readied_weapon = {this.unarmed_weapon};
20return this:tell("You ready your bare ", this.unarmed_weapon:name(), ".");
21elseif (dobjstr in {"clear", "nothing"})
22this.readied_weapon = {};
23return this:tell("You no longer have a weapon readied.");
24elseif (dobjstr == "ready")
25return this:tell("Ready ready.  Steady steady.  Okay, no, that's not how this works.");
26endif
27"We need to check for the word 'and' for the new syntax.";
28weapons = {};
29weapon_str = $su:fast_words(dobjstr, " and ");
30hands_used = 0;
31"Iterate through the string, matching weapons.";
32for x in (weapon_str)
33if (x == "nothing")
34weapons = setadd(weapons, this.unarmed_weapon);
35break;
36endif
37weapon = $mu:match(x, this.contents);
38if ($cu:object_match_failed(weapon, x))
39return;
40elseif (!is_a(weapon, $thing))
41return this:tell("You know, trying to ready ", weapon:dname(), " doesn't seem like it would be very effective.");
42endif
43hands_used = hands_used + weapon.handed;
44if (hands_used > this:hands())
45return this:tell("You don't have enough hands to wield that many items!");
46endif
47weapons = setadd(weapons, weapon);
48endfor
49this:tell("You ready your ", $su:title_list(weapons), ".  You'll now autowield ", (length(weapons) > 1) ? "them" | "it", " when combat begins.");
50this.readied_weapon = weapons;

doing_msg

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

none

Source

1if (this in connected_players())
2return pass(@args);
3else
4return "dozing";
5endif

@random

Spec none on top of/on/onto/upon anyFlags rxdOwner #361Definer #33

Referenced by

none

Source

1return player:tell("Usage: @mail random <other filters> on <mailing list>");
2if (!args)
3return player:tell("Usage: @random on <mailing list>");
4endif
5folder = $mail_agent:match(iobjstr);
6if ($cu:object_match_failed(folder, iobjstr))
7"Message already printed, nothing left to do here.";
8return;
9else
10if (!folder:is_readable_by(player))
11return player:tell("*", folder.name, " is not readable by you.");
12endif
13if (!folder.messages)
14return player:tell("*", folder.name, " has no messages.");
15endif
16i = folder:length_all_msgs();
17randmsg = random(i);
18seq = {randmsg, randmsg + 1};
19folder:display_seq_full(seq, tostr($ansi.bold_on, "Random message from *", $su:nn(folder), ":", $ansi.reset));
20endif

last_huh

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

Source

1"Copied from generic immortal (#89):last_huh by Satan (#2) Tue Jul 28 22:53:58 2009 CDT";
2set_task_perms(caller_perms());
3if (pass(@args))
4return 1;
5endif
6{verb, args} = args;
7if (((dobjstr && (dobjstr[1] == "*")) && valid(dobj = $string_utils:literal_object(dobjstr))) && (r = $match_utils:match_verb(verb, dobj, args)))
8return r;
9elseif (((iobjstr && (iobjstr[1] == "*")) && valid(iobj = $string_utils:literal_object(iobjstr))) && (r = $match_utils:match_verb(verb, iobj, args)))
10return r;
11else
12return 0;
13endif

upgrade_to_hashmail

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

none

Source

No program (verb defined but unprogrammed).

@stop

Spec none none noneFlags rxdOwner #361Definer #33

Referenced by

none

Source

1t = this._mail_task;
2if (task_valid(t))
3kill_task(t);
4player:systell("Killed mail task.");
5else
6player:tell("You do not currently have an active mail task.");
7endif

_old_expire_old_messages

Spec this none thisFlags rxdOwner #361Definer #33

Referenced by

none

Source

1"Copied from generic normal player (#40):expire_old_messages by Satan (#2) Tue Dec 28 16:56:25 2010 CST";
2set_task_perms(caller_perms());
3if (!$perm_utils:controls(caller_perms(), this))
4return E_PERM;
5else
6seq = this:expirable_msg_seq();
7if (seq)
8this:rm_message_seq(seq);
9return this:expunge_rmm();
10else
11return 0;
12endif
13endif

pick

Spec any none noneFlags rxdOwner #361Definer #33

Referenced by

none

Source

1if (player.executing && (player.executing[1] == $actions.apick))
2return player:tell("You're already picking something.");
3endif
4"Get a list of possible things to pick (add more filters here when necessary)";
5possibles = setremove(player.location.contents, player);
6door = $mu:match(dobjstr, possibles);
7if (!valid(door))
8$mu:object_match_failed(door, dobjstr, possibles);
9return;
10elseif ($ou:has_verb(door, "pick") && (!is_a(door, $player)))
11"This is basically just for #3632";
12door:pick();
13return;
14elseif (!is_a(door, $door))
15return player:tell("I don't understand that.");
16endif
17for dude in (door.location:occupants($player))
18if ((dude.executing && (dude.executing[1] == $actions.apick)) && (dude.executing[2][1] == door.lock))
19return player:tell("Someone else beat you to the punch there, champ.");
20endif
21endfor
22if (!valid(door.lock))
23player:tell("You can't see any way to pick a lock in ", door:dname(), ".");
24elseif (door.open)
25player:tell("The uh...the door's already open, champ.  Mission accomplished, I guess.");
26elseif (!door.lock:is_locked())
27player:tell("It doesn't appear to be locked.");
28elseif (0 && (!door:ok_to_pick()))
29"Disabled door so you can try picking a logged-out guy.  Sucks to be you.";
30player:tell("You jiggle the door a bit, and realize it's been barred from the inside.  The owner must be sleeping in there.  Dammit!");
31else
32what = door.otherside.location.owner;
33if (is_a(what, $player) && (!is_a(what, $immortal)))
34what:_pvp_record({player}, "lockpick");
35endif
36player:queue_action($actions.apick, {door.lock});
37endif