Back to "pot" tags

Small potion example by Jaseowns

1# Small potion example by Jaseowns
2# UO Outlands
3# Stream question
4if poisoned
5    if findtype "Orange Potion" backpack as pot 
6        dclick pot
7        wait 200
8    endif
9endif
10
11if hp < maxhp
12    if findtype "Yellow Potion" backpack as pot 
13        getlabel pot desc
14        if "next usable" in desc
15            // do nothing
16        else
17            dclick pot
18            wait 200
19        endif
20    endif
21endif
22
23
24// what we want to do... drink a regular potion if less then 10 stam missing
25// else drink full refresh pot.
26// need to split out regular pot with total refresh using get label
27
28
29@setvar! regularRefreshPots 0
30@setvar! totalRefreshPots 0
31
32@clearignore 
33while findtype "Red Potion" backpack as pot 
34    getlabel pot desc
35    overhead desc 88
36    if "Total Refresh potion" in desc
37        @setvar! totalRefreshPots pot
38    else
39        @setvar! regularRefreshPots pot
40    endif
41    @ignore pot
42endwhile
43@clearignore 
44
45
46if stam < maxstam
47    if diffstam > 5
48        if totalRefreshPots = 0
49            overhead "Drinking a regular refresh" 88
50            while stam < maxstam and find regularRefreshPots backpack
51                dclick regularRefreshPots    
52            endwhile
53        else
54            overhead "Drinking a total refresh" 88
55            if find totalRefreshPots backpack
56                dclick totalRefreshPots
57            endif
58        endif
59    else
60        if regularRefreshPots = 0
61            overhead "Drinking a total refresh" 88
62            if find totalRefreshPots backpack
63                dclick totalRefreshPots
64            endif
65        else
66            overhead "Drinking a regular refresh" 88
67            while stam < maxstam and find regularRefreshPots backpack
68                dclick regularRefreshPots    
69            endwhile
70        endif 
71    endif
72endif
73
74overhead totalRefreshPots
75
76
77// 3851
78if stam < maxstam
79    if findtype "Red Potion" backpack as pot 
80        dclick pot
81        wait 200
82    endif
83endif