Vendor Cataloguing Script (updated, fixed for NPCs that interrupt the cataloguing) by .divined
Description: Replace the ID on line 36 with your rune tome's ID
1if not listexists "tomerunes"
2 createlist "tomerunes"
3endif
4
5if list 'tomerunes' = 0
6
7pushlist 'tomerunes' 200
8pushlist 'tomerunes' 201
9pushlist 'tomerunes' 202
10pushlist 'tomerunes' 203
11pushlist 'tomerunes' 204
12pushlist 'tomerunes' 205
13pushlist 'tomerunes' 206
14pushlist 'tomerunes' 207
15pushlist 'tomerunes' 208
16pushlist 'tomerunes' 209
17pushlist 'tomerunes' 210
18pushlist 'tomerunes' 211
19pushlist 'tomerunes' 212
20pushlist 'tomerunes' 213
21pushlist 'tomerunes' 214
22pushlist 'tomerunes' 215
23pushlist 'tomerunes' 216
24pushlist 'tomerunes' 217
25pushlist 'tomerunes' 218
26pushlist 'tomerunes' 219
27pushlist 'tomerunes' 220
28pushlist 'tomerunes' 221
29pushlist 'tomerunes' 222
30pushlist 'tomerunes' 223
31pushlist 'tomerunes' 224
32pushlist 'tomerunes' 225
33
34endif
35
36dclick 0x49D07AEE
37 waitforgump 167090027 5000
38 foreach "recallHomeGumpResponse" in "tomerunes"
39
40 if recallHomeGumpResponse = 201 or recallHomeGumpResponse = 203 or recallHomeGumpResponse = 205 or recallHomeGumpResponse = 207 or recallHomeGumpResponse = 209 or recallHomeGumpResponse = 211 or recallHomeGumpResponse = 213 or recallHomeGumpResponse = 215 or recallHomeGumpResponse = 217 or recallHomeGumpResponse = 219 or recallHomeGumpResponse = 221 or recallHomeGumpResponse = 223 or recallHomeGumpResponse = 223 or recallHomeGumpResponse = 225
41 @setvar! secondaryGumpResponse 20
42 else
43 @setvar! secondaryGumpResponse 10
44 endif
45
46 gumpresponse recallHomeGumpResponse 167090027
47 waitforgump 167090027 5000
48 gumpresponse secondaryGumpResponse 167090027
49 break
50 endfor
51poplist "tomerunes" "front"
52
53clearignore
54clearsysmsg
55wait 5000
56say '[coord'
57sysmsg "START CATALOGUE"
58clearignore
59while not dead
60
61 if not hidden
62 useskill 'Hiding'
63 endif
64
65 @hotkey 'Next Monster Target'
66 wait 250
67 @setvar! 'lastserial' lasttarget
68 getlabel lastserial vlabel
69 if noto 'lastserial' = invulnerable
70 if 'dockmaster' in vlabel
71 overhead 'dockmaster found'
72 elseif 'stablemaster' in vlabel
73 overhead 'stablemaster found'
74 elseif 'barkeeper' in vlabel
75 overhead 'barkeeper found'
76 elseif 'battle trainer' in vlabel
77 overhead 'battle trainer found'
78 elseif 'salvage foreman' in vlabel
79 overhead 'salvage foreman' found
80 elseif 'fisherman' in vlabel
81 overhead 'fisherman found'
82 else
83 if findtype 3701 'lastserial' as foundBackpack
84 sysmsg 'New Vendor'
85 dclick 'foundBackpack'
86 @ignore 'foundBackpack'
87 wait 250
88 #Now we dig
89 #List items in top layer
90 #Search through list
91 while findtype 'portrait painting|ph furniture|large painting|hieroglyph|cathedral tapestry|wall display|rune|tray|bottle|fulljars|deed|wallshelf|crate|robe|statue|figurine|2597|3530|3568|3657|3713|3718|3721|3736|3737|3738|3762|3827|3834|3836|3842|3843|3856|3859|3861|3862|3865|3873|3877|3878|3885|3897|3908|3911|3920|3985|5042|5049|5078|5117|5127|5187|5356|5359|5362|5363|5445|5901|5903|5981|6264|7107|7109|7127|8012|8029|8031|8032|8033|8034|8035|8037|8038|8039|8041|8042|8455|8786|8787|8788|8826|8901|11552|11761|11881|11882|11883|11884|11885|11886|11887|11888|11889|11890|11891|12215|12686|15178|16898|17087|17686|18283|19227|19232|19234|19235|19236|19239|20495|22187|22326|22336|23034|24434|27611|27612|28236|28879|28883|28885|28888|29025|29030|29036|29040|29048|29103|29348|29447|29773|29774|29863|39860|42519|42692|42694|43167|43206|45085|45285|45315|48407|49113|49711|51094|51100|52610|54006' "foundBackpack" as foundItem
92 #found an item, display it to log
93 @getlabel 'foundItem' foundItemLabel
94 sysmsg foundItemLabel 33
95 @ignore foundItem
96 endwhile
97 wait 250
98
99 #Start container part
100
101 while findtype 'ph chest|bone chest|armoire|chest|wooden chest|metal chest|trunk|wooden shelf|51998|3649|3648|29833|3705|2448|5402|2472|2473|2474|2475|2476|2477|2480|2481|2482|3701|3702|3704|3712|23034|18283|3644|11761|41449' foundBackpack as foundContainer
102 @getlabel 'foundContainer' foundContainerLabel
103 #output container label for bulk sells
104 sysmsg foundContainerLabel 33
105 getlabel foundContainer desc
106 if "Price: Not for sale" in desc
107 dclick foundContainer
108 wait 250
109
110 #container is open, now search it
111 while findtype 'portrait painting|ph furniture|large painting|hieroglyph|cathedral tapestry|wall display|rune|tray|bottle|fulljars|deed|wallshelf|crate|robe|statue|figurine|2597|3530|3568|3657|3713|3718|3721|3736|3737|3738|3762|3827|3834|3836|3842|3843|3856|3859|3861|3862|3865|3873|3877|3878|3885|3897|3908|3911|3920|3985|5042|5049|5078|5117|5127|5187|5356|5359|5362|5363|5445|5901|5903|5981|6264|6464|7107|7109|7127|8012|8029|8031|8032|8033|8034|8035|8037|8038|8039|8041|8042|8455|8786|8787|8788|8826|8901|11552|11761|11881|11882|11883|11884|11885|11886|11887|11888|11889|11890|11891|12215|12686|15178|16898|17087|17686|18283|19227|19232|19234|19235|19236|19239|20495|22187|22326|22336|23034|24434|27611|27612|28236|28879|28883|28885|28888|29025|29030|29036|29040|29048|29103|29348|29447|29773|29774|29863|39860|42519|42692|42694|43167|43206|45085|45285|45315|48407|49113|49711|51094|51100|52610|54006' "foundContainer" as foundItem
112 @getlabel 'foundItem' foundItemLabel
113 sysmsg foundItemLabel 33
114 @ignore foundItem
115 endwhile
116 endif
117 @ignore foundContainer
118 endwhile
119 else
120 overhead 'DONE CATALOGUE'
121 break
122 endif
123 endif
124 endif
125endwhile
126
127if insysmsg 'saving'
128 if not insysmsg 'save complete'
129 settimer isSAVING 0
130 settimer isTICKING 0
131 while not insysmsg 'save complete' and timer isSAVING < 8000
132 if timer isTICKING > 500
133 overhead '[ ... ]' 56
134 settimer isTICKING 0
135 endif
136 endwhile
137 endif
138endif
139loop