f49 @verb #13:"_list_verb" this none this rxdo #55 @program #13:"_list_verb" this none this "@list : [ ] [with(out) parens|numbers] [ranges]" if (caller != this) raise(E_PERM) elseif (!this:isa($guardian)) "Allow guardians to see all -r verbs." set_task_perms(this) endif {object, spec, args} = args pflag = 0 nflag = 1 argspec = {} range = {} while (args) if (args[1] && (index("without", args[1]) == 1 || args[1] == "wo")) "...w,wi,wit,with => 1; wo,witho,withou,without => 0..." fval = !index(args[1], "o") if (index("parentheses", args[2]) == 1) pflag = fval args = args[3..length(args)] elseif (index("numbers", args[2]) == 1) nflag = fval args = args[3..length(args)] else this:notify(tostr(args[1], " WHAT?")) args = E_INVARG endif elseif (index("0123456789", args[1][1]) || index(args[1], "..") == 1) if (E_INVARG == (s = $seq_utils:from_string(args[1]))) this:notify(tostr("Garbled range: ", args[1])) args = E_INVARG else range = $seq_utils:union(range, s) args = listdelete(args, 1) endif elseif (argspec) "... second argspec? Not likely ..." this:notify(tostr(args[1], " unexpected.")) args = E_INVARG elseif (typeof(pas = $code_utils:parse_argspec(@args)) == $LIST) argspec = pas[1] argspec[2] = $code_utils:full_prep(argspec[2]) || argspec[2] args = pas[2] else "... argspec is bogus ..." this:notify(tostr(pas)) args = E_INVARG endif endwhile if (args == E_INVARG) this:notify(tostr("Usage: #: [player] [ ] [with|without parentheses|numbers] [ranges]")) return endif what = object if (argspec) vnum = $code_utils:find_verb_named(what, spec, 1) while (vnum < 0 ? valid(what = parent(what)) | verb_args(what, vname = vnum) != argspec) vnum = $code_utils:find_verb_named(what, spec, max(vnum + 1, 1)) endwhile code = vnum < 0 ? E_VERBNF | verb_code(what, vname, pflag) else vname = spec if (toint(vname) > 0 && (code = `verb_code(what, toint(vname), pflag) ! ANY') != E_VERBNF) vname = toint(vname) else while (valid(what) && (code = `verb_code(what, vname, pflag) ! ANY') == E_VERBNF) what = parent(what) endwhile endif endif inf = `verb_info(what, vname) ! ANY' if (code == E_VERBNF && toint(vname) != 0) inf = `verb_info(what, toint(vname)) ! ANY' endif if (code == E_VERBNF) this:notify(tostr("That object does not define that verb", argspec ? " with those args." | ".")) elseif (typeof(code) == $ERR) this:notify(tostr(code)) elseif (code == {}) this:notify("That verb has not been programmed.") else if (what != object) this:notify(tostr("Object ", object, " does not define that verb", argspec ? " with those args" | "", ", but its ancestor ", what, " does.")) endif lineseq = {1, length(code) + 1} range && (lineseq = $seq_utils:intersection(range, lineseq)) if (!lineseq) this:notify("No lines in that range.") return endif info = verb_info(what, vname) vargs = verb_args(what, vname) if (index(vargs[2], "/")) vargs[2] = tostr("(", vargs[2], ")") endif text = {tostr(what, ":", toliteral(info[3]), " ", $string_utils:from_list(vargs, " "))} for k in [1..length(lineseq) / 2] for i in [lineseq[2 * k - 1]..lineseq[2 * k] - 1] if ("syntax_color" in player.display_options) code[i] = tostr(@$compile_utils:color($compile_utils:lex(code[i]))) else code[i] = $html_utils:literal_text(code[i]) endif text = {@text, nflag ? tostr(" "[1..i < 10], i, ": ", code[i]) | code[i]} $command_utils:suspend_if_needed() endfor endfor player:tell_suspended(text) endif "Last modified by Dax (#789) on Tue May 3 14:09:29 2005 MDT." . 0