Advertisement
Guest User

QuarryFrameDigger

a guest
Apr 13th, 2012
417
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. print("Forward length of the quarry")
  2. input = read()
  3. dz = tonumber(input)
  4. print("-----")
  5. print("Side length of quarry")
  6. input = read()
  7. dx = tonumber(input)
  8. print("-----")
  9. print("Height of quarry")
  10. input = read()
  11. dy = tonumber(input)
  12. print("-----")
  13. print("Does the quarry move left or right?")
  14. print("Type 1 for left, 2 for right")
  15. input = read()
  16. direction = tonumber(input)
  17. print("-----")
  18. print("Starting mining")
  19.  
  20.  
  21. for i=1, 2 do
  22. if i==2 then
  23. dz = dz-1
  24. end
  25. for z=1, dz do
  26. while turtle.detect() do
  27. turtle.dig()
  28. end
  29. turtle.forward()
  30. end
  31. if direction == 1 then
  32. turtle.turnLeft()
  33. end
  34. if direction == 2 then
  35. turtle.turnRight()
  36. end
  37. for x=1, dx-1 do
  38. while turtle.detect() do
  39. turtle.dig()
  40. end
  41. turtle.forward()
  42. end
  43. if direction == 1 then
  44. turtle.turnLeft()
  45. end
  46. if direction == 2 then
  47. turtle.turnRight()
  48. end
  49.  
  50. end
  51. dy = dy-1
  52. for y=1, dy do
  53. while turtle.detectUp() do
  54. turtle.digUp()
  55. end
  56. turtle.up()
  57. end
  58. for i=1, 2 do
  59. for z=1, dz do
  60. while turtle.detect() do
  61. turtle.dig()
  62. end
  63. turtle.forward()
  64. end
  65.  
  66. if direction == 1 then
  67. turtle.turnLeft()
  68. end
  69. if direction == 2 then
  70. turtle.turnRight()
  71. end
  72.  
  73. for y=1, dy do
  74. while turtle.detectDown() do
  75. turtle.digDown()
  76. end
  77. turtle.down()
  78. end
  79. for y=1, dy do
  80. turtle.up()
  81. end
  82.  
  83. for x=1, dx-1 do
  84. while turtle.detect() do
  85. turtle.dig()
  86. end
  87. turtle.forward()
  88. end
  89. if direction == 1 then
  90. turtle.turnLeft()
  91. end
  92. if direction == 2 then
  93. turtle.turnRight()
  94. end
  95. for y=1, dy do
  96. while turtle.detectDown() do
  97. turtle.digDown()
  98. end
  99. turtle.down()
  100. end
  101. for y=1, dy do
  102. turtle.up()
  103. end
  104. end
  105. print("Completed")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement