Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. print("Tunnel has started.")
  2.  
  3. io.write("Please enter the width, in number of blocks, to dig: ")
  4. width = io.read()
  5.  
  6. io.write("Please enter the height, in number of blocks, to dig: ")
  7. height = io.read()
  8.  
  9. io.write("Please enter the depth, in number of blocks, to dig: ")
  10. depth = io.read()
  11.  
  12. print("Tunnel will run with parameters width = " .. width .. ", height = " .. height .. ", and depth = " .. depth .. ".")
  13.  
  14. intWidth = tonumber(width)
  15.  
  16. for i = 1, tonumber(depth) do
  17. currentDug = 0
  18. for i = 1, tonumber(height) do
  19. while (currentDug < intWidth) do
  20. turtle.dig()
  21. currentDug = currentDug + 1
  22. turtle.forward()
  23. if (currentDug == intWidth and i ~= tonumber(height)) then
  24. turtle.digUp()
  25. currentDug = 1
  26. turtle.up()
  27. turtle.turnLeft()
  28. turtle.turnLeft()
  29. break
  30. end
  31. end
  32. end
  33. for i = tonumber(height) - 1, 1, -1 do
  34. turtle.down()
  35. end
  36. if (i ~= tonumber(depth)) then
  37. turtle.forward()
  38. turtle.turnLeft()
  39. turtle.dig()
  40. tuirtle.forward()
  41. turtle.turnLeft()
  42. end
  43. end
  44.  
  45. turtle.turnRight()
  46.  
  47. for i = 1, tonumber(depth) do
  48. turtle.forward()
  49. end
  50.  
  51. turtle.turnRight()
  52.  
  53. for i = 1, tonumber(width) do
  54. turtle.forward()
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement