Yoko

All sides of Injection
It is currently 2025-10-17 03:44:56

All times are UTC+02:00




Post new topic  Reply to topic  [ 10 posts ] 
Author Message
PostPosted: 2009-03-21 18:35:24 
Offline

Joined: 2008-12-12 04:30:22
Posts: 89
Доброго времени суток. Облазил весь форум ни где не нашел объяснений как можно заставить персонажа ходить... Вообщем ребят мне нужно что бы чар шел по координатам (расстояние где-то 2-3 таила) затем возвращался на прежнюю позицию и ждал 6 секунд, повторял эту комбинацию 5 раз, затем делал тоже самое но с задержкой в 10 секунд, а потом начинал читать скрипт с начала (то есть вся операция 5 раз по 6 сек, 1 раз 10 сек и опять 5 раз по 6 сек, 1 раз 10 сек и так до бесконечности) Знаю что скрипт пустяковый но сам я его написать не смогу... Или хотя бы киньте ссылочку где можно прочитать как это можно реализовать. Заранее спасибо!


Top
   
 Post subject:
PostPosted: 2009-03-21 20:39:36 
Offline

Joined: 2008-12-13 00:00:15
Posts: 174
что-то тип таго )

Code:
sub go()
var x, y, x1, y1
x = 2000
y = 1000
x1 = 2003
y1 = 1003
var i
while not uo.dead()
for i=1 to 5
gotoxy( x, y, 0)
wait(100)
gotoxy( x1, y1, 0)
wait(6000)
next
gotoxy( x, y,  0)
wait(100)
gotoxy( x1, y1, 0)
wend
end sub

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) <= prec and Numb(y-myY) <= prec 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: 2009-03-21 20:42:04 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
А еще есть FAQ..

viewtopic.php?t=804

_________________
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Skype: d119060


Top
   
 Post subject:
PostPosted: 2009-03-21 20:44:47 
Offline

Joined: 2008-12-12 04:30:22
Posts: 89
ввел координаты, ходит тупо по рандомным точкам =(


Top
   
 Post subject:
PostPosted: 2009-03-21 22:37:37 
Offline

Joined: 2008-12-13 00:00:15
Posts: 174
Jekaaa wrote:
ввел координаты, ходит тупо по рандомным точкам =(

Норм %))))
попробуй ходилку поменять)


Last edited by Successful on 2009-03-21 22:38:46, edited 1 time in total.

Top
   
 Post subject:
PostPosted: 2009-03-21 22:38:43 
Offline

Joined: 2008-12-12 04:30:22
Posts: 89
Мне нужно что бы ходила строго по определенным координатам и не обходила препятствия =)


Top
   
 Post subject:
PostPosted: 2009-03-21 22:55:35 
Offline
Expert!
User avatar

Joined: 2006-02-07 08:51:40
Posts: 1348
Location: г. Старый Оскол
Jekaaa wrote:
Мне нужно что бы ходила строго по определенным координатам и не обходила препятствия =)

UO.Press() и НумПад вам в помощь. (для справки: НумПад это цифровые клавиши в правой части клавиатуры.)


Top
   
 Post subject:
PostPosted: 2009-03-21 23:40:04 
Offline

Joined: 2008-12-12 04:30:22
Posts: 89
А можно по точнее?


Top
   
 Post subject:
PostPosted: 2009-03-21 23:57:47 
Offline

Joined: 2008-12-13 00:00:15
Posts: 174
Code:
uo.press(34)
uo.press(36)

в скобах код клавиш,сейчас это нум7 и нум 3,код клавиши можно посмотреть в скрипт эдиторе,в ячейке кей код,вписав свою кнопочку))


Top
   
 Post subject:
PostPosted: 2009-03-22 00:26:47 
Offline

Joined: 2008-12-12 04:30:22
Posts: 89
Спасибо написал наитупкриптейший скрипт но он работает как надо =)


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