Verb Editor #41

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

Aliases: Verb Editor

14 verbs · 118 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
e*ditany none nonerxd#415
com*pile savenone any anyrxd#4182
working_onthis none thisrxd#4112
init_sessionthis none thisrxd#418
parse_invokethis none thisrxd#4144
fetch_verb_codethis none thisrxd#417
set_verb_codethis none thisrxd#418
local_editing_infothis none thisrxd#4120
verb_namethis none thisrxd#4116
verb_argsthis none thisrxd#419
commentany any anyrxd#4126
uncommentany any anyrxd#4135
nextnone none nonerxd#4117
@queue-grepany none nonerxd#4129

Properties

PropertyDefinerFlagsOwnerValue
objects#41#29{}
verbnames#41#29{}
queued_edits#41rc#29{{#7195, {}}}
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", "e*dit", "com*pile", "abort", "q*uit,done,pause"}}
help#43rc#29{}
no_text_msg#43rc#29"Verb body is empty."
commands#43rc#29{{"e*dit", "<obj>:<verb>"}, {"com*pile", "[as <obj>:<verb>]"}}
invoke_task#43r#290
exit_on_abort#43rc#29<clear>
previous_session_msg#43rc#29"You need to either COMPILE or ABORT this verb before you can start on another."
stateprops#43r#29{{"objects", 0}, {"verbnames", 0}, {"texts", 0}, {"changes", 0}, {"inserting", 1}, {"readable", 0}}
depart_msg#43rc#29"%DN sizzles and vanishes."
return_msg#43rc#29"A cloud of static rezzes into %dn."
no_littering_msg#43rc#29
list of 3{"Keeping your verb for later work. ", "To return, give the `@edit' command with no arguments.", "Please come back and COMPILE or ABORT if you don't intend to be working on this verb in the immediate future. Keep Our MOO Clean! No Littering!"}
no_change_msg#43rc#29"The verb has no pending changes."
change_msg#43rc#29"You have changed the verb since last successful compile."
nothing_loaded_msg#43rc#29"First, you have to select a verb to edit with the EDIT command."
texts#43#29{}
active#43r#29{}
changes#43#29{}
inserting#43#29{}
original#43r#29{}
no_actions#43rc#29<clear>
wiz_editors#43rc#29<clear>
who_location_msg#3rc#29"%L [editing verbs]"
exits#3c#29{}
go_fail_msg#3rc#29<clear>
outdoor#3rc#29<clear>
covers#3rc#29<clear>
covering#3rc#29{}
tracks#3rc#29
list of 20{{#413632, 1302123010, 1311761949}, {#45097, 1311722032, 1311722094}, {#241405, 1303991603, 1303991606}, {#142, 1259863335, 1259863489}, {#45093, 1260832793, 1261949185}, {#350044, 1301592547, 1311762105}, {#298277, 1294439268, 1294439276}, {#657, 1307640781, 1307640822}, {#364606, 1302281543, 1302541045}, {#298567, 1306864337, 1306864533}, {#143894, 1297056895, 1297057035}, {#275649, 1289032271, 1289032294}, {#310, 1251739992, 1251740019}, {#349965, 1295406242, 1295406375}, {#2918, 1311649554, 1311650055}, {#98, 1308768742, 1308768790}, {#7195, 1296680655, 1296680658}, {#299353, 1295770799, 1295770823}, {#520419, 1286762896, 1295770768}, {#520424, 1295710689, 1295711111}}
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{6544914, 9969718, 3809773, 3469633, 912849}
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#292
max_objects#3rc#29<clear>
show_map#3rc#29<clear>
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#291311722032
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{"Verb Editor"}
description#1rc#29<clear>
object_size#1r#29{25400, 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 n41_0 #41:e*dit n107_43 #107:tell n41_0->n107_43 n43_36 #43:invoke n41_0->n43_36 n41_1 #41:com*pile n41_1->n107_43 n43_27 #43:loaded n41_1->n43_27 n43_55 #43:nothing_loaded_msg n41_1->n43_55 n51_14 #51:parse_verbref n41_1->n51_14 n51_15 #51:parse_argspec n41_1->n51_15 n20_5 #20:from_list n41_1->n20_5 n48_0 #48:object_match_failed n41_1->n48_0 n6_6 #6:my_match_object n41_1->n6_6 n43_60 #43:get_room n41_1->n43_60 n51_18 #51:full_prep n41_1->n51_18 n51_21 #51:find_verb_named n41_1->n51_21 n51_1 #51:toint n41_1->n51_1 n41_8 #41:verb_name n41_1->n41_8 n6_23 #6:edit_option n41_1->n6_23 n43_23 #43:text n41_1->n43_23 n51_41 #51:substitute n41_1->n51_41 n41_6 #41:set_verb_code n41_1->n41_6 n43_18 #43:set_changed n41_1->n43_18 n17_41 #17:set_verb_code n41_6->n17_41 n41_2 #41:working_on n41_2->n20_5 n41_2->n41_8 n43_26 #43:ok n41_2->n43_26 n41_9 #41:verb_args n41_2->n41_9 n41_9->n20_5 n41_3 #41:init_session n41_3->n41_2 n41_3->n43_26 n43_24 #43:load n41_3->n43_24 n41_4 #41:parse_invoke n41_4->n107_43 n41_4->n51_14 n41_4->n51_15 n41_4->n20_5 n41_4->n48_0 n41_4->n6_6 n41_4->n43_60 n41_4->n51_18 n41_4->n51_21 n20_39 #20:words n41_4->n20_39 n41_5 #41:fetch_verb_code n41_4->n41_5 n41_5->n6_23 n41_7 #41:local_editing_info n51_17 #51:short_prep n41_7->n51_17 n41_10 #41:comment n41_10->n107_43 n41_10->n43_27 n41_10->n43_55 n43_33 #43:parse_range n41_10->n43_33 n1_11 #1:tell_lines n41_10->n1_11 n51_11 #51:verb_documentation n41_10->n51_11 n41_11 #41:uncomment n41_11->n107_43 n41_11->n43_27 n41_11->n43_55 n41_11->n43_33 n41_11->n1_11 n41_11->n51_11 n31_0 #31:eval n41_11->n31_0 n20_6 #20:english_list n41_11->n20_6 n41_12 #41:next n41_12->n107_43 n41_12->n43_36 n47_18 #47:iassoc n41_12->n47_18 n20_38 #20:explode n41_12->n20_38 n41_13 #41:@queue-grep n41_13->n107_43 n41_13->n47_18 n51_30 #51:_egrep_verb_code n41_13->n51_30 n48_8 #48:suspend_if_needed n41_13->n48_8

Source

e*dit

Spec any none noneFlags rxdOwner #29Definer #41

Referenced by

none

Source

1if (!args)
2player:tell("edit what?");
3else
4this:invoke(argstr, verb);
5endif

com*pile save

Spec none any anyFlags rxdOwner #29Definer #41

Referenced by

none

Source

1pas = {{}, {}};
2if (!(who = this:loaded(player)))
3player:tell(this:nothing_loaded_msg());
4return;
5elseif (!args)
6object = this.objects[who];
7vname = this.verbnames[who];
8if (typeof(vname) == LIST)
9vargs = listdelete(vname, 1);
10vname = vname[1];
11else
12vargs = {};
13endif
14changeverb = 0;
15elseif ((args[1] != "as") || ((length(args) < 2) || ((!(spec = $code_utils:parse_verbref(args[2]))) || ((typeof(pas = $code_utils:parse_argspec(@args[3..$])) != LIST) || pas[2]))))
16if (typeof(pas) != LIST)
17player:tell(pas);
18elseif (pas[2])
19player:tell("I don't understand \"", $string_utils:from_list(pas[2], " "), "\"");
20endif
21player:tell("Usage: ", verb, " [as <object>:<verb>]");
22return;
23elseif ($command_utils:object_match_failed(object = player:my_match_object(spec[1], this:get_room(player)), spec[1]))
24return;
25else
26vname = spec[2];
27vargs = pas[1] && {@pas[1], "none", "none"}[1..3];
28if (vargs)
29vargs[2] = $code_utils:full_prep(vargs[2]) || vargs[2];
30endif
31changeverb = 1;
32endif
33if (vargs)
34vnum = $code_utils:find_verb_named(object, vname);
35while (vnum && (verb_args(object, vnum) != vargs))
36vnum = $code_utils:find_verb_named(object, vname, vnum + 1);
37endwhile
38if (!vnum)
39player:tell("There is no ", object, ":", vname, " verb with args (", $string_utils:from_list(vargs, " "), ").");
40if (!changeverb)
41player:tell("Use 'compile as ...' to write your code to another verb.");
42endif
43return;
44endif
45objverbname = tostr(object, ":", vname, " (", $string_utils:from_list(vargs, " "), ")");
46else
47vnum = 0;
48objverbname = tostr(object, ":", ($code_utils:toint(vname) == E_TYPE) ? vname | this:verb_name(object, vname));
49endif
50"...";
51"...perform eval_subs on verb code if necessary...";
52"...";
53if (player.eval_subs && player:edit_option("eval_subs"))
54verbcode = {};
55for x in (this:text(who))
56verbcode = {@verbcode, $code_utils:substitute(x, player.eval_subs)};
57endfor
58else
59verbcode = this:text(who);
60endif
61"...";
62"...write it out...";
63"...";
64if (result = this:set_verb_code(object, vnum ? vnum | vname, verbcode))
65player:tell(objverbname, " not compiled because:");
66for x in (result)
67player:tell("  ", x);
68endfor
69elseif (typeof(result) == ERR)
70player:tell({result, ("You do not have write permission on " + objverbname) + ".", ("The verb " + objverbname) + " does not exist (!?!)", ("The object " + tostr(object)) + " does not exist (!?!)"}[1 + (result in {E_PERM, E_VERBNF, E_INVARG})]);
71if (!changeverb)
72player:tell("Do 'compile as <object>:<verb>' to write your code to another verb.");
73endif
74changeverb = 0;
75else
76player:tell(objverbname, verbcode ? " successfully compiled." | " verbcode removed.");
77this:set_changed(who, 0);
78endif
79if (changeverb)
80this.objects[who] = object;
81this.verbnames[who] = vargs ? {vname, @vargs} | vname;
82endif

working_on

Spec this none thisFlags rxdOwner #29Definer #41

Referenced by

Source

1if (!(fuckup = this:ok(who = args[1])))
2return fuckup;
3else
4object = this.objects[who];
5verbname = this.verbnames[who];
6if (typeof(verbname) == LIST)
7return tostr(object, ":", verbname[1], " (", $string_utils:from_list(listdelete(verbname, 1), " "), ")");
8else
9return tostr(object, ":", this:verb_name(object, verbname), " (", this:verb_args(object, verbname), ")");
10endif
11endif
12"return this:ok(who = args[1]) && tostr(this.objects[who]) + \":\" + this.verbnames[who];";

init_session

Spec this none thisFlags rxdOwner #29Definer #41

Referenced by

none

Source

1{who, object, vname, vcode} = args;
2if (this:ok(who))
3this:load(who, vcode);
4this.verbnames[who] = vname;
5this.objects[who] = object;
6this.active[who]:tell("Now editing ", this:working_on(who), ".");
7"this.active[who]:tell(\"Now editing \", object, \":\", vname, \".\");";
8endif

parse_invoke

Spec this none thisFlags rxdOwner #29Definer #41

Referenced by

none

Source

1":parse_invoke(string,v,?code)";
2"  string is the commandline string to parse to obtain the obj:verb to edit";
3"  v is the actual command verb used to invoke the editor";
4" => {object, verbname, verb_code} or error";
5vref = $string_utils:words(args[1]);
6if ((!vref) || (!(spec = $code_utils:parse_verbref(vref[1]))))
7player:tell("Usage: ", args[2], " object:verb");
8return;
9endif
10if (argspec = listdelete(vref, 1))
11if (typeof(pas = $code_utils:parse_argspec(@argspec)) == LIST)
12if (pas[2])
13player:tell("I don't understand \"", $string_utils:from_list(pas[2], " "), "\"");
14return;
15endif
16argspec = {@pas[1], "none", "none"}[1..3];
17argspec[2] = $code_utils:full_prep(argspec[2]) || argspec[2];
18else
19player:tell(pas);
20return;
21endif
22endif
23if (!$command_utils:object_match_failed(object = player:my_match_object(spec[1], this:get_room(player)), spec[1]))
24vnum = $code_utils:find_verb_named(object, vname = spec[2]);
25if (argspec)
26while (vnum && (verb_args(object, vnum) != argspec))
27vnum = $code_utils:find_verb_named(object, vname, vnum + 1);
28endwhile
29endif
30if (length(args) > 2)
31code = args[3];
32elseif (vnum)
33code = this:fetch_verb_code(object, vnum);
34else
35code = E_VERBNF;
36endif
37if (typeof(code) == ERR)
38player:tell((code != E_VERBNF) ? code | "That object does not define that verb", argspec ? " with those args." | ".");
39return code;
40else
41return {object, argspec ? {vname, @argspec} | vname, code};
42endif
43endif
44return 0;

fetch_verb_code

Spec this none thisFlags rxdOwner #361Definer #41

Referenced by

Source

1"WIZARDLY";
2if ((caller != $verb_editor) || (caller_perms() != $verb_editor.owner))
3return E_PERM;
4else
5set_task_perms(player);
6return `verb_code(args[1], args[2], !player:edit_option("no_parens")) ! ANY';
7endif

set_verb_code

Spec this none thisFlags rxdOwner #361Definer #41

Referenced by

Source

1"WIZARDLY";
2if ((caller != $verb_editor) || (caller_perms() != $verb_editor.owner))
3return E_PERM;
4else
5set_task_perms(player);
6{object, verbname, code} = args;
7return `$wiz_utils:set_verb_code(object, verbname, code) ! ANY';
8endif

local_editing_info

Spec this none thisFlags rxdOwner #361Definer #41

Referenced by

none

Source

1if (caller == $verb_editor)
2set_task_perms(player);
3endif
4{object, vname, code} = args;
5if (typeof(vname) == LIST)
6vargs = tostr(" ", vname[2], " ", $code_utils:short_prep(vname[3]), " ", vname[4]);
7vname = vname[1];
8else
9vargs = "";
10endif
11name = tostr(object.name, ":", vname);
12"... so the next 2 lines are actually wrong, since verb_info won't";
13"... necessarily retrieve the correct verb if we have more than one";
14"... matching the given same name; anyway, if parse_invoke understood vname,";
15"... so will @program.  I suspect these were put here because in the";
16"... old scheme of things, vname was always a number.";
17"vname = strsub($string_utils:explode(verb_info(object, vname)[3])[1], \"*\", \"\")";
18"vargs = verb_args(object, vname)";
19"";
20return {name, code, tostr("@program ", object, ":", vname, vargs)};

verb_name

Spec this none thisFlags rxdOwner #361Definer #41

Referenced by

Source

1"verb_name(object, vname)";
2"Find vname on object and return its full name (quoted).";
3"This is useful for when we're working with verb numbers.";
4if ((caller != $verb_editor) || (caller_perms() != $verb_editor.owner))
5return E_PERM;
6else
7set_task_perms(player);
8given = args[2];
9if (typeof(info = `verb_info(args[1], given) ! ANY') == ERR)
10return tostr(given, "[", info, "]");
11elseif (info[3] == given)
12return given;
13else
14return tostr(given, "/\"", info[3], "\"");
15endif
16endif

verb_args

Spec this none thisFlags rxdOwner #361Definer #41

Referenced by

Source

1"verb_name(object, vname)";
2"Find vname on object and return its full name (quoted).";
3"This is useful for when we're working with verb numbers.";
4if ((caller != $verb_editor) || (caller_perms() != $verb_editor.owner))
5return E_PERM;
6else
7set_task_perms(player);
8return $string_utils:from_list(`verb_args(args[1], args[2]) ! ANY', " ");
9endif

comment

Spec any any anyFlags rxdOwner #29Definer #41

Referenced by

none

Source

1"Syntax: comment [<range>]";
2"";
3"Turns the specified range of lines, into comments.";
4if ((caller != player) && (caller_perms() != player))
5return E_PERM;
6elseif (!(who = this:loaded(player)))
7player:tell(this:nothing_loaded_msg());
8elseif (typeof(range = this:parse_range(who, {"."}, @args)) != LIST)
9player:tell(tostr(range));
10elseif (range[3])
11player:tell_lines($code_utils:verb_documentation());
12else
13text = this.texts[who];
14{from, to, crap} = range;
15cut = $maxint;
16for line in [from..to]
17cut = min(cut, `match(text[line], "[^ ]")[1] ! E_RANGE => 1');
18endfor
19for line in [from..to]
20text[line] = toliteral(text[line][cut..$]) + ";";
21endfor
22this.texts[who] = text;
23player:tell((to == from) ? "Line" | "Lines", " changed.");
24this.changes[who] = 1;
25this.times[who] = time();
26endif

uncomment

Spec any any anyFlags rxdOwner #29Definer #41

Referenced by

none

Source

1"Syntax: uncomment [<range>]";
2"";
3"Turns the specified range of lines from comments to, uh, not comments.";
4if ((caller != player) && (caller_perms() != player))
5return E_PERM;
6elseif (!(who = this:loaded(player)))
7player:tell(this:nothing_loaded_msg());
8elseif (typeof(range = this:parse_range(who, {"."}, @args)) != LIST)
9player:tell(tostr(range));
10elseif (range[3])
11player:tell_lines($code_utils:verb_documentation());
12else
13text = this.texts[who];
14{from, to, crap} = range;
15bogus = {};
16for line in [from..to]
17if (match(text[line], "^ *\"%([^\\\"]%|\\.%)*\";$"))
18"check from $code_utils:verb_documentation";
19if (!bogus)
20text[line] = $no_one:eval(text[line])[2];
21endif
22else
23bogus = setadd(bogus, line);
24endif
25endfor
26if (bogus)
27player:tell((length(bogus) == 1) ? "Line" | "Lines", " ", $string_utils:english_list(bogus), " ", (length(bogus) == 1) ? "is" | "are", " not comments.");
28player:tell("No changes.");
29return;
30endif
31this.texts[who] = text;
32player:tell((to == from) ? "Line" | "Lines", " changed.");
33this.changes[who] = 1;
34this.times[who] = time();
35endif

next

Spec none none noneFlags rxdOwner #361Definer #41

Referenced by

none

Source

1idx = $lu:iassoc(player, this.queued_edits);
2if (!idx)
3player:tell("You have no next verb to work on.");
4else
5queue = this.queued_edits[idx][2];
6if (queue)
7next = queue[1];
8this.queued_edits[idx][2] = queue[2..$];
9next = $su:explode(next)[1];
10if (star = index(next, "*"))
11next = next[1..star - 1];
12endif
13this:invoke(next, verb);
14else
15player:tell("You have no next verb to work on.");
16endif
17endif

@queue-grep

Spec any none noneFlags rxdOwner #361Definer #41

Referenced by

none

Source

1if (!player.wizard)
2player:tell("You must be a wizard to use @queue-grep.");
3return;
4endif
5regexp = dobjstr;
6queue = {};
7for o in [#0..max_object()]
8if (!valid(o))
9continue;
10endif
11for v in (verbs(o))
12linenum = $code_utils:_egrep_verb_code(regexp, o, v);
13if (linenum)
14spec = tostr(o, ":", v);
15queue = {@queue, spec};
16player:tell(" + ", spec);
17endif
18$cu:sin();
19endfor
20$cu:sin(1, tostr("...", o));
21endfor
22idx = $lu:iassoc(player, this.queued_edits);
23if (idx)
24this.queued_edits[idx][2] = queue;
25else
26this.queued_edits = {@this.queued_edits, {player, queue}};
27endif
28player:tell();
29player:tell("Total: ", length(queue), " verbs queued for edit.");