Back to "trap" tags

Modified Ultimate Dungeon Chest Crawler V0.7 by DaKlue

Description: #Added some features to Jaseowns script.

#Now uses band-aids while not hidden, Will use pots when not hidden. Took out casting invisibility. It seems to be getting me into more trouble than its helping. Still testing.

1#Modified Ultimate Dungeon Chest Crawler by DaKlue
2#Added some features to Jaseowns script. 
3#Now uses band-aids while not hidden, Will use pots when not hidden, Will cast Invisibility If skill magery is greater than or equal to 80 when not hidden and hiding is still on cool down. 
4#Original script by 
5# Ultimate Dungeon Chest Crawler by Jaseowns
6# UO Outlands
7# WIP - livestream https://youtu.be/hrIUbaB0SDk
8// Go to dungeon and find a chest
9// see if it loot
10// see if it needs be opened
11// move next
12// handle hiding and healing
13
14///ADJUSTABLE VARIABLES///
15@setvar! automaticallyCastIvis 0
16@setvar! automaticallyHealSelf 1
17@setvar! globalTimeout 650
18///ADJUSTABLE VARIABLES///
19
20if not varexist isStealthing
21    @setvar! isStealthing 0
22endif
23
24if not varexist chestWeWannaWork
25    @setvar! chestWeWannaWork 0
26endif
27
28if not timerexists chestOpenTimer
29    createtimer chestOpenTimer
30    settimer chestOpenTimer 3500
31endif
32
33if not timerexists secondsTimer
34    createtimer secondsTimer
35    settimer secondsTimer 3500
36endif
37
38
39if not timerexists useSkillTimer
40    createtimer useSkillTimer
41    settimer useSkillTimer 11000
42endif
43
44if not timerexists messageHelperTimer
45    createtimer messageHelperTimer
46    settimer messageHelperTimer 11000
47endif
48
49if insysmsg 'world is saving'
50    for 60
51        overhead 'Waiting for world save...'
52        wait 100
53        if insysmsg 'save complete'
54            overhead 'Save complete - continue on!' 88
55            break
56        endif
57    endfor
58endif
59
60if dead 
61    overhead "RIP" 34
62    wait 5000
63    loop
64endif
65
66if automaticallyHealSelf = 1 and hp < 50 and not hidden or findbuff "Invisibility"
67    //Healing with aids
68    if hp < maxhp and not bandaging
69        hotkey 'Bandage Self'
70    endif
71
72    // Trapped
73    if paralyzed 
74        if findtype "pouch" backpack 38 
75            yell "[pouch"
76            wait globalTimeout
77        else
78            overhead "Out of Pouches!" 34
79        endif
80    endif
81
82    // Drink Cure pot
83    if poisoned 
84        if findtype "Orange Potion" backpack as jPot
85            dclick jPot
86            wait globalTimeout
87        else
88            overhead "Out of cure pots" 34
89        endif
90    endif
91
92    // Drink Red pot
93    if diffstam >= 5
94        overhead "drink a red pot"
95        if findtype "Red Potion" backpack as jPot
96            dclick jPot
97            wait globalTimeout
98        else
99            overhead "Out of refresh pots" 34
100        endif
101    endif
102
103    // Drink Str pot
104    if str < 100
105        if not findbuff "Strength"
106            if findtype "White Potion" backpack as jPot
107                dclick jPot
108                wait globalTimeout
109            else
110                overhead "Out of str pots" 34
111            endif
112        endif
113    endif
114
115    // Max Weight
116    if weight > maxweight or findbuff "Strength"
117        if findtype "gold coin" backpack as item
118            lift item 2000
119            droprelloc 0 0
120            wait 200
121            if insysmsg "cannot drop anything"
122                drop backpack -1 -1 -1
123            endif
124            wait globalTimeout
125            replay
126        else
127            overhead "We are overweight and cannot drop anything" 34
128        endif
129    endif
130
131    // Heal Pot
132    if hp < 50
133        if findtype "Yellow Potion" backpack as jPot
134            dclick jPot
135            wait globalTimeout
136        else
137            overhead "Out of heals pots" 34
138        endif
139    endif
140        
141    if diffhits >= 60 and mana >= 12
142        while not targetexists
143            if diffhits >= 60
144                cast 'Heal'             
145            endif
146            wait 50
147            if hp = maxhp
148                hotkey '> Interrupt'
149                break
150            endif
151        endwhile
152        if targetexists
153            target self
154        endif
155    elseif diffhits >= 15 and mana >= 12
156        while not targetexists
157            cast 'Heal'
158            wait 50
159            if hp = maxhp
160                hotkey '> Interrupt'
161                break
162            endif
163        endwhile
164        if targetexists
165            target self
166        endif
167    endif
168        
169    if poisoned
170        while not targetexists
171            cast 'Cure'
172            wait 50
173            
174            if not poisoned
175                hotkey '> Interrupt'
176                break
177            endif
178        endwhile
179        if targetexists
180            target self
181        endif
182    endif
183endif
184
185if not hidden or findbuff "Invisibility"
186    if hp < maxhp and not bandaging
187        hotkey 'Bandage Self'
188    endif
189    @setvar! isStealthing 0
190    useskill 'hiding'
191    wait 200
192    if hidden
193        overhead "Successfully hidden" 88
194        settimer useSkillTimer 0
195    endif
196endif 
197
198if automaticallyCastIvis = 1
199    if not hidden or findbuff "Invisibility"
200    @setvar! isStealthing 0
201    useskill 'hiding'
202    wait 200
203        if hidden
204            overhead "Successfully hidden" 88
205            settimer useSkillTimer 0
206        elseif not hidden or findbuff "Invisibility"
207            if skill "Magery" >= 80
208                overhead "Casting Invisability" 34
209                cast 'Invisibility'
210                wait 500
211                if targetexists
212                    target self
213                    @setvar! isStealthing 0
214                    wait 200
215                    if findbuff "Invisibility" or hidden
216                        overhead "Successfully used Invisability" 34
217                        settimer useSkillTimer 0
218                    endif
219                endif
220            endif
221        endif
222    endif
223endif
224        
225if timer messageHelperTimer >= 5000
226    if findtype 3651|3649|3648|3650|3708|2475 ground -1 -1 16 as chest
227    //gumpclose 736038070
228        getlabel chest desc
229        if "lock" in desc
230            overhead "desc" 88
231            settimer messageHelperTimer 0
232        endif
233    endif
234endif
235
236if timer useSkillTimer >= 11000 and isStealthing = 0
237    @setvar! chestWeWannaWork 0
238    overhead "Using Stealth"
239    useskill 'Stealth'
240    wait 200
241    if insysmsg "You begin to move quietly"
242        @setvar! isStealthing 1
243        settimer useSkillTimer 0
244    elseif insysmsg "You must wait a few moments to use another skill"
245        overhead "Please wait.." 34
246    elseif not hidden or insysmsg "You must hide first"
247        if timer useSkillTimer >= 11000
248            overhead "Need to hide first..."
249            useskill 'hiding'
250            wait 200
251            if hidden
252                settimer useSkillTimer 0
253            endif
254        endif
255    endif
256    elseif findtype 3651|3649|3648|3650|3708|2475 ground -1 -1 2 as chest
257
258    if chestWeWannaWork = chest
259        // do nothing
260    else
261        dclick chest
262        wait 200
263        @setvar! chestWeWannaWork chest
264    endif
265
266    if gumpexists 736038070
267        sysmsg "Working chest..." 88
268        if timer chestOpenTimer >= 3500
269            if ingump "Cleared of Traps" 736038070
270                if findtype "lockpicks" backpack as picky
271                    gumpresponse 4 736038070
272                    //dclick picky 
273                    //wft 500
274                    //target chest
275                else 
276                    overhead "No lockpicks left!" 34
277                endif
278            else
279                if findtype "drill" backpack as drilly
280                    gumpresponse 7 736038070
281                    wait 200
282                    if insysmsg "You do not have any trap tools of that material on hand."
283                        gumpresponse 5 736038070
284                    endif
285                else 
286                    overhead "No trap tools left!" 34
287                endif
288            endif
289            settimer chestOpenTimer 0
290        endif
291        wait 200
292    else
293        
294        // Gold
295        while find chest ground -1 -1 2 and findtype 24434|43206|29363|43166|22336|29348|17087|3985|8826|3827|29030|3836|5981|4248|5359|3839|3838|3843|2597|29036|48407|3834|3865|3859|3885|3856|3878|3877|3873|3861|3862|576|5123|7177|7027|3920|5131|5179|5075|3980|5060|5076|5042|10245|3938|3913|7169|3909|5063|5089|3981|7170|7033|3976|3762|5040|5103|5117|7181|7029|3568|6264|3742|5139|6263|7026|5125|3740|5121|3973|3974|5204|5105|5185|5078|5115|7175|5059|7034|3713|3915|5112|5070|5049|5119|5205|5046|3962|3934|7035|3911|7179|5106|5143|3573|3719|5177|7610|5181|3917|5132|3963|7031|5207|5056|5085|3763|5129|5187|3721|3972|5138|3570|5101|5061|5074|5142|5182|5146|6265|5090|5203|5044|5144|3932|5201|5127|3572|7173|5135|3937|3571|22326|27611|9917|3821|5356|8455|5362|45315|8454|22187|5901|7163|3617|3903|12686 chest as item
296            getlabel item lootDesc
297            overhead lootDesc
298            wait 50
299            hotkey 'Grab Item'
300            target item
301            while queued
302                wait 50
303            endwhile
304        endwhile
305        
306        // Scrolls
307        //while find chest ground -1 -1 2 and findtype 7981|7982|7983|7984|7985|7986|7987|7988|7989|7990|7991|7992|7993|7994|7995|7996|7997|7998|7999|8000|8001|8002|8003|8004|8005|8006|8007|8008|8009|8010|8011|8012|8013|8014|8015|8016|8017|8018|8019|8020|8021|8022|8023|8024|8025|8026|8027|8028|8029|8030|8031|8032|8033|8034|8035|8036|8037|8038|8039|8040|8041|8042|8033|8044 chest as item
308        //getlabel item lootDesc
309        //overhead lootDesc
310        //wait 50
311        //hotkey 'Grab Item'
312        //target item
313        //while queued
314        //wait 50
315        //endwhile
316        //endwhile
317       
318        // Satchel
319        if findtype "reagent satchel" self as satchel
320            menu satchel 0
321            wait 200
322        endif
323        
324        // quiver
325        if findtype 12215 self as satchel
326            menu satchel 0
327            wait 200
328        endif
329    endif
330elseif timer useSkillTimer < 11500
331    if not hidden
332        @setvar! isStealthing 0
333    endif
334    
335    // overhead "{{useSkillTimer}}"
336    
337    // we need to wait
338    if timer useSkillTimer >= 10000 and timer secondsTimer >= 1000
339        overhead "1 second remaining" 0
340        settimer secondsTimer 0
341    elseif timer useSkillTimer >= 9000 and timer secondsTimer >= 1000
342        overhead "2 seconds remaining" 0
343        settimer secondsTimer 0
344    elseif timer useSkillTimer >= 8000 and timer secondsTimer >= 1000
345        overhead "3 seconds remaining" 0
346        settimer secondsTimer 0
347    elseif timer useSkillTimer >= 7000 and timer secondsTimer >= 1000
348        overhead "4 seconds remaining" 0
349        settimer secondsTimer 0
350    elseif timer useSkillTimer >= 6000 and timer secondsTimer >= 1000
351        overhead "5 seconds remaining" 0
352        settimer secondsTimer 0
353    elseif timer useSkillTimer >= 5000 and timer secondsTimer >= 1000
354        overhead "6 seconds remaining" 0 
355        settimer secondsTimer 0
356    elseif timer useSkillTimer >= 4000 and timer secondsTimer >= 1000
357        overhead "7 seconds remaining" 0
358        settimer secondsTimer 0
359    elseif timer useSkillTimer >= 3000 and timer secondsTimer >= 1000
360        overhead "8 seconds remaining" 0
361        settimer secondsTimer 0
362    elseif timer useSkillTimer >= 2000 and timer secondsTimer >= 1000
363        overhead "9 seconds remaining" 0
364        settimer secondsTimer 0
365    elseif timer useSkillTimer >= 1000 and timer secondsTimer >= 1000
366        overhead "10 seconds remaining" 0
367        settimer secondsTimer 0
368    endif
369else
370    if insysmsg! "You have 1 stealth steps remaining"
371        overhead "JBot: Using Stealth" 1
372        useskill 'Stealth'
373        if insysmsg "You begin to move quietly"
374            @setvar! isStealthing 1
375            settimer useSkillTimer 0
376            clearsysmsg 
377        elseif insysmsg "You must wait a few moments to use another skill"
378            overhead "Please wait.." 34
379            // replay
380        elseif not hidden or insysmsg "You must hide first"
381            @setvar! isStealthing 0
382            if timer useSkillTimer >= 11000
383                useskill 'hiding'
384                wait 200
385                if hidden
386                    clearsysmsg 
387                    settimer useSkillTimer 0
388                endif
389            endif
390        endif
391    endif
392    
393endif
394
395
396wait 200
397loop