Yoko

All sides of Injection
It is currently 2025-12-11 03:07:53

All times are UTC+02:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 2010-12-14 07:54:30 
Offline

Joined: 2010-12-01 08:01:12
Posts: 19
hey guys... was wandering if yoko can work with PATHFINDING... ive made my own script but the original pathfinding is better...


Code:
sub Go(GX,GY)
var GDIR,GnX,GnY,GKR
REPEAT
  IF UO.GetX() > GX then
    GDIR=36
  ENDIF
  IF UO.GetX() < GX then
    GDIR=34
  ENDIF
  IF GDIR==36 or GDIR==34 then
    REPEAT
      GKR=0
      REPEAT
        GKR=GKR+1
        GnX=UO.GetX()
        UO.Press(GDIR)
        Wait(250)
        IF UO.GetX()==GnX AND GKR>2 then
          GoWrong(GDIR,1)
        ENDIF
      UNTIL GKR>3 or GnX<>UO.GetX()
    UNTIL UO.GetX() == GX OR (GDIR==36 AND UO.GetX()<GX) OR (GDIR==34 and UO.GetX()>GX)
  ENDIF
  IF UO.GetY() > GY then
    GDIR=33
  ENDIF
  IF UO.GetY() < GY then
    GDIR=35
  ENDIF
  IF GDIR==33 or GDIR==35 then
    REPEAT
      GKR=0
      REPEAT
        GKR=GKR+1
        GnY=UO.GetY()
        UO.Press(GDIR)
        Wait(250)
        IF UO.GetY()==GnY and GKR>3 then
          GoWrong(GDIR,1)
        ENDIF   
      UNTIL GKR>3 or GnY<>UO.GetY()
    UNTIL UO.GetY()==GY OR (GDIR==33 AND UO.GetY()<GY) or (GDIR==35 AND UO.GetY()>GY)
  ENDIF
  Wait(100)
UNTIL UO.GetX()==GX AND UO.GetY()==GY
end sub

sub GoWrong(WA,WB)
var WDIR,WnX,WnY,WB0
var WX=UO.GetX()
var WY=UO.GetY()
var WN=0
REPEAT
WB0=WB
WN=WN+1
     IF WB THEN
        IF WA==36 THEN
           WDIR=33
        ELSE
           WDIR=WA+1
        ENDIF
     ELSE
        IF WA==33 THEN
           WDIR=36
        ELSE
           WDIR=WA-1
        ENDIF
     ENDIF
     IF WA==33 or WA==35 then
          WHILE UO.GetY()==WY and WB==WB0
               WnX=UO.GetX()
               UO.Press(WDIR,2)
               Wait(250)
               IF UO.GetX()==WnX then
                      WB=0
               ENDIF
               UO.Press(WA,2)
               Wait(250)
          WEND
     ENDIF
     IF WA==36 or WA==34 then
          WHILE UO.GetX()==WX and WB==WB0
               WnY=UO.GetY()
               UO.Press(WDIR,2)
               Wait(250)
               IF UO.GetY()==WnY then
                     WB=0
               ENDIF
               UO.Press(WA,2)
               Wait(250)
          WEND
     ENDIF
     Wait(100)
UNTIL UO.GetX() <> WX AND UO.GetY() <> WY AND WB0==WB OR WN>15
end sub


Top
   
PostPosted: 2010-12-14 08:06:03 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
Yoko can not work with PATHFINDING. :wink:

_________________
Image
YokoInjection CodeSweeper
Ошибка "Unhandled exception in parser"
Стрелялка для олдов.


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 3 guests


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