И так ходилка
Code: Select all
sub GoToMine( Current_Tree )
var Tree, TreeX, TreeY
var oldX, oldY
var Dx, Dy
var Distance
TreeX = Current_Tree[5]+Current_Tree[6]+Current_Tree[7]+Current_Tree[8]
TreeY = Current_Tree[10]+Current_Tree[11]+Current_Tree[12]+Current_Tree[13] ;uo.print("TreeX="+TreeX + ", TreeY=" + TreeY )
Repeat
oldX = UO.GetX()
oldY = UO.GetY()
Dx = val(TreeX) - oldX
Dy = val(TreeY) - oldY
Distance = Dx*Dx+Dy*Dy
; uo.print("Dx="+str(Dx)+", Dy="+str(Dy)+", ----Dist= "+str(Distance) )
if Distance < 2 then
Return
endif
move(Dx,Dy,Distance)
Until (Distance < 10)
end sub
sub move(Dx,Dy,Distance)
var q
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
moveside(q)
end sub
sub moveside(q)
var k,l
var m,n
var j
k=UO.GetX()
l=UO.GetY()
For j=0 to 2
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
Next
m=UO.GetX()
n=UO.GetY()
wait(300)
if k==m and l==n then
q=q+1
if q==9 then
q=1
endif
moveside(q)
endif
end sub
Просим его сделать
Code: Select all
sub GoToMine("3302 204 1488 0 ")
А чар идет хз куда.. Причем все ходилки (я пробовал еще 2), ведут себя по разному, но к целе не идет ни одна