отход для лечения
Moderators: Murderator+, Murderator
Вот как должно все выглядить
Code: Select all
sub main()
repeat
wait(3000)
if uo.life<70 then
WalkN(1524,1725,"")
wait(3000)
WalkN(1527,1726,"")
end if
until uo.dead()
end sub
sub WalkN(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()
If UO.GetDistance(Target)<2 Then
Exit=1
Endif
Else
dx=x-UO.GetX()
dy=y-UO.GetY()
UO.Print('Left '+STR(dx)+' steps to target. ')
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,300)
If StepSucess==-1 Then
StepSucess=Go(7,38,300)
StepSucess=Go(1,39,300)
If StepSucess==-1 Then
StepSucess=Go(5,37,300)
Endif
Endif
Endif
If dx>0 AND dy<0 Then
StepSucess=Go(1,39,300)
If StepSucess==-1 Then
StepSucess=Go(5,37,300)
StepSucess=Go(3,40,300)
If StepSucess==-1 Then
StepSucess=Go(7,38,300)
Endif
Endif
Endif
If dx<0 AND dy>0 Then
StepSucess=Go(5,37,300)
If StepSucess==-1 Then
StepSucess=Go(1,39,300)
StepSucess=Go(7,38,300)
If StepSucess==-1 Then
StepSucess=Go(3,40,300)
Endif
Endif
Endif
If dx<0 AND dy<0 Then
StepSucess=Go(7,38,300)
If StepSucess==-1 Then
StepSucess=Go(3,40,300)
StepSucess=Go(5,37,300)
If StepSucess==-1 Then
StepSucess=Go(1,39,300)
Endif
Endif
Endif
Endif
If dx<>0 AND dy==0 Then
If dx>0 Then
StepSucess=Go(2,34,300)
If StepSucess==-1 Then
StepSucess=Go(3,40,300)
If StepSucess==-1 Then
StepSucess=Go(1,39,300)
Endif
StepSucess=Go(2,34,300)
Endif
Endif
If dx<0 Then
StepSucess=Go(6,36,300)
If StepSucess==-1 Then
StepSucess=Go(7,38,300)
If StepSucess==-1 Then
StepSucess=Go(5,37,300)
Endif
StepSucess=Go(6,36,300)
Endif
Endif
Endif
If dx==0 AND dy<>0 Then
If dy>0 Then
StepSucess=Go(4,35,300)
If StepSucess==-1 Then
StepSucess=Go(3,40,300)
If StepSucess==-1 Then
StepSucess=Go(5,37,300)
Endif
StepSucess=Go(4,35,300)
Endif
Endif
If dy<0 Then
StepSucess=Go(0,33,300)
If StepSucess==-1 Then
StepSucess=Go(1,39,300)
If StepSucess==-1 Then
StepSucess=Go(7,38,300)
Endif
StepSucess=Go(0,33,300)
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
Endif
Endif
UO.Press(key)
wait(walkwait)
if x==UO.GetX() AND y==UO.GetY() Then
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
Endif
If x==UO.GetX() AND y==UO.GetY() Then
UO.Print("Stuck. Try move else!")
return -1
Else
return 1
Endif
end sub
Все просто.
BETEPAH ™
BETEPAH ™