Advertisement
Maderdash

turtle paving program

Feb 28th, 2025
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 KB | None | 0 0
  1. -- Variables
  2. local length = 1000  -- Tunnel length
  3. local paveBlock = "minecraft:netherrack"  -- Replace with your block of choice
  4. local width = 3  -- Tunnel width (each turtle handles part)
  5.  
  6. -- Function to place block below
  7. local function pave()
  8.     if turtle.detectDown() == false then
  9.         turtle.select(1)  -- Ensure the first slot has the pave block
  10.         turtle.placeDown()
  11.     end
  12. end
  13.  
  14. -- Function to dig forward and pave below
  15. local function digAndMove()
  16.     turtle.dig()
  17.     turtle.forward()
  18.     pave()
  19. end
  20.  
  21. -- Main function
  22. local function digTunnel()
  23.     for i = 1, length do
  24.         digAndMove()
  25.         if i % 125 == 0 then
  26.             print("Reminder: Place portal at this location.")
  27.         end
  28.     end
  29. end
  30.  
  31. -- Prepare the turtle
  32. local function prepare()
  33.     print("Loading...")
  34.     turtle.select(1)  -- Make sure the correct block is in slot 1
  35.     turtle.refuel()  -- Ensure the turtle has enough fuel
  36. end
  37.  
  38. -- Start digging
  39. prepare()
  40. digTunnel()
  41. print("Tunnel complete!")
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement