145e @verb #13:"@rawdump" any with/using any ro #7407 @program #13:"@rawdump" any with/using any "@dump something [with [id=...] [noprops] [noverbs] [create]]" "This spills out all properties and verbs on an object, calling suspend at appropriate intervals." " id=#nnn -- specifies an idnumber to use in place of the object's actual id (for porting to another MOO)" " noprops -- don't show properties." " noverbs -- don't show verbs." " create -- indicates that a @create command should be generated and all of the verbs be introduced with @verb rather than @args; the default assumption is that the object already exists and you're just doing this to have a look at it." if (player != this) return $msg:mtell("huh") endif set_task_perms(this) dobj = player:my_match_object(dobjstr) if ($command_utils:object_match_failed(dobj, dobjstr)) return elseif (prepstr && prepstr != "with") return notify(player, tostr("Usage: ", verb, " something [with [id=...] [noprops] [noverbs] [create]]")) endif targname = tostr(dobj) options = {"props", "verbs"} create = 0 o_flags = 1 if (iobjstr) for o in ($string_utils:explode(iobjstr)) if (index(o, "id=") == 1) targname = o[4..$] elseif (o in {"noprops", "noverbs"}) options = setremove(options, o[3..$]) elseif (o in {"create"}) create = 1 elseif (o in {"no_oflag"}) o_flags = 0 endif endfor endif if (create) parent = parent(dobj) pstring = tostr(parent) for p in (properties(#0)) if (#0.(p) == parent) pstring = "$" + p endif endfor notify(player, tostr("@create ", pstring, " named ", dobj.name, ":", $string_utils:from_list(dobj.aliases, ","))) endif if (filelist = `dobj:filelist() ! E_PERM => {"E_PERM (Permission denied)"}') player:tell(";\"Files in off-line dir: ", $string_utils:english_list(filelist), "\"") endif for p in ("props" in options ? properties(dobj) | {}) pquoted = toliteral(p) info = property_info(dobj, p) value = dobj.(p) if (create) uvalue = typeof(value) == $LIST ? "{}" | 0 notify(player, tostr("@prop ", targname, ".", pquoted, " ", uvalue || toliteral(value), " ", info[2] || "\"\"", info[1] == dobj.owner ? "" | tostr(" ", info[1]))) if (uvalue && value) notify(player, tostr(";;", targname, ".(", pquoted, ") = ", toliteral(value))) endif else if (info[2] != "rc") notify(player, tostr("@chmod ", targname, ".", pquoted, " ", info[2])) endif if (info[1] != dobj.owner) notify(player, tostr("@chown ", targname, ".", pquoted, " to ", info[1])) endif notify(player, tostr(";;", targname, ".(", pquoted, ") = ", toliteral(value))) endif $command_utils:suspend_if_needed() endfor for a in ("props" in options ? $object_utils:ancestors(dobj) | {}) for p in (properties(a)) $command_utils:suspend_if_needed(1) pquoted = toliteral(p) value = dobj.(p) avalue = a.(p) if (typeof(value) == $ERR) notify(player, tostr("\"", targname, ".(", pquoted, ") => ", $code_utils:error_name(value), " (", value, ")")) elseif (typeof(avalue) == $ERR || !is_clear_property(dobj, p)) notify(player, tostr(";;", targname, ".(", pquoted, ") = ", toliteral(value))) endif endfor $command_utils:suspend_if_needed(1) endfor if (!("verbs" in options)) notify(player, "\"***finished***") return endif notify(player, "") v = 1 while ((info = `verb_info(dobj, v) ! ANY') || info == E_PERM) suspend(1) if (typeof(info) == $ERR) notify(player, tostr("\"", dobj, ":", v, " --- ", info, "\";")) else if (i = index(vname = info[3], " ")) vname = vname[1..i - 1] endif if (vname[1] != "*") vname = strsub(vname, "*", "") endif args = verb_args(dobj, v) prep = args[2] in {"any", "none"} ? args[2] | $code_utils:short_prep(args[2]) perms = info[2] != (args == {"this", "none", "this"} ? "rxdo" | "rdo") ? info[2] || "\"\"" | "" " perms = o_verbs ? perms | (y = index(perms, \"o\") ? perms[1..y - 1] | perms);" if (create) if (info[1] == dobj.owner) tail = perms ? tostr(" ", perms) | "" else tail = tostr(" ", perms || info[2], " ", info[1]) endif notify(player, tostr("@verb ", targname, ":\"", info[3], "\" ", args[1], " ", prep, " ", args[3], tail)) else notify(player, tostr("@args ", targname, ":\"", info[3], "\" ", args[1], " ", prep, " ", args[3])) if (info[1] != dobj.owner) notify(player, tostr("@chown ", targname, ":", vname, " to ", info[1])) endif if (perms) notify(player, tostr("@chmod ", targname, ":", vname, " ", perms)) endif endif if (code = verb_code(dobj, v, 1, 1)) notify(player, tostr("@program ", targname, ":", vname)) for c in (code) notify(player, c) $command_utils:suspend_if_needed() endfor notify(player, ".") notify(player, "") endif endif v = v + 1 $command_utils:suspend_if_needed() endwhile notify(player, "\"***finished***") "Last modified by Dax (#789) on Tue May 3 13:57:40 2005 MDT." . 0