Advertisement
Guest User

depositer bp

a guest
Dec 20th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.76 KB | None | 0 0
  1.     elseif (labelName == "Backpacks") then
  2.                 Walker.Stop()
  3.                 print("Backpacks")
  4.                 Self.CloseContainers()
  5.                 repeat
  6.                 wait(900)
  7.                 until (Self.UseItemFromEquipment("backpack") > 0)
  8.                 wait(1000)
  9.                 Container.GetFirst():OpenChildren(Item.GetID(LootBp), Item.GetID(ItemsBp), Item.GetID(SupplyBp))
  10.                 wait(300)
  11.                 Container.GetByName(MainBp):Minimize()
  12.                 wait(300)
  13.                 Container.GetByName(LootBp):Minimize()
  14.                 wait(300)
  15.                 Container.GetByName(ItemsBp):Minimize()
  16.                 wait(300)
  17.                 Container.GetByName(SupplyBp):Minimize()
  18.                 wait(300)
  19.                 Walker.Start()
  20.  
  21.  
  22.    elseif (labelName == "Depositer") then
  23.         --Opening depot & bps
  24.         Walker.Stop()
  25.         Self.ReachDepot()
  26.         wait(500,600)
  27.         Container.GetByName("Locker"):OpenChildren({3502, true})            -- Opens depot chest
  28.         wait(500,600)
  29.         Container.GetByName("Locker"):Close()                               -- Closes locker
  30.         wait(500,600)
  31.         Container.GetByName("Depot Chest"):OpenChildren({ItemsDepotBP, true})   -- Opens depot bp for normal items
  32.         wait(500,600)
  33.         Container.GetByName("Depot Chest"):OpenChildren({StackDepotBP, true})   -- Opens depot bp for stackables
  34.         wait(500,600)
  35.  
  36.         while (Container.GetByName(ItemsDepotBP):isFull()) do       -- Opening next backpack untill reach non fully filled
  37.             Dedi_OpenNextBp(ItemsDepotBP)
  38.             wait(200,400)
  39.         end
  40.  
  41.         while (Container.GetByName(StackDepotBP):isFull()) do       -- Opening next backpack untill reach non fully filled
  42.             Dedi_OpenNextBp(StackDepotBP)
  43.             wait(200,400)
  44.         end
  45.  
  46.  
  47.         --Depositing items
  48.         for i=0,5 do        -- Repeat 4 times (put here amount of loot backpacks you have on yourself)
  49.             for j=Container.GetByName(LootBp):ItemCount()-1, 0, -1 do     -- Checks all slot takens
  50.                 local ItemName = Item.GetName(Container.GetByName(LootBp):GetItemData(j).id):titlecase()
  51.  
  52.                 if table.contains(Items, ItemName) then     -- If item is in Item list, move from loot backpack to depot bp)
  53.                     Container.GetByName(LootBp):MoveItemToContainer(j, Container.GetByName(ItemsDepotBP):Index(), Container.GetByName(ItemsDepotBP):ItemCapacity()-1)
  54.                     wait(200,400)
  55.                 end
  56.  
  57.                 if Container.GetByName(ItemsDepotBP):isFull() then      -- If depot backpack is filled open next
  58.                     Dedi_OpenNextBp(ItemsDepotBP)
  59.                     wait(200,400)
  60.                 end
  61.             end
  62.             Dedi_OpenNextBp(LootBp)   -- Checked all slots in current loot backpack, so open next and repeat looking for items again :)
  63.             wait(200,400)
  64.         end
  65.  
  66.  
  67.         --Depositing stackables
  68.         -- Here we have only 1 backpack, so we don't have to repeat it few times
  69.         for j=Container.GetByName(StackBackpack):ItemCount()-1, 0, -1 do
  70.             local ItemName = Item.GetName(Container.GetByName(StackBackpack):GetItemData(j).id):titlecase()
  71.                 if table.contains(Stackable, ItemName) then
  72.                     Container.GetByName(StackBackpack):MoveItemToContainer(j, Container.GetByName(StackDepotBP):Index(), Container.GetByName(StackDepotBP):ItemCapacity()-1)
  73.                     wait(200,400)
  74.                 end
  75.  
  76.                 if Container.GetByName(StackDepotBP):isFull() then
  77.                     Dedi_OpenNextBp(StackDepotBP)
  78.                     wait(200,400)
  79.                 end
  80.         end
  81.  
  82.  
  83.         --Closing bps with items
  84.         Container.GetByName(ItemsDepotBP):Close()
  85.         wait(200,400)
  86.         Container.GetByName(StackDepotBP):Close()
  87.         wait(200,400)
  88.        
  89.  
  90.         -- Opening main backpack and backpack for supplies
  91.         Self.CloseContainers()
  92.         while Dedi_WindowCount("all") < 4 do
  93.             Self.CloseContainers()
  94.                 repeat
  95.                 wait(900)
  96.                 until (Self.UseItemFromEquipment("backpack") > 0)
  97.                 wait(1000)
  98.                 Container.GetFirst():OpenChildren(Item.GetID(LootBp), Item.GetID(ItemsBp), Item.GetID(SupplyBp))
  99.                 wait(300)
  100.                 Container.GetByName(MainBp):Minimize()
  101.                 wait(300)
  102.                 Container.GetByName(LootBp):Minimize()
  103.                 wait(300)
  104.                 Container.GetByName(ItemsBp):Minimize()
  105.                 wait(300)
  106.                 Container.GetByName(SupplyBp):Minimize()
  107.                 wait(300)
  108.                 Walker.Start()
  109.         end
  110.  
  111.         Walker.Start()
  112.  
  113.     end
  114. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement