1003 @verb #12:"@rmalias" any out of/from inside/from any rdo #55 @program #12:"@rmalias" any out of/from inside/from any "Syntax: @rmalias [,...,] from " " @rmalias [,...,] from :" "" "The first form is used to remove aliases from an object. If the object is a valid player, space and commas will be assumed to be separations between unwanted aliases. Otherwise, only commas will be assumed to be separations." "[5/10/93 Nosredna: flushed above is_player feature" "Note that @rmalias will not affect the object's name, only its aliases." "" "The second form is for use by programmers, to remove aliases from a verb they own. All spaces and commas are assumed to be separations between unwanted aliases." if (player != this) return endif set_task_perms(player) spec = $code_utils:parse_verbref(iobjstr) if (spec) object = player:my_match_object(spec[1]) if (!$command_utils:object_match_failed(object, spec[1])) vname = spec[2] try info = verb_info(object, vname) except (E_VERBNF) return player:notify("That object does not define that verb.") except e (ANY) return player:tell(e) endtry old_aliases = $string_utils:explode(info[3]) not_used = {} for alias in (bad_aliases = $list_utils:remove_duplicates($string_utils:explode(strsub(dobjstr, ",", " ")))) if (!(alias in old_aliases)) not_used = {@not_used, alias} bad_aliases = setremove(bad_aliases, alias) else old_aliases = setremove(old_aliases, alias) endif endfor if (not_used) player:notify(tostr(object.name, "(", object, "):", vname, " does not have the alias", length(not_used) > 1 ? "es" | "", " ", $string_utils:english_list(not_used), ".")) endif if (bad_aliases && old_aliases) aliases = $string_utils:from_list(old_aliases, " ") info[3] = aliases result = set_verb_info(object, vname, info) if (typeof(result) == $ERR) player:notify(tostr(result)) else player:notify(tostr("Alias", length(bad_aliases) > 1 ? "es" | "", " ", $string_utils:english_list(bad_aliases), " removed from verb ", $string_utils:nn(object), ":", vname)) player:notify(tostr("Verbname is now ", $string_utils:nn(object), ":\"", aliases, "\"")) endif elseif (!old_aliases) player:notify("You have to leave a verb with at least one alias.") endif endif else object = player:my_match_object(iobjstr) if (!$command_utils:object_match_failed(object, iobjstr)) old_aliases = object.aliases not_used = {} for alias in (bad_aliases = $list_utils:remove_duplicates($list_utils:map_arg($string_utils, "trim", $string_utils:explode(dobjstr, ",")))) "removed is_player(object) ? strsub(dobjstr, \" \", \",\") | --Nosredna" if (!(alias in old_aliases)) not_used = {@not_used, alias} bad_aliases = setremove(bad_aliases, alias) else old_aliases = setremove(old_aliases, alias) endif endfor if (not_used) player:notify(tostr(object.name, "(", object, ") does not have the alias", length(not_used) > 1 ? "es" | "", " ", $string_utils:english_list(not_used), ".")) endif if (bad_aliases) try r = object:set_aliases(old_aliases) player:notify(tostr("Alias", length(bad_aliases) > 1 ? "es" | "", " ", $string_utils:english_list(bad_aliases), " removed from ", object.name, "(", object, ").")) player:notify(tostr("Aliases for ", object.name, "(", object, ") are now ", $string_utils:from_value(old_aliases, 1))) except (E_INVARG) player:notify("That particular name change not allowed (see help @rename or help @rmalias).") except (E_NACC) player:notify("Oops. You can't update that object's aliases right now; try again in a few minutes.") except e (ANY) player:notify(tostr(e)) endtry endif endif endif "Last modified by Dax (#789) on Thu May 5 17:15:48 2005 MDT." . 0