Advertisement
ChrisWalley

Turtle Dig v2.0

Feb 12th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.03 KB | None | 0 0
  1. local LongLoop = 0
  2. local DeepLoop = 0
  3. local WideLoop = 0
  4.  
  5.  
  6. write ("Enter the area length: ")
  7.  
  8. local length = toNumber(read())
  9.  
  10. write ("Enter the area width: ")
  11.  
  12. local width = toNumber(read())
  13.  
  14. write ("Enter the area depth: ")
  15.  
  16. local width = toNumber(read())
  17.  
  18. print("Selected area is "+length+"x"+width+"x"+depth+" in size")
  19. local volume = length*width*depth
  20. print("Area volume is: "+volume+" blocks)
  21.  
  22. write("Type START to begin")
  23.  
  24. local beginVAR = " "
  25.  
  26. while(beginVAR != "START")
  27.  
  28. do
  29. beginVAR = read()
  30. end
  31.  
  32. turtle.dig()
  33. turtle.forward()
  34. while(DeepLoop < depth)
  35. do
  36.  
  37. while(WideLoop < width)
  38.  
  39. do
  40.  
  41. while(LongLoop < length)
  42. do
  43.  
  44. turtle.dig()
  45. turtle.forward()
  46.  
  47. LongLoop = LongLoop+1
  48.  
  49. end
  50.  
  51. if((WideLoop%2) = 1)
  52. do
  53. turtle.turnRight()
  54. turtle.dig()
  55. turtle.forward()
  56. turtle.turnRight()
  57.  
  58. WideLoop = WideLoop+1
  59. end
  60. if((WideLoop%2) = 0)
  61. do
  62. turtle.turnLeft()
  63. turtle.dig()
  64. turtle.forward()
  65. turtle.turnLeft()
  66.  
  67. WideLoop = WideLoop+1
  68. end
  69. end
  70. turtle.digDown()
  71. turtle.Down()
  72. DeepLoop = DeepLoop+1
  73. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement