Advertisement
fatboychummy

quarryRefiller.lua

Aug 27th, 2019
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. local function find()
  2.   for i = 1, 16 do
  3.     if turtle.getItemCount(i) > 0 then
  4.       turtle.select(i)
  5.       return
  6.     end
  7.   end
  8.   error("No Items.", 0)
  9. end
  10.  
  11. local i = 0
  12. while true do
  13.   if not turtle.back() then
  14.     turtle.turnRight()
  15.     i = i + 1
  16.     if i >= 2 then
  17.       turtle.up()
  18.       find()
  19.       turtle.placeDown()
  20.       repeat until not turtle.back()
  21.       turtle.turnRight()
  22.       repeat until not turtle.back()
  23.       turtle.turnRight()
  24.       turtle.back()
  25.     end
  26.   else
  27.     i = 0
  28.   end
  29.  
  30.   find()
  31.   turtle.place()
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement