Dump of #8855 (Player Class hacked with eval that does substitutions and assorted stuff) @create #5803 named Player Class hacked with eval that does substitutions and assorted stuff:Player Class hacked with eval that does substitutions and assorted stuff,eval-test @prop #8855."followable" 0 rc @prop #8855."followers" {} r #3685 @prop #8855."follow_teleport" 0 rc @prop #8855."paste_footer" "" rc @prop #8855."paste_header" "" rc ;;#8855.("spoof_attribution") = " --" "#8855.("idle_messages") => E_PERM (Permission denied) "#8855.("respond_to") => E_PERM (Permission denied) ;;#8855.("moved_by") = {} ;;#8855.("sessile") = 0 "#8855.("witnessing") => E_PERM (Permission denied) ;;#8855.("rooms") = {{"Living", #17}, {"Dining", #28}, {"Library", #1670}, {"Pool", #1428}} "#8855.("messages_going") => E_PERM (Permission denied) ;;#8855.("mail_options") = {"sticky", {"@mail", "new"}} "#8855.("current_message") => E_PERM (Permission denied) "#8855.("messages") => E_PERM (Permission denied) ;;#8855.("features") = {#55317, #30203, #40842, #26787} "#8855.("previous_connection") => E_PERM (Permission denied) "#8855.("email_address") => E_PERM (Permission denied) ;;#8855.("help") = #16122 "#8855.("linebuffer") => E_PERM (Permission denied) "#8855.("current_folder") => E_PERM (Permission denied) "#8855.("all_connect_places") => E_PERM (Permission denied) "#8855.("last_connect_place") => E_PERM (Permission denied) "#8855.("lines") => E_PERM (Permission denied) "#8855.("ownership_quota") => E_PERM (Permission denied) "#8855.("password") => E_PERM (Permission denied) "#8855.("size_quota") => E_PERM (Permission denied) "#8855.("last_password_time") => E_PERM (Permission denied) "#8855.("last_connect_attempt") => E_PERM (Permission denied) "#8855.("key") => E_PERM (Permission denied) ;;#8855.("aliases") = {"Player Class hacked with eval that does substitutions and assorted stuff", "eval-test"} ;;#8855.("description") = "You see a player who looks like it has a Special Nifty eval command." ;;#8855.("object_size") = {27096, 1141286558} @verb #8855:"eval(old)" this none this r #2487 @program #8855:eval(old) "Should be wizard-owned."; "A MOO-code evaluator. Type `;CODE' or `eval CODE'."; " For the case where CODE is an expression, we need to prepend `return ' and append `;' to CODE before passing it to eval(). For statements, though, we don't want to make any changes before passing it to eval(). The code below assumes that CODE is an expression unless it either begins with a semicolon `;' or one of the MOO language keywords."; " If you set your .eval_time property to 1, you find out how many ticks and seconds you used. Also allows you to have your own predefined variables like `here' and `me': These should be set with the @define and @undef commands. To list your current @defines, use the @listdefs command. Player.eval_ticks may be subtracted from the resulting tick count; the author never really followed that, and would appreciate any assistance on fixing it if it doesn't work."; set_task_perms(player); argstr = argstr + ";"; start = 1; while (argstr[start] == " ") start = start + 1; endwhile end = start; while (("A" <= (l = argstr[end])) && (l <= "Z")) end = end + 1; endwhile if ((argstr[start] == ";") || (argstr[start..end - 1] in {"if", "for", "fork", "return", "while"})) program = this:fixeval(argstr); else program = this:fixeval("return " + argstr); endif ticks = (ticks_left() - 13) - player.eval_ticks; seconds = seconds_left(); value = eval(program); seconds = seconds - seconds_left(); ticks = ticks - ticks_left(); if (value[1]) val = value[2]; if (typeof(val) == OBJ) player:tell("=> ", val, " ", valid(val) ? ("(" + val.name) + ")" | ((a = $list_utils:assoc(val, {{#-1, "<$nothing>"}, {#-2, "<$ambiguous_match>"}, {#-3, "<$failed_match>"}})) ? a[2] | "")); elseif (typeof(val) == ERR) player:tell("=> ", $code_utils:error_name(val), " (", val, ")"); else player:tell("=> ", $string_utils:print(value[2])); endif if (player.eval_time && (!output_delimiters(player)[2])) player:tell("[used ", ticks, " tick", (ticks != 1) ? "s, " | ", ", seconds, " second", (seconds != 1) ? "s" | "", ".]"); endif else player:tell_lines(value[2]); nerrors = length(value[2]); player:tell(nerrors, " error", (nerrors == 1) ? "." | "s."); endif . @verb #8855:"@define" any as any @program #8855:@define "Define