94Lord

Untitled

Sep 2nd, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.55 KB | None | 0 0
  1. momfuellevel = 0
  2. aufsammeln = 40
  3. fuellevel = 100
  4. count = 0
  5. anzahl1 = 0
  6. anzahl2 = 0
  7. treeblock = "minecraft:log"
  8. steinblock = "minecraft:cobblestone"
  9. chestdistance = 5
  10. j = 0
  11.  
  12.  
  13.  
  14.  
  15.  
  16. -- (Standart)--
  17. function forward()
  18. refuel()
  19. while(turtle.forward()==false) do
  20. print("WARNUNG Block im Weg !!")
  21. turtle.attack()
  22. sleep(2)
  23. end
  24. end
  25.  
  26. function up()
  27. refuel()
  28. while(turtle.up()==false) do
  29. if turtle.detectUp() then
  30. turtle.digUp()
  31. end
  32. end
  33. end
  34.  
  35. function down()
  36. refuel()
  37. while(turtle.down()==false) do
  38. if turtle.detectDown() then
  39. turtle.digDown()
  40. end
  41. turtle.attackDown()
  42. end
  43. end
  44.  
  45. function back()
  46. refuel()
  47. while(turtle.back()==false) do
  48. print("WARNUNG Block im Weg !!")
  49. end
  50. end
  51.  
  52. function refuel()
  53. if(turtle.getFuelLevel() < fuellevel) then
  54. turtle.select(16)
  55. if turtle.getItemCount(16) > 0 then
  56. turtle.refuel(1)
  57. momfuellevel = turtle.getFuelLevel()
  58. print("Aufgetankt "..momfuellevel.." Fuel im Tank")
  59. else
  60. print("WARNUNG KEIN FUEL (Slot 16) ")
  61. sleep(1)
  62. for i=1,4 do
  63. turtle.turnRight()
  64. end
  65. refuel()
  66. sleep(1)
  67. end
  68. turtle.select(1)
  69. end
  70. end
  71.  
  72. function Stein()
  73. success, data = turtle.inspect()
  74. while(success and data.name==steinblock) do
  75. turtle.dig()
  76. break
  77. end
  78. end
  79.  
  80. -- (Programm Start Stein) --
  81.  
  82. -- überprüfe ob Cobblegenerator gebaut ist --
  83.  
  84. function abbauen()
  85.  
  86. success, data = turtle.inspect()
  87. if (success and data.name==steinblock) then
  88. print("Cobblegenerator Vorhanden")
  89. else
  90. print("kein Cobblegenerator vorhanden !")
  91. end
  92.  
  93. if turtle.getItemCount(13) <= 62 then
  94.  
  95. print("Baue 1 Stack Stein ab")
  96.  
  97. while turtle.getItemCount(13) <= 62 do
  98. turtle.select(13)
  99. Stein()
  100. turtle.turnLeft()
  101. Stein()
  102. turtle.turnRight()
  103.  
  104. end
  105.  
  106. turtle.select(1)
  107. print("habe nun 1 Stack Stein im Invi")
  108.  
  109. else
  110. print("Habe schon genug Steine im Invi(Slot 13) ")
  111.  
  112. end
  113. end
  114.  
  115. function fell()
  116. count = count + 1
  117. print("Baum Nr. " ..count.. " wird gefaellt!")
  118. while(turtle.forward()==false) do
  119. turtle.dig()
  120. end
  121. success, data = turtle.inspectUp()
  122. while(success and data.name==treeblock) do
  123. turtle.digUp()
  124. up()
  125. success, data = turtle.inspectUp()
  126. end
  127. while(turtle.down()) do end
  128. while(turtle.back()==false) do end
  129. end
  130.  
  131. function place()
  132. if turtle.getItemCount(4) > 1 then
  133. turtle.select(4)
  134. turtle.place()
  135. turtle.select(1)
  136. end
  137. end
  138.  
  139. function collect()
  140. for i=1,4 do
  141. turtle.suck()
  142. turtle.turnRight()
  143. end
  144. end
  145.  
  146. function Steinofenbef()
  147. if turtle.getItemCount(13) > 20 then
  148. turtle.select(13)
  149. turtle.dropUp(19)
  150. turtle.select(1)
  151. end
  152. end
  153.  
  154. function Steinofenent()
  155. if turtle.getItemCount(14) < 50 then
  156. turtle.select(14)
  157. turtle.suckUp(10)
  158. turtle.select(1)
  159. end
  160. end
  161.  
  162. function Drop()
  163.  
  164. for i=1,16 do
  165. if turtle.getItemCount(i) > 0 then
  166. turtle.dropUp(i)
  167. end
  168. end
  169.  
  170. function Suck()
  171.  
  172. for i=1,16 do
  173. turtle.suckUp(i)
  174. end
  175.  
  176.  
  177. function Sortieren()
  178.  
  179. for i=1,16 do
  180. if turtle.getItemCount(i) > 0 then
  181. if turtle.getItemDetail(i).name == "minecraft:cobblestone" then
  182. turtle.select(i)
  183. turtle.transferTo(13)
  184. end
  185. end
  186. end
  187.  
  188. for i=1,16 do
  189. if turtle.getItemCount(i) > 0 then
  190. if turtle.getItemDetail(i).name == "minecraft:stone" then
  191. turtle.select(i)
  192. turtle.transferTo(14)
  193. end
  194. end
  195. end
  196.  
  197. for i=1,16 do
  198. if turtle.getItemCount(i) > 0 then
  199. if turtle.getItemDetail(i).name == "minecraft:stonebrick" then
  200. turtle.select(i)
  201. turtle.transferTo(15)
  202. end
  203. end
  204. end
  205.  
  206. for i=1,16 do
  207. if turtle.getItemCount(i) > 0 then
  208. if turtle.getItemDetail(i).name == "minecraft:coal" then
  209. turtle.select(i)
  210. turtle.transferTo(16)
  211. end
  212. end
  213. end
  214.  
  215. for i=1,16 do
  216. if turtle.getItemCount(i) > 0 then
  217. if turtle.getItemDetail(i).name == "minecraft:sapling" then
  218. turtle.select(i)
  219. turtle.transferTo(4)
  220. end
  221. end
  222. end
  223.  
  224. for i=1,16 do
  225. if turtle.getItemCount(i) > 0 then
  226. if turtle.getItemDetail(i).name == "minecraft:log" then
  227. turtle.select(i)
  228. turtle.transferTo(8)
  229. end
  230. end
  231. end
  232.  
  233. for i=1,16 do
  234. if turtle.getItemCount(i) > 0 then
  235. if turtle.getItemDetail(i).name == "minecraft:planks" then
  236. turtle.select(i)
  237. turtle.transferTo(12)
  238. end
  239. end
  240. end
  241. print("Sortiert")
  242. end
  243.  
  244. function CraftStein()
  245. while turtle.getItemCount(14) > 5 and turtle.getItemCount(15) < 60 do
  246.  
  247. turtle.select(14)
  248. turtle.transferTo(1,1)
  249. turtle.select(14)
  250. turtle.transferTo(2,1)
  251. turtle.select(14)
  252. turtle.transferTo(5,1)
  253. turtle.select(14)
  254. turtle.transferTo(6,1)
  255.  
  256. turtle.select(15)
  257. turtle.craft()
  258. turtle.select(1)
  259. end
  260. end
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270. Drop()
  271. Suck()
  272.  
  273. Sortieren()
  274.  
  275. CraftStein()
  276. print("1")
Advertisement
Add Comment
Please, Sign In to add comment