Verb Editor #41
Aliases: Verb Editor
14 verbs · 118 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
e*dit | any none none | rxd | #41 | 5 |
com*pile save | none any any | rxd | #41 | 82 |
working_on | this none this | rxd | #41 | 12 |
init_session | this none this | rxd | #41 | 8 |
parse_invoke | this none this | rxd | #41 | 44 |
fetch_verb_code | this none this | rxd | #41 | 7 |
set_verb_code | this none this | rxd | #41 | 8 |
local_editing_info | this none this | rxd | #41 | 20 |
verb_name | this none this | rxd | #41 | 16 |
verb_args | this none this | rxd | #41 | 9 |
comment | any any any | rxd | #41 | 26 |
uncomment | any any any | rxd | #41 | 35 |
next | none none none | rxd | #41 | 17 |
@queue-grep | any none none | rxd | #41 | 29 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
objects | #41 | | #29 | {} |
verbnames | #41 | | #29 | {} |
queued_edits | #41 | rc | #29 | {{#7195, {}}} |
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", "e*dit", "com*pile", "abort", "q*uit,done,pause"}} |
help | #43 | rc | #29 | {} |
no_text_msg | #43 | rc | #29 | "Verb body is empty." |
commands | #43 | rc | #29 | {{"e*dit", "<obj>:<verb>"}, {"com*pile", "[as <obj>:<verb>]"}} |
invoke_task | #43 | r | #29 | 0 |
exit_on_abort | #43 | rc | #29 | <clear> |
previous_session_msg | #43 | rc | #29 | "You need to either COMPILE or ABORT this verb before you can start on another." |
stateprops | #43 | r | #29 | {{"objects", 0}, {"verbnames", 0}, {"texts", 0}, {"changes", 0}, {"inserting", 1}, {"readable", 0}} |
depart_msg | #43 | rc | #29 | "%DN sizzles and vanishes." |
return_msg | #43 | rc | #29 | "A cloud of static rezzes into %dn." |
no_littering_msg | #43 | rc | #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 | #43 | rc | #29 | "The verb has no pending changes." |
change_msg | #43 | rc | #29 | "You have changed the verb since last successful compile." |
nothing_loaded_msg | #43 | rc | #29 | "First, you have to select a verb to edit with the EDIT command." |
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 | #29 | <clear> |
who_location_msg | #3 | rc | #29 | "%L [editing verbs]" |
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 | {} |
tracks | #3 | rc | #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 | #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 | {6544914, 9969718, 3809773, 3469633, 912849} |
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 | 2 |
max_objects | #3 | rc | #29 | <clear> |
show_map | #3 | rc | #29 | <clear> |
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 | 1311722032 |
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 | {"Verb Editor"} |
description | #1 | rc | #29 | <clear> |
object_size | #1 | r | #29 | {25400, 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 (!args) 2player:tell("edit what?"); 3else 4this:invoke(argstr, verb); 5endif
com*pile save
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
Referenced by
- #41:init_session line 6:
this:working_on
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
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
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
Referenced by
- #41:parse_invoke line 33:
this:fetch_verb_code
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
Referenced by
- #41:com*pile line 64:
this:set_verb_code
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
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
Referenced by
- #41:com*pile line 48:
this:verb_name - #41:working_on line 9:
this:verb_name
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
Referenced by
- #41:working_on line 9:
this:verb_args
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
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
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
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
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.");