It is currently 29 Mar 2024, 02:54

All times are UTC + 2 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: 05 Jul 2018, 19:12 
Offline
Игрок
User avatar

Joined: 13 Dec 2016, 01:38
Posts: 159
Помогите пожалуйста,пытался настроить скрипт под себя,но что то пошло не так! Он идёт и упирается в конец шахты,(координаты брал через .where ибо не знаю как их ещё взять)
Помогите подскожите где подправить!



Code:
sub Mining()
   start:
   gotoXY(762,1693 -30)
   minround()
   gotoXY(771,1688 -30)
   minround()
   gotoXY(775, 1686 -30)
   minround()   
   gotoXY(777,1688  -30)
   minround()
   gotoXY(780,1685 -30)
   minround()
   gotoXY(783,1682 -30)
   minround()
   gotoXY(780,1681 -30)
   minround()
   gotoXY(779,1678 -30)
   minround()   
   gotoXY(777,1674 -30)
   minround()
   gotoXY(773,1675 -30)
   minround()
   gotoXY(770,1676 -30)
   minround()   
   gotoXY(776,1677 -30)
   minround()
   gotoXY(770,1678 -30)
   minround()
   gotoXY(770,1681 -30)
   minround()
   gotoXY(768,1683 -30)
   minround()
   gotoXY(771,1683 -30)
   minround()   
   gotoXY(772,1681 -30)
   minround()
   gotoXY(770,1685 -30)
   minround()
   gotoXY(772,1683 -30)
   minround()   
   gotoXY(774,1683 -30)
   minround()
   gotoXY(776,1682 -30)
   minround()
   gotoXY(776,1684 -30)
   minround()
   gotoXY(774,1686 -30)
   minround()
   gotoXY(772,1689 -30)
   minround()   
   gotoXY(773,1691 -30)
   minround()
   gotoXY(775,1693 -30)
   minround()
   goto start:
endsub

Sub minround()
   VAR Kirka = '0x0E86'
   VAR MaxVes = 1000
   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 = "Öåëü ñëèøêîì äàëåêî"
   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
   ;----------------------------------------------------------------------- 
   
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(775,1698)
   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('0x40022AF8')
      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


Top
 Profile  
 
PostPosted: 06 Jul 2018, 00:20 
Offline
Эксперт
User avatar

Joined: 22 Jun 2013, 13:27
Posts: 1272
gotoXY(762,1693 -30) zachem -30 ?


Top
 Profile  
 
PostPosted: 06 Jul 2018, 08:16 
Offline
Игрок
User avatar

Joined: 13 Dec 2016, 01:38
Posts: 159
Vel wrote:
gotoXY(762,1693 -30) zachem -30 ?



Исправил,Всё равно идёт и уперается в стену. В чём может быть причина?


Top
 Profile  
 
PostPosted: 06 Jul 2018, 08:29 
Offline
Игрок

Joined: 23 Sep 2015, 21:33
Posts: 139
Code:
   gotoXY(762,1693 -30)
   minround()
попробуй убрать эту строку или пробуй так
Code:
gotoXY(762,1693,0)


Top
 Profile  
 
PostPosted: 06 Jul 2018, 08:46 
Offline
Игрок
User avatar

Joined: 13 Dec 2016, 01:38
Posts: 159
vertijok2000 wrote:
Code:
   gotoXY(762,1693 -30)
   minround()
попробуй убрать эту строку или пробуй так
Code:
gotoXY(762,1693,0)



Спасибо огромное!!! Удалил эту строчку,поменял максимальный вес на 1800 и вроде копает,проверю ещё и вечером отпишусь!


Top
 Profile  
 
PostPosted: 08 Jul 2018, 23:31 
Offline
Игрок

Joined: 23 Sep 2015, 21:33
Posts: 139
как скрипт ?


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 155 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:  
cron
Powered by phpBB® Forum Software © phpBB Group