Code:
sub GoToMine(TreeX,TreeY,maxDist)
var Dx,Dy,Distance,oldX,oldY,j,w,q
j=0
UO.Print("x="+TreeX+" y="+TreeY)
Repeat
#####################
j=j+1
if j==201 then
j=201
endif
UO.Print("j="+str(j))
#####################
Dx = val(TreeX)-UO.GetX()
Dy = val(TreeY)-UO.GetY()
Distance = Dx*Dx+Dy*Dy
uo.print("Dx="+str(Dx)+", Dy="+str(Dy)+", ----Dist= "+str(Distance))
if Distance > maxDist then
if Dx<0 and Dy==0 then
q=1
endif
if Dx<0 and Dy<0 then
q=2
endif
if Dx==0 and Dy<0 then
q=3
endif
if Dx>0 and Dy<0 then
q=4
endif
if Dx>0 and Dy==0 then
q=5
endif
if Dx>0 and Dy>0 then
q=6
endif
if Dx==0 and Dy>0 then
q=7
endif
if Dx<0 and Dy>0 then
q=8
endif
w=q
oldX=UO.GetX()
oldY=UO.GetY()
Repeat
move(w)
CheckLag() #######
w=w+1
if w==9 then
w=1
endif
if j==50 or j==100 or j==150 or j==200 then
side(q,j)
endif
Until oldX<>UO.GetX() or oldY<>UO.GetY()
endif
Until Distance <= maxDist
end sub
sub move(q)
var i
For i=0 to 1
if q==1 then
UO.Press(36)
endif
if q==2 then
UO.Press(38)
endif
if q==3 then
UO.Press(33)
endif
if q==4 then
UO.Press(39)
endif
if q==5 then
UO.Press(34)
endif
if q==6 then
UO.Press(40)
endif
if q==7 then
UO.Press(35)
endif
if q==8 then
UO.Press(37)
endif
wait(100)
Next
end sub
sub side(q,j)
UO.Print("Obxodim")
var i
for i=0 to 8
######################
if q==1 and j==50 then
UO.Press(35)
endif
if q==2 and j==50 then
UO.Press(37)
endif
if q==3 and j==50 then
UO.Press(36)
endif
if q==4 and j==50 then
UO.Press(38)
endif
if q==5 and j==50 then
UO.Press(33)
endif
if q==6 and j==50 then
UO.Press(39)
endif
if q==7 and j==50 then
UO.Press(34)
endif
if q==8 and j==50 then
UO.Press(40)
endif
######################
if q==1 and j==100 then
UO.Press(33)
endif
if q==2 and j==100 then
UO.Press(39)
endif
if q==3 and j==100 then
UO.Press(34)
endif
if q==4 and j==100 then
UO.Press(40)
endif
if q==5 and j==100 then
UO.Press(35)
endif
if q==6 and j==100 then
UO.Press(37)
endif
if q==7 and j==100 then
UO.Press(36)
endif
if q==8 and j==100 then
UO.Press(38)
endif
######################
if q==1 and j==150 then
UO.Press(37)
endif
if q==2 and j==150 then
UO.Press(36)
endif
if q==3 and j==150 then
UO.Press(38)
endif
if q==4 and j==150 then
UO.Press(33)
endif
if q==5 and j==150 then
UO.Press(39)
endif
if q==6 and j==150 then
UO.Press(34)
endif
if q==7 and j==150 then
UO.Press(40)
endif
if q==8 and j==150 then
UO.Press(35)
endif
######################
if q==1 and j==200 then
UO.Press(38)
endif
if q==2 and j==200 then
UO.Press(33)
endif
if q==3 and j==200 then
UO.Press(39)
endif
if q==4 and j==200 then
UO.Press(34)
endif
if q==5 and j==200 then
UO.Press(40)
endif
if q==6 and j==200 then
UO.Press(35)
endif
if q==7 and j==200 then
UO.Press(37)
endif
if q==8 and j==200 then
UO.Press(36)
endif
######################
next
end sub
sub CheckLag()
var time
var maxtime=10000
wait(130) ##
if UO.InJournal('cliloc# 0xA18E') or UO.InJournal('cliloc# 0xA6E6') then
wait(10000) #осбенность моего шарда: стамина до 0 если голоден
UO.DeleteJournal()
endif
time=0
UO.DeleteJournal()
UO.Click('backpack')
repeat
time=time+50
wait(50)
until UO.InJournal('cliloc# 0x9ED5') or time>maxtime
UO.DeleteJournal()
end sub
вот такая у меня ходилка:) вот если пустить чара бегать по 4 местам циклом то рано или поздно парсер. дольше часа не работала пока:)