Advertisement
mehanika_rush

mine

Sep 23rd, 2023
874
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1. local x = 20
  2. local y = 20
  3.  
  4. function digForward(mode)
  5.     if mode == 3 then
  6.         while turtle.detect() do turtle.dig() end
  7.         turtle.forward()
  8.         while turtle.detectUp() do turtle.digUp() end
  9.         while turtle.detectDown() do turtle.digDown() end
  10.     end
  11. end
  12.  
  13. function digLine(length, mode)
  14.    for i = 1, length do digForward(mode) end
  15. end
  16.  
  17. function newLine(side, mode)
  18.     if side == true then
  19.         turtle.turnRight()
  20.         digForward(mode)
  21.         turtle.turnRight()
  22.     else
  23.         turtle.turnLeft()
  24.         digForward(mode)
  25.         turtle.turnLeft()
  26.     end
  27. end
  28.  
  29. function digLayer(x, y, mode, side)
  30.     local turn
  31.     if side == "left" then turn = false else turn = true end
  32.     for i = 1, y do
  33.         digLine(x - 1, mode)
  34.         if i ~= y then newLine(turn, mode) end
  35.         turn = not turn
  36.     end
  37. end
  38.  
  39. digLayer(x, y, 3, "right")
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement