Back to "b" tags

Potion Buffs: Handle all weapon types by Jaseowns

1# Potion Buffs: Handle all weapon types by Jaseowns
2# UO Outlands
3# https://youtube.com/jaseowns/live
4# This handles: Alchemy, all two handed, one handed and shield builds
5# This only drinks buff potions if you need them
6# There will be another script for healing, cures and red pots.
7
8// Check buff controllers
9@setvar! checkStr 1
10@setvar! checkDex 1
11@setvar! checkMagic 1
12
13@setvar! needStrBuff 0
14@setvar! needDexBuff 0
15@setvar! needMagicBuff 0
16
17if checkStr = 1 and not findbuff "Strength"
18    @setvar! needStrBuff 1
19endif
20
21if checkDex = 1 and not findbuff "Agility"
22    @setvar! needDexBuff 1 
23endif
24
25if checkMagic = 1 and not findbuff "Magic Resist Potion"
26    @setvar! needMagicBuff 1 
27endif
28
29
30if needStrBuff = 1 and not findtype "White Potion" backpack
31    overhead "No white potions!" 34
32    @setvar! needStrBuff 0
33endif
34
35if needDexBuff = 1 and not findtype "Blue Potion" backpack
36    overhead "No blue agi potions!" 34
37    @setvar! needDexBuff 0
38endif
39
40if needMagicBuff = 1 and not findtype "Black Potion" backpack
41    @setvar! needMagicBuff 0
42endif
43
44@setvar! jaseCanDrinkPotion 0
45
46if needStrBuff = 1 or needDexBuff = 1 or needMagicBuff = 1
47
48    // katana and battleaxe are hardcoded
49    @setvar! minimumWaitForPing 200
50
51    @setvar! jaseRightHand 0
52    @setvar! jaseLeftHand 0
53    @setvar! needTwoHandSwap 0
54    @setvar! needShieldSwap 0
55
56    if skill "Alchemy" >= 80
57        @setvar! jaseCanDrinkPotion 1
58    else
59        if not findlayer self lefthand and not findlayer self righthand
60            @setvar! jaseCanDrinkPotion 1
61        else
62            if findlayer self lefthand as myLefthand
63                @setvar! jaseLeftHand myLefthand
64            endif
65            if findlayer self righthand as myRightHand
66                @setvar! jaseRightHand myRightHand
67            endif 
68            if not lhandempty 
69                if not rhandempty 
70                    @setvar! jaseCanDrinkPotion 0
71                else
72                    // handle two handed weapons
73                    getlabel jaseLeftHand desc
74                    if skill "Swordsmanship" > 0
75                       if "axe" in desc or "bardiche" in desc or "halberd" in desc
76                            @setvar! jaseCanDrinkPotion 0
77                            @setvar! needTwoHandSwap 1
78                        else   
79                            @setvar! jaseCanDrinkPotion 1
80                        endif
81                    elseif skill "Mace Fighting" > 0
82                        if "staff" in desc or "crook" in desc or "war hammer" in desc
83                            @setvar! jaseCanDrinkPotion 0
84                            @setvar! needTwoHandSwap 1
85                        else   
86                            @setvar! jaseCanDrinkPotion 1
87                        endif
88                    elseif skill "Fencing" > 0
89                        if "spear" in desc or "pitchfork" in desc
90                            @setvar! jaseCanDrinkPotion 0
91                            @setvar! needTwoHandSwap 1
92                        else   
93                            @setvar! jaseCanDrinkPotion 1
94                        endif
95                    elseif skill "Archery" > 0
96                        if "bow" in desc or "heavy crossbow" in desc
97                            @setvar! jaseCanDrinkPotion 0
98                            @setvar! needTwoHandSwap 1
99                        else   
100                            @setvar! jaseCanDrinkPotion 1
101                        endif
102                    elseif skill "Wrestling" > 0
103                        @setvar! jaseCanDrinkPotion 1
104                    endif  
105                endif
106            endif
107            if not rhandempty 
108                if lhandempty 
109                    @setvar! jaseCanDrinkPotion 1
110                else
111                    @setvar! needShieldSwap 1
112                endif
113            endif
114        endif
115    endif
116
117    if jaseCanDrinkPotion = 1
118        // do nothing
119    else
120        if needTwoHandSwap = 1
121            if skill "Swordsmanship" > 0 and findtype "cutlass|broadsword|scimitar|viking sword|longsword|katana" backpack as item
122                dclick item
123                wait minimumWaitForPing
124            elseif skill "Mace Fighting" > 0 and findtype "maul|war axe|war mace|mace|hammer pick|club" backpack as item
125                dclick item
126                wait minimumWaitForPing
127            elseif skill "Fencing" > 0 and findtype "kryss|war fork|dagger" backpack as item
128                dclick item
129                wait minimumWaitForPing
130            elseif skill "Archery" > 0 and findtype "crossbow" backpack as item
131                dclick item
132                wait minimumWaitForPing
133            else
134                hotkey 'Arm/Disarm Left Hand'    
135                wait minimumWaitForPing
136            endif
137            @setvar! jaseCanDrinkPotion 1
138        elseif needShieldSwap = 1
139            hotkey 'Arm/Disarm Left Hand'
140            @setvar! jaseCanDrinkPotion 1
141            wait minimumWaitForPing
142        endif
143    endif
144
145    if jaseCanDrinkPotion = 1
146        if needStrBuff = 1
147            if findtype "White Potion" backpack as jotion
148                overhead "chug"
149                dclick jotion
150                wait minimumWaitForPing
151            else
152                overhead "No STR potion found!" 34
153            endif
154        endif
155        
156        if needDexBuff = 1
157            if findtype "Blue Potion" backpack as jotion
158                overhead "chug"
159                dclick jotion
160                wait minimumWaitForPing
161            else
162                overhead "No AGI potion found!" 34
163            endif
164        endif
165        
166        if needMagicBuff = 1
167            if findtype "Black Potion" backpack as jotion
168                overhead "chug"
169                dclick jotion
170                wait minimumWaitForPing
171            else
172                overhead "No MR potion found!" 34
173            endif
174        endif
175
176        if needTwoHandSwap = 1
177            dclick jaseLeftHand
178            wait minimumWaitForPing
179        elseif needShieldSwap = 1
180            hotkey 'Arm/Disarm Left Hand'
181        endif
182    endif
183endif
184
185
186
187
188
189