It is currently 28 Mar 2024, 19:03

All times are UTC + 2 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: 13 Dec 2017, 23:07 
Offline
Начинающий игрок

Joined: 15 Oct 2017, 11:14
Posts: 21
Вопрос по манингу (программа Инжект) у меня есть скрипт(см. ниже), он все делает но как доходит до плавки - стоит и все. В чём может быть проблема? (желательно ткнуть носом в строку)
Code:
sub Mining()
   start:
   gotoXY(2557,498)
   minround()
   gotoXY(2557,495)
   minround()
   gotoXY(2560,495)
   minround()
   gotoXY(2560,492)
   minround()
   gotoXY(2563,492)
   minround()
   gotoXY(2566,489)
   minround()
   gotoXY(2563,489)
   minround()
   gotoXY(2560,489)
   minround()
   gotoXY(2561,487)
   minround()
   gotoXY(2563,486)
   minround()
   gotoXY(2566,486)
   minround()
   gotoXY(2569,486)
   minround()
   gotoXY(2569,488)
   minround()
   gotoXY(2572,486)
   minround()
   gotoXY(2572,483)
   minround()
   gotoXY(2575,480)
   minround()
   gotoXY(2572,480)
   minround()
   gotoXY(2569,480)
   minround()
   gotoXY(2566,483)
   minround()
   gotoXY(2563,483)
   minround()
   gotoXY(2563,480)
   minround()
   gotoXY(2566,480)
   minround()
   gotoXY(2563,477)
   minround()
   gotoXY(2566,477)
   minround()
   gotoXY(2566,474)
   minround()
   gotoXY(2569,475)
   minround()
   gotoXY(2569,477)
   minround()
   gotoXY(2572,477)
   minround()
   gotoXY(2575,477)
   minround()
   goto start:
endsub

Sub minround()
   VAR Kirka = '0x0E86'
   VAR MaxVes = 1040
   VAR Tiles
   VAR x, y, t, k, mX, mY, mZ
   VAR MaxTime = 100
   VAR ms1 = "There is nothing"
   VAR ms2 = "You can't use"
   VAR ms3 = "You put "
   VAR ms4 = "You loosen some rocks"
   VAR ms5 = "location"
   VAR ms6 = "Try mining"
   VAR ms7 = "Цель слишком далеко"
   VAR ms8 = "У вас не получилось ничего добыть"
   mX = UO.GetX('self')
   mY = UO.GetY('self')
   mZ = UO.GetZ('self')
   for y=-1 to 1
      for x=-1 to 1
         If UO.Weight > MaxVes Then
            Plavca()
            BS()
         Endif
         Tiles = F_HarvestTiles(mX+x, mY+y)
         k = 0
         repeat
            UO.DeleteJournal()
            t = UO.Timer()
            k = k + 1
            UO.WaitTargetTile(Tiles, mX+x, mY+y, mZ)
            UO.UseType( Kirka )
            repeat
               wait(300)
            until UO.InJournal(ms1) OR UO.InJournal(ms2) OR UO.InJournal(ms3) OR UO.InJournal(ms4) OR UO.InJournal(ms5) OR UO.InJournal(ms6) OR UO.InJournal(ms7) OR ((t + MaxTime) < UO.Timer()) or UO.Weight > MaxVes
         until ( NOT UO.InJournal(ms4) AND NOT UO.InJournal(ms3) OR (k > 10) ) or UO.Weight > MaxVes
      next
   next
   Drop() ; функция сброса чтобы закоментировать поставь перед ней ;
endsub

Sub F_HarvestTiles(x,y)
   var i
   if UO.PrivateGetTile(x, y, -1, 1339, 1343) then
      for i=1339 to 1343
         if UO.PrivateGetTile(x, y, -1, i, i) then
            return i
         end if
      next
   end if
   return 0
end sub

Sub Drop() ; сотри ненужное...
   ;---------------------------------------------------------------------
   uo.findtype('0x19B9','0x0000','backpack')  ;????? ??????
   if uo.findcount() > 0 then
      UO.Drop('-1',1,1,0,'finditem')
      wait(300)
   endif
   ;--------------------------------------------------------------------
   uo.findtype('0x19B9','0x0AB2','backpack') ;сброс меди
   if uo.findcount() > 0 then
      UO.Drop('-1',1,1,0,'finditem')
      wait(300)
   endif
   ;-------------------------------------------------------------------
   uo.findtype('0x19B9','0x0488','backpack') ;сброс бронзы
   if uo.findcount() > 0 then
      UO.Drop('-1',1,1,0,'finditem')
   endif
   ;-----------------------------------------------------------------------
endsub

sub BS()
   uo.findtype('0x1BEF','0x0AB2','backpack')
   UO.WaitTargetType('0x1BEF')
   UO.UseType('0x13E3')
   wait(3000)
   While uo.count('0x1BEF') > 9
      UO.SendGumpSelect(508)
      wait(7000)
      PlavcaItem()
   wend
endsub

Sub Plavca()
   gotoXY(2573,474)
   uo.findtype('0x19B9',-1,'backpack')
   while uo.count('0x19B9') > 0
      uo.usetype('0x19B9')
      wait(300)
   wend
endsub

sub PlavcaItem()
   uo.findtype('0x1413','0x0AB2','backpack')
   while uo.findcount() > 0
      UO.WaitTargetObject('finditem')
      UO.UseObject('0x40008433')
      wait(300)
      uo.findtype('0x1413','0x0AB2','backpack')
   wend
endsub

Sub gotoXY(x,y)
   var ld=0,ldc=0
   var dx,dy
   var mx,my
   var ox,oy,mk,k
   start:
   mx=UO.GetX()
   my=UO.GetY()
   dx=mx-x
   if dx<0 then
      dx=0-dx
   endif
   dy=my-y
   if dy<0 then
      dy=0-dy
   endif
   if dy>dx then
      dx=dy
   end if
   if dx<=0 then
      return
   end if
   if not ldc then
   end if
   if dx<3 then
      mk=70
   else
      mk=15
   end if
   
   ox=mx
   oy=my
   for k=1 to mk
      mx=UO.GetX()
      my=UO.GetY()
      if mx<>ox or my<>oy then
         goto sdidapl
      end if
      wait(10)
   next
   sdidapl:
   
   mx=UO.GetX()
   my=UO.GetY()
   dx=mx-x
   if dx<0 then
      dx=0-dx
   endif
   dy=my-y
   if dy<0 then
      dy=0-dy
   endif
   if dy>dx then
      dx=dy
   end if
   
   if dx<=0 then
      return
   end if
   if ld==dx then
      ldc=ldc+1
      if ldc>100 then
         uo.print("Can not reach location!")
         return
      end if
   else
      ld=dx
   end if
   
   if mx==x then
      if my==y then
         return
      endif
      if my>y then
         UO.Press(33)
         goto start
      endif
      UO.Press(35)
      goto start
   end if
   if mx<x then
      if my>y then
         UO.Press(39)
         goto start
      endif
      if my==y then
         UO.Press(34)
         goto start
      endif
      UO.Press(40)
      goto start
   end if
   if my<y then
      UO.Press(37)
      goto start
   endif
   if my==y then
      UO.Press(36)
      goto start
   endif
   UO.Press(38)
   goto start
end sub

по идее делает перчатки из стали (Type=0x13EB) или последнюю вещь я так и не разобрался


Top
 Profile  
 
PostPosted: 13 Dec 2017, 23:13 
Offline
Бывалый игрок

Joined: 03 Dec 2016, 22:27
Posts: 317
UO.SendGumpSelect(508)

Скорее всего в этой строке проблема. Или меняли гамп или как на изиуо проблема с расширением.

_________________
...


Top
 Profile  
 
PostPosted: 13 Dec 2017, 23:15 
Offline
Эксперт
User avatar

Joined: 22 Jun 2013, 13:27
Posts: 1272
id plavilki proverj


Top
 Profile  
 
PostPosted: 13 Dec 2017, 23:25 
Offline
Начинающий игрок

Joined: 15 Oct 2017, 11:14
Posts: 21
тут дело в том что он куёт но не плавит результат, и id плавилки верное проверял, мне кажется проблема где-то в этой части
Code:
sub PlavcaItem()
   uo.findtype('0x1413','0x0AB2','backpack')
   while uo.findcount() > 0
      UO.WaitTargetObject('finditem')
      UO.UseObject('0x40008433')
      wait(300)
      uo.findtype('0x1413','0x0AB2','backpack')
   wend
endsub


Top
 Profile  
 
PostPosted: 13 Dec 2017, 23:38 
Offline
Начинающий игрок

Joined: 15 Oct 2017, 11:14
Posts: 21
Фу......х нашёл проблему , если кому надо вот на 100% для минока (нижняя плавилка)
Code:
sub Mining()
   start:
   gotoXY(2557,498)
   minround()
   gotoXY(2557,495)
   minround()
   gotoXY(2560,495)
   minround()
   gotoXY(2560,492)
   minround()
   gotoXY(2563,492)
   minround()
   gotoXY(2566,489)
   minround()
   gotoXY(2563,489)
   minround()
   gotoXY(2560,489)
   minround()
   gotoXY(2561,487)
   minround()
   gotoXY(2563,486)
   minround()
   gotoXY(2566,486)
   minround()
   gotoXY(2569,486)
   minround()
   gotoXY(2569,488)
   minround()
   gotoXY(2572,486)
   minround()
   gotoXY(2572,483)
   minround()
   gotoXY(2575,480)
   minround()
   gotoXY(2572,480)
   minround()
   gotoXY(2569,480)
   minround()
   gotoXY(2566,483)
   minround()
   gotoXY(2563,483)
   minround()
   gotoXY(2563,480)
   minround()
   gotoXY(2566,480)
   minround()
   gotoXY(2563,477)
   minround()
   gotoXY(2566,477)
   minround()
   gotoXY(2566,474)
   minround()
   gotoXY(2569,475)
   minround()
   gotoXY(2569,477)
   minround()
   gotoXY(2572,477)
   minround()
   gotoXY(2575,477)
   minround()
   goto start:
endsub

Sub minround()
   VAR Kirka = '0x0E86'
   VAR MaxVes = 1040
   VAR Tiles
   VAR x, y, t, k, mX, mY, mZ
   VAR MaxTime = 100
   VAR ms1 = "There is nothing"
   VAR ms2 = "You can't use"
   VAR ms3 = "You put "
   VAR ms4 = "You loosen some rocks"
   VAR ms5 = "location"
   VAR ms6 = "Try mining"
   VAR ms7 = "Öåëü ñëèøêîì äàëåêî"
   VAR ms8 = "Ó âàñ íå ïîëó÷èëîñü íè÷åãî äîáûòü"
   mX = UO.GetX('self')
   mY = UO.GetY('self')
   mZ = UO.GetZ('self')
   for y=-1 to 1
      for x=-1 to 1
         If UO.Weight > MaxVes Then
            Plavca()
            BS()
         Endif
         Tiles = F_HarvestTiles(mX+x, mY+y)
         k = 0
         repeat
            UO.DeleteJournal()
            t = UO.Timer()
            k = k + 1
            UO.WaitTargetTile(Tiles, mX+x, mY+y, mZ)
            UO.UseType( Kirka )
            repeat
               wait(300)
            until UO.InJournal(ms1) OR UO.InJournal(ms2) OR UO.InJournal(ms3) OR UO.InJournal(ms4) OR UO.InJournal(ms5) OR UO.InJournal(ms6) OR UO.InJournal(ms7) OR ((t + MaxTime) < UO.Timer()) or UO.Weight > MaxVes
         until ( NOT UO.InJournal(ms4) AND NOT UO.InJournal(ms3) OR (k > 10) ) or UO.Weight > MaxVes
      next
   next
   Drop() ; ôóíêöèÿ ñáðîñà ÷òîáû çàêîìåíòèðîâàòü ïîñòàâü ïåðåä íåé ;
endsub

Sub F_HarvestTiles(x,y)
   var i
   if UO.PrivateGetTile(x, y, -1, 1339, 1343) then
      for i=1339 to 1343
         if UO.PrivateGetTile(x, y, -1, i, i) then
            return i
         end if
      next
   end if
   return 0
end sub

Sub Drop() ; ñîòðè íåíóæíîå...
   ;---------------------------------------------------------------------
   uo.findtype('0x19B9','0x0000','backpack')  ;????? ??????
   if uo.findcount() > 0 then
      UO.Drop('-1',1,1,0,'finditem')
      wait(300)
   endif
   ;--------------------------------------------------------------------
   uo.findtype('0x19B9','0x0AB2','backpack') ;ñáðîñ ìåäè
   if uo.findcount() > 0 then
      UO.Drop('-1',1,1,0,'finditem')
      wait(300)
   endif
   ;-------------------------------------------------------------------
   uo.findtype('0x19B9','0x0488','backpack') ;ñáðîñ áðîíçû
   if uo.findcount() > 0 then
      UO.Drop('-1',1,1,0,'finditem')
   endif
   ;-----------------------------------------------------------------------
endsub

sub BS()
   uo.findtype('0x1BEF','0x0AB2','backpack')
   UO.WaitTargetType('0x1BEF')
   UO.UseType('0x13E3')
   wait(3000)
   While uo.count('0x1BEF') > 9
      UO.SendGumpSelect(508)
      wait(7000)
      PlavcaItem()
   wend
endsub

Sub Plavca()
   gotoXY(2573,474)
   uo.findtype('0x19B9',-1,'backpack')
   while uo.count('0x19B9') > 0
      uo.usetype('0x19B9')
      wait(300)
   wend
endsub

sub PlavcaItem()
   uo.findtype('0x13EB','0x042C','backpack')
   while uo.findcount() > 0
      UO.WaitTargetObject('finditem')
      UO.UseObject('0x40008433')
      wait(300)
      uo.findtype('0x13EB','0x042C','backpack')
   wend
endsub

Sub gotoXY(x,y)
   var ld=0,ldc=0
   var dx,dy
   var mx,my
   var ox,oy,mk,k
   start:
   mx=UO.GetX()
   my=UO.GetY()
   dx=mx-x
   if dx<0 then
      dx=0-dx
   endif
   dy=my-y
   if dy<0 then
      dy=0-dy
   endif
   if dy>dx then
      dx=dy
   end if
   if dx<=0 then
      return
   end if
   if not ldc then
   end if
   if dx<3 then
      mk=70
   else
      mk=15
   end if
   
   ox=mx
   oy=my
   for k=1 to mk
      mx=UO.GetX()
      my=UO.GetY()
      if mx<>ox or my<>oy then
         goto sdidapl
      end if
      wait(10)
   next
   sdidapl:
   
   mx=UO.GetX()
   my=UO.GetY()
   dx=mx-x
   if dx<0 then
      dx=0-dx
   endif
   dy=my-y
   if dy<0 then
      dy=0-dy
   endif
   if dy>dx then
      dx=dy
   end if
   
   if dx<=0 then
      return
   end if
   if ld==dx then
      ldc=ldc+1
      if ldc>100 then
         uo.print("Can not reach location!")
         return
      end if
   else
      ld=dx
   end if
   
   if mx==x then
      if my==y then
         return
      endif
      if my>y then
         UO.Press(33)
         goto start
      endif
      UO.Press(35)
      goto start
   end if
   if mx<x then
      if my>y then
         UO.Press(39)
         goto start
      endif
      if my==y then
         UO.Press(34)
         goto start
      endif
      UO.Press(40)
      goto start
   end if
   if my<y then
      UO.Press(37)
      goto start
   endif
   if my==y then
      UO.Press(36)
      goto start
   endif
   UO.Press(38)
   goto start
end sub


Top
 Profile  
 
PostPosted: 24 Dec 2017, 15:02 
Offline
Начинающий игрок

Joined: 15 Oct 2017, 11:14
Posts: 21
возникла проблема с гампом (UO.SendGumpSelect(508)) наверное поменяли, подскажите как исправить?


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

All times are UTC + 2 hours [ DST ]


Who is online

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