Примитивная ходьба.
Moderators: Murderator+, Murderator
Примитивная ходьба.
Доброго времени суток. Облазил весь форум ни где не нашел объяснений как можно заставить персонажа ходить... Вообщем ребят мне нужно что бы чар шел по координатам (расстояние где-то 2-3 таила) затем возвращался на прежнюю позицию и ждал 6 секунд, повторял эту комбинацию 5 раз, затем делал тоже самое но с задержкой в 10 секунд, а потом начинал читать скрипт с начала (то есть вся операция 5 раз по 6 сек, 1 раз 10 сек и опять 5 раз по 6 сек, 1 раз 10 сек и так до бесконечности) Знаю что скрипт пустяковый но сам я его написать не смогу... Или хотя бы киньте ссылочку где можно прочитать как это можно реализовать. Заранее спасибо!
-
- Posts: 174
- Joined: 2008-12-13 00:00:15
что-то тип таго )
Code: Select all
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
-
- Junior Expert
- Posts: 3221
- Joined: 2004-06-24 22:08:56
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.
Telegram: @tatikom
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Telegram: @tatikom
-
- Posts: 174
- Joined: 2008-12-13 00:00:15
Jekaaa wrote:ввел координаты, ходит тупо по рандомным точкам =(
Норм %))))
попробуй ходилку поменять)
Last edited by Successful on 2009-03-21 22:38:46, edited 1 time in total.
-
- Posts: 174
- Joined: 2008-12-13 00:00:15
Code: Select all
uo.press(34)
uo.press(36)
в скобах код клавиш,сейчас это нум7 и нум 3,код клавиши можно посмотреть в скрипт эдиторе,в ячейке кей код,вписав свою кнопочку))