Advertisement
HamBrick327

barrel.1

Jan 23rd, 2022
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.78 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. function findBarrel()
  29.     print('succing')
  30.     t.suck()
  31. end
  32.  
  33. while true do
  34.     findBarrel()
  35.     placeBarrel()
  36.     t.turnLeft()
  37.     t.forward()
  38.     t.turnRight()
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement