Advertisement
MarsP4ste

Mineshaft-staircase

Jul 25th, 2023 (edited)
1,200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. print("how deep?")
  2. write("->")
  3. depth = tonumber(read())
  4. print(depth)
  5.  
  6. function forward()
  7.   while not turtle.forward() do
  8.     turtle.dig()
  9.     sleep(1.5)
  10.   end
  11. end
  12.  
  13. function down()
  14.   while not turtle.down() do
  15.     turtle.digDown()
  16.     sleep(1.5)
  17.   end
  18. end
  19.  
  20. looped = 0
  21. maxdepth = depth
  22.  
  23. while depth > 0 do
  24.   term.clear()
  25.   term.setCursorPos(1,1)
  26.   print("Doing layer "..(maxdepth-depth).." of "..maxdepth)  
  27.   forward()
  28.   turtle.digDown()
  29.   forward()
  30.   down()
  31.   turtle.dig()
  32.   down()
  33.   depth = depth - 1
  34.   looped = 1
  35. end
  36.  
  37. if looped == 1 then
  38.   turtle.dig()
  39. end
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement