Page 2 of 2

Posted: 2005-02-25 15:45:20
by Profik
щас работает до того как хп станет ниже 70 и пишет Line 3:Function not Found-WALKN

Posted: 2005-02-25 15:47:16
by Profik
вру пишет Line 5:Function not Found-WALKN

Posted: 2005-02-25 16:03:06
by BETEPAH
К скрипту на хождние вставь саму ходилку ...........

sub main()
>>>>>>
>>>>>>
end sub

sub walkD()
>>>>>>
>>>>>>
end sub

В скрипте у тебя должно будет выглядеть так.

Posted: 2005-02-25 16:06:12
by Profik
что это "ходилка" ??

Posted: 2005-02-25 16:11:56
by BETEPAH
Вот как должно все выглядить

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 

Posted: 2005-02-25 16:28:45
by Profik
во вроде пашет, но сам яб такой скрипт не зделал пока
спасибо за помощ