Advertisement
Mowmaster

Quarry Hole

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