Advertisement
Guest User

mining.lua

a guest
May 14th, 2019
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. turtle.refuel()
  2.  
  3. width = 3
  4. height = 3
  5. levels = 3
  6. turn = 0
  7.  
  8. for l = 0, levels, 1 do
  9.     for i = 0, width, 1 do
  10.         for j = 0, width, 1 do
  11.             while turtle.detect() do
  12.                 turtle.dig()
  13.             end
  14.                
  15.             turtle.forward()
  16.         end
  17.         if turn == 0 then
  18.  
  19.             turtle.turnRight()
  20.             while turtle.detect() do
  21.                 turtle.dig()
  22.             end
  23.             turtle.forward()
  24.             turtle.turnRight()
  25.             turn = 1
  26.         else
  27.             turtle.turnLeft()
  28.             while turtle.detect() do
  29.                 turtle.dig()
  30.             end
  31.             turtle.forward()
  32.             turtle.turnLeft()
  33.             turn = 0
  34.         end        
  35.     end
  36.     turtle.digDown()
  37.     turtle.down()
  38.  
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement