Blackhome

dropAll

Jan 6th, 2025 (edited)
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.68 KB | Gaming | 0 0
  1. -- Drops all slots forward except items from list in above storage
  2. function Forward(notDroppedBlocks)
  3.     local bDrop = true
  4.     for i = 1, 16, 1 do
  5.         turtle.select(i)
  6.         for j = 1, #notDroppedBlocks, 1 do
  7.             local itemDetail = turtle.getItemDetail()
  8.             if itemDetail then
  9.                 if itemDetail.name == notDroppedBlocks[j] then
  10.                     bDrop = False
  11.                 end
  12.             end
  13.         end
  14.         if bDrop then
  15.             turtle.drop()
  16.         end
  17.         bDrop = true
  18.     end
  19. end
  20.  
  21. -- Drops all slots up except items from list in above storage
  22. function Up(notDroppedBlocks)
  23.     local bDrop = true
  24.     for i = 1, 16, 1 do
  25.         turtle.select(i)
  26.         for j = 1, #notDroppedBlocks, 1 do
  27.             local itemDetail = turtle.getItemDetail()
  28.             if itemDetail then
  29.                 if itemDetail.name == notDroppedBlocks[j] then
  30.                     bDrop = False
  31.                 end
  32.             end
  33.         end
  34.         if bDrop then
  35.             turtle.dropUp()
  36.         end
  37.         bDrop = true
  38.     end
  39. end
  40.  
  41. -- Drops all slots down except items from list in above storage
  42. function Down(notDroppedBlocks)
  43.     local bDrop = true
  44.     for i = 1, 16, 1 do
  45.         turtle.select(i)
  46.         for j = 1, #notDroppedBlocks, 1 do
  47.             local itemDetail = turtle.getItemDetail()
  48.             if itemDetail then
  49.                 if itemDetail.name == notDroppedBlocks[j] then
  50.                     bDrop = False
  51.                 end
  52.             end
  53.         end
  54.         if bDrop then
  55.             turtle.dropDown()
  56.         end
  57.         bDrop = true
  58.     end
  59. end
  60.  
  61. return { Forward = Forward, Up = Up, Down = Down}
Add Comment
Please, Sign In to add comment