Yoko

All sides of Injection
It is currently 2025-11-03 11:31:21

All times are UTC+02:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 2006-02-28 09:01:47 
Offline

Joined: 2006-02-03 12:56:56
Posts: 5
Скрипт делает торчи, берет из сундука 250 логов делает из них торчи, а после того как логи в паке кончаются он не берет их снова из сундука и скрипт остонавливается что тут не так?
Code:
var idSourceCont = '0x4037786A'   ;êîíòåéíåð â êîòîðîì ëåæàò ëîãè è åäà 
var idResiveCont = '0x4037786A'   ;êîíòåéíåð â êîòîðûé áóäóò ñêëàäûâàòüñÿ òîð÷è (ìîæíî ñêëàäûâàòü òóäà æå îòêóäà áåðóòüñÿ ëîãè)
var tTools = '0x0F51'            ;òèï íîæà
var ñTools = '0x0000'               ;öâåò íîæà
var tEat = '0x097B'               ;òèï åäû
var cEat = '0x0000'               ;öâåò åäû
var qTree = 250                  ;êîë-âî ëîãîâ êîòîðîå áåð¸òñÿ çà ðàç
VAR SpiritTime = UO.Timer()

sub main()
var i
Dim cTree[18]
  cTree[0]='0x047C'
  cTree[1]='0x0279'
  cTree[2]='0x096B'
  cTree[3]='0x0237'
  cTree[4]='0x0482'
  cTree[5]='0x010F'
  cTree[6]='0x0014'
  cTree[7]='0x03C1'
  cTree[8]='0x0085'
  cTree[9]='0x04C2'
  cTree[10]='0x0033'
  cTree[11]='0x002B'
  cTree[12]='0x0071'
  cTree[13]='0x09A4'
  cTree[14]='0x0B82'
  cTree[15]='0x00BE'
  cTree[16]='0x0035'
  cTree[17]='0x0BB6'
Dim mTree[17]
  mTree[0]='Oak'
  mTree[1]='Red Tree'
  mTree[2]='Dark Tree'
  mTree[3]='Swamp'
  mTree[4]='Silver Leaf'
  mTree[5]='Keranit'
  mTree[6]='Perit'
  mTree[7]='Petrified'
  mTree[8]='Dragon Tree'
  mTree[9]='Vampire Tree'
  mTree[10]='Eridan'
  mTree[11]='Hellios'
  mTree[12]='Illusions Tree'
  mTree[13]='Crystal'
  mTree[14]='Dead Tree'
  mTree[15]='Paradise Tree'
  mTree[16]='Titan Tree'
  mTree[17]='Avalon'
      If ( UO.Timer() - SpiritTime ) / 600 > 5 Then
         ; Ïðîøëî 5 ìèíóò ñ ìîìåíòà ïîñëåäíåé ïðîêà÷êè Spirit Speak
         SpSpeak()
         SpiritTime = UO.Timer()
      Endif
   UO.UseObject(idSourceCont)
   UO.DisArm()
   CheckLag()
   Open('backpack')
   if UO.Count(tTools) > 0 then
      UO.FindType(tTools,ñTools,'backpack')
      UO.AddObject('objTools','finditem')
   else
      return
   end if
   Open(idSourceCont)
   Open(idResiveCont)
   for i = 0 to 17   
       CraftTorch(mTree[i],cTree[i])
   next
end sub

sub CraftTorch(mTree,cTree)
   UO.FindType('0x1BDD',cTree,idSourceCont)
   if UO.FindCount() < 1 then
      return
   end if
   UO.CancelMenu()
   UO.AutoMenu('What do you',mTree)
   UO.AutoMenu(mTree,'torch')
   while GrabContainer('0x1BDD',cTree,qTree)==0
      UO.DeleteJournal()
      UO.WaitTargetType('0x1BDD')
      UO.UseObject('objTools')   
      repeat
         wait(100)
      until UO.InJournal('You put the torch') or UO.InJournal('fail') or UO.InJournal('failed')   
   wend
end sub

sub GrabContainer(tType, cType, Quanty)
   if UO.Count(tType,cType)<1 then
      UO.FindType('0x0F64','-1','backpack')
      if UO.FindCount() > 0 then
         UO.MoveItem('finditem','-1',idResiveCont)
         CheckLag()
      end if
      ToEat()
      UO.FindType(tType,cType,idSourceCont)
      If UO.FindCount() > 0 then
         UO.MoveItem('finditem',str(Quanty),'backpack')
         Wait(1000)
         CheckLag()
      else
         return 1
      End if             
   End If
   return 0
end sub

sub ToEat()   
   UO.FindType(tEat, cEat, idSourceCont)
   if UO.GetQuantity('finditem') > 0 then
      UO.MoveItem('finditem','20','backpack')
   else
      return
   end if
   repeat     
      CheckLag()
      uo.UseType(tEat,cEat)
      while not uo.InJournal("can't") and not uo.InJournal('full') and not uo.InJournal('stuffed') and not uo.InJournal('hungry') and not uo.InJournal('satiated') and not UO.Dead()
         wait(100)
      wend
   until uo.InJournal('too full') or UO.Dead() or uo.InJournal("can't")
   CheckLag()
   UO.FindType(tEat, cEat,'backpack')
   if UO.GetQuantity('finditem') > 0 then
      UO.MoveItem('finditem','-1',idSourceCont)     
   end if     
   CheckLag()
   wait(1000)
end sub

sub Open(Container)
   UO.UseObject(Container)
   CheckLag()
   wait(500)
end sub

sub CheckLag()
   UO.DeleteJournal()
   UO.Click('backpack')
   repeat
      wait(50)
   until UO.InJournal('backpack')
end sub

sub SpSpeak()
   VAR mod = UO.WarMode(), num
   VAR fizzle = 'You fail your attempt'
   VAR success = 'You establish a connection'
   UO.WarMode( 0 )
   UO.DeleteJournal( success )
   repeat
      UO.DeleteJournal( fizzle )
      UO.UseSkill( 'Spirit Speak' )
      num = 1
      repeat
         wait(100)
         num = num + 1
      until UO.InJournal( fizzle ) OR UO.InJournal( success ) OR num > 600
   until UO.InJournal( success )
   UO.WarMode( mod )
endsub


Top
   
 Post subject:
PostPosted: 2006-03-01 05:06:40 
Offline

Joined: 2005-04-19 18:00:29
Posts: 2259
Location: Московская область
скрипт зацыкли.
Code:
...
while not uo.Dead()
...
wend
...


Top
   
 Post subject:
PostPosted: 2007-03-15 14:39:18 
Offline

Joined: 2006-03-12 17:45:04
Posts: 11
u menja takaja ze problema!!! A mozno pokankretnee-kak zaciklitj script a to ja v iinje ploho razbirajusj!!! Zaranee spasibo!!!


Top
   
 Post subject:
PostPosted: 2007-03-15 16:30:11 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
Code:
while 1
      If ( UO.Timer() - SpiritTime ) / 600 > 5 Then
         ; Ïðîøëî 5 ìèíóò ñ ìîìåíòà ïîñëåäíåé ïðîêà÷êè Spirit Speak
         SpSpeak()
         SpiritTime = UO.Timer()
      Endif
   UO.UseObject(idSourceCont)
   UO.DisArm()
   CheckLag()
   Open('backpack')
   if UO.Count(tTools) > 0 then
      UO.FindType(tTools,ñTools,'backpack')
      UO.AddObject('objTools','finditem')
   else
      return
   end if
   Open(idSourceCont)
   Open(idResiveCont)
   for i = 0 to 17   
       CraftTorch(mTree[i],cTree[i])
   next
wend

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


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

All times are UTC+02:00


Who is online

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