Note Editor #40
Aliases: Note Editor
14 verbs · 120 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
e*dit | any none none | rxd | #40 | 5 |
save | any none none | rxd | #40 | 27 |
init_session | this none this | rxd | #40 | 6 |
working_on | this none this | rxd | #40 | 12 |
parse_invoke | this none this | rxd | #40 | 12 |
note_text | this none this | rxd | #40 | 20 |
set_note_text | this none this | rxd | #40 | 30 |
note_match_failed | this none this | rxd | #40 | 22 |
w*hat | none none none | rxd | #40 | 4 |
mode | any none none | rxd | #40 | 23 |
local_editing_info | this none this | rxd | #40 | 5 |
set_* | this none this | rxd | #40 | 5 |
look_self | this none this | rxd | #40 | 3 |
can_all_edit | this none this | rxd | #40 | 36 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
strmode | #40 | r | #29 | {} |
objects | #40 | rc | #29 | {} |
authorized_props | #40 | rc | #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 | #40 | rc | #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 | #40 | rc | #29 | {#533, #530} |
readable | #43 | r | #29 | {} |
times | #43 | r | #29 | {} |
commands2 | #43 | rc | #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 | #43 | rc | #29 | {} |
no_text_msg | #43 | rc | #29 | "Note is devoid of text." |
commands | #43 | rc | #29 | {{"e*dit", "<note>"}, {"save", "[<note>]"}, {"mode", "[string|list]"}} |
invoke_task | #43 | r | #29 | 0 |
exit_on_abort | #43 | rc | #29 | <clear> |
previous_session_msg | #43 | rc | #29 | "You need to ABORT or SAVE this note before editing any other." |
stateprops | #43 | r | #29 | {{"strmode", 0}, {"objects", 0}, {"texts", 0}, {"changes", 0}, {"inserting", 1}, {"readable", 0}} |
depart_msg | #43 | rc | #29 | "A small swarm of 3x5 index cards arrives, engulfs %n, and carries %o away." |
return_msg | #43 | rc | #29 | "A small swarm of 3x5 index cards blows in and disperses, revealing %n." |
no_littering_msg | #43 | rc | #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 | #43 | rc | #29 | "Note has not been modified since the last save." |
change_msg | #43 | rc | #29 | "There are changes." |
nothing_loaded_msg | #43 | rc | #29 | "Use the EDIT command to select a note." |
texts | #43 | | #29 | {} |
active | #43 | r | #29 | {} |
changes | #43 | | #29 | {} |
inserting | #43 | | #29 | {} |
original | #43 | r | #29 | {} |
no_actions | #43 | rc | #29 | <clear> |
wiz_editors | #43 | rc | #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 | #3 | rc | #29 | "%L [editing notes]" |
exits | #3 | c | #29 | {} |
go_fail_msg | #3 | rc | #29 | <clear> |
outdoor | #3 | rc | #29 | <clear> |
covers | #3 | rc | #29 | <clear> |
covering | #3 | rc | #29 | <clear> |
tracks | #3 | rc | #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 | #3 | rc | #29 | <clear> |
public | #3 | rc | #29 | <clear> |
drop_msg | #3 | rc | #29 | <clear> |
get_msg | #3 | rc | #29 | <clear> |
contents_msg | #3 | rc | #29 | <clear> |
contents_many_msg | #3 | rc | #29 | <clear> |
default_posture_msg | #3 | rc | #29 | <clear> |
seats | #3 | rc | #29 | 0 |
sitting | #3 | rc | #29 | {} |
reclining | #3 | rc | #29 | {} |
sit_msg | #3 | rc | #29 | <clear> |
osit_msg | #3 | rc | #29 | <clear> |
sit_from_reclining | #3 | rc | #29 | <clear> |
osit_from_reclining | #3 | rc | #29 | <clear> |
rise_msg | #3 | rc | #29 | <clear> |
orise_msg | #3 | rc | #29 | <clear> |
icon | #3 | rc | #29 | <clear> |
map | #3 | rc | #29 | {" ", " ", " ~1b[36m~1b[1m~1b[44m()~1b[0m ", " ", " "} |
recent_noises | #3 | rc | #29 | {2714832, 3477280, 6426148} |
fall_into_msg | #3 | rc | #29 | <clear> |
size | #3 | rc | #29 | <clear> |
sit_from_reclining_msg | #3 | rc | #29 | <clear> |
osit_from_reclining_msg | #3 | rc | #29 | <clear> |
look_sitting_and_reclining | #3 | rc | #29 | <clear> |
look_sitting_msg | #3 | rc | #29 | <clear> |
recline_full_msg | #3 | rc | #29 | <clear> |
already_sitting_msg | #3 | rc | #29 | <clear> |
already_reclining_msg | #3 | rc | #29 | <clear> |
recline_from_sitting_msg | #3 | rc | #29 | <clear> |
orecline_from_sitting_msg | #3 | rc | #29 | <clear> |
recline_msg | #3 | rc | #29 | <clear> |
orecline_msg | #3 | rc | #29 | <clear> |
look_reclining_msg | #3 | rc | #29 | <clear> |
sitting_doing_msg | #3 | rc | #29 | <clear> |
reclining_doing_msg | #3 | rc | #29 | <clear> |
rise_failed_msg | #3 | rc | #29 | <clear> |
infect_interval | #3 | rc | #29 | <clear> |
no_exit_msg | #3 | rc | #29 | <clear> |
x | #3 | rc | #29 | <clear> |
y | #3 | rc | #29 | <clear> |
z | #3 | rc | #29 | <clear> |
residents | #3 | rc | #29 | <clear> |
sit_full_msg | #3 | rc | #29 | <clear> |
value | #3 | rc | #29 | <clear> |
rustle_msg | #3 | rc | #29 | <clear> |
last_rustle | #3 | rc | #29 | <clear> |
thing_fall_into_msg | #3 | rc | #29 | <clear> |
decal_fall_into_msg | #3 | rc | #29 | <clear> |
client_icon | #3 | rc | #29 | <clear> |
client_map | #3 | rc | #29 | {"aaaaaaaaaa", "aaaaaaaaaa", "aaaaabaaaa", "aaaaaaaaaa", "aaaaaaaaaa"} |
track_msg | #3 | rc | #29 | <clear> |
watched | #3 | rc | #29 | 0 |
max_objects | #3 | rc | #29 | <clear> |
show_map | #3 | rc | #29 | 0 |
objects_to_echo | #3 | rc | #29 | <clear> |
always_brief | #3 | rc | #29 | <clear> |
furniture | #3 | rc | #29 | {} |
fall_into_noise | #3 | rc | #29 | <clear> |
ambience | #3 | rc | #29 | <clear> |
temperature | #3 | rc | #29 | 65 |
last_temp_update | #3 | rc | #29 | 1311720450 |
continue_look_self_msg | #3 | rc | #29 | <clear> |
map_restricted | #3 | rc | #29 | <clear> |
global_xyz | #3 | rc | #29 | {0, 0, 0} |
common_name_msg | #3 | rc | #29 | <clear> |
verb_subs | #3 | rc | #29 | <clear> |
darkness | #3 | rc | #29 | {0, 0} |
total_dark_description_msg | #3 | rc | #29 | <clear> |
has_commands | #3 | rc | #29 | 1 |
too_dark_msg | #3 | rc | #29 | <clear> |
next_room_to_global_origin | #3 | rc | #29 | #-1 |
global_xyz_anchor | #3 | r | #361 | 0 |
search_items | #3 | rc | #29 | <clear> |
search_items_left | #3 | rc | #29 | {} |
already_searched | #3 | rc | #29 | {} |
aliases | #1 | rc | #29 | {"Note Editor"} |
description | #1 | rc | #29 | {} |
object_size | #1 | r | #29 | {17598, 1298433815} |
hidden_verbs | #1 | rc | #29 | <clear> |
phelp_msg | #1 | rc | #29 | <clear> |
weight | #1 | rc | #29 | <clear> |
owner_verbs | #1 | rc | #29 | <clear> |
plural_name | #1 | rc | #29 | <clear> |
client_image | #1 | rc | #29 | <clear> |
listening | #1 | rc | #29 | <clear> |
Ancestry
Ancestors (nearest first): #43 Generic Editor → #3 generic room → #1 root
Children: none
Call graph
Source
e*dit
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
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
Referenced by
- #40:e*dit line 4:
this:init_session
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
Referenced by
- #40:e*dit line 2:
this:working_on - #40:save line 18:
this:working_on - #40:save line 25:
this:working_on - #40:init_session line 5:
this:working_on
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
Referenced by
- #40:e*dit line 3:
this:parse_invoke
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
Referenced by
- #40:parse_invoke line 7:
this:note_text
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
Referenced by
- #40:save line 17:
this:set_note_text
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
Referenced by
- #40:save line 7:
this:note_match_failed - #40:parse_invoke line 6:
this:note_match_failed
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
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
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
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_*
Referenced by
none
Source
1if ($perm_utils:controls(caller_perms(), this)) 2return pass(@args); 3else 4return E_PERM; 5endif
look_self
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
Referenced by
- #40:set_note_text line 7:
this:can_all_edit - #50:@writeprop line 24:
$note_editor:can_all_edit - #50:@canedit line 73:
$note_editor:can_all_edit
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;