Нужен скрипт на производство Torch.

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
Talez
Posts: 30
Joined: 2005-02-25 20:42:05

Нужен скрипт на производство Torch.

Post by Talez »

Собственно сабж.Желательно, чтобы он их в сундук складывал)
Leo
Expert!
Posts: 791
Joined: 2005-01-15 19:15:05
Location: Dragon World
Contact:

Post by Leo »

Code: Select all

var idSourceCont = '0x40135151'   ;контейнер в котором лежат логи и еда 
var idResiveCont = '0x40135151'   ;контейнер в который будут складываться торчи (можно складывать туда же откуда беруться логи) 
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
Talez
Posts: 30
Joined: 2005-02-25 20:42:05

Post by Talez »

Он из любых логов делает?
Leo
Expert!
Posts: 791
Joined: 2005-01-15 19:15:05
Location: Dragon World
Contact:

Post by Leo »

Oak
Red Tree
Dark Tree
Swamp
Silver Leaf
Keranit
Perit
Petrified
Dragon Tree
Vampire Tree
Eridan
Hellios
Illusions Tree
Crystal
Dead Tree
Paradise Tree
Titan Tree
Avalon
Talez
Posts: 30
Joined: 2005-02-25 20:42:05

Post by Talez »

Leo wrote:Oak
Red Tree
Dark Tree
Swamp
Silver Leaf
Keranit
Perit
Petrified
Dragon Tree
Vampire Tree
Eridan
Hellios
Illusions Tree
Crystal
Dead Tree
Paradise Tree
Titan Tree
Avalon
Тобишь я могу много их в сейф накидать разных и он сам выбирать будет?
Leo
Expert!
Posts: 791
Joined: 2005-01-15 19:15:05
Location: Dragon World
Contact:

Post by Leo »

Угу.
Post Reply