Page 1 of 1

Ругается что полетел счетчик вложенности goto. Mining

Posted: 2008-03-13 11:23:14
by altukhov
помогите найти ошибку

sub mining()
var mx, my, mz, i, j

na4alo:
mx = UO.GetX("self")
my = UO.GetY("self")
mz = UO.GetZ("self")

UO.DeleteJournal()

for i = mx-2 to mx+2
for j = my -2 to my+2

UO.Print("Копаем в координатах: "+str(mx-i)+" "+str(my-j))
while not UO.InJournal("0xAD00") and not UO.InJournal("0xA866") and not UO.InJournal("0xA20D")
UO.DeleteJournal()

if uo.waiting() then
uo.canceltarget()
endif

UO.Waittargettile("0", str(i), str(j), str(mz))
UO.Usetype("Pickaxe")
while not UO.InJournal("0xACF9") and not UO.InJournal("0xAD03")
wait (500)

wend
wend

UO.DeleteJournal()
goto na4alo
end sub

Re: Ругается что полетел счетчик вложенности goto. Mining

Posted: 2008-03-13 11:28:19
by Kynep
altukhov wrote:помогите найти ошибку

Code: Select all

sub mining() 
  var mx, my, mz, i, j 

  mx = UO.GetX("self")  
  my = UO.GetY("self") 
  mz = UO.GetZ("self") 

  UO.DeleteJournal() 

  for i = mx-2 to mx+2 
    for j = my -2 to my+2 

    UO.Print("Копаем в координатах: "+str(mx-i)+" "+str(my-j)) 
      while not UO.InJournal("0xAD00") and not UO.InJournal("0xA866") and not UO.InJournal("0xA20D") 
        UO.DeleteJournal() 
        if uo.waiting() then 
          uo.canceltarget() 
        endif 
        UO.Waittargettile("0", str(i), str(j), str(mz)) 
        UO.Usetype("Pickaxe") 
        while not UO.InJournal("0xACF9") and not UO.InJournal("0xAD03") 
          wait (500) 
        wend 
      wend 
      UO.DeleteJournal() 
    next
  next
end sub

Posted: 2008-03-13 11:34:29
by altukhov
Спасибо работает.