Advertisement
HamBrick327

barrel

Jan 23rd, 2022
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. local t = turtle
  2.  
  3. local i = 0
  4. local q = 0
  5. local a = true
  6. local SLOT_COUNT = 16
  7.  
  8. DROPPED_ITEMS = {
  9.     "minecraft:barrel"
  10. }
  11.  
  12. function placeBarrel()
  13.     print("Purging Inventory...")
  14.     for slot = 1, SLOT_COUNT, 1 do
  15.         local item = t.getItemDetail(slot)
  16.         if(item ~= nil) then
  17.             for filterIndex = 1, #DROPPED_ITEMS, 1 do
  18.                 if(item["name"] == DROPPED_ITEMS[filterIndex]) then
  19.                     print("Dropping - " .. item["name"])
  20.                     t.select(slot)
  21.                     t.place()
  22.                 end
  23.             end
  24.         end
  25.     end
  26. end
  27.  
  28.  
  29. while true do
  30.     placeBarrel()
  31.     t.turnLeft()
  32.     t.forward()
  33.     t.turnRight()
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement