Back to "b" tags

Mugger Bot (1) by Jaseowns

1# Mugger Bot by Jaseowns
2# UO Outlands
3# WIP
4// find a target 
5 // in game, client macro to attack nearest
6 // in razor
7
8// need to be in range to mug/backstab
9// but need to be hidden
10// and stealthed
11
12// attack with 2hander, then 2 swings with 1hander
13// re-hide
14  // ^ smoke bomb
15  // ^ shadow aspect proc
16  // ^ los/ hiding out of range
17clearsysmsg 
18@setvar! stealthIsOn 0
19@setvar! fightingSomething 0
20@setvar! myKillTarget 0
21@setvar! helperTextCooldown 2000
22@setvar! helperHideCooldown 2500
23@setvar! automaticallySkinCorpses 1
24
25@setvar! jaseowns_HitPointCheckForHealthPot 70
26@setvar! cdSkinningCheck 3000
27@setvar! minimumWaitForPing 200
28
29if not timerexists helperTextTimer
30    settimer helperTextTimer helperTextCooldown
31endif
32
33if not timerexists helperHideTimer
34    settimer helperHideTimer helperHideCooldown
35endif
36
37if not timerexists skinningCheckTimer
38    settimer skinningCheckTimer cdSkinningCheck
39endif
40
41
42while not dead
43    
44    while not hidden
45
46        if hp <= jaseowns_HitPointCheckForHealthPot
47            if not lhandempty
48                cast "magic lock"
49                getlabel backpack jaseowns_PingCheck
50            endif
51            hotkey "Drink Heal"
52            getlabel backpack jaseowns_PingCheck 
53        endif
54
55
56            
57        if automaticallySkinCorpses = 1 and findtype "corpse" ground -1 -1 2 as jorpse
58            if findtype "Elven Spellblade" backpack and timer skinningCheckTimer >= cdSkinningCheck 
59                while not targetexists 
60                    useskill 'forensicevaluation'
61                endwhile
62                if targetexists 
63                    hotkey "Target Self"
64                    wait minimumWaitForPing
65                    settimer skinningCheckTimer 0
66                    settimer helperHideTimer 0
67                    @ignore jorpse
68                endif
69            endif
70        endif
71    
72        @setvar! stealthIsOn 0
73        if not cooldown "skill"
74            if timer helperHideTimer >= helperHideCooldown
75                if not cooldown "Moving" and not queued
76                    useskill "Hiding"
77                endif
78            endif
79            
80            if find myKillTarget ground -1 -1 10
81                if find myKillTarget ground -1 -1 1
82                    overhead "1 tiles away"
83                elseif find myKillTarget ground -1 -1 2
84                    overhead "2 tiles away"
85                elseif find myKillTarget ground -1 -1 3
86                    overhead "3 tiles away"
87                elseif find myKillTarget ground -1 -1 4
88                    overhead "4 tiles away"
89                elseif find myKillTarget ground -1 -1 5
90                    overhead "5 tiles away"
91                elseif find myKillTarget ground -1 -1 6
92                    overhead "6 tiles away"
93                elseif find myKillTarget ground -1 -1 7
94                    overhead "7 tiles away"
95                elseif find myKillTarget ground -1 -1 8
96                    overhead "8 tiles away"
97                elseif find myKillTarget ground -1 -1 9
98                    overhead "9 tiles away"
99                else
100                    overhead "10 tiles away"
101                endif
102            else
103                hotkey "Target Closest Grey Monster"
104                wait 200
105                if insysmsg "no one matching"
106                    // do nothing
107                else
108                    @setvar! myKillTarget lasttarget 
109                endif
110            endif
111            // check target range
112            // (we dont know the target tho)
113            // however, we can use target nearest creature
114            // ^ that should match our in game target
115            
116            // assuming we got a target from that, check its range
117            // if its within x tiles, assume we are fighting it
118            
119            /// maybe use a timer to know when we pop out of hiding
120            // use that timer to know for sure we are fighting
121            // then re-hide and start all over
122            
123            // we need to be fighting or running
124            // check our current weapons
125            wait 200
126            if not hidden
127                // we cannot hide (we need to move or we are fighting)
128
129    
130            endif
131        endif
132        // we could be fighting or just popped out of stealth
133    endwhile
134    
135    
136
137    if insysmsg "You begin to move quietly."
138        @setvar! stealthIsOn 1
139    endif
140    
141    if stealthIsOn = 1
142        if timer helperTextTimer > helperTextCooldown
143            sysmsg "scanning for target" 77
144            settimer helperTextTimer 0
145        endif
146        
147        if findtype "halberd" backpack 1790 as item
148            dclick item
149            wait 200
150        endif
151        
152        hotkey "Target Closest Grey Monster"
153        wait 200
154        if insysmsg "no one matching"
155            // do nothing
156        
157            if not cooldown "skill"
158                useskill "Stealth"
159            endif
160        else
161                
162            @setvar! myKillTarget lasttarget 
163            
164            if find myKillTarget ground -1 -1 1
165                if cooldown "skill"
166                    overhead "waiting for skill cooldown"
167                else
168                    attack myKillTarget
169                    wait 200
170                    settimer helperHideTimer 0
171                    if findtype "katana" backpack 1790 as item
172                        dclick item
173                    endif
174                endif
175            else
176                if timer helperTextTimer > helperTextCooldown
177                    overhead "Out of range" 88  myKillTarget
178                    settimer helperTextTimer 0
179                endif
180            endif
181        endif
182    else    
183        if not cooldown "skill"
184            useskill "Stealth"
185        endif
186        
187        if timer helperTextTimer > helperTextCooldown
188            sysmsg "waiting for stealth" 88
189            settimer helperTextTimer 0
190        endif
191    endif
192endwhile
193// use ingame macro to attack
194
195stop
196 
197 
198
199@setvar! myMuggyTarget
200
201
202while not dead myMuggyTarget
203    for 10
204        if find myMuggyTarget ground -1 -1 index
205            overhead "We found a target in range {{index}}"
206        endif
207    endfor
208    wait 200
209endwhile