Back to "dungeon" tags

Bapeth's Time Sense by barryroser

Description: This script will sense and loot containers in Time Dungeon

1# Bapeths Time Dungeon Sense
2# 
3# March 19th 2025 Update : Added lockpicking support for locked chests
4#
5# This script will sense and loot containers in Time Dungeon (Some quest items may still need to be added)
6#
7# "Auto Loot Control"
8# This script uses razor "Auto-Queue Object Delay" setting
9# Make sure this setting is turned ON in the razor Options tab > Targeting & Queues sub-tab
10# And set "object delay to 503" AUTO LOOTING WILL BE SLOW IF YOU DONT DO THIS!
11#
12# "Loot-Sense & Vacuum Mode"
13# This function will overhead display *loot* above items on the ground and pick them up as you pass by (2 tiles)
14# To toggle this feature on/off (default is off) "Double click a Wizard Grimoire"
15#
16# "Auto Door Lockpick"
17# Go into "Warmode" near a pickable door and the scirpt will ask you which door you wish to pick
18# The script will then pick the door lock untill it opens
19#
20# "Auto Switch Flipper"
21# This is for green wall switches in "Time Dungeon"
22# Go into warmode when standing near a wall switch and the script will flip the switch and return to peacemode
23#
24# "Wizard Hat Stealth Trick" - prevents you from stumbling over a player/mob while moving in stealth
25# It is recommended to have in your pack a "Blessed and Aspected Armored Magical Wizard Hat" (Purchasable at prev vendor)
26# Alternatively you can buy a cheap "Magical Wizards Hat" from the Mage NPC in town (non-aspectable)
27# This is for the stealth part of the script
28# It will quick swap your hat and reduce your stamina
29# If your hat ever gets stuck in a "spam loop"
30# Go to Script tab > Options subtab and delete "bwiz" "bmain" and "nonaspectedwiz"
31#
32# "Auto-Recycler"
33# This feature will auto recycle bad items and keep the good ones - To use this feature:
34# You must be carrying at least one "Container identification wand" and at least one "recycler tool" type (Tinker Tools, Sewing Kit, Saw, Tongs, or Scribes Pen)
35# You must have a pair of scissors in your pack (blessed)
36# Double click the scissors when you are ready to start the recycle routine
37#
38# Script starts here...
39
40if not targetexists and not casting
41    if not timerexists bappykeytimer
42        createtimer bappykeytimer
43        settimer bappykeytimer 5500
44    elseif timer bappykeytimer >= 5500 and findtype "4112" backpack as bappykey
45        overhead "*key*" 78 bappykey
46        settimer bappykeytimer 0
47    endif
48    if not timerexists timesensecontainer
49        createtimer timesensecontainer
50        settimer timesensecontainer 1000
51    endif
52    if not findtype 4239|4240 ground -1 -1 2 and timer timesensecontainer >= 1000
53        for 18
54            if index > 0 and findtype "wooden shelf|wooden box|armoire|dead|chest of drawers|3712|2712|3651|3649|3648|3650|3708|2475|2713|2637|2474|3647|3710|3645|3703|3702|2472|3701|2473|2639|3788|3791|3786|2711|3709|3789|3646|3705|27284|27287|27289|27286|27288|3793|3787|3794|3790|3792|2643|3644" ground -1 -1 index as dungeonfloorcontainers
55                getlabel dungeonfloorcontainers desc
56                overhead "*search*" 88 dungeonfloorcontainers
57                @ignore dungeonfloorcontainers
58            endif
59            if findtype "wooden shelf|wooden box|armoire|dead|chest of drawers|3712|2712|3651|3649|3648|3650|3708|2475|2713|2637|2474|3647|3710|3645|3703|3702|2472|3701|2473|2639|3788|3791|3786|2711|3709|3789|3646|3705|27284|27287|27289|27286|27288|3793|3787|3794|3790|3792|2643|3644" ground -1 -1 2
60                break
61            endif
62            if warmode and findtype "barred metal door|metal door|iron gate" ground -1 -1 2
63                break
64            endif
65            if warmode and findtype 4239|4240 ground -1 -1 2
66                break
67            endif
68            if varexist "bwiz" and find "bwiz" backpack and find "bmain" self
69                if not targetexists and not casting and skill "Stealth" >= 80 and hidden and stam = maxstam
70                    while queued
71                        //donothing
72                    endwhile
73                    dclick "bwiz"
74                    while queued
75                        //donothing
76                    endwhile
77                    pause 30
78                    dclick "bmain"
79                    pause 500
80                    getlabel backpack ping
81                endif
82                if not targetexists and not casting and not findlayer self head and find "bmain" self
83                    while queued
84                        //donothing
85                    endwhile
86                    dclick "bmain"
87                    pause 500
88                    getlabel backpack ping
89                endif
90            endif
91            if varexist "bwiz" and find "bmain" self
92                if not targetexists and not casting and not find "bwiz" backpack
93                    while queued
94                        //donothing
95                    endwhile
96                    dclick "bmain"
97                    pause 500
98                    getlabel backpack ping
99                endif
100            endif
101        endfor
102        @clearignore
103        settimer timesensecontainer 0
104    endif
105    if not timerexists switchandstufftimer
106        createtimer switchandstufftimer
107        settimer switchandstufftimer 1000
108    endif
109    if timer switchandstufftimer >= 1000
110        for 18
111            if index > 0 and findtype 4239|4240  ground -1 -1 index as switchandstuff
112                getlabel switchandstuff desc
113                overhead "*switch*" 78 switchandstuff
114                @ignore switchandstuff
115            endif
116            if warmode and findtype 4239|4240 ground -1 -1 2
117                break
118            endif 
119        endfor
120        @clearignore
121        settimer switchandstufftimer 0
122    endif
123    if warmode and findtype 4239|4240 ground -1 -1 2 as timewallswitch
124        dclick timewallswitch
125        warmode off
126        getlabel backpack ping
127    endif
128    @clearignore 
129    while findtype "wooden box|armoire|dead|chest of drawers|wooden shelf|3712|2712|3651|3649|3648|3650|3708|2475|2713|2637|2474|3647|3710|3645|3703|3702|2472|3701|2473|2639|3788|3791|3786|2711|3709|3789|3646|3705|27284|27287|27289|27286|27288|3793|3787|3794|3790|3792|2643|3644" ground -1 -1 2 as timecontainer
130        if warmode and findtype 4239|4240 ground -1 -1 2
131            break
132        endif
133        if varexist "bwiz" and find "bwiz" backpack and find "bmain" self
134            if not targetexists and not casting and skill "Stealth" >= 80 and hidden and stam = maxstam
135                while queued
136                    //donothing
137                endwhile
138                dclick "bwiz"
139                while queued
140                    //donothing
141                endwhile
142                pause 30
143                dclick "bmain"
144                pause 500
145                getlabel backpack ping
146            endif
147            if not targetexists and not casting and not findlayer self head and find "bmain" self
148                while queued
149                    //donothing
150                endwhile
151                dclick "bmain"
152                pause 500
153                getlabel backpack ping
154            endif
155        endif
156        if varexist "bwiz" and find "bmain" self
157            if not targetexists and not casting and not find "bwiz" backpack
158                while queued
159                    //donothing
160                endwhile
161                dclick "bmain"
162                pause 500
163                getlabel backpack ping
164            endif
165        endif        
166        @setvar "bapcontaineroftime" timecontainer
167        while queued
168            //donothing
169        endwhile
170        getlabel timecontainer desc
171        if "the remains of" in desc
172            overhead "*avatar corpse*" 45 timecontainer
173        else
174            dclick timecontainer
175            pause 500
176            getlabel backpack ping
177            if gumpexists 736038070 and skill "Lockpicking" >= 20 and findtype 5373 backpack
178                while gumpexists 736038070
179                    gumpresponse 4
180                endwhile
181                getlabel backpack ping
182            elseif gumpexists 736038070
183                @ignore timecontainer
184                gumpclose 736038070
185            endif
186# This seems to have been broken by Tranq in the last update - check again later to see if it gets fixed
187#            @ignore timecontainer
188#            while findtype "wooden shelf|wooden box|armoire|dead|chest of drawers|3712|2712|3651|3649|3648|3650|3708|2475|2713|2637|2474|3647|3710|3645|3703|3702|2472|3701|2473|2639|3788|3791|3786|2711|3709|3789|3646|3705|27284|27287|27289|27286|27288|3793|3787|3794|3790|3792|2643|3644" timecontainer -1 -1 2 as innercontainer
189#                while queued
190#                    //donothing
191#                endwhile
192#                dclick innercontainer
193#                pause 500
194#                getlabel backpack ping
195#                @ignore innercontainer
196#            endwhile
197#            @unignore timecontainer
198        endif
199        while findtype 5056|5059|5060|5061|5063|5070|5074|5075|5076|5078|5085|5089|5090|5101|5103|5105|5106|5129|5131|5132|5135|5138|5139|5142|5143|5144|5146|5201|5203|5204|5205|5207|7169|7170|7173|7175|7177|7179|7181|7610|7947|31003|31004|31005|31006|31007|31008|31009|31010|31011|31012|31015|31191|31017|31019|31021|31023|31025|31027|31029|31031|31033|31035|31037|31038|31041|31043|31045|31047|31049|31051|31053|31055|3834|3740|3742|3762|3763|10245|20006|20008|20010|20012|20014|20016|7026|7027|7029|7031|7033|7034|7035|7107|7109|31002|31130|3920|5042|5117|30990|30993|30994|30995|31184|31186|3719|3922|3938|5121|5123|5125|30989|30992|30996|30997|30998|31176|31188|3568|3713|3721|3932|5040|5044|5112|5127|5177|5179|5181|30991|30999|31000|31001|31014|31178|31180|31182|3909|3911|3913|3915|3917|3934|3937|5046|5049|5115|5119|5182|5185|5187|30988|31128|31190|22187|31141|31142|31169|31172 timecontainer as checkunid
200            getlabel checkunid desc
201            if "unidentified" in desc
202                hotkey 'Grab Item' 
203                target checkunid
204                overhead "*looting*" 2091 timecontainer
205                if insysmsg "Invalid or inaccessible item."
206                    @ignore checkunid
207                endif
208                while queued
209                    //donothing
210                endwhile
211            else 
212                @ignore checkunid
213            endif
214            if insysmsg "That container cannot hold more weight."
215                break
216            endif
217            if not find "bapcontaineroftime" ground -1 -1 2
218                break
219            endif
220            if varexist "bwiz" and find "bwiz" backpack and find "bmain" self
221                if not targetexists and not casting and skill "Stealth" >= 80 and hidden and stam = maxstam
222                    while queued
223                        //donothing
224                    endwhile
225                    dclick "bwiz"
226                    while queued
227                        //donothing
228                    endwhile
229                    pause 30
230                    dclick "bmain"
231                    pause 500
232                    getlabel backpack ping
233                endif
234                if not targetexists and not casting and not findlayer self head and find "bmain" self
235                    while queued
236                        //donothing
237                    endwhile
238                    dclick "bmain"
239                    pause 500
240                    getlabel backpack ping
241                endif
242            endif
243            if varexist "bwiz" and find "bmain" self
244                if not targetexists and not casting and not find "bwiz" backpack
245                    while queued
246                        //donothing
247                    endwhile
248                    dclick "bmain"
249                    pause 500
250                    getlabel backpack ping
251                endif
252            endif
253        endwhile
254        while findtype 3827 timecontainer 0 as zeroscroll
255            @ignore zeroscroll
256        endwhile
257        while findtype 7154 timecontainer 0 as zeroingot
258            @ignore zeroingot
259        endwhile
260        while findtype 4225 timecontainer 0 as zeroleather
261            @ignore zeroleather
262        endwhile
263        while findtype 7127 timecontainer 0 as zeroboard
264            @ignore zeroboard
265        endwhile
266        while findtype 7154 timecontainer 2419 as zeroingot
267            @ignore zeroingot
268        endwhile
269        while findtype 4225 timecontainer 2419 as zeroleather
270            @ignore zeroleather
271        endwhile
272        while findtype 7127 timecontainer 2419 as zeroboard
273            @ignore zeroboard
274        endwhile
275        while findtype 7154 timecontainer 2406 as zeroingot
276            @ignore zeroingot
277        endwhile
278        while findtype 4225 timecontainer 2406 as zeroleather
279            @ignore zeroleather
280        endwhile
281        while findtype 7127 timecontainer 2406 as zeroboard
282            @ignore zeroboard
283        endwhile
284        while findtype 7154 timecontainer 2413 as zeroingot
285            @ignore zeroingot
286        endwhile
287        while findtype 4225 timecontainer 2413 as zeroleather
288            @ignore zeroleather
289        endwhile
290        while findtype 7127 timecontainer 2413 as zeroboard
291            @ignore zeroboard
292        endwhile
293        while findtype 7154 timecontainer 2418 as zeroingot
294            @ignore zeroingot
295        endwhile
296        while findtype 4225 timecontainer 2418 as zeroleather
297            @ignore zeroleather
298        endwhile
299        while findtype 7127 timecontainer 2418 as zeroboard
300            @ignore zeroboard
301        endwhile
302        while findtype 7154 timecontainer 2213 as zeroingot  
303            @ignore zeroingot
304        endwhile
305        while findtype 4225 timecontainer 2213 as zeroleather
306            @ignore zeroleather
307        endwhile
308        while findtype 7127 timecontainer 2213 as zeroboard
309            @ignore zeroboard
310        endwhile
311        while findtype 22326 timecontainer 2401 as badseed
312            @ignore badseed
313        endwhile
314        while findtype 22326 timecontainer 2882 as badseed
315            @ignore badseed
316        endwhile
317        while findtype 22326 timecontainer 2451 as badseed
318            @ignore badseed
319        endwhile
320        while findtype 22326 timecontainer 63 as badseed
321            @ignore badseed
322        endwhile
323        while findtype 5901|5899|5903|5905 timecontainer as timefootwear
324            getlabel timefootwear desc
325            if "(hue" in desc
326                break
327            else 
328                @ignore timefootwear
329            endif
330        endwhile
331        while findtype "54230|44985|glass display|20049|Pig Iron|broken shield|blackrock fragment|gargish fragment|18705|55247|49482|53694|54570|53696|53876|50612|55420|53280|53473|54831|50278|49528|bottle set|entrail bucket|mounted stalaghorn|sea glass bulb|juggling daggers|st patricks cross|divination orb|mirror display|murder of crows|charmed cobra|prodigy fiddle|wilting rose belljar|scale of balance|screaming mandrake|statue of the siren|the final hour|55204|specimen jars|shattered weapon|bird cage|widows grief|54684|27612|49223|54591|54601|54718|7408|19948|58325|19959|19822|49730|49729|19944|19949|47613|47612|47611|47610|47611|3986|3966|cathedral tapestry|Darkscale tapestry|large painting|landscape painting|portrait painting|figurine|statue|20291|44987|49730|47107|18653|45127|20103|47103|29363|47105|29361|43453|5899|47109|45250|41509|43447|18657|4025|51308|45156|51304|45214|28769|28799|28803|28765|45211|45248|51259|45220|51328|45218|3842|51327|45222|45241|51336|11858|51375|45282|54722|45255|45246|28795|44983|45235|45251|45238|51258|51314|28761|45236|51260|54718|18400|58325|45252|18656|47111|3839|45239|45242|45254|45281|45247|42241|45216|28775|51321|3838|51318|5901|5905|45259|5903|48407|51302|4248|27611|15296|43166|5359|5981|4026|3985|25359|17686|3836|17087|5356|29030|24434|22336|29036|3843|29025|51098|29034|8826|51094|576|3827|22326|45315|3891|2539|39898|39896|39892|39918|39911|39916|39897|39905|39891|39917|39912|39909|39889|31047|31017|31049|31019|31055|31051|31053|31025|31027|31031|31041|54717|31021|31011|31023|31029|31043|31003|31035|31033|31045|31037|31002|20006|31169|31006|30999|31012|31009|30996|7109|7107|31128|31188|20014|31014|31004|31142|31001|31000|37181|31010|30998|31172|30988|30997|31038|31141|7947|20008|31005|31191|31008|31007|30994|30993|31182|30989|20012|31186|31178|31015|30991|20010|20016|31184|31190|30990|30995|31176|31180|30992|31130|5207|7031|7026|7034|7033|7027|7035|7029|5078|5063|5059|5105|5060|5138|5129|5201|5142|5143|5076|5106|7610|5139|5090|5103|5132|7177|5061|7181|7179|3920|5042|5127|5117|5185|5125|3938|5177|3937|5044|5121|3915|3909|3568|3932|5123|5144|5119|5056|5135|5187|5074|5089|3934|3913|3917|3721|5075|5046|5049|7170|5146|5205|5203|5115|5204|5040|5179|5070|5182|5085|5181|3719|7173|5131|3911|5101|7175|7169|3713|5112|22187|9917|3859|3862|3878|3865|3856|3873|3877|3834|3742|3762|3740|3763|10245|3572|3573|3571|12686|19985|19981|19984|19982|19983|19991|19989|19986|19987|19988|19994|19995|19992|19993|19990|19980|19977|19976|19978|19979|43423|7154|4225|7127" timecontainer as bitem
332            hotkey 'Grab Item' 
333            target bitem
334            overhead "*looting*" 2091 timecontainer
335            if insysmsg "Invalid or inaccessible item."
336                @ignore bitem
337            endif
338            while queued
339                //donothing
340            endwhile
341            if insysmsg "That container cannot hold more weight."
342                break
343            endif
344            if not find "bapcontaineroftime" ground -1 -1 2
345                break
346            endif
347            if varexist "bwiz" and find "bwiz" backpack and find "bmain" self
348                if not targetexists and not casting and skill "Stealth" >= 80 and hidden and stam = maxstam
349                    while queued
350                        //donothing
351                    endwhile
352                    dclick "bwiz"
353                    while queued
354                        //donothing
355                    endwhile
356                    pause 30
357                    dclick "bmain"
358                    pause 500
359                    getlabel backpack ping
360                endif
361                if not targetexists and not casting and not findlayer self head and find "bmain" self
362                    while queued
363                        //donothing
364                    endwhile
365                    dclick "bmain"
366                    pause 500
367                    getlabel backpack ping
368                endif
369            endif
370            if varexist "bwiz" and find "bmain" self
371                if not targetexists and not casting and not find "bwiz" backpack
372                    while queued
373                        //donothing
374                    endwhile
375                    dclick "bmain"
376                    pause 500
377                    getlabel backpack ping
378                endif
379            endif
380        endwhile
381        @ignore timecontainer
382    endwhile
383endif
384if not findtype 4239|4240 ground -1 -1 1 and skill "Lockpicking" >= 20 and warmode and findtype "barred metal door|metal door|iron gate|stone wall" ground -1 -1 2
385    if findtype 5373 backpack as picks
386        clearsysmsg 
387        overhead "Which door shall I pick?" 88
388        hotkey "Set Last Target"
389        wft 1000
390        while targetexists 
391            if not findtype "barred metal door|metal door|iron gate|stone wall" ground -1 -1 2
392                break
393            endif
394        endwhile
395        @setvar "bapdoorpick" lasttarget 
396        overhead "Time is of the essence..." 88
397        for 2000
398            if not timerexists doorpicktimer
399                createtimer doorpicktimer
400                settimer doorpicktimer 3150
401            endif
402            if timer doorpicktimer >= 3150
403                dclick picks
404                wft 1000
405                target bapdoorpick
406                overhead "*picking*" 1060 bapdoorpick
407                getlabel backpack ping
408                settimer doorpicktimer 0
409            endif
410            if insysmsg "That is not locked"
411                warmode "off"
412                getlabel backpack ping
413                break
414            endif
415            if insysmsg "Target cannot be seen"
416                warmode "off"
417                getlabel backpack ping
418                break
419            endif
420            if insysmsg "You pick the lock!"
421                overhead "What lay beyond this door..." 87
422                dclick bapdoorpick
423                warmode "off"
424                getlabel backpack ping
425                break
426            endif
427            if not findtype 5373 backpack
428                overhead "Argh, it was my last pick..." 38
429                warmode "off"
430                getlabel backpack ping
431                break
432            endif
433            if not findtype "barred metal door" ground -1 -1 2
434                warmode "off"
435                getlabel backpack ping
436                break
437            endif
438            if not warmode 
439                break
440            endif
441            if insysmsg "You have worn out your tool"
442                overhead "This tool is worn out!" 805
443            endif
444            if not findtype 5373 backpack
445                break
446            endif
447            if timerexists frostshellswitch and timer frostshelltimer > 5000 and not cooldown "Aspect" and hp <= 35
448                say "[AspectArmor Frost"
449                getlabel backpack ping
450                if insysmsg "Your armor is already of that aspect"
451                    //donothing
452                else
453                    cooldown "Aspect" 30000
454                    overhead "--Frost Shell Primed--" 2234
455                endif
456                settimer frostshelltimer 0
457            endif
458            if not cooldown "Move" and not hidden and not cooldown "Hiding" and not cooldown "Stealth" and not cooldown "Stealing" and skill "Hiding" >= 80
459                skill "Hiding"
460                warmode on
461                getlabel backpack ping
462                if hidden
463                    getlabel backpack ping
464                    cooldown "Hiding" 10000
465                endif
466            endif
467            if not cooldown "Move" and findbuff "Invisibility" and not cooldown "Hiding" and not cooldown "Stealth" and not cooldown "Stealing" and skill "Hiding" >= 80
468                skill "Hiding"
469                warmode on
470                getlabel backpack ping
471                if hidden
472                    getlabel backpack ping
473                    cooldown "Hiding" 10000
474                    removetimer ots
475                endif
476            endif
477            if hidden and not cooldown "Hiding" and not cooldown "Stealth" and not timerexists ots and skill "Stealth" >= 80
478                skill "Stealth"
479                getlabel backpack ping
480                if not timerexists ots
481                    createtimer ots
482                endif
483            endif
484            if insysmsg "move quietly"
485                getlabel backpack ping
486                cooldown "Stealth" 10000
487            endif
488            if not cooldown "Move" and hidden and not cooldown "Hiding" and not cooldown "Stealth" and insysmsg "hide first" and skill "Hiding" >= 80
489                pause 1000
490                getlabel backpack ping
491                skill "Hiding"
492                getlabel backpack ping
493                if hidden
494                    getlabel backpack ping
495                    cooldown "Hiding" 10000
496                endif
497                removetimer ots
498            endif
499            if varexist "bwiz" and find "bwiz" backpack and find "bmain" self
500                if not targetexists and not casting and skill "Stealth" >= 80 and hidden and stam = maxstam
501                    while queued
502                        //donothing
503                    endwhile
504                    dclick "bwiz"
505                    while queued
506                        //donothing
507                    endwhile
508                    pause 30
509                    dclick "bmain"
510                    pause 500
511                    getlabel backpack ping
512                endif
513                if not targetexists and not casting and not findlayer self head and find "bmain" self
514                    while queued
515                        //donothing
516                    endwhile
517                    dclick "bmain"
518                    pause 500
519                    getlabel backpack ping
520                endif
521            endif
522            if varexist "bwiz" and find "bmain" self
523                if not targetexists and not casting and not find "bwiz" backpack
524                    while queued
525                        //donothing
526                    endwhile
527                    dclick "bmain"
528                    pause 500
529                    getlabel backpack ping
530                endif
531            endif
532        endfor
533     else 
534         overhead "I am out of lockpicks!" 38
535         warmode "off"
536         getlabel backpack ping
537     endif
538endif
539
540if insysmsg "What should I use these scissors on?" and findtype "sewing kit|saw|pen and ink|tongs|tool kit" backpack as breakdowntool
541    hotkey "Cancel Current Target"
542    if not find "ContainerIDWand" and findtype 20495 backpack as contIDwand
543        @setvar "ContainerIDWand" contIDwand
544    endif
545    if find "ContainerIDWand" backpack
546        clearsysmsg 
547        while queued
548            //donothing
549        endwhile
550        dclick "ContainerIDWand"
551        wft 500
552        overhead "Select Container to ID..." 88
553        while targetexists 
554            //donothing
555        endwhile
556        getlabel backpack ping
557        overhead "Attempting recycle..." 88
558        if insysmsg "No unidentified items found."
559            overhead "Nothing fresh to ID..." 45
560        elseif insysmsg "That is not a container." 
561            overhead "Invalid container, try again.." 45
562        endif
563        if findtype 3834 backpack 0 as bbook
564            @ignore bbook
565        endif
566        while findtype 5056|5059|5060|5061|5063|5070|5074|5075|5076|5078|5085|5089|5090|5101|5103|5105|5106|5129|5131|5132|5135|5138|5139|5142|5143|5144|5146|5201|5203|5204|5205|5207|7169|7170|7173|7175|7177|7179|7181|7610|7947|31003|31004|31005|31006|31007|31008|31009|31010|31011|31012|31015|31191|31017|31019|31021|31023|31025|31027|31029|31031|31033|31035|31037|31038|31041|31043|31045|31047|31049|31051|31053|31055|3834|3740|3742|3762|3763|10245|20006|20008|20010|20012|20014|20016|7026|7027|7029|7031|7033|7034|7035|7107|7109|31002|31130|3920|5042|5117|30990|30993|30994|30995|31184|31186|3719|3938|5121|5123|5125|30989|30992|30996|30997|30998|31176|31188|3568|3713|3721|3932|5040|5044|5112|5127|5177|5179|5181|30991|30999|31000|31001|31014|31178|31180|31182|3909|3911|3913|3915|3917|3934|3937|5046|5049|5115|5119|5182|5185|5187|30988|31128|31190|22187|31141|31142|31169|31172 backpack as IDitem
567            getlabel IDitem desc
568            if "aspect" in desc or "training" in desc or "vanquishing" in desc or "supremely" in desc or "slaying" in desc or "enticement" in desc or "invulnerability" in desc or "power" in desc or "exceedingly accurate force" in desc or "exceedingly potent" in desc or "valorite" in desc or "valehide" in desc or "valewood" in desc or "avarite" in desc or "avarhide" in desc or "avarwood" in desc or "verite" in desc or "verehide" in desc or "verewood" in desc or "agapite" in desc or "rosehide" in desc or "rosewood" in desc or "fortification" in desc
569                @ignore IDitem
570                overhead "*strong magic*" 2091 IDitem
571            elseif "durable" in desc or "substantial" in desc or "massive" in desc or "fortified" in desc or "indestructible" in desc or "exceptional" in desc or "accurate" in desc or "surpassingly" in desc or "eminently" in desc or "exceedingly" in desc or "ruin" in desc or "might" in desc or "force" in desc or "power" in desc or "mastercrafted" in desc or "defense" in desc or "guarding" in desc or "hardening" in desc or "potent" in desc or "melodious" in desc
572                overhead "*trash*" 1779 IDitem
573                while not gumpexists 949095101
574                    while queued
575                        //donothing
576                    endwhile
577                    dclick breakdowntool
578                    waitforgump 949095101 1000
579                endwhile
580                while not ingump "Recycle Single Item" 949095101
581                    gumpresponse 2
582                    waitforgump 949095101 1000
583                endwhile                                
584                gumpresponse 3
585                waitforgump 949095101 1000
586                target IDitem
587                getlabel backpack ping
588                pause 250
589                gumpclose 949095101
590            else
591                @ignore IDitem
592            endif
593            if not find "ContainerIDWand" backpack
594                break
595            endif
596        endwhile
597        if gumpexists 949095101
598            gumpclose 949095101
599        endif
600    else
601        overhead "No Container ID Wand..." 38
602    endif
603    if targetexists 
604        hotkey "Cancel Current Target"
605    endif
606    overhead "Recycle Complete." 88
607endif
608
609if not timerexists lootvacuumswitch
610    if gumpexists 1281623709
611        gumpclose 1281623709
612        createtimer lootvacuumswitch
613        settimer lootvacuumswitch 15000
614        overhead "--Loot Vacuum Enabled--" 2085
615    endif
616endif
617if timerexists lootvacuumswitch
618    if gumpexists 1281623709
619        gumpclose 1281623709
620        removetimer lootvacuumswitch
621        overhead "--Loot Vacuum Disabled--" 1779
622    endif
623endif
624while diffweight <= 0 and findtype "gold coin" backpack as dropgold
625    if not hidden and stam <= 4 and findtype "Red Potion" backpack as redpot
626        while queued
627            //donothing
628        endwhile
629        dclick redpot
630    endif
631    overhead "My cup runneth over..." 1194
632    if findtype 4225 backpack 0 as garbleather
633        drop backpack
634        lift garbleather 59999
635        drop 0
636        while queued
637            //donothing
638        endwhile
639    endif
640    drop backpack
641    lift dropgold 444
642    drop 0
643    while queued
644        //donothing
645    endwhile
646    settimer lootvacuumswitch 0
647endwhile
648if timerexists lootvacuumswitch
649    if timer lootvacuumswitch >= 9000
650        if not timerexists lootsensetimer
651            createtimer lootsensetimer
652            settimer lootsensetimer 1000
653        endif
654        if not findtype 4239|4240 ground -1 -1 2 and timer lootsensetimer >= 1000
655            for 18
656                while findtype 3827 ground 0 as zeroscroll
657                    @ignore zeroscroll
658                endwhile
659                while findtype 7154 ground 0 as zeroingot
660                    @ignore zeroingot
661                endwhile
662                while findtype 4225 ground 0 as zeroleather
663                    @ignore zeroleather
664                endwhile
665                while findtype 7127 ground 0 as zeroboard
666                    @ignore zeroboard
667                endwhile
668                while findtype 7154 ground 2419 as zeroingot
669                    @ignore zeroingot
670                endwhile
671                while findtype 4225 ground 2419 as zeroleather
672                    @ignore zeroleather
673                endwhile
674                while findtype 7127 ground 2419 as zeroboard
675                    @ignore zeroboard
676                endwhile
677                while findtype 7154 ground 2406 as zeroingot
678                    @ignore zeroingot
679                endwhile
680                while findtype 4225 ground 2406 as zeroleather
681                    @ignore zeroleather
682                endwhile
683                while findtype 7127 ground 2406 as zeroboard
684                    @ignore zeroboard
685                endwhile
686                while findtype 7154 ground 2413 as zeroingot
687                    @ignore zeroingot
688                endwhile
689                while findtype 4225 ground 2413 as zeroleather
690                    @ignore zeroleather
691                endwhile
692                while findtype 7127 ground 2413 as zeroboard
693                    @ignore zeroboard
694                endwhile
695                while findtype 7154 ground 2418 as zeroingot
696                    @ignore zeroingot
697                endwhile
698                while findtype 4225 ground 2418 as zeroleather
699                    @ignore zeroleather
700                endwhile
701                while findtype 7127 ground 2418 as zeroboard
702                    @ignore zeroboard
703                endwhile
704                while findtype 7154 ground 2213 as zeroingot  
705                    @ignore zeroingot
706                endwhile
707                while findtype 4225 ground 2213 as zeroleather
708                    @ignore zeroleather
709                endwhile
710                while findtype 7127 ground 2213 as zeroboard
711                    @ignore zeroboard
712                endwhile
713                while findtype 22326 ground 2401 as badseed
714                    @ignore badseed
715                endwhile
716                while findtype 22326 ground 2882 as badseed
717                    @ignore badseed
718                endwhile
719                while findtype 22326 ground 2451 as badseed
720                    @ignore badseed
721                endwhile
722                while findtype 22326 ground 63 as badseed
723                    @ignore badseed
724                endwhile
725                if index > 0 and findtype "54230|44985|glass display|20049|Pig Iron|blackrock fragment|gargish fragment|18705|55247|49482|53694|54570|53696|53876|50612|55420|53280|53473|54831|50278|49528|bottle set|entrail bucket|mounted stalaghorn|sea glass bulb|juggling daggers|st patricks cross|divination orb|mirror display|murder of crows|charmed cobra|prodigy fiddle|wilting rose belljar|scale of balance|screaming mandrake|statue of the siren|the final hour|55204|specimen jars|bird cage|widows grief|54684|27612|49223|54591|54601|54718|19948|58325|19959|19822|49730|49729|19944|19949|47613|47612|47611|47610|47611|3986|3966|cathedral tapestry|Darkscale tapestry|large painting|landscape painting|portrait painting|figurine|statue|20291|44987|49730|47107|18653|45127|20103|47103|29363|47105|29361|43453|5899|47109|45250|41509|43447|18657|4025|51308|45156|51304|45214|28769|28799|28803|28765|45211|45248|51259|45220|51328|45218|3842|51327|45222|45241|51336|11858|51375|45282|54722|45255|45246|28795|44983|45235|45251|45238|51258|51314|28761|45236|51260|54718|18400|58325|45252|18656|47111|3839|45239|45242|45254|45281|45247|42241|45216|28775|51321|3838|51318|5901|5905|45259|5903|48407|51302|4248|27611|15296|43166|5359|5981|4026|3985|25359|17686|3836|17087|5356|29030|24434|22336|29036|3843|29025|51098|29034|8826|51094|576|3827|22326|45315|3891|2539|39898|39896|39892|39918|39911|39916|39897|39905|39891|39917|39912|39909|39889|31047|31017|31049|31019|31055|31051|31053|31025|31027|31031|31041|54717|31021|31011|31023|31029|31043|31003|31035|31033|31045|31037|31002|20006|31169|31006|30999|31012|31009|30996|7109|7107|31128|31188|20014|31014|31004|31142|31001|31000|37181|31010|30998|31172|30988|30997|31038|31141|7947|20008|31005|31191|31008|31007|30994|30993|31182|30989|20012|31186|31178|31015|30991|20010|20016|31184|31190|30990|30995|31176|31180|30992|31130|5207|7031|7026|7034|7033|7027|7035|7029|5078|5063|5059|5105|5060|5138|5129|5201|5142|5143|5076|5106|7610|5139|5090|5103|5132|7177|5061|7181|7179|3920|5042|5127|5117|5185|5125|3938|5177|3937|5044|5121|3915|3909|3568|3932|5123|5144|5119|5056|5135|5187|5074|5089|3934|3913|3917|3721|5075|5046|5049|7170|5146|5205|5203|5115|5204|5040|5179|5070|5182|5085|5181|3719|7173|5131|3911|5101|7175|7169|3713|5112|22187|9917|3859|3862|3878|3865|3856|3873|3877|3834|3742|3762|3740|3763|10245|3572|3573|3571|12686|19985|19981|19984|19982|19983|19991|19989|19986|19987|19988|19994|19995|19992|19993|19990|19980|19977|19976|19978|19979|43423|7154|4225|7127" ground -1 -1 index as lootlocation
726                    overhead "*loot*" 2091 lootlocation
727                    @ignore lootlocation
728                endif
729                if warmode and findtype 4239|4240 ground -1 -1 2
730                    break
731                endif
732            endfor
733            @clearignore 
734            settimer lootsensetimer 0
735        endif
736        while findtype 3827 ground 0 as zeroscroll
737            @ignore zeroscroll
738        endwhile
739        while findtype 7154 ground 0 as zeroingot
740            @ignore zeroingot
741        endwhile
742        while findtype 4225 ground 0 as zeroleather
743            @ignore zeroleather
744        endwhile
745        while findtype 7127 ground 0 as zeroboard
746            @ignore zeroboard
747        endwhile
748        while findtype 7154 ground 2419 as zeroingot
749            @ignore zeroingot
750        endwhile
751        while findtype 4225 ground 2419 as zeroleather
752            @ignore zeroleather
753        endwhile
754        while findtype 7127 ground 2419 as zeroboard
755            @ignore zeroboard
756        endwhile
757        while findtype 7154 ground 2406 as zeroingot
758            @ignore zeroingot
759        endwhile
760        while findtype 4225 ground 2406 as zeroleather
761            @ignore zeroleather
762        endwhile
763        while findtype 7127 ground 2406 as zeroboard
764            @ignore zeroboard
765        endwhile
766        while findtype 7154 ground 2413 as zeroingot
767            @ignore zeroingot
768        endwhile
769        while findtype 4225 ground 2413 as zeroleather
770            @ignore zeroleather
771        endwhile
772        while findtype 7127 ground 2413 as zeroboard
773            @ignore zeroboard
774        endwhile
775        while findtype 7154 ground 2418 as zeroingot
776            @ignore zeroingot
777        endwhile
778        while findtype 4225 ground 2418 as zeroleather
779            @ignore zeroleather
780        endwhile
781        while findtype 7127 ground 2418 as zeroboard
782            @ignore zeroboard
783        endwhile
784        while findtype 7154 ground 2213 as zeroingot  
785            @ignore zeroingot
786        endwhile
787        while findtype 4225 ground 2213 as zeroleather
788            @ignore zeroleather
789        endwhile
790        while findtype 7127 ground 2213 as zeroboard
791            @ignore zeroboard
792        endwhile
793        while findtype 22326 ground 2401 as badseed
794            @ignore badseed
795        endwhile
796        while findtype 22326 ground 2882 as badseed
797            @ignore badseed
798        endwhile
799        while findtype 22326 ground 2451 as badseed
800            @ignore badseed
801        endwhile
802        while findtype 22326 ground 63 as badseed
803            @ignore badseed
804        endwhile
805        while not casting and not targetexists and findtype "54230|44985|glass display|20049|Pig Iron|blackrock fragment|gargish fragment|18705|55247|49482|53694|54570|53696|53876|50612|55420|53280|53473|54831|50278|49528|bottle set|entrail bucket|mounted stalaghorn|sea glass bulb|juggling daggers|st patricks cross|divination orb|mirror display|murder of crows|charmed cobra|prodigy fiddle|wilting rose belljar|scale of balance|screaming mandrake|statue of the siren|the final hour|55204|specimen jars|bird cage|widows grief|54684|27612|49223|54591|54601|54718|19948|58325|19959|19822|49730|49729|19944|19949|47613|47612|47611|47610|47611|3986|3966|cathedral tapestry|Darkscale tapestry|large painting|landscape painting|portrait painting|figurine|statue|20291|44987|49730|47107|18653|45127|20103|47103|29363|47105|29361|43453|5899|47109|45250|41509|43447|18657|4025|51308|45156|51304|45214|28769|28799|28803|28765|45211|45248|51259|45220|51328|45218|3842|51327|45222|45241|51336|11858|51375|45282|54722|45255|45246|28795|44983|45235|45251|45238|51258|51314|28761|45236|51260|54718|18400|58325|45252|18656|47111|3839|45239|45242|45254|45281|45247|42241|45216|28775|51321|3838|51318|5901|5905|45259|5903|48407|51302|4248|27611|15296|43166|5359|5981|4026|3985|25359|17686|3836|17087|5356|29030|24434|22336|29036|3843|29025|51098|29034|8826|51094|576|3827|22326|45315|3891|2539|39898|39896|39892|39918|39911|39916|39897|39905|39891|39917|39912|39909|39889|31047|31017|31049|31019|31055|31051|31053|31025|31027|31031|31041|54717|31021|31011|31023|31029|31043|31003|31035|31033|31045|31037|31002|20006|31169|31006|30999|31012|31009|30996|7109|7107|31128|31188|20014|31014|31004|31142|31001|31000|37181|31010|30998|31172|30988|30997|31038|31141|7947|20008|31005|31191|31008|31007|30994|30993|31182|30989|20012|31186|31178|31015|30991|20010|20016|31184|31190|30990|30995|31176|31180|30992|31130|5207|7031|7026|7034|7033|7027|7035|7029|5078|5063|5059|5105|5060|5138|5129|5201|5142|5143|5076|5106|7610|5139|5090|5103|5132|7177|5061|7181|7179|3920|5042|5127|5117|5185|5125|3938|5177|3937|5044|5121|3915|3909|3568|3932|5123|5144|5119|5056|5135|5187|5074|5089|3934|3913|3917|3721|5075|5046|5049|7170|5146|5205|5203|5115|5204|5040|5179|5070|5182|5085|5181|3719|7173|5131|3911|5101|7175|7169|3713|5112|22187|9917|3859|3862|3878|3865|3856|3873|3877|3834|3742|3762|3740|3763|10245|3572|3573|3571|12686|19985|19981|19984|19982|19983|19991|19989|19986|19987|19988|19994|19995|19992|19993|19990|19980|19977|19976|19978|19979|43423|7154|4225|7127" ground -1 -1 2 as eatloot
806            hotkey 'Grab Item' 
807            target eatloot
808            if insysmsg "Invalid or inaccessible item."
809                @ignore eatloot
810            endif            
811            while queued
812                //donothing
813            endwhile 
814        endwhile
815    endif
816endif
817
818if findtype 5912 self and not varexist "bwiz" and findlayer self head as regularhat
819    getlabel regularhat desc
820    if "magical" in desc
821        dclick regularhat
822        pause 500
823        getlabel backpack ping
824        replay
825    endif
826endif
827if not find "bwiz" self and findtype 5912 backpack as wizhat
828    getlabel wizhat desc
829    if "restyled" in desc
830        @ignore wizhat
831        replay
832    elseif "armored" in desc
833        @setvar "bwiz" wizhat
834    elseif "magical" in desc
835        @setvar "bwiz" wizhat
836        @setvar "nonaspectedwiz" wizhat
837    endif
838endif
839if varexist "bwiz" and find "bwiz" backpack
840    if not find "bmain" self and findlayer self head as hat
841        @setvar "bmain" hat
842    endif
843    if not varexist "bmain"
844        overhead "I need a primary hat or helm to wear.." 88
845        pause 2000
846        overhead "Anything will do, just not a magical wizard hat..." 88
847        stop
848    endif
849endif
850
851if varexist "bwiz" and find "bwiz" backpack and find "bmain" self
852    if not targetexists and not casting and skill "Stealth" >= 80 and hidden and stam = maxstam
853        while queued
854            //donothing
855        endwhile
856        dclick "bwiz"
857        while queued
858            //donothing
859        endwhile
860        pause 30
861        dclick "bmain"
862        pause 500
863        getlabel backpack ping
864    endif
865    if not targetexists and not casting and not findlayer self head and find "bmain" self
866        while queued
867            //donothing
868        endwhile
869        dclick "bmain"
870        pause 500
871        getlabel backpack ping
872    endif
873endif
874if varexist "bwiz" and find "bmain" self
875    if not targetexists and not casting and not find "bwiz" backpack
876        while queued
877            //donothing
878        endwhile
879        dclick "bmain"
880        pause 500
881        getlabel backpack ping
882    endif
883endif
884loop