@verb #14:"@last-tb @last-tr*aceback" any any any rdo #55 @program #14:"@last-tb @last-tr*aceback" any any any "Copied from Quadir (#9780):@last-tb Jul 6 13:31:07 2000" "Programmed by Quadir (#9780) from an original" "Syntax:" " @last-tb [,for player] - Displays last tb for player" " @last-tb [tb #] [,on player] - Displays tb # [tb #] for player" " @last-tb list [,for player] - Displays list of recorded tbs" " @last-tb clear [,for player] - Clears all sotred tracebacks" " @last-tb find [text] [,on player] - Displays a list of tbs containing [text] for player" " @last-tb limit [#] [,on player] - Sets number of tbs to collect" "--" "If no player is specified, it assumes you mean yourself." set_task_perms(player) if (!iobjstr) iobj = this elseif ($command_utils:player_match_failed(iobj = this:match_entity(iobjstr), iobjstr)) return endif dobjstr = $su:words(dobjstr) info = `iobj.last_tb ! ANY' if (typeof(info) == $ERR) player:tell(info) elseif (`dobjstr[1] == "clear" ! E_RANGE') `iobj.last_tb[2] = {} ! E_PERM => 0' ok = iobj.last_tb != info if (info[2] == {}) player:tell(iobj == this ? "Your" | tostr(iobj.name, "'s"), " has no tracebacks to reset.") elseif (ok) player:tell(iobj == this ? "Your" | tostr(iobj.name, "'s"), " traceback list has been cleared.") else player:tell("You cannot clear ", iobj == this ? "your" | tostr(iobj.name, "'s"), " tracebacks.") endif elseif (`dobjstr[1] == "find" ! E_RANGE') tbs = "" for tb in [1..length(info[2])] for line in (info[2][tb][1]) if (index(line, dobjstr[2])) tbs = tostr(tbs, ", ", $su:ordinal(tb)) break endif $cmd_utils:suspend_if_needed(0) endfor $cmd_utils:suspend_if_needed(0) endfor player:tell("The string \"", dobjstr[2], "\" ", tbs ? tostr("was found in the ", tbs[3..$], " traceback") | "could not be found", iobj != this ? tostr(" for ", iobj.name) | "", ".") elseif (`dobjstr[1] == "list" ! E_RANGE') player:tell(iobj == this ? "You have " | tostr(iobj.name, " has"), length(info[2]), " tbs out of ", info[1], ":") for tb in [1..length(info[2])] player:tell("[", tb, "]: ", info[2][tb][1][1]) $cmd_utils:suspend_if_needed(0) endfor player:tell("...") elseif (`dobjstr[1] == "limit" ! E_RANGE') "The user might change their mind and set their limit back up, so we won't clear old tracebacks in .last_tb, even if they have more then their limit." "This is done automatically once they receive their next tb." if ((x = $su:to_value(dobjstr[2]))[1] && x[2]) ok = `iobj.last_tb[1] = x[2] ! E_PERM' if (ok) player:tell(iobj == this ? "Your" | tostr(iobj.name, "'s "), " amount of recorded tracebacks is set from ", info[1], " to ", x[2], ".") else player:tell("You cannot set ", iobj == this ? "your " | tostr(iobj.name, "'s "), "traceback limit.") endif else return player:tell("Please enter an integer (above 0) when setting a limit.") endif else tbs = {} if (!dobjstr && info[2]) tbs = setadd(tbs, length(info[2])) else dobjstr = strsub(strsub(tostr(@dobjstr), " ", ""), "$", tostr(length(info[2]))) for group in ($su:explode(dobjstr, ",")) x = $su:explode(group, "..") if (length(x) == 1 && (x = $su:to_value(x[1]))[1]) tbs = setadd(tbs, x[2]) elseif (length(x) == 2 && (x[1] = $su:to_Value(x[1]))[1] && (x[2] = $su:to_value(x[2]))[2]) for realtb in [x[1][2]..x[2][2]] tbs = setadd(tbs, realtb) $cmd_utils:suspend_if_needed(0) endfor else return player:tell("Your specified set of tbs is malformed. Please use integers, $ and ..") endif $cmd_utils:suspend_if_needed(0) endfor endif player:tell(iobj.name, " (", iobj, ") can record up to ", info[1], " TB's.") if (tbs) for tb in (tbs) if (tb > length(info[2])) player:tell("Could not display Traceback #", tb, ".") else player:tell("") player:tell("Traceback #", tb, " recorded at ", player:ctime(info[2][tb][2]), ":") player:tell($su:space(player:linelength(), "-")) player:tell(info[2][tb][1]) player:tell($su:space(player:linelength(), "-")) endif $cmd_utils:suspend_if_needed(0) endfor else player:tell(iobj.name + " has no recorded tracebacks.") endif endif "Last modified by Dax (#789) on Tue May 3 13:45:56 2005 MDT." .