Yoko

All sides of Injection
It is currently 2026-01-08 01:48:00

All times are UTC+02:00




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: 2009-06-08 10:50:06 
Offline

Joined: 2009-06-08 10:30:25
Posts: 9
Вопрос такой - У меня ходилка на випке ходит не в сторону сундука а в другую сторону
;---------------- Õîäèëêà -----------------------
sub GoW()
VAR walkwait=300
VAR x,y,dir=6
VAR key=36 ; Home key
x=UO.GetX()
y=UO.GetY()
while UO.GetDir()<>dir
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
wend
UO.Press(key)

wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif

If UO.GetX()+1==x Then
return -1
Else
return 1
Endif
end sub


sub GoN()
VAR walkwait=300
VAR x,y,dir=0
VAR key=33 ; PgUp
x=UO.GetX()
y=UO.GetY()
while UO.GetDir()<>dir
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
wend
UO.Press(key)

wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif

If UO.GetY()+1==y Then
return -1
Else
return 1
Endif
end sub


sub GoE()
VAR walkwait=300
VAR x,y,dir=2
VAR key=34 ; PgDown
x=UO.GetX()
y=UO.GetY()
while UO.GetDir()<>dir
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
wend
UO.Press(key)

wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif

If UO.GetX()-1==x Then
return -1
Else
return 1
Endif
end sub


sub GoS()
VAR walkwait=300
VAR x,y,dir=4
VAR key=35 ; End
x=UO.GetX()
y=UO.GetY()
while UO.GetDir()<>dir
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
wend
UO.Press(key)

wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif

If UO.GetY()-1==y Then
return -1
Else
return 1
Endif
end sub


sub GoWN()
VAR walkwait=300
VAR x,y,dir=7
VAR key=38 ; UpArrow
x=UO.GetX()
y=UO.GetY()

If UO.GetDir()<>dir Then
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
Endif

If UO.GetDir()==dir Then
UO.Press(key)
wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif
If UO.GetDir()==dir Then
return -1
Else
return UO.GetDir()
Endif
Else
return UO.GetDir()
Endif
end sub


sub GoNE()
VAR walkwait=300
VAR x,y,dir=1
VAR key=39 ; RightArrow
x=UO.GetX()
y=UO.GetY()

If UO.GetDir()<>dir Then
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
Endif

If UO.GetDir()==dir Then
UO.Press(key)
wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif
If UO.GetDir()==dir Then
return -1
Else
return UO.GetDir()
Endif
Else
return UO.GetDir()
Endif
end sub


sub GoSE()
VAR walkwait=300
VAR x,y,dir=3
VAR key=40 ; DownArrow
x=UO.GetX()
y=UO.GetY()

If UO.GetDir()<>dir Then
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
Endif

If UO.GetDir()==dir Then
UO.Press(key)
wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif
If UO.GetDir()==dir Then
return -1
Else
return UO.GetDir()
Endif
Else
return UO.GetDir()
Endif
end sub


sub GoSW()
VAR walkwait=300
VAR x,y,dir=5
VAR key=37 ; LeftArrow
x=UO.GetX()
y=UO.GetY()

If UO.GetDir()<>dir Then
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
Endif

If UO.GetDir()==dir Then
UO.Press(key)
wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif
If UO.GetDir()==dir Then
return -1
Else
return UO.GetDir()
Endif
Else
return UO.GetDir()
Endif
end sub


#==============================================================
# WalkN(X,Y,Serial) - char is walking by dX and dY step
# sub using Home, End, PgUp, PgDown keys
# d'not rebind this key from default action!
# walkwait - delay after keypress
#--------------------------------------------------------------
sub WalkN(x,y,Target)
VAR i
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
GoSE()
Endif

If dx>0 AND dy<0 Then
GoNE()
Endif

If dx<0 AND dy>0 Then
GoSW()
Endif

If dx<0 AND dy<0 Then
GoWN()
Endif

Endif

If dx<>0 AND dy==0 Then
If dx>0 Then
GoE()
Endif

If dx<0 Then
GoW()
Endif
Endif


If dx==0 AND dy<>0 Then
If dy>0 Then
GoS()
Endif

If dy<0 Then
GoN()
Endif
Endif
Wend
end sub

/слево наискосо юг,правый верхний угол север http:**dump.ru*file*2863945 скрин *=\


Last edited by Night Party on 2009-06-08 11:04:23, edited 1 time in total.

Top
   
 Post subject:
PostPosted: 2009-06-08 11:02:05 
Offline
Expert!
User avatar

Joined: 2005-05-04 14:05:19
Posts: 2580
Location: Москва
Code:
sub Abs(num)
   if num < 0 then
      return -num
   end if
   return num
end sub

sub Sig(num)
if num < 0 then
   return -1
else
   if num == 0 then
      return 0
   endif
endif
return 1
end sub
      
sub MoveToXY(x, y, prec)
   var dx, dy
   dim Key[9]
      Key[0]=37
      Key[1]=35
      Key[2]=40
      Key[3]=36
      Key[4]=12
      Key[5]=34
      Key[6]=38
      Key[7]=33
      Key[8]=39
      dx=x-uo.GetX()
      dy=-y+uo.GetY()
   while (Abs(dx) > prec) or (Abs(dy) > prec)
      dx=x-uo.GetX()
      dy=-y+uo.GetY()
      uo.Press(Key[(sig(dy)+1)*3+1+sig(dx)])
      wait(10)
   wend
end sub   

sub MoveTo(object, prec)
   var dx, dy
   dim Key[9]
      Key[0]=37
      Key[1]=35
      Key[2]=40
      Key[3]=36
      Key[4]=12
      Key[5]=34
      Key[6]=38
      Key[7]=33
      Key[8]=39
   while uo.GetDistance(object) > prec
      dx=uo.GetX(object)-uo.GetX()
      dy=-uo.GetY(object)+uo.GetY()
      uo.Press(Key[(sig(dy)+1)*3+1+sig(dx)])
      wait(10)
   wend
end sub   


Top
   
 Post subject:
PostPosted: 2009-06-08 11:05:04 
Offline

Joined: 2009-06-08 10:30:25
Posts: 9
эммм,а что это за ходилка?


Top
   
 Post subject:
PostPosted: 2009-06-08 11:07:26 
Offline
Expert!
User avatar

Joined: 2005-05-04 14:05:19
Posts: 2580
Location: Москва
обыкновенная:) идет по крайтчайщему пути, может обойти элементарные препятствия, но это скорее баг чем фича:)))


Top
   
 Post subject:
PostPosted: 2009-06-08 11:09:30 
Offline

Joined: 2009-06-08 10:30:25
Posts: 9
можешь стукнуть 447-150-634,а то с ходилками вообще не дружу)


Top
   
 Post subject:
PostPosted: 2009-06-08 16:36:27 
Offline
Expert!
User avatar

Joined: 2006-02-07 08:51:40
Posts: 1348
Location: г. Старый Оскол
Координаты сундука поменял? Проверь 2 раза, может где еще прописаны в скрипте.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 6 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited