Как уменьшить количество шагов в ходилке?
Posted: 2012-11-06 16:37:59
Помогите изменить в этой ходилки значение, что бы чар делал меньше шагов? не ходил кругами.
Code: Select all
Sub GotoXY(x,y)
var myX,myY,LastX=0,LastY=0,i,halt=0,z,r=0
for i=1 to 100
waits(1)
if IsDead() then
AutoRess()
endif
CheckPlayer()
CheckEnt()
ToHide()
myX=uo.GetX()
myY=uo.GetY()
if LastX==myX and LastY==myY then
halt=halt+1
else
halt=0
endif
if halt>=10 then
if uo.GetDir()==1 then
for z=0 to 8
uo.Press(40)
next
endif
if uo.GetDir()==3 then
for z=0 to 8
uo.Press(37)
next
endif
if uo.GetDir()==5 then
for z=0 to 8
uo.Press(38)
next
endif
if uo.GetDir()==7 then
for z=0 to 8
uo.Press(39)
next
endif
halt=15
endif
if Numb(x-myX)<=1 and Numb(y-myY)<=2 then
return 1
endif
if x<=myX then
if y<=myY then
for z=0 to 2
uo.Press(38)
next
else
for z=0 to 2
uo.Press(37)
next
endif
else
if y<=myY then
for z=0 to 2
uo.Press(39)
next
else
for z=0 to 2
uo.Press(40)
next
endif
endif
LastX=myX
LastY=myY
waits(WalkWait)
next
return 0
end sub