Guest User

Untitled

a guest
Oct 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. local sSnow = 1
  2. local sPlate = 5
  3. local sRep = 9
  4. local sPist = 13
  5.  
  6. function fwd()
  7. while not turtle.forward() do turtle.attack() end
  8. end
  9.  
  10. function placeSnow(dir)
  11. while turtle.getItemCount(sSnow) <= 0 and sSnow <= 16 do
  12. sSnow = sSnow + 1
  13. end
  14. if sSnow >= sPlate then
  15. error("Out of snow")
  16. end
  17.  
  18. turtle.select(sSnow)
  19. if dir == -1 then
  20. turtle.placeDown()
  21. elseif dir == 1 then
  22. turtle.placeUp()
  23. else
  24. turtle.place()
  25. end
  26. end
  27.  
  28. function placePlate(dir)
  29. while turtle.getItemCount(sPlate) <= 0 and sPlate <= 16 do
  30. sPlate = sPlate + 1
  31. end
  32. if sPlate >= sRep then
  33. error("Out of pressure plates")
  34. end
  35.  
  36. turtle.select(sPlate)
  37. if dir == -1 then
  38. turtle.placeDown()
  39. elseif dir == 1 then
  40. turtle.placeUp()
  41. else
  42. turtle.place()
  43. end
  44. end
  45.  
  46. function placeRep(dir)
  47. while turtle.getItemCount(sRep) <= 0 and sRep <= 16 do
  48. sRep = sRep + 1
  49. end
  50. if sRep >= sPist then
  51. error("Out of repeaters")
  52. end
  53.  
  54. turtle.select(sRep)
  55. if dir == -1 then
  56. turtle.placeDown()
  57. elseif dir == 1 then
  58. turtle.placeUp()
  59. else
  60. turtle.place()
  61. end
  62. end
  63.  
  64. function placePist(dir)
  65. while turtle.getItemCount(sPist) <= 0 and sPist <= 16 do
  66. sPist = sPist + 1
  67. end
  68. if sPist > 16 then
  69. error("Out of pistons")
  70. end
  71.  
  72. turtle.select(sPist)
  73. if dir == -1 then
  74. turtle.placeDown()
  75. elseif dir == 1 then
  76. turtle.placeUp()
  77. else
  78. turtle.place()
  79. end
  80. end
  81.  
  82. function segment()
  83. for i = 1, 13 do
  84. placeSnow(-1)
  85. fwd()
  86. end
  87.  
  88. turtle.back()
  89. turtle.turnRight()
  90. fwd()
  91. turtle.turnRight()
  92.  
  93. for i = 1, 13 do
  94. turtle.turnRight()
  95. fwd()
  96. fwd()
  97. fwd()
  98. placePist(1)
  99. turtle.back()
  100. placeSnow(-1)
  101. placeSnow(0)
  102. placeSnow(1)
  103. turtle.back()
  104. placeRep(0)
  105. turtle.back()
  106. placePlate(0)
  107. turtle.turnLeft()
  108. fwd()
  109. end
  110.  
  111. turtle.turnLeft()
  112. turtle.back()
  113. turtle.down()
  114.  
  115. for i = 1, 4 do
  116. placeSnow(1)
  117. fwd()
  118. end
  119. end
  120.  
  121. turtle.up()
  122.  
  123. segment()
  124.  
  125. turtle.turnLeft()
  126. fwd()
  127. turtle.up()
  128.  
  129. for i = 1, 12 do
  130. fwd()
  131. end
  132.  
  133. turtle.turnLeft()
  134. fwd()
  135. turtle.turnLeft()
  136.  
  137. segment()
Add Comment
Please, Sign In to add comment