sub test dim creeps creeps 0x00E7 bull creeps 0x00D8 cow creeps 0x00E9

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
sub test()
dim creeps[4]
creeps[0] = '0x00E7' ; bull
creeps[1] = '0x00D8' ; cow
creeps[2] = '0x00E9' ; cow
creeps[3] = '0x0122' ; boar
var i
while not uo.dead()
for i = 0 to 3
uo.FindType(creeps[i], '-1', 'ground')
if uo.FindCount() > 0 then
go(uo.getx('finditem'),uo.gety('finditem'),1)
uo.attack('finditem')
while uo.getHP('finditem') > 0
wait(1000)
wend
endif
next
wait(1000)
wend
endsub
sub go(x,y,p)
p = p + 1
while( abs(uo.GetX()-x) > p && abs(uo.GetY()-y) > p)
move(x,y)
wait(200)
wend
end sub
sub abs(n)
if n < 0 then
return (-1) * n
else
return n
endif
endsub
sub move(xko,yko)
var mx=UO.GetX()
var my=UO.GetY()
if mx == xko and my > yko then
UO.Press(33)
endif
if mx == xko and my < yko then
UO.Press(35)
endif
if mx < xko and my == yko then
UO.Press(34)
endif
if mx < xko and my > yko then
UO.Press(39)
endif
if mx < xko and my < yko then
UO.Press(40)
endif
if mx > xko and my == yko then
UO.Press(36)
endif
if mx > xko and my > yko then
UO.Press(38)
endif
if mx > xko and my < yko then
UO.Press(37)
endif
end sub