Code: Select all
sub go(n)
VAR X,Y,D,dx1,dy1,dx,dy,i,t,tile,destx="",desty=""
VAR key="506301427",f=file("C:\mining.wp.txt")
f.open()
if n>1 then
for i=1 to n-1
f.ReadLn()
next
endif
tile=f.ReadLn()
uo.print(str(n))
uo.print(tile)
f.close()
while true
dx=val(extract(tile,"2")) - UO.GetX()
dy=val(extract(tile,"3")) - UO.GetY()
dx1=Sign(dx)
dy1=Sign(dy)
if ((dx==-1 or dx==0 or dx==1)and (dy==-1 or dy==0 or dy==1)) then
mine(tile)
return
endif
X=UO.GetX()
Y=UO.GetY()
D=UO.GetDir()
UO.Press(val(Key[4+dy1*3+dx1])+33)
t=UO.Timer()
while ((UO.GetX() == X) and (UO.GetY() == Y) and UO.GetDir() == D)
wait(100)
if ((UO.Timer()-T) > 30) then
UO.Print("Lag")
UO.Press(val(Key[4+dy1*3+dx1])+33)
T = UO.Timer()
endif
wend
wend
end sub
Не запускаетйса, что-то, вот очень прошу, что надо переделать, или лучше, если не трудно сами переделайте, прошу!