Yoko

All sides of Injection
It is currently 2025-12-29 01:43:10

All times are UTC+02:00




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Ходилка
PostPosted: 2005-08-27 22:31:04 
Offline
User avatar

Joined: 2005-08-18 09:09:18
Posts: 104
Location: RUSSIA
Что нужно сделать чтоб в ниже приведенном скрипте чар ходил по указанным координатам? Или накрайняк напишите свой скрипт.

Code:
sub GotoXY(x,y,prec) 
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 Numb(x-myX)<=1 and Numb(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 Numb(num)
if num>=0 then
return num
else
return num*(-1)
end if
end sub


Top
   
 Post subject:
PostPosted: 2005-08-28 00:59:10 
Offline

Joined: 2004-12-13 01:27:00
Posts: 190
Code:
dig()
go(2251,434,33,0)
    go(2251,433,36,0)
end sub


------X----Y---Z-
go(2251,434,33,0)


Top
   
 Post subject:
PostPosted: 2005-08-28 11:09:01 
Offline
User avatar

Joined: 2005-08-18 09:09:18
Posts: 104
Location: RUSSIA
и куда это вставлять


Top
   
 Post subject:
PostPosted: 2005-08-28 11:37:15 
Offline
Expert!
User avatar

Joined: 2005-01-15 19:15:05
Posts: 791
Location: Dragon World
Всё это в один скрипт и запускай функцию test() :wink:
Code:
sub test()
GotoXY(2532,576,"") ##тут вставь координаты куда идти
endsub

sub GotoXY(x,y,prec)
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 Numb(x-myX)<=1 and Numb(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 Numb(num)
if num>=0 then
return num
else
return num*(-1)
end if
end sub


Top
   
 Post subject:
PostPosted: 2005-08-28 13:36:29 
Offline
User avatar

Joined: 2005-08-18 09:09:18
Posts: 104
Location: RUSSIA
а вот допустим он идет по этим координатам в шахту покопал там, а назад он как пойдет?


Top
   
 Post subject:
PostPosted: 2005-08-28 13:40:57 
Offline
Expert!
User avatar

Joined: 2005-01-15 19:15:05
Posts: 791
Location: Dragon World
Координаты другие поставь :wink:


Top
   
 Post subject:
PostPosted: 2005-08-28 13:43:44 
Offline
User avatar

Joined: 2005-08-18 09:09:18
Posts: 104
Location: RUSSIA
в одном скрипте чтоб это было.
идет туда и оттуда


Top
   
 Post subject:
PostPosted: 2005-08-28 13:46:38 
Offline
Expert!
User avatar

Joined: 2005-01-15 19:15:05
Posts: 791
Location: Dragon World
Code:
sub test()
GotoXY(2532,576,"") ##тут вставь координаты куда идти
...
действия
...
GotoXY(2532,576,"")
endsub


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 20 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:  
Powered by phpBB® Forum Software © phpBB Limited