Yoko

All sides of Injection
It is currently 2025-10-15 14:00:58

All times are UTC+02:00




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
PostPosted: 2010-12-01 02:40:47 
Offline

Joined: 2010-12-01 02:33:17
Posts: 3
Ребят,если не в лом,помогите подправить данный скрипт(конкретно его ходилку),что бы,допустим,после 6-7 прохождений низ,верх,право,он 1 раз шёл лево (допустим на 15 тайлов),и вверх (на 14-к примеру):
Code:
sub main()
var i
uo.print("Poneslas`!!!")
While UO.Life>0
for i=1 to 10
kopat()
        uo.press(34)
        wait(500)
        uo.press(34)
        wait(500)
        uo.press(34)
    next
        uo.press(33)
        wait(500)
        uo.press(33)
        wait(500)
        uo.press(33)
    uo.print("Idem nazad!!!")
kopat()
    for i=1 to 10
        uo.press(36)
        wait(500)
        uo.press(36)
        wait(500)
        uo.press(36)
    next
        uo.press(33)
        wait(500)
        uo.press(33)
        wait(500)
        uo.press(33)

wend
end sub

sub kopat()
var where_x,where_y,coords,i
UO.DeleteJournal()
where_x=uo.getx()
where_y=uo.gety()
for i=-2 to 2
uo.print("Kopaem "+str(i+3)+"/5")
coords="waittargettile "+" 0 "+str(where_x)+" "+str(where_y+i)+" 0"
uo.exec(coords)
uo.exec("usetype '0x0E85'")
UO.DeleteJournal()
while (not (UO.InJournal("stop mining") or UO.InJournal("dig anything there") or UO.InJournal("too far away") or UO.InJournal("world saved")))
wait(1000)
wend
next
end sub

Заранее пасиб :roll:


Top
   
PostPosted: 2010-12-01 11:20:40 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
Во первых вот так отступы правильно расставлены:
Code:
sub main()
   var i
   uo.print("Poneslas`!!!")
   While UO.Life>0
      for i=1 to 10
         kopat()
         uo.press(34)
         wait(500)
         uo.press(34)
         wait(500)
         uo.press(34)
      next
      uo.press(33)
      wait(500)
      uo.press(33)
      wait(500)
      uo.press(33)
      uo.print("Idem nazad!!!")
      kopat()
      for i=1 to 10
         uo.press(36)
         wait(500)
         uo.press(36)
         wait(500)
         uo.press(36)
      next
      uo.press(33)
      wait(500)
      uo.press(33)
      wait(500)
      uo.press(33)
   wend
end sub
sub kopat()
   var where_x,where_y,coords,i
   UO.DeleteJournal()
   where_x=uo.getx()
   where_y=uo.gety()
   for i=-2 to 2
      uo.print("Kopaem "+str(i+3)+"/5")
      coords="waittargettile "+" 0 "+str(where_x)+" "+str(where_y+i)+" 0"
      uo.exec(coords)
      uo.exec("usetype '0x0E85'")
      UO.DeleteJournal()
      while (not (UO.InJournal("stop mining|dig anything there|too far away|world saved")))
         wait(1000)
      wend
   next
end sub

Во вторых uo.press(33) ;34,36 это и есть перемещение чара. Добавь в нужное место - сосчитать то не проблема.
А в третьих лучше посмотреть скрипты с координатными ходилками. Брекера или Дестракшена. Там вроде не сложно но в десятки разов качественнее и изменить координаты проще.

_________________
Image
YokoInjection CodeSweeper
Ошибка "Unhandled exception in parser"
Стрелялка для олдов.


Top
   
PostPosted: 2010-12-01 18:07:47 
Offline

Joined: 2010-12-01 02:33:17
Posts: 3
Ам...Пасиб за совет ща буду смотреть.
Про направления я понял(ток сща допёр,почему 3 раза направление-первый раз поворот в нужную сторону,так?),только когда вставлял влево-вверх,он у мя после каждого цикла возвращалси назад,а мне над что бы через каждых 6-7 циклов...Ну да лан рока никто не подскажет,буду мучать :) :)
Quote:
Во первых вот так отступы правильно расставлены:

А какая разница?Так красивее,проще читать?


Top
   
PostPosted: 2010-12-01 20:54:03 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
Grinder wrote:
А какая разница?Так красивее,проще читать?

Code:
for i=1 to 10
kopat()
        uo.press(34)
        wait(500)
        uo.press(34)
        wait(500)
        uo.press(34)
    next

так некрасиво и не ясно что next относится к for.

_________________
Image
YokoInjection CodeSweeper
Ошибка "Unhandled exception in parser"
Стрелялка для олдов.


Top
   
PostPosted: 2010-12-02 20:50:07 
Offline

Joined: 2010-12-01 02:33:17
Posts: 3
Не,чёт не врубаюсь :( :cry: :cry: :shock:


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 2 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