Advertisement
HappySunChild

TurtleBridge

Jun 24th, 2022
1,210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. local args = { ... }
  2.  
  3. local distance = tonumber(args[1])
  4.  
  5. local function selectBlock()
  6.     for i = 1, 16 do
  7.         local count = turtle.getItemCount(i)
  8.  
  9.         if count > 1 then
  10.             turtle.select(i)
  11.             break
  12.         end
  13.     end
  14. end
  15.  
  16. for i = 1, distance do
  17.     if turtle.getItemCount(turtle.getSelectedSlot()) == 0 then
  18.         selectBlock()
  19.     end
  20.  
  21.     turtle.placeDown()
  22.     turtle.dig()
  23.     turtle.forward()
  24. end
  25.  
  26. turtle.placeDown()
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement