View/Edit #12:@ch*eck-full

Switch to edit mode.

Name(s): @ch*eck-full
1:  if (typeof(this.responsible) != $LIST)
2:    this:notify("Hey, someone was mucking about with your .responsible property, and it was probably you.  Don't do it again.")
3:    this.responsible = {}
4:    return
5:  endif
6:  if (length(verb) <= 6)
7:    "@check, not @check-full"
8:    n = 5
9:    trust = {this, $no_one, $hacker}
10:   "... trust no one, my friend.... no one....  --Herod"
11:   mistrust = {}
12:   for k in (args)
13:     if (z = $code_utils:toint(k))
14:       n = z
15:     elseif (k[1] == "!")
16:       mistrust = listappend(mistrust, $string_utils:match_player(k[2..length(k)]))
17:     else
18:       trust = listappend(trust, $string_utils:match_player(k))
19:     endif
20:   endfor
21:   msg_width = player:linelength() - 60
22:   for q in (n > (y = length(z = this.responsible)) ? z | z[y - n + 1..y])
23:     msg = $html_utils:detag(tostr(@q[2]))
24:     if (length(msg) > msg_width)
25:       msg = msg[1..msg_width]
26:     endif
27:     s = this:whodunnit(q[1], trust, mistrust)
28:     text = valid(s[1]) ? s[1].name | "** NONE **"
29:     this:notify(tostr($string_utils:left(tostr(length(text) > 13 ? text[1..13] | text, " (", s[1], ")"), 20), $string_utils:left($html_utils:literal_text(s[2]), 16), $string_utils:left(tostr(length(s[3].name) > 13 ? s[3].name[1..13] | s[3].name, " (", s[3], ")"), 20), msg))
30:   endfor
31:   this:notify("*** finished ***")
32:   this.responsible = z
33: else
34:   "@check-full, from @traceback by APHiD"
35:   matches = {}
36:   if (length(match = argstr) == 0)
37:     player:notify(tostr("Usage: ", verb, " &lt;string&gt; --or-- ", verb, " &lt;number&gt;"))
38:     return
39:   endif
40:   if (!(responsible = player.responsible))
41:     player:notify("No text has been saved by the monitor.  (See `help @paranoid').")
42:   else
43:     if (typeof(x = $code_utils:toint(argstr)) == $ERR)
44:       for line in (responsible)
45:         if (index(tostr(@line[length(line)]), argstr))
46:           matches = {@matches, line}
47:         endif
48:       endfor
49:     else
50:       matches = this.responsible[(l = length(this.responsible)) - x + 1..l]
51:     endif
52:     if (matches)
53:       linelength = player:linelength()
54:       string_utils = $string_utils
55:       list_utils = $list_utils
56:       for match in (matches)
57:         $command_utils:suspend_if_needed(3)
58:         text = tostr(@match[length(match)])
59:         player:notify("Traceback for:")
60:         player:notify(text)
61:         verbwidth = 0
62:         for verbitem in (list_utils:slice(mm = listdelete(mm = match[1], length(mm)), 2))
63:           verbwidth = max(verbwidth, length(verbitem))
64:         endfor
65:         numwidth = (linelength - verbwidth) / 4 - 1
66:         widths = {numwidth, verbwidth, numwidth, numwidth, numwidth}
67:         top = l = between = ""
68:         for x in [1..5]
69:           top = top + between + string_utils:left({"This", "Verb", "Programmer", "VerbLocation", "Player"}[x], widths[x])
70:           l = l + between + string_utils:space(widths[x], "-")
71:           between = " "
72:         endfor
73:         player:notify(top)
74:         player:notify(l)
75:         for line in (listdelete(mm = match[1], length(mm)))
76:           output = {}
77:           for bit in [1..5]
78:             output = {@output, string_utils:left(typeof(word = line[bit]) == $STR ? word | tostr(word, "(", valid(word) ? list_utils:shortest({word.name, @`word.aliases ! E_PROPNF => {}'}) | (word == $nothing ? "invalid" | (word == $ambiguous_match ? "ambiguous match" | "Error")), ")"), widths[bit]), " "}
79:           endfor
80:           player:notify(string_utils:trimr(tostr(@output)))
81:         endfor
82:         player:notify(l)
83:       endfor
84:       player:notify("**** finished ****")
85:     else
86:       player:notify(tostr("No matches for \"", argstr, "\" found."))
87:     endif
88:   endif
89: endif
90: "Last modified by Dax (#789) on Wed May  4 06:45:59 2005 MDT."

Verb arguments: any any any
Verb perms: Readable NOT-Debug
Verb owned by: Slacker (#55)

You are not logged in.

[home | help | who | search | setup | code]