Yoko

All sides of Injection
It is currently 2025-12-24 16:04:11

All times are UTC+02:00




Post new topic  Reply to topic  [ 7 posts ] 
Author Message
PostPosted: 2007-02-25 12:02:48 
Offline

Joined: 2004-06-28 11:20:01
Posts: 8
Code:
sub gotoXY(x,y) 
var myX,myY,lastX=0,lastY=0,i,halt=0,z,r=0
for i=1 to 60
MyX=uo.getX();
MyY=uo.getY();
if LastX==MyX AND LastY==MyY then
halt=halt+1
else
halt=0
end if
if halt>=10 then
if uo.GetDir()==1 then
for z=0 to 8
uo.press(40)
next
end if
if uo.GetDir()==3 then
for z=0 to 8
uo.press(37)
next
end if
if uo.GetDir()==5 then
for z=0 to 8
uo.press( 38 )
next
end if
if uo.GetDir()==7 then
for z=0 to 8
uo.press(39)
next
end if
halt=15
end if
if abs(x-myX)<=1 AND abs(y-myY)<=2 then
return 1
end if
if x<=MyX then
if y<=MyY then
for z=0 to 3
uo.press( 38 )
next
else
for z=0 to 3
uo.press(37)
next
end if
else
if y<=MyY then
for z=0 to 3
uo.press(39)
next
else
for z=0 to 3
uo.press(40)
next
end if
end if
lastX=myX
lastY=myY
wait(200)
next
return 0
end sub

sub abs(num)
if num>=0 then
return num
else
return num*(-1)
end if
end sub


Нужно, чтобы чар приходил в точно заданную точку. Прошу не пинать, в скриптовании ничего не смыслю ВООБЩЕ. Спасибо за понимание и помощь.


Top
   
 Post subject:
PostPosted: 2007-02-25 12:08:12 
Offline

Joined: 2005-01-01 04:00:14
Posts: 76
Code:
sub script()
var X = 1234
var Y = 4321
gotoXY(X,Y)
end sub


Top
   
 Post subject:
PostPosted: 2007-02-25 12:24:12 
Offline

Joined: 2004-06-28 11:20:01
Posts: 8
Спасибо.
У меня в скрипте прописано типа такого.
Code:
...
gotoXY(1111,2222)
script()
gotoXY(2222,3333)
script()
...

Проблема в том, что чар точно в эти точки иногда не приходит, становится рядом. В скрипте видимо есть допуски точности подхода. Где они написаны - для меня темный лес. Помогите пожалуйста.


Top
   
 Post subject:
PostPosted: 2007-02-25 12:36:29 
Offline

Joined: 2005-01-01 04:00:14
Posts: 76
Black Widow wrote:
Спасибо.
У меня в скрипте прописано типа такого.
Code:
...
gotoXY(1111,2222)
script()
gotoXY(2222,3333)
script()
...

Проблема в том, что чар точно в эти точки иногда не приходит, становится рядом. В скрипте видимо есть допуски точности подхода. Где они написаны - для меня темный лес. Помогите пожалуйста.

Тогда тебе проще найти другую ходилку.


Top
   
 Post subject:
PostPosted: 2007-02-25 12:42:05 
Offline

Joined: 2004-06-28 11:20:01
Posts: 8
prof wrote:
Тогда тебе проще найти другую ходилку.

Очень жаль, т.к. ходилка очень устраивает на предмет обхода препятствий.


Top
   
 Post subject:
PostPosted: 2007-02-25 13:00:35 
Offline

Joined: 2004-10-19 16:25:45
Posts: 95
Code:
if abs(x-myX)<=1 AND abs(y-myY)==0 then 

должно быть так


Top
   
 Post subject:
PostPosted: 2007-02-25 13:50:12 
Offline

Joined: 2004-06-28 11:20:01
Posts: 8
volhram wrote:
Code:
if abs(x-myX)<=1 AND abs(y-myY)==0 then 

должно быть так

Спасибо.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 7 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:  
Powered by phpBB® Forum Software © phpBB Limited