Yoko

All sides of Injection
It is currently 2025-12-20 07:04:05

All times are UTC+02:00




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: 2005-08-30 21:42:55 
Offline

Joined: 2005-03-05 21:30:19
Posts: 10
вот скрипт на ходьбу для лесорубства...По нему чар подходит к дереву не вплотную а на расстояние 1-2 тайла от него. Переделайте пожалуйста скрипт так чтоб чар подходил к деревьям только вплотную.
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


Last edited by Romaxa on 2005-08-30 21:50:10, edited 2 times in total.

Top
   
 Post subject:
PostPosted: 2005-08-30 21:45:25 
Offline

Joined: 2005-08-12 03:04:00
Posts: 125
Предположу что дело в параметре prec, который ты передаёшь в функцию GotoXY. Поиграйся с ним. Я думаю prec = 0 или 1 это то что тебе нужно.

_________________
I NEED HELP at viewtopic.php?t=4903


Top
   
 Post subject:
PostPosted: 2005-08-30 21:48:52 
Offline

Joined: 2005-03-05 21:30:19
Posts: 10
тьфу блин не тот скрипт выложил :lol: пресмотрите еще - испривил.

PS Дело в том что тот скрипт который я выложил в первый раз не может выйти с тупика если чар застрянет.


Top
   
 Post subject:
PostPosted: 2005-08-30 21:50:27 
Offline

Joined: 2005-08-12 03:04:00
Posts: 125
Дай строчку из скрипта, которая вызывает функцию ходилки

_________________
I NEED HELP at viewtopic.php?t=4903


Top
   
 Post subject:
PostPosted: 2005-08-30 21:53:28 
Offline

Joined: 2005-03-05 21:30:19
Posts: 10
если я правильно тебя понял то вот
Code:
gotoxy(x,y)


Top
   
 Post subject:
PostPosted: 2005-08-30 21:58:49 
Offline

Joined: 2005-08-12 03:04:00
Posts: 125
Code:
if abs(x-myX)<=1 AND abs(y-myY)<=2 then 


Попробуй тут заменить. 1 и 2 на поменьше. 0, 0 например.

_________________
I NEED HELP at viewtopic.php?t=4903


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 6 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