Yoko
http://forum.yoko.com.ua/

Ходим по координатам
http://forum.yoko.com.ua/viewtopic.php?f=20&t=12272
Page 1 of 1

Author:  Scripts Writer [ 2007-08-01 12:06:29 ]
Post subject:  Ходим по координатам

Ходилка по координатам.

Code:
##################### 
# by Scripts Writer #
# 01/08/07          #
#####################
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=1
  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

Page 1 of 1 All times are UTC+02:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/