Не хочешь не верь .....
а не могли бы вы тогда из етой ходилки убратьсистему обхода препядствий чтобы ломился на пролом !?)
Code: Select all
sub Walk(x,y,Target)
VAR i,StepSucess
VAR dx,dy,Exit=0
While Exit<>1
If Target<>"" Then
dx=UO.GetX(Target)-UO.GetX()
dy=UO.GetY(Target)-UO.GetY()
; UO.Print("Target locked!")
If UO.GetDistance(Target)<2 Then
Exit=1
Endif
Else
dx=x-UO.GetX()
dy=y-UO.GetY()
If dx==0 AND dy==0 Then
Exit=1
Endif
Endif
If dx<>0 AND dy<>0 Then
If dx>0 AND dy>0 Then
StepSucess=Go(3,40,100) ;SE - DownArrow
If StepSucess==-1 Then
StepSucess=Go(7,38,100) ;WN - UpArrow
StepSucess=Go(1,39,100) ;NE - RightArrow
If StepSucess==-1 Then
StepSucess=Go(5,37,100) ;SW - LeftArrow
Endif
Endif
Endif
If dx>0 AND dy<0 Then
StepSucess=Go(1,39,100) ;NE - RightArrow
If StepSucess==-1 Then
StepSucess=Go(5,37,100) ;SW - LeftArrow
StepSucess=Go(3,40,100) ;SE - DownArrow
If StepSucess==-1 Then
StepSucess=Go(7,38,100) ;WN - UpArrow
Endif
Endif
Endif
If dx<0 AND dy>0 Then
StepSucess=Go(5,37,100) ;SW - LeftArrow
If StepSucess==-1 Then
StepSucess=Go(1,39,100) ;NE - RightArrow
StepSucess=Go(7,38,300) ;WN - UpArrow
If StepSucess==-1 Then
StepSucess=Go(3,40,100) ;SE - DownArrow
Endif
Endif
Endif
If dx<0 AND dy<0 Then
StepSucess=Go(7,38,100) ;WN - UpArrow
If StepSucess==-1 Then
StepSucess=Go(3,40,100) ;SE - DownArrow
StepSucess=Go(5,37,100) ;SW - LeftArrow
If StepSucess==-1 Then
StepSucess=Go(1,39,100) ;NE - RightArrow
Endif
Endif
Endif
Endif
If dx<>0 AND dy==0 Then
If dx>0 Then
StepSucess=Go(2,34,100) ;E - PgDown
If StepSucess==-1 Then
StepSucess=Go(3,40,100) ;SE - DownArrow
If StepSucess==-1 Then
StepSucess=Go(1,39,100) ;NE - RightArrow
Endif
StepSucess=Go(2,34,100) ;E - PgDown
Endif
Endif
If dx<0 Then
StepSucess=Go(6,36,100) ;W - Home
If StepSucess==-1 Then
StepSucess=Go(7,38,100) ;WN - UpArrow
If StepSucess==-1 Then
StepSucess=Go(5,37,100) ;SW - LeftArrow
Endif
StepSucess=Go(6,36,100) ;W - Home
Endif
Endif
Endif
If dx==0 AND dy<>0 Then
If dy>0 Then
StepSucess=Go(4,35,100) ;S - End
If StepSucess==-1 Then
StepSucess=Go(3,40,100) ;SE - DownArrow
If StepSucess==-1 Then
StepSucess=Go(5,37,100) ;SW - LeftArrow
Endif
StepSucess=Go(4,35,100) ;S - End
Endif
Endif
If dy<0 Then
StepSucess=Go(0,33,100) ;N - PgUp
If StepSucess==-1 Then
StepSucess=Go(1,39,100) ;NE - RightArrow
If StepSucess==-1 Then
StepSucess=Go(7,38,100) ;WN - UpArrow
Endif
StepSucess=Go(0,33,100) ;N - PgUp
Endif
Endif
Endif
Wend
end sub
;
sub Go(dir,key,Walkwait)
VAR x,y, OldDir
x=UO.GetX()
y=UO.GetY()
OldDir=UO.GetDir()
If UO.GetDir()<>dir Then
UO.Press(key)
wait(Walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
Endif
UO.Press(key)
wait(Walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif
If x==UO.GetX() AND y==UO.GetY() AND OldDir<>UO.GetDir() Then
UO.Press(key)
wait(Walkwait)
Endif
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif
If x==UO.GetX() AND y==UO.GetY() Then
UO.Print("Zasada!")
return -1
Else
return 1
Endif
end sub