Note Editor #40

Parent #43Owner #29Flags readSource hellcore/hellcore.db

Aliases: Note Editor

14 verbs · 120 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
e*ditany none nonerxd#405
saveany none nonerxd#4027
init_sessionthis none thisrxd#406
working_onthis none thisrxd#4012
parse_invokethis none thisrxd#4012
note_textthis none thisrxd#4020
set_note_textthis none thisrxd#4030
note_match_failedthis none thisrxd#4022
w*hatnone none nonerxd#404
modeany none nonerxd#4023
local_editing_infothis none thisrxd#405
set_*this none thisrxd#405
look_selfthis none thisrxd#403
can_all_editthis none thisrxd#4036

Properties

PropertyDefinerFlagsOwnerValue
strmode#40r#29{}
objects#40rc#29{}
authorized_props#40rc#29
list of 14{{"custom_voice", {#138}}, {"client_icon", {#3}}, {"client_map", {#3}}, {"freedom", {#83535}}, {"random_animals", {#259575}}, {"text", {#672, #1447}}, {"notes", {#3}}, {"make_travel_quest", {#326}}, {"default_alias", {#706}}, {"powerplant", {#326}}, {"wardrobe", {#138}}, {"covers", {#3}}, {"noises", {#35827}}, {"annoys", {#35827}}}
authorized_props_any_object#40rc#29
list of 37{"description", "*_msg", "name", "aliases", "blankicon", "icon", "hidden_verbs", "article", "gender", "genders", "verb_subs", "names_base_*", "names_adj", "prc", "ppc", "poc", "psc", "pr", "pp", "po", "ps", "pq", "pqc", "nude_descs", "posture", "plural_name", "comments", "conversation", "blank_icon", "comments", "map", "setup_list", "descriptions", "colors", "names_*", "owner_verbs", "rename_on_break"}
authorized_objects#40rc#29{#533, #530}
readable#43r#29{}
times#43r#29{}
commands2#43rc#29
list of 2{{"say", "emote", "lis*t", "ins*ert", "n*ext,p*rev", "enter", "del*ete", "f*ind", "s*ubst", "m*ove,c*opy", "join*l", "fill"}, {"y*ank", "w*hat", "mode", "e*dit", "save", "abort", "q*uit,done,pause"}}
help#43rc#29{}
no_text_msg#43rc#29"Note is devoid of text."
commands#43rc#29{{"e*dit", "<note>"}, {"save", "[<note>]"}, {"mode", "[string|list]"}}
invoke_task#43r#290
exit_on_abort#43rc#29<clear>
previous_session_msg#43rc#29"You need to ABORT or SAVE this note before editing any other."
stateprops#43r#29{{"strmode", 0}, {"objects", 0}, {"texts", 0}, {"changes", 0}, {"inserting", 1}, {"readable", 0}}
depart_msg#43rc#29"A small swarm of 3x5 index cards arrives, engulfs %n, and carries %o away."
return_msg#43rc#29"A small swarm of 3x5 index cards blows in and disperses, revealing %n."
no_littering_msg#43rc#29
list of 3{"Partially edited text will be here when you get back.", "To return, give the `@notedit' command with no arguments.", "Please come back and SAVE or ABORT if you don't intend to be working on this text in the immediate future. Keep Our MOO Clean! No Littering!"}
no_change_msg#43rc#29"Note has not been modified since the last save."
change_msg#43rc#29"There are changes."
nothing_loaded_msg#43rc#29"Use the EDIT command to select a note."
texts#43#29{}
active#43r#29{}
changes#43#29{}
inserting#43#29{}
original#43r#29{}
no_actions#43rc#29<clear>
wiz_editors#43rc#362
list of 31{#142, #657, #143894, #275227, #275649, #290421, #298277, #349965, #298567, #349965, #350002, #350188, #359869, #364606, #365235, #365801, #365733, #299353, #275456, #413385, #274435, #275456, #521943, #381051, #276116, #538008, #604304, #610904, #283521, #619043, #519007}
who_location_msg#3rc#29"%L [editing notes]"
exits#3c#29{}
go_fail_msg#3rc#29<clear>
outdoor#3rc#29<clear>
covers#3rc#29<clear>
covering#3rc#29<clear>
tracks#3rc#29
list of 20{{#364606, 1301520368, 1301520378}, {#275649, 1298698009, 1298698028}, {#143894, 1306316477, 1306316605}, {#142, 1259863319, 1259863335}, {#299353, 1298252066, 1298252086}, {#413385, 1284927608, 1284927702}, {#657, 1267028547, 1267028555}, {#298277, 1295060114, 1295060124}, {#275227, 1287855943, 1287855946}, {#413632, 1299000234, 1299000293}, {#349965, 1297465039, 1297465090}, {#45097, 1311720450, 1311720512}, {#45093, 1259868774, 1259868803}, {#440530, 1254782966, 1254997331}, {#7195, 1275182852, 1275183071}, {#298567, 1308368424, 1308368430}, {#520424, 1297345679, 1297350238}, {#520419, 1269665818, 1269665958}, {#521943, 1301089770, 1301089778}, {#381051, 1311187120, 1311187211}}
windows#3rc#29<clear>
public#3rc#29<clear>
drop_msg#3rc#29<clear>
get_msg#3rc#29<clear>
contents_msg#3rc#29<clear>
contents_many_msg#3rc#29<clear>
default_posture_msg#3rc#29<clear>
seats#3rc#290
sitting#3rc#29{}
reclining#3rc#29{}
sit_msg#3rc#29<clear>
osit_msg#3rc#29<clear>
sit_from_reclining#3rc#29<clear>
osit_from_reclining#3rc#29<clear>
rise_msg#3rc#29<clear>
orise_msg#3rc#29<clear>
icon#3rc#29<clear>
map#3rc#29{" ", " ", " ~1b[36m~1b[1m~1b[44m()~1b[0m ", " ", " "}
recent_noises#3rc#29{2714832, 3477280, 6426148}
fall_into_msg#3rc#29<clear>
size#3rc#29<clear>
sit_from_reclining_msg#3rc#29<clear>
osit_from_reclining_msg#3rc#29<clear>
look_sitting_and_reclining#3rc#29<clear>
look_sitting_msg#3rc#29<clear>
recline_full_msg#3rc#29<clear>
already_sitting_msg#3rc#29<clear>
already_reclining_msg#3rc#29<clear>
recline_from_sitting_msg#3rc#29<clear>
orecline_from_sitting_msg#3rc#29<clear>
recline_msg#3rc#29<clear>
orecline_msg#3rc#29<clear>
look_reclining_msg#3rc#29<clear>
sitting_doing_msg#3rc#29<clear>
reclining_doing_msg#3rc#29<clear>
rise_failed_msg#3rc#29<clear>
infect_interval#3rc#29<clear>
no_exit_msg#3rc#29<clear>
x#3rc#29<clear>
y#3rc#29<clear>
z#3rc#29<clear>
residents#3rc#29<clear>
sit_full_msg#3rc#29<clear>
value#3rc#29<clear>
rustle_msg#3rc#29<clear>
last_rustle#3rc#29<clear>
thing_fall_into_msg#3rc#29<clear>
decal_fall_into_msg#3rc#29<clear>
client_icon#3rc#29<clear>
client_map#3rc#29{"aaaaaaaaaa", "aaaaaaaaaa", "aaaaabaaaa", "aaaaaaaaaa", "aaaaaaaaaa"}
track_msg#3rc#29<clear>
watched#3rc#290
max_objects#3rc#29<clear>
show_map#3rc#290
objects_to_echo#3rc#29<clear>
always_brief#3rc#29<clear>
furniture#3rc#29{}
fall_into_noise#3rc#29<clear>
ambience#3rc#29<clear>
temperature#3rc#2965
last_temp_update#3rc#291311720450
continue_look_self_msg#3rc#29<clear>
map_restricted#3rc#29<clear>
global_xyz#3rc#29{0, 0, 0}
common_name_msg#3rc#29<clear>
verb_subs#3rc#29<clear>
darkness#3rc#29{0, 0}
total_dark_description_msg#3rc#29<clear>
has_commands#3rc#291
too_dark_msg#3rc#29<clear>
next_room_to_global_origin#3rc#29#-1
global_xyz_anchor#3r#3610
search_items#3rc#29<clear>
search_items_left#3rc#29{}
already_searched#3rc#29{}
aliases#1rc#29{"Note Editor"}
description#1rc#29{}
object_size#1r#29{17598, 1298433815}
hidden_verbs#1rc#29<clear>
phelp_msg#1rc#29<clear>
weight#1rc#29<clear>
owner_verbs#1rc#29<clear>
plural_name#1rc#29<clear>
client_image#1rc#29<clear>
listening#1rc#29<clear>

Ancestry

Ancestors (nearest first): #43 Generic Editor#3 generic room#1 root

Children: none

Call graph

calls n40_0 #40:e*dit n43_17 #43:changed n40_0->n43_17 n107_43 #107:tell n40_0->n107_43 n40_3 #40:working_on n40_0->n40_3 n40_4 #40:parse_invoke n40_0->n40_4 n40_2 #40:init_session n40_0->n40_2 n40_4->n107_43 n40_7 #40:note_match_failed n40_4->n40_7 n1_11 #1:tell_lines n40_4->n1_11 n40_5 #40:note_text n40_4->n40_5 n40_2->n107_43 n40_2->n40_3 n43_26 #43:ok n40_2->n43_26 n43_24 #43:load n40_2->n43_24 n40_1 #40:save n40_1->n107_43 n40_1->n40_3 n43_27 #43:loaded n40_1->n43_27 n43_55 #43:nothing_loaded_msg n40_1->n43_55 n40_1->n40_7 n43_23 #43:text n40_1->n43_23 n40_6 #40:set_note_text n40_1->n40_6 n43_18 #43:set_changed n40_1->n43_18 n40_7->n107_43 n45_3 #45:has_callable_verb n40_7->n45_3 n51_13 #51:parse_propref n40_7->n51_13 n48_0 #48:object_match_failed n40_7->n48_0 n6_6 #6:my_match_object n40_7->n6_6 n43_60 #43:get_room n40_7->n43_60 n45_0 #45:has_property n40_7->n45_0 n40_13 #40:can_all_edit n40_6->n40_13 n20_59 #20:name_and_number n40_6->n20_59 n253_9 #253:log_prop n40_6->n253_9 n40_6->n45_3 n48_4 #48:yes_or_no n40_5->n48_4 n48_8 #48:suspend_if_needed n40_13->n48_8 n40_8 #40:w*hat n40_8->n107_43 n40_8->n43_27 n43_11 #43:w*hat n40_8->n43_11 n40_9 #40:mode n40_9->n107_43 n40_9->n43_27 n40_9->n43_55 n40_11 #40:set_* n42_0 #42:controls n40_11->n42_0 n40_12 #40:look_self n40_12->n107_43 n40_12->n1_11 n3_31 #3:title n40_12->n3_31 n43_51 #43:description n40_12->n43_51

Source

e*dit

Spec any none noneFlags rxdOwner #29Definer #40

Referenced by

none

Source

1if (this:changed(who = player in this.active))
2player:tell("You are still editing ", this:working_on(who), ".  Please type ABORT or SAVE first.");
3elseif (spec = this:parse_invoke(dobjstr, verb))
4this:init_session(who, @spec);
5endif

save

Spec any none noneFlags rxdOwner #29Definer #40

Referenced by

none

Source

1if (!(who = this:loaded(player)))
2player:tell(this:nothing_loaded_msg());
3return;
4endif
5if (!dobjstr)
6note = this.objects[who];
7elseif (1 == (note = this:note_match_failed(dobjstr)))
8return;
9else
10this.objects[who] = note;
11endif
12text = this:text(who);
13strmode = (length(text) <= 1) && this.strmode[who];
14if (strmode)
15text = text ? text[1] | "";
16endif
17if (ERR == typeof(result = this:set_note_text(note, text)))
18player:tell("Text not saved to ", this:working_on(who), ":  ", result);
19if ((result == E_TYPE) && (typeof(note) == OBJ))
20player:tell("Do `mode list' and try saving again.");
21elseif (!dobjstr)
22player:tell("Use `save' with an argument to save the text elsewhere.");
23endif
24else
25player:tell("Text written to ", this:working_on(who), strmode ? " as a single string." | ".");
26this:set_changed(who, 0);
27endif

init_session

Spec this none thisFlags rxdOwner #29Definer #40

Referenced by

Source

1if (this:ok(who = args[1]))
2this.strmode[who] = strmode = typeof(text = args[3]) == STR;
3this:load(who, strmode ? text ? {text} | {} | text);
4this.objects[who] = args[2];
5player:tell("Now editing ", this:working_on(who), ".", strmode ? "  [string mode]" | "");
6endif

working_on

Spec this none thisFlags rxdOwner #29Definer #40

Referenced by

Source

1if (!(who = args[1]))
2return "????";
3endif
4spec = this.objects[who];
5if (typeof(spec) == LIST)
6object = spec[1];
7prop = spec[2];
8else
9object = spec;
10prop = 0;
11endif
12return valid(object) ? tostr("\"", object.name, "\"(", object, ")", prop ? "." + prop | "") | tostr(prop ? ("." + prop) + " on " | "", "invalid object (", object, ")");

parse_invoke

Spec this none thisFlags rxdOwner #29Definer #40

Referenced by

Source

1":parse_invoke(string,verb)";
2" string is the actual commandline string indicating what we are to edit";
3" verb is the command verb that is attempting to invoke the editor";
4if (!(string = args[1]))
5player:tell_lines({("Usage:  " + args[2]) + " <note>   (where <note> is some note object)", ("        " + args[2]) + "          (continues editing an unsaved note)"});
6elseif (1 == (note = this:note_match_failed(string)))
7elseif (ERR == typeof(text = this:note_text(note)))
8player:tell("Couldn't retrieve text:  ", text);
9else
10return {note, text};
11endif
12return 0;

note_text

Spec this none thisFlags rxdOwner #361Definer #40

Referenced by

Source

1"WIZARDLY";
2if ((caller != $note_editor) || (caller_perms() != $note_editor.owner))
3return E_PERM;
4endif
5set_task_perms(player);
6if (typeof(spec = args[1]) == OBJ)
7text = spec:text();
8else
9text = `spec[1].(spec[2]) ! ANY';
10endif
11if (((tt = typeof(text)) in {ERR, STR}) || ((tt == LIST) && ((!text) || (typeof(text[1]) == STR))))
12return text;
13else
14if ((typeof(text) == INT) && (text == 0))
15if ($cu:yes_or_no(tostr("The current value of ", spec[1], ".", spec[2], " is 0. Would you like to make it a string?")))
16return "";
17endif
18endif
19return E_TYPE;
20endif

set_note_text

Spec this none thisFlags rxdOwner #361Definer #40

Referenced by

Source

1"WIZARDLY";
2if (!(player in this.wiz_editors))
3if ((caller != $note_editor) || (caller_perms() != $note_editor.owner))
4return E_PERM;
5endif
6set_task_perms(player);
7elseif (!this:can_all_edit(@args[1]))
8set_task_perms(player);
9endif
10attempt = E_NONE;
11if (typeof(spec = args[1]) == OBJ)
12ret = spec:set_text(args[2]);
13if (typeof(ret) == ERR)
14return ret;
15else
16$nets.changenet:announce(player, tostr(player.name, " wrote ", $su:nn(args[1][1]), ".", args[1][2], "."), 1);
17$changelog:log_prop(player, args[1][1], args[1][2]);
18endif
19elseif ($object_utils:has_callable_verb(spec[1], "set_" + spec[2]))
20attempt = spec[1]:("set_" + spec[2])(args[2]);
21endif
22if (typeof(attempt) == ERR)
23attempt = `spec[1].(spec[2]) = args[2] ! ANY';
24if (typeof(attempt) == ERR)
25return attempt;
26endif
27endif
28$nets.changenet:announce(player, tostr(player.name, " wrote ", $su:nn(args[1][1]), ".", args[1][2], "."), 1);
29$changelog:log_prop(player, args[1][1], args[1][2]);
30return attempt;

note_match_failed

Spec this none thisFlags rxdOwner #29Definer #40

Referenced by

Source

1if (pp = $code_utils:parse_propref(string = args[1]))
2object = pp[1];
3prop = pp[2];
4else
5object = string;
6prop = 0;
7endif
8if ($command_utils:object_match_failed(note = player:my_match_object(object, this:get_room(player)), object))
9elseif (prop)
10if (!$object_utils:has_property(note, prop))
11player:tell(object, " has no \".", prop, "\" property.");
12else
13return {note, prop};
14endif
15elseif ((!$object_utils:has_callable_verb(note, "text")) || (!$object_utils:has_callable_verb(note, "set_text")))
16return {note, "description"};
17"... what we used to do.  but why barf?   that's no fun...";
18player:tell(object, "(", note, ") doesn't look like a note.");
19else
20return note;
21endif
22return 1;

w*hat

Spec none none noneFlags rxdOwner #29Definer #40

Referenced by

none

Source

1pass(@args);
2if ((who = this:loaded(player)) && this.strmode[who])
3player:tell("Text will be stored as a single string instead of a list when possible.");
4endif

mode

Spec any none noneFlags rxdOwner #29Definer #40

Referenced by

none

Source

1"mode [string|list]";
2if (!(who = this:loaded(player)))
3player:tell(this:nothing_loaded_msg());
4return;
5endif
6if (dobjstr && (index("string", dobjstr) == 1))
7this.strmode[who] = mode = 1;
8player:tell("Now in string mode:");
9elseif (dobjstr && (index("list", dobjstr) == 1))
10this.strmode[who] = mode = 0;
11player:tell("Now in list mode:");
12elseif (dobjstr)
13player:tell("Unrecognized mode:  ", dobjstr);
14player:tell("Should be one of `string' or `list'");
15return;
16else
17player:tell("Currently in ", mode = this.strmode[who] ? "string " | "list ", "mode:");
18endif
19if (mode)
20player:tell("  store text as a single string instead of a list when possible.");
21else
22player:tell("  always store text as a list of strings.");
23endif

local_editing_info

Spec this none thisFlags rxdOwner #29Definer #40

Referenced by

none

Source

1{what, text} = args;
2cmd = (typeof(text) == STR) ? "@set-note-string" | "@set-note-text";
3name = (typeof(what) == OBJ) ? what.name | tostr(what[1].name, ".", what[2]);
4note = (typeof(what) == OBJ) ? what | tostr(what[1], ".", what[2]);
5return {name, text, tostr(cmd, " ", note)};

set_*

Spec this none thisFlags rxdOwner #29Definer #40

Referenced by

none

Source

1if ($perm_utils:controls(caller_perms(), this))
2return pass(@args);
3else
4return E_PERM;
5endif

look_self

Spec this none thisFlags rxdOwner #361Definer #40

Referenced by

none

Source

1"Copied from Verb Editor (#49):look_self by Seraph (#7195) Thu Mar 12 17:19:35 2009 CDT";
2player:tell(this:title());
3player:tell_lines(this:description());

can_all_edit

Spec this none thisFlags rxdOwner #361Definer #40

Referenced by

Source

1{object, propname} = args;
2for parent in (this.authorized_objects)
3if (is_a(object, parent))
4return 1;
5endif
6$cu:sin();
7endfor
8for prop in (this.authorized_props_any_object)
9if (propname == prop)
10return 1;
11elseif (index(prop, "*") && $su:match_string(propname, prop))
12return 1;
13endif
14$cu:sin();
15endfor
16permspec = {};
17for specs in (this.authorized_props)
18propspec = specs[1];
19if (propname == propspec)
20permspec = specs[2];
21break;
22elseif (index(propspec, "*") && $su:match_string(propname, propspec))
23permspec = specs[2];
24break;
25endif
26$cu:sin();
27endfor
28if (!permspec)
29return 0;
30endif
31for parent in (permspec)
32if (is_a(object, parent))
33return 1;
34endif
35endfor
36return 0;