Yoko

All sides of Injection
It is currently 2018-12-14 08:29:12

All times are UTC+02:00




Post new topic  Reply to topic  [ 1 post ] 
Author Message
PostPosted: 2004-07-07 16:32:11 
Offline
Site Admin
User avatar

Joined: 2004-04-03 16:49:38
Posts: 1970
There is no now special command to move in Injection.
Нет специальной команды для хотьбы на инжекте.

1) use EasyUO for moving http://www.easyuo.com
2) you may use this simple macro, but you must keep in mind it is primitive, not evase obstacles and lag sensitive.
(примитивный макрос для хотьбы по мировым координатам)

X,Y - world coordinates where you'd like to move, PREC is precision, how close macro must walk to be enough. 0 mean exact location, 1 - exact or nearby cell, and so on.
X,Y - мировые координаты куда нужно стать, PREC это точность, насколько близко нужно подойти. 0 означает место в точности, 1 - в точности или соседняя клетка и т.д.

Code:
sub gotoxy(x,y,prec) 
var ld=0,ldc=0
var dx,dy
var mx,my
var ox,oy,mk,k
#uo.print(">")
#uo.track("1",str(x),str(y))
start:
mx=UO.GetX()
my=UO.GetY()
dx=mx-x
if dx<0 then
dx=0-dx
endif
dy=my-y
if dy<0 then
dy=0-dy
endif
if dy>dx then
dx=dy
end if
if dx<=prec then
return
end if
if not ldc then
uo.print(STR(dx))
end if
if dx<3 then
mk=70
else
mk=15
end if

ox=mx
oy=my
for k=1 to mk
mx=UO.GetX()
my=UO.GetY()
if mx<>ox or my<>oy then
goto sdidapl
end if
wait(10)
next
sdidapl:

mx=UO.GetX()
my=UO.GetY()
dx=mx-x
if dx<0 then
dx=0-dx
endif
dy=my-y
if dy<0 then
dy=0-dy
endif
if dy>dx then
dx=dy
end if

if dx<=prec then
return
end if
if ld==dx then
ldc=ldc+1
if ldc>100 then
uo.print("Can not reach location!")
return
end if
else
ld=dx
end if

if mx==x then
if my==y then
return
endif
if my>y then
#UO.Print("UR")
UO.Press(33)
goto start
endif
#UO.Print("DL")
UO.Press(35)
goto start
end if
if mx<x then
if my>y then
#UO.Print("R")
UO.Press(39)
goto start
endif
if my==y then
#UO.Print("DR")
UO.Press(34)
goto start
endif
#UO.Print("D")
UO.Press(40)
goto start
end if
if my<y then
#UO.Print("L")
UO.Press(37)
goto start
endif
if my==y then
#UO.Print("LU")
UO.Press(36)
goto start
endif
#UO.Print("U")
UO.Press(38)
goto start
end sub


Example to use it in your script:
Пример использования в вашем скрипте:
Code:
sub main() 
......
var myobject=uo.getserial("laststatus")
var goX=uo.getx(myobject)
var goY=uo.gety(myobject)
#go to object X:Y in 0-1 cells range
gotoxy(goX,goY,1) 
......
end sub

.....
#somewhere / гдето
sub gotoxy(x,y,prec)
.....
end sub


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

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:  
Powered by phpBB® Forum Software © phpBB Limited