Forum in READ ONLY mode! All questions and discussions on Discord official server, invite link: https://discord.gg/VxsGzJ7

помощь в переделке скрипта

тут можно задать вопрос по скриптингу
Post Reply
ice_k7
Neophyte
Neophyte
Posts: 11
Joined: 26.08.2015 21:24

помощь в переделке скрипта

Post by ice_k7 »

ребята кто может переделать данный скрипт с ижекта под стелс???
зарание спс за помощь :)

Code: Select all

# 23.11.2009 
# 1# Mining Elemental hunter by Nmy a.k.a. Dark Enemy
# Суть скрипта - мининг по рункам. Запускать надо только sub main(). Нечего другого.
# Если чар жив, при запуске надо иметь в бекпаке руну к сундуку,
# если чар мертв, тогда просто запускайте скрипт.
# После запуска скрипт ищет кирку или лопату - автоматически.
# Требования перед запуском - реги bp bm mr ns ga в сундуке,
# бланк руны в мешке BlankRunebag,
# замарченые руны в Runebag (Чем больше, тем лучше. У меня где то 59 спотов),
# руна домой Runehome, прямо у сундука,
# инвизки в сундуке для рекола от пк и фарма елемов,
# скролы на Energy Vortex для фарма елемов,
# куча кирок в сундуке.
# При запуске чар должен иметь готовую руну домой в бекпаке. Других рун в бекпаке не должно быть.
##
# Запускается скрипт у сундука и записывается руна домой.
# Скрипт берет реги, 2 инвизки, скрол вортекса, если надо, кирку и улетает.
# Начинается копка. Через каждый тайл идет проверка на елема,
# если елем выха, плут или обсид - убивает елема, Vas An Ort, лутает руду, улетает, выгружается, берет руну в следующею шахту,
# Тщательно проверяется журнал на пк, исключая ('Elemental|Scorpion King|Giant Spider|Energy Vortex').
# Улетает от пк - пьет инвизку и делает рекол по рунбуке или руне,
# открываетcя окно текста TextOpen и пишется Nick @ время @ дата, например:
# Roland @ 15:59:20 @ 9.09.18
##
# Track World Items должен быть включен.
# Reconnector - включается, он просто заходит обратно, нет гарантии что скрипт будет дальше работать,
# но шанс на успех все таки есть.
##
# Добавлен ресс в Миноке. Чар ресается, летит домой, маркает руну домой, ищет кирку в сундуке, запускает мейн скрипт.
# Добавлены переменные для хелп кнопки, т.к. папердолл у каждого может быть в разных местах. 
# Undead надо включить.
##
# Чар медитирует фулл ману перед реколом в шахту.
var Pickaxe, Runehome, Blankrune, Runinetu, Nrune, flagpk
var Runebook='0x403A779E' # Для рекола домой.
var Runenr='46' # Номер руны.
var Chest='0x403DDE5C' # Я лично поставил 2 сейфа рядом - 1 для ресурсов, 2й для руды.
var Orechest='0x404BE1AE' # Сюда кидают руду.
var Dropbag='0x400F04AB' # Пустой мешок куда кидают руны после обкопа.
var Runebag='0x402C79CB' # Руны куда лететь.
var Blankrunebag='0x4006A346' # Мешок с бланк рунами.
var rune='0x1F14' # Тип руны.
var homeX=1520 # Координаты где стоит чар у сундука.
var homeY=205 # Координаты где стоит чар у сундука.
var helpX=1398 # Переменные без кавычек!
var helpY=53 # Переменные без кавычек!
var recallrunebook=0 # Улетает от пк по рунбуке или по руне. 1-рунбук, 0-руна.
var food='0x09BB' # Тип еды. Будет брать по 2 и кушать.
sub main()
   var markflag
   uo.exec('exec Reconnector')
   if not uo.getglobal('flagRes')=='1' then
      uo.exec('exec Resurrector')
      uo.setglobal('flagRes','1')
   endif
   wait(1000)   
   uo.print('Dont forget track world items!')
   uo.findtype(rune,-1,'backpack')
   if uo.findcount() then
      Runehome=uo.getserial('finditem')
   else
      uo.print('Runehome not found! Terminate.')
      uo.exec('terminate all')
   endif
   Open(Chest)
   GrabBlankRune()
   while not uo.dead()
      Open(Runebag)
      uo.findtype(rune,-1,Runebag)
      while uo.findcount() 
         uo.print('Медитируем')
         meditation(uo.int)
         Nrune=uo.getserial('finditem')
         uo.moveitem(Nrune,0,Dropbag)
         checklag()
         wait(700)
         RegCheck()
         RegCheck()
         grabinvis()
         GetPickaxe()
         grabvortex()
         toeat()
         RecallRune(Nrune)
         uo.ignorereset()
         markflag=0
         flagpk=0
         checkifelem()
         if uo.injournal('is attacking you') then
            uo.warmode(0)
            invis()
         endif
         if uo.injournal('The recall rune fades completely.') then
            markflag=1
            Mark(Blankrune,0)
            Runinetu=1
         endif
         mining() 
         checkifelem()
         if not flagpk==1 then
            repeat
               RecallRune(Runehome)
            until uo.getx('self')==homeX && uo.getY('self')==homeY
         endif
         if uo.injournal('The recall rune fades completely.') then
            Open(Chest)
            if Runinetu==1 then
               GrabBlankRune()
            endif
            Mark(Blankrune,1)
            GrabBlankRune()
         endif
         Open(Chest)
         if Runinetu==1 then
            GrabBlankRune()
         endif
         if markflag==1 then
            uo.moveitem(Nrune,0,Dropbag)
            checklag()
            wait(700)
         endif
         Dropore()
         if flagpk==1 then
            uo.print(' ждем 100 секунд ')
            wait(100000)
         endif
         Open(Runebag)
         uo.findtype(rune,-1,Runebag)
      wend
      DropbagCheck()
   wend
endsub
sub Resurrector()
   var oldX,oldY 
   while 1
      if uo.dead() then
         uo.exec('terminate main')
         uo.exec('terminate Reconnector')
         uo.TextOpen()
         uo.TextPrint('- dead - @ '+MakeTime())
         wait(5000)
         oldX = Uo.GetX() 
         oldY = Uo.GetY()
         uo.useobject('self')
         checklag()
         wait(700)
         repeat
            uo.lclick(helpX,helpY)
            checklag()
            wait(700)
            uo.lclick(264,308)
            checklag()
            wait(700)      
            uo.lclick(175,203)
            checklag()
            wait(5000)   
         until oldX<>UO.GetX() OR oldY<>UO.GetY()
         repeat
            uo.press(39)
            wait(2000)
         until UO.GetY()<534
         repeat
            uo.useobject('0x4001BDF0')
            wait(3000)
         until uo.life>0
         Open(uo.getserial('backpack'))
         wait(100000)
         oldX = Uo.GetX() 
         oldY = Uo.GetY()         
         uo.recall(Runebook,Runenr)
         repeat
            wait(700)
         until oldX<>uo.getx('self') && oldY<>uo.gety('self')
         Open(Chest)
         RegCheck()
         GrabBlankRune()
         Mark(Blankrune,1)
         if uo.waiting() then 
            uo.canceltarget() 
         endif 
         uo.exec('exec main')
      endif
      wait(5000)
   wend
endsub
sub checkifelem()
   uo.ignorereset()
   uo.findtype('0x0010',-1,'ground')
   if uo.findcount() then
      invis()
   endif
endsub
sub GetPickaxe()
   var n
   dim instrument[4]
   instrument[1]='0x0F39'
   instrument[2]='0x0F3A'
   instrument[3]='0x0E86'
   instrument[4]='0x0E85'
   if uo.count('0x0F39')==0 and uo.count('0x0F3A')==0 and uo.count('0x0E86')==0 and uo.count('0x0E85')==0 then
      for n=1 to 4
         uo.findtype(instrument[n],-1,Chest)
         if uo.findcount() then
            pickaxe=uo.getserial('finditem')
            uo.moveitem('finditem',0,'backpack')
            checklag()
            wait(700)
            return
         endif
      next
   else
      for n=1 to 4
         uo.findtype(instrument[n],-1,'my')
         if uo.findcount() then
            pickaxe=uo.getserial('finditem')
            return
         endif
      next   
   endif
   while 1
      uo.print(' pickaxe not found ')
      wait(3000)
   wend
endsub
sub Tohide()
   while not uo.Hidden()
      uo.warmode(0)
      uo.Print('Пытаемся уйти в хайд...')
      uo.UseSkill('Hiding')
      wait(4000)
   wend
end sub
sub checkelem()
   var n
   var flagvortex, Elemental, flaginvis
   Dim ore[2]
   ore[1]='0x19B8'
   ore[2]='0x19B9'
   uo.set('finddistance','3')
   uo.findtype('0x0010',-1,'ground')
   while uo.findcount()
      Elemental=uo.getserial('finditem')
      if checkcolor(Elemental)==1 then
         flagvortex=1
         if not flaginvis==1 then
            invis()
            flaginvis=1
         endif
         castvortex()
         uo.textopen()
         uo.textprint(uo.getname(Elemental)+' @ '+MakeTime())
         for n=0 to 15
            wait(1000)
            checkpk()
            if flagpk==1 then
               return
            endif
         next
      else
         uo.ignore(Elemental)
      endif
      uo.findtype('0x0010',-1,'ground')
   wend
   if flagvortex==1 then
      repeat
         checklag()
         while uo.mana<22
            wait(500)
         wend
         uo.waittargetobject('self')
         uo.cast('Mass Dispel')
         WaitForMana()
         wait(1000)
      until not uo.injournal('The spell fizzles')
      for n=1 to 2
         uo.findtype(ore[n],-1,'ground')
         while uo.findcount()
            uo.moveitem('finditem',-1,'backpack')
            checklag()
            wait(700)
            uo.findtype(ore[n],-1,'ground')
         wend
      next
      return 1
   endif
endsub
sub checkcolor(obj)
   var n, c
   Dim color[14]
   color[1]='0x09DA' ; vulcan
   color[2]='0x0060' ; aqua
   color[3]='0x0BA7' ; eldar
   color[4]='0x09E6' ; elvin
   color[5]='0x09B9' ; acid
   color[6]='0x09D3' ; steel
   color[7]='0x008F' ; sand rock
   color[8]='0x09EC' ; blood crest
   color[9]='0x09F0' ; gorgan
   color[10]='0x010F' ; krynite
   color[11]='0x09A4' ; crystaline
   color[12]='0x0085' ; dragon
   color[13]='0x08AF' ; plutonium
   color[14]='0x0028' ; obsidian
   c=uo.getcolor(obj)
   for n=1 to 14
      if c == color[n] then
         return 1
      endif
   next
endsub
sub castvortex()
   repeat
      checklag()
      uo.waittargettile('1341',str(uo.getx()),str(uo.gety()),str(uo.getz()))
      uo.resend()
      uo.findtype('0x1F66',-1,'backpack')
      if uo.findcount() then
         while uo.mana<13
            wait(500)
         wend
         uo.useobject('finditem')
      else
         while uo.mana<27
            wait(500)
         wend
         uo.cast('Energy Vortex')
      endif
      WaitForMana()
   until not uo.injournal('The spell fizzles')
endsub
sub WaitForMana()
   VAR w,m
   m=uo.mana
   for w=0 to 100
      if uo.mana<m then
         return
      endif
      if uo.injournal('is attacking you') then
         checklag()
         invis()
      endif
      wait(200)
   next
endsub
sub grabvortex()
   var kol=1, q
   uo.findtype('0x1F66',-1,'backpack')
   if uo.getquantity('finditem')<kol then
      q=kol-uo.getquantity('finditem')
      uo.print('Ищем вортекс')
      uo.findtype('0x1F66',-1,Chest)
      if uo.findcount() then
         uo.moveitem('finditem',STR(q),'backpack')
         checklag()
         wait(700)
      endif
   endif
endsub
sub toeat()
   repeat
      uo.findtype(food,-1,Chest)
      if uo.findcount() then
         uo.moveitem('finditem','2','backpack')
         checklag()
         wait(600)
         repeat
            uo.usetype(food)
            wait(500)
         until uo.injournal('full to eat') or uo.count(food)==0
      endif
   until uo.injournal('full to eat')
   uo.findtype(food,-1,'backpack') 
   if uo.findcount() then 
      uo.moveitem('finditem',0,Chest) 
      checklag() 
      wait(600) 
   endif   
endsub
sub Open(what)
   uo.useobject(what)
   checklag()
   wait(700)
endsub
sub Dropore()
   var n
   Dim ore[5]
   ore[0]='0x19BA'
   ore[1]='0x19B7'
   ore[2]='0x19B8'
   ore[3]='0x19B9'
   ore[4]='0x0F10'
   uo.warmode(0)
   uo.useskill('Hiding')
   for n=0 to 4
      uo.findtype(ore[n],-1,'backpack')
      while uo.findcount()
         uo.moveitem('finditem',0,Orechest)
         checklag()
         wait(700)
         uo.findtype(ore[n],-1,'backpack')
      wend
   next
   uo.print('Dropore done.')
endsub
sub Mark(RuneID,Place) 
   repeat
      meditation(33)
      checklag()
      Uo.Cast('Mark',RuneID) 
      WaitForMana()
      wait(300)
   until not uo.injournal('The spell fizzles')
   if Place==0 then 
      Nrune=uo.getserial(RuneID)
   else 
      Runehome=uo.getserial(RuneID)
   endif 
endsub 
sub meditation(mn)
   uo.warmode(0)
   while uo.mana < mn
      if uo.mana==uo.int then
         return
      endif
      checklag()
      uo.Useskill('Meditation') 
      waitformed(mn) 
      wait(1000)
   wend
endsub 
sub waitformed(mn)
   var n
   for n=0 to 100
      if uo.injournal('You lose|You are at peace') or uo.mana>=mn then
         return
      endif
      wait(500)
   next
endsub 
sub RecallRune(nowrune) 
   uo.Print('улетаем по руне') 
   var oldX,oldY 
   oldX = Uo.GetX() 
   oldY = Uo.GetY()
   repeat
      meditation(20)
      checklag()
      Uo.Cast('Recall',nowrune)
      WaitForMana()
      wait(1000)
   Until oldX<>UO.GetX() AND oldY<>UO.GetY() 
endsub 
sub grabinvis()
   uo.findtype('0x0F0E',-1,'backpack')
   while uo.findcount()
      uo.moveitem('finditem',0,Chest)
      checklag()
      wait(700)
      uo.findtype('0x0F0E',-1,'backpack')
   wend
   uo.findtype('0x0F0E','0x0631',Chest)
   if uo.findcount() then
      uo.print('Ищем инвизку')
      uo.moveitem('finditem','2','backpack')
      checklag()
      wait(700)
   endif
endsub
sub RegCheck()
   VAR i,q
   VAR kol=9
   Dim Regs[6]
   Regs[0]='0x0F7A'      ; Black Pearl 
   Regs[1]='0x0F7B'      ; Bood Moss 
   Regs[2]='0x0F86'      ; Mandrake Root
   Regs[3]='0x0F88'     ; Nightshade
   Regs[4]='0x0F8C'     ; Sulfurous Ash
   Regs[5]='0x0F84'     ; Garlic
   
   for i=0 to 5
      if uo.count(Regs[i])<>kol then
         q=kol-uo.count(Regs[i])
         if q<>0 then
            if q>0 then
               uo.findtype(Regs[i],-1,Chest)
               if uo.findcount() then
                  uo.moveitem('finditem',STR(q),'backpack')
                  checklag()
                  wait(700)
                  uo.print('Берем реги для рекола...')
               else
                  uo.print('No regs')
                  return
               endif
            else
               q=q*-1            
               uo.findtype(Regs[i],-1,'my')   
               if uo.findcount() then
                  uo.moveitem('finditem',STR(q),Chest)
                  checklag()
                  wait(700)
                  uo.print('Регов больше чем надо. Кидаем лишнее в сундук')
               endif
            endif
         endif
      endif
   next
endsub
sub GrabBlankRune()
   Open(BlankRunebag)
   uo.findtype(rune,-1,BlankRunebag)
   if uo.findcount() then
      Blankrune=uo.getserial('finditem')
      uo.moveitem('finditem',0,'backpack')
      checklag()
      wait(700)
      uo.print('Взяли бланк руну')
      Runinetu=0
   else
      uo.print('Бланк рун больше нету! Скрипт остановлен.')
      uo.exec('terminate all')
   endif
endsub
sub DropbagCheck()
   uo.print('Проверяем мешок Dropbag')
   Open(Dropbag)
   uo.findtype(rune,-1,Dropbag)
   while uo.findcount()
      uo.moveitem('finditem',0,Runebag)
      checklag()
      wait(700)
      uo.print('Нашли руну. Кладем их в сумку Runebag.')
      uo.findtype(Rune,-1,Dropbag)
   wend
endsub
sub mining() 
   var mx, my, mz, i, j, f
   mx = UO.GetX('self') 
   my = UO.GetY('self') 
   mz = UO.GetZ('self') 
   for i = mx-4 to mx+4 
      for j = my -4 to my+4 
         repeat
            if uo.count('0x0F39')==0 and uo.count('0x0F3A')==0 and uo.count('0x0E86')==0 and uo.count('0x0E85')==0 then
               return
            endif
            if uo.injournal('You loosen some rocks but fail') then
               wait(10000)
            endif
            Tohide() 
            UO.Print('Копаем в координатах: '+str(mx-i)+' '+str(my-j))
            DigAhole(i,j,mz)
            if uo.injournal('You have been revealed') then
               uo.warmode(0)
               invis()
               return
            endif
            if flagpk==1 then
               return
            endif
         until not uo.injournal('You loosen some rocks but fail')
         if checkelem()==1 then
            return
         endif
      next 
   next 
endsub 
sub DigAhole(i,j,mz)
   var f
   for f=0 to 10
      checklag()
      uo.waittargettile('1341',i,j,mz) 
      uo.useobject(pickaxe)
      if waitforore()==1 then
         return
      endif
   next
endsub
sub waitforore()
   var n
   for n=0 to 50
      checkpk()
      if uo.injournal('no ore here|location|far away|in rock|You have been revealed') or flagpk==1 then
         return 1
      endif
      if uo.injournal('You put|heavy|but fail') then
         return
      endif
      wait(500)
   next
endsub
sub checkpk()
   var n
   var ser
   var noto
   var me=uo.getserial('self')
   for n=0 to 9
      ser=uo.journalserial(n)
      noto=uo.getnotoriety(ser)
      if not ser==me then
         if noto<>0 and noto<>1 and noto<>3 and not uo.injournal('Elemental|Scorpion King|Giant Spider|Energy Vortex') then
            uo.TextOpen()
            uo.TextPrint(uo.getname(ser)+' @ '+MakeTime())
            invis()
            if recallrunebook==1 then
               gohome()
            else
               RecallRune(Runehome)
            endif
            flagpk=1
            return
         endif
      endif
   next
endsub
sub gohome()
   var oldX=uo.getx('self')
   var oldY=uo.gety('self')
   uo.recall(Runebook,Runenr)
   repeat
      wait(700)
      if uo.injournal('You have been revealed') then
         checklag()
         invis()
      endif
   until oldX<>uo.getx('self') && oldY<>uo.gety('self')
endsub
sub invis()
   uo.usetype('0x0F0E','0x0631')
endsub
sub CheckLag() 
   repeat
      UO.DeleteJournal() 
      UO.Click('backpack') 
   until backpack()==1
endsub 
sub backpack()
   var n
   for n=0 to 200
      if uo.injournal('a backpack') then
         return 1
      endif
      wait(200)
   next
endsub
sub Reconnector() 
   var ReconnectTime, RFlag 
   ReconnectTime = '0' 
   RFlag = 1 
   Repeat 
      While (UO.ObjAtLayer('Bpack') == '') 
         if RFlag Then 
            ReconnectTime = MakeTime() 
            RFlag = 0 
         endif 
         Wait(1000) 
         UO.Say('') 
         Wait(3000) 
         UO.Say('') 
         Wait(3000) 
         UO.Say('') 
         Wait(3000) 
         UO.LDblClick(357,164) 
         UO.LClick(616,459) 
         Wait(3000) 
      WEnd 
      Wait(3000) 
      if (RFlag == 0) and (ReconnectTime <> '0') Then 
         ;UO.Exec('terminate all') 
         ;UO.Exec('exec autoload') 
         UO.TextOpen() 
         UO.TextPrint('Disconnected & Reconnected @ '+ReconnectTime) 
         RFlag = 1 
         ReconnectTime = '0' 
      endif 
   Until false 
end sub 
sub MakeTime() 
   VAR D, T, Ret, i 
   Ret = STR(UO.Time()) 
   T = "" 
   For i = 0 To Len(Ret) 
      T = Ret[Len(Ret)-i] + T 
      If (I == 2) OR (I == 4) Then 
         T = ":" + T 
      EndIf 
   Next 
   Ret = STR(UO.Date()) 
   D = "" 
   For i = 0 To Len(Ret) 
      D = Ret[Len(Ret)-i] + D 
      If (I == 2) OR (I == 4) Then 
         D = "." + D 
      EndIf 
   Next 
   Ret = T + " @ " + D 
   RETURN Ret 
end sub
Macks
Apprentice
Apprentice
Posts: 250
Joined: 27.02.2006 22:23
Location: АоП - Age Of Power

Re: помощь в переделке скрипта

Post by Macks »

А смысл?

Есть готовые под стелс, возьми и сам добавь из инжектового что тебе не хватает.
ice_k7
Neophyte
Neophyte
Posts: 11
Joined: 26.08.2015 21:24

Re: помощь в переделке скрипта

Post by ice_k7 »

мможеш датьссылку на готовый??? а тоя чет не видел здесь такого :(
Macks
Apprentice
Apprentice
Posts: 250
Joined: 27.02.2006 22:23
Location: АоП - Age Of Power

Re: помощь в переделке скрипта

Post by Macks »

ice_k7 wrote:мможеш датьссылку на готовый??? а тоя чет не видел здесь такого :(
сборник
http://stealth.od.ua/forum/viewtopic.php?f=3&t=765
Post Reply