@verb #14:"@prop*erty" any any any rdo #55 @program #14:"@prop*erty" any any any if (player != this) return $msg:mtell("huh") endif set_task_perms(player) if (!player.programmer) return player:_prog_disclaimer("create properties") endif nargs = length(args) usage = tostr("Usage: ", verb, " . [ [ []]]") if (nargs < 1 || !(spec = $code_utils:parse_propref(args[1]))) return player:notify(usage) endif object = player:my_match_object(spec[1]) name = spec[2] if ($command_utils:object_match_failed(object, spec[1])) return endif if (nargs < 2) value = 0 else argstr = player:input_get_raw(argstr) q = $string_utils:prefix_to_value(argstr[$string_utils:word_start(argstr)[2][1]..length(argstr)]) if (q[1] == 0) return player:notify(tostr("Syntax error in initial value: ", q[2])) endif value = q[2] args = {args[1], value, @$string_utils:words(q[1])} nargs = length(args) endif perms = nargs < 3 ? "rc" | args[3] if (nargs < 4) owner = player else owner = $string_utils:match_player(args[4]) if ($command_utils:player_match_result(owner, args[4])[1]) return endif endif if (nargs > 4) return player:notify(usage) endif e = `add_property(object, name, value, {owner, perms}) ! ANY' if (typeof(e) != $ERR) player:notify(tostr("Property added with value ", toliteral(object.(name)), ".")) elseif (e != E_INVARG) player:notify(tostr(e)) elseif ($object_utils:has_property(object, name)) player:notify(tostr("Property ", object, ".", name, " already exists.")) else for i in [1..length(perms)] if (!index("rcw", perms[i])) return player:notify(tostr("Unknown permission bit: ", perms[i])) endif endfor "...the only other possibility..." player:notify("Property is already defined on one or more descendents.") player:notify(tostr("Try @check-prop ", args[1])) endif "Last modified by Dax (#789) on Wed May 4 06:46:28 2005 MDT." .