View/Edit #6319:qfind

Switch to edit mode.

Name(s): qfind
1:  "Copied from Quadir (#9780):find Oct 21 13:09:51 1999"
2:  "This verb was programmed by Quadir (#9780)                          "
3:  "                       to help Cecil (#7404) with his quota problems"
4:  "Errors:                                                             "
5:  "E_LENGTH       -->  The length of a quota contrib was not 4         "
6:  "E_VALID        -->  The quota was donated to a non-valid object     "
7:  "E_PLAYER       -->  The quota was donated to a non-player           "
8:  "E_TYPE         -->  One of the quota donations was not a number     "
9:  "E_BACK         -->  Donated, but never received                     "
10: "E_MATCH        -->  Quota donated was not the same as quota received"
11: "E_CRASH        -->  Error caused verb to crash                      "
12: {players, done} = {players(), {}}
13: player:tell("Searching...")
14: for x in [1..length(players)]
15:   who = players[x]
16:   try
17:     for z in [1..length(who.quota_contribs)]
18:       quota = who.quota_contribs[z]
19:       if (length(quota) != 4)
20:         player:Tell("...", $su:left("E_LENGTH", 9), "--> ", who, ".quota_contribs[", z, "] => ", length(quota))
21:       elseif (!valid(quota[1]))
22:         player:Tell("...", $su:left("E_VALID", 9), "--> ", who, ".quota_contribs[", z, "][1] => ", quota[1])
23:       elseif (!is_player(quota[1]) && !quota[1]:isa($project))
24:         player:tell("...", $su:left("E_PLAYER", 9), "--> ", who, ".quota_contribs[", z, "][1] => ", quota[1])
25:       elseif (typeof(quota[2]) != $INT)
26:         player:tell("...", $su:left("E_TYPE", 9), "--> ", who, ".quota_contribs[", z, "][2] | ", quota[1], " => ", quota[2])
27:       elseif (typeof(quota[3]) != $INT)
28:         player:tell("...", $su:left("E_TYPE", 9), "--> ", who, ".quota_contribs[", z, "][3] | ", quota[1], " => ", quota[3])
29:       elseif (typeof(quota[4]) != $INT)
30:         player:tell("...", $su:left("E_TYPE", 9), "--> ", who, ".quota_contribs[", z, "][4] | ", quota[1], " => ", quota[4])
31:       else
32:         mine = {}
33:         for back in (quota[1].quota_contribs)
34:           if (back[1] == who)
35:             mine = back
36:           endif
37:           $cmd_utils:suspend_if_needed(0)
38:         endfor
39:         if (!mine)
40:           player:Tell("...", $su:left("E_BACK", 9), "--> ", who, ".quota_contribs[", z, "] => ", quota[1])
41:         elseif ((a = {who, -quota[2], -quota[3], -quota[4]}) != mine && !(a in done))
42:           done = setadd(done, a)
43:           player:tell("...", $su:left("E_MATCH", 9), "--> ", who, ".quota_contribs[", z, "] => ", quota[1])
44:         endif
45:       endif
46:       $cmd_utils:suspend_if_needed(0)
47:     endfor
48:   except (ANY)
49:     player:Tell("...", $su:left("E_CRASH", 9), "-->", who, `z ! E_VARNF => 0' ? tostr(".quota_contribs[", z, "]") | "")
50:   endtry
51:   $cmd_utils:suspend_if_needed(0)
52: endfor
53: player:tell($su:space(15, " "), "...Done")
54: "Last modified by Dax (#789) on Wed May  4 06:45:17 2005 MDT."

Verb arguments: none none none
Verb perms: Readable NOT-Debug
Verb owned by: Raptor (#6319)

You are not logged in.

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