rungholt

tBedrockLadder

May 30th, 2022 (edited)
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. local function detectAndPlace()
  2.     if turtle.detect() == false then
  3.         turtle.select(1)
  4.         turtle.place(1)
  5.     end
  6. end
  7.  
  8. local function checkSides()
  9.     detectAndPlace()
  10.     turtle.turnLeft()
  11.     detectAndPlace()
  12.     turtle.turnLeft()
  13.     detectAndPlace()
  14.     turtle.turnLeft()
  15.     detectAndPlace()
  16.     turtle.turnLeft()
  17. end
  18.  
  19. local function placeLadder()
  20.     if turtle.detect() then
  21.         turtle.dig()
  22.         turtle.select(16)
  23.         turtle.place(1)
  24.     end
  25. end
  26.  
  27. local times = 0
  28. term.write("How deep:")
  29. times = read()
  30. for j = 1, times do
  31.     turtle.digDown()
  32.     turtle.down()
  33.     checkSides()
  34. end
  35. for k = 1, times do
  36.     placeLadder()
  37.     turtle.up()
  38. end
  39.  
Add Comment
Please, Sign In to add comment