@verb #2348:"format" this none this rxdo #9452 @program #2348:"format" this none this if (!(caller_perms() in this.admins)) raise(E_PERM) else text = args[1] formatted = {} typeof(text) == $LIST || (text = {text}) for line in (text) if (length(line) >= 1 && line[1] == "\\") if (length(args) == 1 || args[2] == 0) line = "" else line = line[2..$] endif endif if (index(line, "%")) result = "" while (startsub = index(line, "%")) result = result + line[1..startsub - 1] line = line[startsub + 1..$] endsub = index(line, "%") if (endsub == 0) player:tell("Invalid token in message text.") raise(E_INVARG) endif token = line[1..endsub - 1] line = line[endsub + 1..$] if (token == "") token = "%" endif if (length(token) >= 4 && token[1..4] == "name") which = 2 length(token) == 4 || (which = 1 + toint(token[5])) try token = tostr(args[which]->object:title()) except (ANY) token = "N/A" endtry elseif (token == "sir") token = args[2]->object.gender == "female" ? "madam" | "sir" elseif (length(token) >= 3 && token[1..3] == "arg") which = 4 length(token) == 3 || (which = 3 + toint(token[4])) token = tostr(args[which]) else which = 2 if (toint(token[$]) != 0) which = 1 + toint(token[$]) token = token[1..$ - 1] endif try token = tostr(args[which]->(token)) except (ANY) token = "N/A" endtry endif result = result + token endwhile result = result + line line = result endif formatted = {@formatted, line} if ($command_utils:running_out_of_time()) player:tell("WARNING: running out of ticks") endif endfor " player != $lord_database.owner || player:tell(\"Ticks left: \" + tostr(ticks_left()))" return formatted endif "Last modified by Dax (#789) on Tue May 3 14:11:56 2005 MDT." .