Page 1 of 1

Помогите подправить

Posted: 2008-04-17 04:13:21
by archy_
У меня есть макрос на мининг, с реколами и т.п. +на моем шарде стоит антимакрос система, тут я нашел скрипт который ее обходит, но у меня появилась другая проблема, после того как вылазиет окно антимакроса, скрипт вводит числа и мне пишет что все нормально число введено правильно, но чар дальше не копает, чтобы он продолжил копать нужно тыкнуть два раза на кирку... Подскажите что нужно дописать в скрпте на обкопку чтобы через определенное время он сам продолжал копать если не каких действий не происходит...

Вот кусок скрипта на обкопку:

Code: Select all

sub Obkopka() 
VAR mx, my, mz, a, b, c, d, e, f 
while not uo.dead() 
  if uo.injournal('GM') or uo.injournal('Admin') or uo.injournal('Seer') or uo.injournal('Counselor') or uo.injournal('Developer') then 
    uo.usetype('0x0F08') 
    uo.closeuo() 
  else 
    wait(50) 
  endif      
  uo.deletejournal() 
  mx = uo.getx('self') 
  my = uo.gety('self') 
  mz = uo.getz('self') 
  for a = mx-2 to mx+2 
    for b = my-2 to my+2 
      while not uo.Hidden() 
        c = 0 
        uo.warmode('0') 
        uo.useskill('Stealth') 
        repeat 
          wait(100) 
          c = c + 1 
        until uo.Hidden() or c > 40 
      wend 
      uo.print('!!!КОПАЕМ ТУТ!!!>>> : '+str(mx-a)+' '+str(my-b)) 
      d = val(uo.getglobal('place')) + 1 
      uo.setglobal('place', str(d)) 
      while not uo.injournal('no ore here') and not uo.injournal('location') and not uo.injournal('far away') and not uo.injournal('in rock') and not uo.injournal('You broke') 
        if uo.injournal('GM') or uo.injournal('Admin') or uo.injournal('Seer') or uo.injournal('Counselor') or uo.injournal('Developer') then 
          uo.usetype('0x0F08') 
          uo.closeuo() 
        else 
          wait(50) 
        endif      
        uo.deletejournal() 
        if uo.waiting() then 
          uo.canceltarget() 
        else 
          wait(50) 
        endif 
        uo.waittargettile('1341', str(a), str(b), str(mz)) 
        uo.usetype('0x0E85') #тип кирки# 
        while not uo.injournal('You put') and not uo.injournal('location') and not uo.injournal('no ore') and not uo.injournal('but fail') and not uo.injournal('far away') and not uo.injournal('in rock') and not uo.injournal('You broke') 
          wait(500) 
        wend 
        uo.setglobal('find', '1') 
        wait(200) 
        uo.set('finddistance', '7') 
        uo.findtype('0x000E', '-1', '1') #тип элементаля# 
        if uo.findcount() > 0 then 
          uo.setglobal('find', '0') 
          uo.usetype('0x0F08') 
          uo.exec('exec Teleportation') 
          uo.exec('terminate CheckingPlayers') 
          return 
        else 
          uo.setglobal('find', '0') 
        endif      
        if val(uo.getglobal('place')) > 25 then 
          uo.setglobal('place', '1') 
          uo.exec('exec ChengePlace')          
          return 
        else 
          wait(50) 
        endif 
        if uo.weight > 600 then #максимальный вес# 
          uo.setglobal('back', '1') 
          uo.exec('terminate CheckingPlayers') 
          GoHome() 
          CheckingItems() 
          Teleportation() 
          Back() 
          uo.exec('exec CheckingPlayers') 
        else 
          wait(50) 
        endif 
      wend 
      if uo.injournal('GM') or uo.injournal('Admin') or uo.injournal('Seer') or uo.injournal('Counselor') or uo.injournal('Developer') then 
        uo.usetype('0x0F08') 
        uo.closeuo() 
      else 
        wait(50) 
      endif      
      uo.deletejournal() 
    next 
  next 
wend 
end sub 
Ну или может нужно что в антимакросе подправить? Вот антимакрос:

Code: Select all

sub OneClick() 

   dim reindex[8] 
   reindex[0] = 11 
   reindex[1] = 12 
   reindex[2] = 13 
   reindex[3] = 10 
   reindex[4] = 16 
   reindex[5] = 14 
   reindex[6] = 17 
   reindex[7] = 15 
   var GumpID = 0 
   var ButtonID = 0 
   var ButtonText 
   var i = 18 
    
   if uo.LastGump('text', 4) <> "0" then 
      i = 19 
   end if 
   GumpID = val(Mid(uo.LastGump('command', i), 16, 4)) 
   ButtonID = reindex[GumpID-2225] 
   ButtonText = uo.LastGump('command', ButtonID) 
   uo.LClick(Val(Mid(ButtonText, 7, 3)), Val(Mid(ButtonText, 11, 3))) 
   while not uo.LastGump('replyed') 
   wait(100)
   wend 
end sub 

sub AntiMacro() 

   while not uo.Dead() 
      if not uo.LastGump('replyed') then 
         if uo.LastGump('text', 0) == 'Antimacros System' then 
            OneClick()
            wait(100)
         end if
      endif 
      wait(500)
   wend
end sub
Заранее благодарен! :oops:

Posted: 2008-04-17 05:39:56
by archy_
Добавил в этих строках:

Code: Select all

while not uo.injournal('no ore here') and not uo.injournal('location') and not uo.injournal('far away') and not uo.injournal('in rock') and not uo.injournal('You broke') 
сделал так:

Code: Select all

while not uo.injournal('no ore here') and not uo.injournal('location') and not uo.injournal('far away') and not uo.injournal('in rock') and not uo.injournal('You broke') and not uo.injournal('Success in work')
Эта надпись вылазит когда когд введен правильно...

Но теперь иногда антимакрос система не срабатывает и пишет что типа код введен не правильно...

Posted: 2008-04-17 05:52:57
by archy_
Дописал еще тудаже надпись если неправельно введен, теперь вроде нормально... Но иногда всеже еще останавливается... может еще есть решение какое?

Posted: 2008-04-17 08:46:59
by Yura

Code: Select all

sub AntiMacro() 
   while not uo.Dead() 
      if not uo.LastGump('replyed') then 
         if uo.LastGump('text', 0) == 'Antimacros System' then 
            OneClick() 
            wait(100) 
             uo.waittargettile('1341', str(UO.GetX()), str(UO.GetY()), str(UO.GetZ())) 
             uo.usetype('0x0E85') #тип кирки#
             wait(2000)
         end if 
      endif 
      wait(500) 
   wend 
end sub
или поставь таймер в цикле который проверяет сообщения

Posted: 2008-04-17 14:37:35
by archy_
Поконкретней где?:) А то вот так дописал теперь не хочет работать антимакр...

Posted: 2008-04-17 17:02:28
by Yura
archy_ wrote:Поконкретней где?:) А то вот так дописал теперь не хочет работать антимакр...
пример

Code: Select all

count=0
while not uo.injournal("test") and count < 30
   Count=Count + 1
   wait(100)
wend
[/cede]
через 3 секунды выйдет из цикла

Posted: 2008-04-21 06:36:15
by archy_
Тоесть в скрипте на копку:

Code: Select all

while not uo.injournal('You put') and not uo.injournal('location') and not uo.injournal('no ore') and not uo.injournal('but fail') and not uo.injournal('far away') and not uo.injournal('in rock') and not uo.injournal('You broke') 
          wait(500) 
        wend
Нада исправить на:

Code: Select all

count=0
while not uo.injournal('You put') and not uo.injournal('location') and not uo.injournal('no ore') and not uo.injournal('but fail') and not uo.injournal('far away') and not uo.injournal('in rock') and not uo.injournal('You broke')
Count=Count + 1 
wait(100) 
wend 
          wait(500) 
        wend
Или нет?

Posted: 2008-04-21 08:28:13
by archy_
О все вроде работает, сделал так:

Code: Select all

count=0 
while not uo.injournal('You put') and not uo.injournal('location') and not uo.injournal('no ore') and not uo.injournal('but fail') and not uo.injournal('far away') and not uo.injournal('in rock') and not uo.injournal('You broke') and count < 10
Count=Count + 1 
wait(500) 
wend