Back to "parry" tags

Sword and Shield Dexxer Healing Loop (removes shield to drink pots) by Jaseowns

1# Sword and shield healing loop, unequips shield to drink pot by Jaseowns
2# UO Outlands
3# Requirements:
4#   use a one handed weapon and shield when running this script
5# Description:
6#   Heals with bandaids and tries to drink 
7#   cures or heals (handles unequipping shield)
8
9// Heal pot when below this health ex: (hp < heal_pot_hp_trigger)
10@setvar! heal_pot_hp_trigger 31
11
12// Drink red pots when drink_red is 1
13@setvar! drink_red 1
14// when below stam ex: (diffstam < red_pot_stamdiff_trigger)
15@setvar! red_pot_stamdiff_trigger 20
16
17// General wait after actions
18@setvar! globalTimeout 650
19
20
21
22##########################################################
23#
24# You do not need to edit anything below this.... 
25# unless you are a wild beast - youtube.com/jaseowns
26#
27##########################################################
28
29@setvar! weapon_equipped 0
30@setvar! sheild_equipped 0
31
32if findlayer self righthand as found
33    @setvar! weapon_equipped found
34endif  
35
36if findlayer self lefthand as found
37    @setvar! sheild_equipped found
38endif  
39
40
41if not timerexists '_refreshTimer'
42    createtimer '_refreshTimer'
43    settimer '_refreshTimer' 999999
44endif
45
46while not dead
47
48    if hidden
49        continue
50    endif
51
52    if findtype "clean bandage%s%" backpack
53        if bandaging = 0 
54            if hp != maxhp
55                if targetexists any
56                    target cancel
57                endif
58                hotkey 'Bandage self' 
59                wait globalTimeout
60            endif
61        endif
62    endif
63
64    if insysmsg 'You cannot move!' or paralyzed
65        overhead 'Paralyzed!' 38
66        if findtype "pouch" backpack 38
67            say '[pouch'
68            wait globalTimeout
69        endif
70    endif
71
72    if poisoned
73        if findtype "Orange Potion" backpack as pot
74            if hits < 90
75                if not rhandempty and not lhandempty
76                    overhead "Remove shield..."
77                    if findlayer self lefthand as found
78                        @setvar! sheild_equipped found
79                        lift sheild_equipped
80                        drop backpack
81                        wait globalTimeout
82                    endif  
83                endif
84    
85                dclick pot
86                wait globalTimeout
87            endif
88        else
89            overhead "Out of cure pots!" 34
90            if lhandempty and hp > heal_pot_hp_trigger
91                overhead "Requip shield..." 0
92                if sheild_equipped != 0
93                    dclick sheild_equipped
94                else
95                    overhead "Unable to find your shield, re-equip manually!" 34
96                endif
97            endif
98            wait globalTimeout
99        endif
100    elseif lhandempty and hp > heal_pot_hp_trigger
101        overhead "Requip shield..." 0
102        if sheild_equipped != 0
103            dclick sheild_equipped
104        else
105            overhead "Unable to find your shield, re-equip manually!" 34
106        endif
107        wait globalTimeout
108    endif
109
110    // If Dex is at least 76.
111    // If stamina is 75 or less, drink a Refesh potion.
112    // Set the refresh timer lower or higher, to adjust.
113    if drink_red = 1 and timer '_refreshTimer' >= 300 and findtype 'Red Potion' backpack as pot
114        if diffstam > red_pot_stamdiff_trigger
115                if not rhandempty and not lhandempty
116                    overhead "Remove shield..."
117                    if findlayer self lefthand as found
118                        @setvar! sheild_equipped found
119                        lift sheild_equipped
120                        drop backpack
121                        wait globalTimeout
122                    endif  
123                endif
124            
125                dclick pot
126                settimer '_refreshTimer' 0
127                overhead 'Total Refreshed.' 69
128                wait globalTimeout
129            endif
130        endif
131    endif
132
133    if hp < heal_pot_hp_trigger
134        if findtype 3852 backpack as PotsHeal 
135            getlabel PotsHeal LabelPotsHeal
136            if 'next usable' in LabelPotsHeal
137                sysmsg 'Unable to use Heal Potion Yet!' 33   
138                wait globalTimeout       
139                wait globalTimeout
140            else
141                overhead 'Drinking heal!' 68
142                if not rhandempty and not lhandempty
143                    overhead "Remove shield..."
144                    if findlayer self lefthand as found
145                        @setvar! sheild_equipped found
146                        lift sheild_equipped
147                        drop backpack
148                    endif  
149                endif
150                dclick PotsHeal
151                wait globalTimeout
152            endif
153        endif 
154    endif
155
156endwhile