Advertisement
Gruzing

Depositor

Apr 8th, 2025
399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.09 KB | None | 0 0
  1. label:deposit
  2. delay:5000
  3. function:[[
  4.  
  5. --deposit
  6.  
  7.  
  8. function moveItem(item, destination)
  9.  
  10.  
  11.   return g_game.move(item, destination:getSlotPosition(destination:getItemsCount()), item:getCount())
  12.  
  13.  
  14. end
  15.  
  16.  
  17. local moveFromBp = "magiczny plecak" -- nazwa bp, w ktorym masz itemy
  18.  
  19.  
  20. local moveToBp = "locker"  -- nazwa depo
  21.  
  22.  
  23. local itemsIdToMove = {6548} -- ID przedmiotów, które mają być przenoszone do depot {1010,1010,0101,1010,1111}
  24.  
  25.  
  26.  
  27.  
  28.  
  29. local moveTo = nil
  30.  
  31.  
  32.  
  33.  
  34.  
  35. for i, container in pairs(getContainers()) do
  36.  
  37.  
  38.   if container:getName() == moveToBp and container:getItemsCount() < container:getCapacity() then
  39.  
  40.  
  41.     moveTo = container
  42.  
  43.  
  44.   end
  45.  
  46.  
  47. end
  48.  
  49.  
  50.  
  51.  
  52.  
  53. if moveTo then
  54.  
  55.  
  56.   for i, container in pairs(getContainers()) do
  57.  
  58.  
  59.     if container:getName() == moveFromBp then
  60.  
  61.  
  62.       for j, item in pairs(container:getItems()) do
  63.  
  64.  
  65.         if table.contains(itemsIdToMove, item:getId()) then
  66.  
  67.  
  68.           moveItem(item, moveTo)
  69.  
  70.  
  71.           return "retry"
  72.  
  73.  
  74.         end
  75.  
  76.  
  77.       end
  78.  
  79.  
  80.     end
  81.  
  82.  
  83.   end
  84.  
  85.  
  86. end
  87.  
  88.  
  89. return true
  90.  
  91.  
  92.  
  93. ]]
  94. delay:1000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement