Yoko

All sides of Injection
It is currently 2026-01-23 21:43:24

All times are UTC+02:00




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
PostPosted: 2008-06-28 08:27:40 
Offline

Joined: 2007-07-01 21:23:58
Posts: 82
Code:
sub Step(x,y,mx,my,forstep) 
  if uo.GetX('self') <> x then
    if uo.GetY('self') <> y then
      if mx<0 then
        if my<0 then
          uo.Press(40)
          wait(forstep)
        else
          uo.Press(39)
          wait(forstep)
        end if
      else
        if my<0 then
          uo.Press(37)
          wait(forstep)
        else
          uo.Press(38)
          wait(forstep)
        end if
      end if
    else
      if mx<0 then
        uo.Press(34)
        wait(forstep)
      else
        uo.Press(36)
        wait(forstep)
      end if
    end if
  else
    if my<0 then
      uo.Press(35)
      wait(forstep)
    else
      uo.Press(33)
      wait(forstep)
    end if
  end if
end sub

sub Go_To(x,y)
var mx,my,fx,fy
  var xx=x
  var yy=y
  var DistX=0
  var DistY=0
  var forstep=300
 
  repeat
    mx=uo.GetX('self')-x
    my=uo.GetY('self')-y
    fx=mx+x
    fy=my+y
    Step(xx,yy,mx,my,forstep)
  until x==fx+DistX && y==fy+DistY || x==fx-DistX && y==fy+DistY || x==fx+DistX && y==fy-DistY || x==fx-DistX && y==fy-DistY || x==fx && y==fy
end sub


вот сама ходилка, пишу внизу скрипта координаты, например:
Go_To(1149,1678)
Go_To(1149,1684)
чар начинает проходить 1 раз по заданным координатам, как сделать так чтобы он ходил по этим координатам пока я не отроблю скрипт, пробовал вписывать until uo.dead() но не помогает. может не туда вписываю?


Top
   
PostPosted: 2008-06-28 10:30:13 
Offline
Expert!
User avatar

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

Теперь по теме:
Code:
sub walk()
  while not UO.Dead()
    Go_To(1149,1678)
    Go_To(1149,1684)
  wend
end sub


Так не пробовали?


Top
   
 Post subject:
PostPosted: 2008-06-28 15:17:51 
Offline

Joined: 2007-07-01 21:23:58
Posts: 82
как оформлять читал, квот поставил почему-то не взялось в цитату. по теме спасибо все работает.


Top
   
 Post subject:
PostPosted: 2008-06-28 20:26:09 
Offline

Joined: 2005-04-19 18:00:29
Posts: 2259
Location: Московская область
ychenik wrote:
как оформлять читал, квот поставил почему-то не взялось в цитату. по теме спасибо все работает.


Не квот, а
Code:
[code][/code]


Top
   
 Post subject:
PostPosted: 2008-06-30 08:20:23 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
ychenik wrote:
как оформлять читал, квот поставил почему-то не взялось в цитату. по теме спасибо все работает.

Потому, что у вас два открывающих квота..

_________________
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Skype: d119060


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 2 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