@verb #13:"@set*prop" any at/to any rdo #789 @program #13:"@set*prop" any at/to any "Syntax: @set . to " "Changes the value of the specified object's property to the given value." "You must have permission to modify the property, either because you own the property or if it is writable." set_task_perms(player) iobjstr = player:input_get_raw(iobjstr) if (this != player) return player:tell(E_PERM) elseif (!(l = $code_utils:parse_propref(dobjstr))) return player:tell("Property ", dobjstr, " not found.") endif dobj = player:my_match_object(l[1], player.location) if ($command_utils:object_match_failed(dobj, l[1])) return endif prop = l[2] if (prop in $code_utils.builtin_props && !player.wizard) player:tell("Can't set builtin properties this way.") player:tell("Use @rename for .name, @move/@eject for .location/.contents, and @chmod for .r, .w and .f") return endif iobjstr = argstr[$string_utils:word_start(argstr)[prepstr in args][2] + 1..$] iobjstr = $string_utils:trim(iobjstr) propowner = `property_info(dobj, prop)[1] ! ANY' if (!$object_utils:has_property(dobj, prop)) return player:notify("That object does not have that property.") elseif (!iobjstr) old_val = dobj.(prop) dobj:("_set_" + prop)("") elseif (iobjstr[1] == "\"") old_val = dobj.(prop) dobj:("_set_" + prop)(iobjstr[2..iobjstr[$] == "\"" ? $ - 1 | $]) else val = $string_utils:to_value(iobjstr) if (!val[1]) return player:tell("[", val[2], "] Could not parse: ", iobjstr) endif old_val = dobj.(prop) dobj:("_set_" + prop)(val[2]) endif player:tell("Property ", dobj, ".", prop, equal(old_val, dobj.(prop)) ? " unchanged with value " | " set to ", toliteral(dobj.(prop)), ".") "Last modified by Dax (#789) on Thu Jul 25 11:00:50 2002 MDT." .