Advertisement
Guest User

ScrapSetup2.0

a guest
Aug 18th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.63 KB | None | 0 0
  1. local i=1
  2. local j=1
  3. local k=1
  4. local u=1
  5. local l=1
  6. local o=1
  7. local z=1
  8. print("Schreibe Anzahl von Recyclern durch 32 geteilt")
  9. lcoal AnzahlDoppelreihen=read()
  10. local h=AnzahlDoppelreihen +1
  11. local g=1
  12. local t=1
  13. local q=turtle.getItemCount(1)
  14. local w=turtle.getItemCount(2)
  15. local e=turtle.getItemCount(3)
  16. local r=turtle.getItemCount(4)
  17. local p=turtle.getItemCount(5)
  18. local a=turtle.getItemCount(6)
  19. local s=turtle.getItemCount(7)
  20. local d=turtle.getItemCount(8)
  21. local f=turtle.getItemCount(9)
  22. local y=turtle.getItemCount(10)
  23. local n=turtle.getItemCount(11)
  24. local m=turtle.getItemCount(12)
  25. local x=turtle.getItemCount(13)
  26. local c=turtle.getItemCount(14)
  27. local v=turtle.getItemCount(15)
  28. local b=turtle.getItemCount(16)
  29. local Faktor=h-1
  30. local SlotRecycler=0
  31. local AnzahlRecycler=q+r+s+y
  32. local AnzahlConduits=w+p+d+n
  33. local AnzahlFibre=e+a+f+m
  34. local MultipleSlots=wrong
  35.  
  36.  
  37. function Enough()
  38. if AnzahlRecycler>32*AnzahlDoppelreihen
  39. then print("Genug Recycler!")
  40. else print("Mehr Recycler!")
  41. print("Turtle wird in 5 Sek. beendet")
  42.      sleep(5)
  43.      shell.exit()
  44. end
  45. if AnzahlConduits>32*AnzahlDoppelreihen+1
  46. then print("Genug Conduits!")
  47. else print("Mehr Conduits!")
  48.      print("Turtle wird in 5 Sek. beendet")
  49.      sleep(5)
  50.      shell.exit()
  51. end
  52. if AnzahlFibre>16*AnzahlDoppelreihen+3
  53. then print("Genug Fibre")
  54. else print("Mehr Fibre")
  55.      print("Turtle wird in 5 Sek. beendet")
  56.      sleep(5)
  57.      shell.exit()
  58. end
  59. end
  60.  
  61. function Recycler()
  62. repeat
  63. turtle.forward()
  64. turtle.turnRight()
  65. if q>0
  66. then turtle.select(1)
  67. elseif r>0
  68. then turtle.select(4)
  69. elseif s>0
  70. then turtle.select(7)
  71. elseif y>0
  72. then turtle.select(10)
  73. else print("FAIL")
  74. end
  75. turtle.place()
  76. turtle.turnLeft()
  77. i=i+1
  78. until i > 16
  79. repeat
  80. turtle.turnLeft()
  81. if q>0
  82. then turtle.select(1)
  83. elseif r>0
  84. then turtle.select(4)
  85. elseif s>0
  86. then turtle.select(7)
  87. elseif y>0
  88. then turtle.select(10)
  89. else print("FAIL")
  90. end
  91. turtle.place()
  92. turtle.turnRight()
  93. turtle.back()
  94. j=j+1
  95. until j > 16
  96. end
  97.  
  98. function Conduits()
  99. turtle.up()
  100. turtle.select(2)
  101. repeat
  102. turtle.forward()
  103. turtle.turnRight()
  104. turtle.place()
  105. turtle.turnLeft()
  106. k=k+1
  107. until k > 16
  108. repeat
  109. turtle.turnLeft()
  110. turtle.place()
  111. turtle.turnRight()
  112. turtle.back()
  113. u=u+1
  114. until u > 16
  115. turtle.down()
  116. end
  117.  
  118. function Fibre()
  119. turtle.up()
  120. turtle.select(3)
  121. repeat
  122. turtle.forward()
  123. turtle.placeDown()
  124. o=o+1
  125. until o > 16
  126. repeat
  127. turtle.back()
  128. l=l+1
  129. until l > 16
  130. end
  131.  
  132. function AnschlussFibre()
  133.  
  134. repeat
  135. turtle.forward()
  136. g=g+1
  137. until g > 16
  138. turtle.select(12)
  139. local Block=turtle.compareDown()
  140. turtle.select(13)
  141. local Block2=turtle.compareDown()
  142. if Block==ture
  143. then turtle.select(14)
  144. elseif Block2==true
  145. then turtle.select(13)
  146. end
  147. turtle.digDown()
  148. turtle.down()
  149. turtle.turnRight()
  150. turtle.select(12)
  151. local Block=turtle.compare()
  152. turtle.select(13)
  153. local Block2=turtle.compare()
  154. if Block==ture
  155. then turtle.select(14)
  156. elseif Block2==true
  157. then turtle.select(13)
  158. end
  159. turtle.dig()
  160. turtle.forward()
  161. turtle.select(12)
  162. local Block=turtle.compare()
  163. turtle.select(13)
  164. local Block2=turtle.compare()
  165. if Block==ture
  166. then turtle.select(14)
  167. elseif Block2==true
  168. then turtle.select(13)
  169. end
  170. turtle.dig()
  171. turtle.select(3)
  172. turtle.place()
  173. turtle.back()
  174. turtle.place()
  175. turtle.up()
  176. turtle.placeDown()
  177. turtle.turnLeft()
  178. repeat
  179. turtle.back()
  180. t=t+1
  181. until t > 16
  182. end
  183.  
  184. function AnschlussConduit()
  185. turtle.up()
  186. turtle.turnRight()
  187. turtle.select(2)
  188. turtle.place()
  189. turtle.down()
  190. turtle.turnLeft()
  191. end
  192.  
  193. Enough()
  194. repeat
  195. turtle.forward()
  196. turtle.turnRight()
  197. AnschlussFibre()
  198. Recycler()
  199. Conduits()
  200. Fibre()
  201. turtle.back()
  202. turtle.turnLeft()
  203. turtle.forward()
  204. turtle.forward()
  205. turtle.down()
  206. z=z+1
  207. until z > h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement