-Upgrading LambdaCore to 1.8.0-
$verb_editor:compile Well before I had the fixes as differences to the verb, but you can't edit it if compile is broken, eh? Silly me. Fix the other $code_utils verbs first, then @program this verb, I thought I had it going right, but forgot the last few lines, I'll just put it in long format (hope you can scroll down).. @program $verb_editor:com pas = {{}, {}}; if (!(who = this:loaded(player))) player:tell(this:nothing_loaded_msg()); return; elseif (!args) object = this.objects[who]; vname = this.verbnames[who]; if (typeof(vname) == LIST) vargs = listdelete(vname, 1); vname = vname[1]; else vargs = {}; endif changeverb = 0; elseif (args[1] != "as" || (length(args) < 2 || (!(spec = $code_utils:parse_verbref(args[2])) || (typeof(pas = $code_utils:parse_argspec(@args[3..$])) != LIST || pas[2])))) if (typeof(pas) != LIST) player:tell(pas); elseif (pas[2]) player:tell("I don't understand \"", $string_utils:from_list(pas[2], " "), "\""); endif player:tell("Usage: ", verb, " [as <object>:<verb>]"); return; elseif ($command_utils:object_match_failed(object = player:my_match_object (spec[1], this:get_room(player)), spec[1])) return; else vname = spec[2]; vargs = pas[1] && {@pas[1], "none", "none"}[1..3]; vargs && (vargs[2] = $code_utils:full_prep(vargs[2]) || vargs[2]); changeverb = 1; endif if (vargs) vnum = $code_utils:find_verb_named(object, vname); while (vnum && verb_args(object, vnum) != vargs) vnum = $code_utils:find_verb_named(object, vname, vnum + 1); endwhile if (!vnum) player:tell("There is no ", object, ":", vname, " verb with args (", $string_utils:from_list(vargs, " "), ")."); changeverb || player:tell("Use 'compile as ...' to write your code to another verb."); return; endif objverbname = tostr(object, ":", vname, " (", $string_utils:from_list (vargs, " "), ")"); else vnum = 0; objverbname = tostr(object, ":", $code_utils:tonum(vname) == E_TYPE ? vname | this:verb_name(object, vname)); endif "..."; "...perform eval_subs on verb code if necessary..."; "..."; if (player.eval_subs && player:edit_option("eval_subs")) verbcode = {}; for x in (this:text(who)) verbcode = {@verbcode, $code_utils:substitute(x, player.eval_subs)}; endfor else verbcode = this:text(who); endif "..."; "...write it out..."; "..."; if (result = this:set_verb_code(object, vnum || vname, verbcode)) player:tell(objverbname, " not compiled because:"); for x in (result) player:tell(" ", x); endfor elseif (typeof(result) == ERR) player: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})]); changeverb || player:tell( "Do 'compile as <object>:<verb>' to write your code to another verb."); changeverb = 0; else player:tell(objverbname, verbcode ? " successfully compiled." | " verbcode removed."); this:set_changed(who, 0); endif if (changeverb) this.objects[who] = object; this.verbnames[who] = vargs ? {vname, @vargs} | vname; endif .
-9-
[Previous Page][Next Page][Contents]