Advertisement
Mowmaster

Quarry 1.4

Aug 31st, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.51 KB | None | 0 0
  1. print("How long of an area?")
  2. lmax=read()
  3. print("How wide of an area?")
  4. w=read()
  5. print("current y level of turtle?")
  6. hmax=read()-2
  7.  
  8. l=lmax
  9. h=hmax
  10.  
  11. function Left(lt)
  12. while lt~=0 do
  13. turtle.turnLeft()
  14. lt=lt-1
  15. end
  16. end
  17.  
  18. function Right(rt)
  19. while rt~=0 do
  20. turtle.turnRight()
  21. rt=rt-1
  22. end
  23. end
  24.  
  25. function layer()
  26. turtle.dig()
  27. turtle.digUp()
  28. Right(1)
  29. turtle.dig()
  30. Left(2)
  31. turtle.dig()
  32. Right(1)
  33. end
  34.  
  35. function down()
  36. while h~=0 do
  37. layer()
  38. turtle.digDown()
  39. turtle.down()
  40. h=h-1
  41. end
  42. end
  43.  
  44. function up()
  45. while h~=hmax do
  46. layer()
  47. turtle.digUp()
  48. turtle.up()
  49. h=h+1
  50. end
  51. end
  52.  
  53. function store()
  54. turtle.select(1)
  55. turtle.digUp()
  56. turtle.placeUp()
  57. for s=2,16 do
  58. turtle.select(s)
  59. turtle.dropUp()
  60. end
  61. turtle.select(1)
  62. turtle.digUp()
  63. end
  64.  
  65. function length(v)
  66. if v==0 then
  67. while l~=0 do
  68. down()
  69. layer()
  70. store()
  71. turtle.dig()
  72. turtle.forward()
  73. up()
  74. layer()
  75. store()
  76. l=l-1
  77. if l>0 then
  78. turtle.dig()
  79. turtle.forward()
  80. l=l-1
  81. end
  82. end
  83. else
  84. while l~=lmax do
  85. down()
  86. layer()
  87. store()
  88. turtle.dig()
  89. turtle.forward()
  90. up()
  91. layer()
  92. store()
  93. l=l+1
  94. if l<lmax then
  95. turtle.dig()
  96. turtle.forward()
  97. l=l+1
  98. end
  99. end
  100. end
  101. end
  102.  
  103. function widthLength()
  104. length(0)
  105. Right(1)
  106. turtle.dig()
  107. turtle.forward()
  108. w=w-1
  109. turtle.dig()
  110. turtle.forward()
  111. w=w-1
  112. turtle.dig()
  113. turtle.forward()
  114. w=w-1
  115. Right(1)
  116. length(1)
  117. end
  118.  
  119. function start()
  120. Right(1)
  121. turtle.dig()
  122. turtle.forward()
  123. w=w-1
  124. Left(1)
  125. end
  126.  
  127. function worldHole()
  128. while w>0 do
  129. widthLength()
  130. end
  131. end
  132.  
  133. start()
  134. worldHole()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement