Advertisement
Guest User

Untitled

a guest
May 25th, 2015
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. function startBildschirm()
  2.  
  3. print(" MinerTurtle")
  4. print("=======================================")
  5. print("")
  6. print(" Gaenge Anzahl: ")
  7. print(" Gaenge Laenge: ")
  8. print("")
  9. print("")
  10. print("")
  11. print("")
  12. print("")
  13. print("")
  14. print("")
  15.  
  16. end
  17.  
  18. function readDetails()
  19.  
  20. term.setCursorPos( 17, 4)
  21. local inputstring = read()
  22. gaengeAnzahl = (tonumber(inputstring))
  23.  
  24. term.setCursorPos( 17, 5)
  25. local inputstring = read()
  26. gaengeLaenge = (tonumber(inputstring))
  27.  
  28. end
  29.  
  30.  
  31. function hauptgang()
  32.  
  33. for i=1,3 do
  34. while turtle.detect()==true do
  35. turtle.dig()
  36. dropCobble()
  37. os.sleep(0.5)
  38. end
  39. turtle.forward()
  40. turtle.digUp()
  41.  
  42. while turtle.detectDown()==false do
  43. turtle.select(1)
  44. turtle.placeDown()
  45. end
  46. end
  47. end
  48.  
  49. function seitenGaenge()
  50.  
  51. -- gang nach rechts
  52. turtle.turnRight()
  53.  
  54. for i=1,gaengeLaenge do
  55.  
  56. while turtle.detect()==true do
  57. turtle.dig()
  58. dropCobble()
  59. os.sleep(0.5)
  60. end
  61. turtle.forward()
  62. turtle.digUp()
  63.  
  64. --while turtle.detectDown()==false do
  65. -- turtle.select(2)
  66. -- turtle.placeDown()
  67. --end
  68.  
  69. end
  70.  
  71. turtle.select(16)
  72. turtle.placeUp()
  73. turtle.select(1)
  74.  
  75.  
  76.  
  77. turtle.turnRight()
  78. turtle.turnRight()
  79.  
  80. for i=1,gaengeLaenge do
  81.  
  82. while turtle.detect()==true do
  83. turtle.dig()
  84. dropCobble()
  85. os.sleep(0.5)
  86. end
  87.  
  88. turtle.forward()
  89. end
  90. -- gang nach links
  91. for i=1,gaengeLaenge do
  92.  
  93. while turtle.detect()==true do
  94. turtle.dig()
  95. dropCobble()
  96. os.sleep(0.5)
  97. end
  98. turtle.forward()
  99. turtle.digUp()
  100.  
  101. --while turtle.detectDown()==false do
  102. -- turtle.select(2)
  103. -- turtle.placeDown()
  104. --end
  105. end
  106. turtle.select(16)
  107. turtle.placeUp()
  108. turtle.select(1)
  109.  
  110. turtle.turnRight()
  111. turtle.turnRight()
  112.  
  113. for i=1,gaengeLaenge do
  114. while turtle.detect()==true do
  115. while turtle.detect()==true do
  116. turtle.dig()
  117. dropCobble()
  118. os.sleep(0.5)
  119. end
  120. end
  121. turtle.forward()
  122. end
  123.  
  124. turtle.turnLeft()
  125.  
  126. end
  127.  
  128. function comeBack()
  129.  
  130. turtle.turnRight()
  131. turtle.turnRight()
  132.  
  133. for i=1,gaengeAnzahl*3 do
  134. turtle.forward()
  135. end
  136.  
  137. turtle.turnRight()
  138. turtle.turnRight()
  139.  
  140. for a=1,15 do
  141. while turtle.getItemCount(a) ~= 0 do
  142. for i=1,16 do
  143. turtle.select(i)
  144. turtle.dropDown()
  145. end
  146. end
  147. end
  148. end
  149.  
  150. function dropCobble()
  151. if (turtle.getItemCount(1) == 63) then
  152. turtle.select(1)
  153. turtle.drop(63)
  154. end
  155.  
  156. end
  157.  
  158. startBildschirm()
  159. readDetails()
  160.  
  161. for i=1,gaengeAnzahl do
  162. hauptgang()
  163. seitenGaenge()
  164. end
  165. comeBack()
  166.  
  167. gaengeLaenge = 0
  168. gaengeAnzahl = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement