Advertisement
94Lord

Untitled

Sep 3rd, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.93 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. zaehler = 0
  11. zaehler1 = 0
  12. j = 0
  13.  
  14. -- (Standart)--
  15. function forward()
  16. refuel()
  17. zaehler1 = zaehler1 +1
  18. while(turtle.forward()==false) do
  19. print("WARNUNG Block im Weg !!")
  20. turtle.attack()
  21. turtle.dig()
  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.  
  54. if fuellevel > 5000 then
  55. fuellevel = 3000
  56. end
  57.  
  58. if fuellevel < 11 then
  59. fuellevel = 60
  60. end
  61.  
  62. fuellevel = fuellevel + 1
  63. if(turtle.getFuelLevel() < fuellevel) then
  64. turtle.select(16)
  65. if turtle.getItemCount(16) > 0 then
  66. turtle.refuel(1)
  67. momfuellevel = turtle.getFuelLevel()
  68. print("Aufgetankt "..momfuellevel.." Fuel im Tank")
  69. print("Neuer Sollwert "..fuellevel.." Fuel")
  70. refuel()
  71. else
  72. print("WARNUNG KEIN FUEL (Slot 16) ")
  73. print("Neuer Sollwert "..fuellevel.." Fuel")
  74. fuellevel = fuellevel - 50
  75. sleep(1)
  76. for i=1,4 do
  77. turtle.turnRight()
  78. end
  79. refuel()
  80. sleep(1)
  81. end
  82. turtle.select(1)
  83. end
  84. end
  85.  
  86. function Stein()
  87. success, data = turtle.inspect()
  88. while(success and data.name==steinblock) do
  89. turtle.dig()
  90. break
  91. end
  92. end
  93.  
  94. -- (Programm Start Stein) --
  95.  
  96. -- überprüfe ob Cobblegenerator gebaut ist --
  97.  
  98. function abbauen()
  99. if turtle.getItemCount(13) <= 61 then
  100. turtle.dig()
  101. sleep(5)
  102. success, data = turtle.inspect()
  103. if (success and data.name==steinblock) then
  104. print("Wasser und Lava vorhanden")
  105. else
  106. print("-------------------------------")
  107. print("kein Cobblegenerator vorhanden !")
  108. print("Fuege Wasser und Lava hinzu !")
  109. print("Wasser Links und Rechts")
  110. print("Lava in der Mitte")
  111. print("-------------------------------")
  112. sleep(2)
  113. print("...")
  114. sleep(2)
  115. print("Turtle Startet dann automatisch")
  116. end
  117. end
  118. if turtle.getItemCount(13) <= 62 then
  119.  
  120. print("Baue 1 Stack Stein ab")
  121.  
  122. while turtle.getItemCount(13) <= 62 do
  123. turtle.select(13)
  124. Stein()
  125. turtle.turnLeft()
  126. Stein()
  127. turtle.turnRight()
  128.  
  129. end
  130.  
  131. turtle.select(1)
  132. print("habe nun 1 Stack Stein im Invi")
  133.  
  134. else
  135. print("Habe schon genug Steine im Invi")
  136. print("(Slot 13) ")
  137.  
  138. end
  139. end
  140. --(Baum)-----------------------------------------------------------
  141. function fell1()
  142. count = count + 1
  143. print("Baum Nr. " ..count.. " wird gefaellt!")
  144. while(turtle.forward()==false) do
  145. turtle.dig()
  146. end
  147. success, data = turtle.inspectUp()
  148. while(success and data.name==treeblock) do
  149. turtle.digUp()
  150. up()
  151. success, data = turtle.inspectUp()
  152. end
  153. while(turtle.down()) do end
  154. while(turtle.back()==false) do end
  155. end
  156.  
  157. function place()
  158. turtle.select(4)
  159. turtle.place()
  160. turtle.select(1)
  161. end
  162.  
  163. function collect()
  164. for i=1,4 do
  165. turtle.suck()
  166. turtle.turnRight()
  167. end
  168. end
  169.  
  170. function fc()
  171. forward()
  172. for i=1,4 do
  173. turtle.suck()
  174. turtle.turnRight()
  175. end
  176. end
  177.  
  178. function fell()
  179. turtle.select(8)
  180. success, data = turtle.inspect()
  181. if(success and data.name==treeblock) then
  182. fell1()
  183. end
  184. end
  185.  
  186.  
  187. function weg1()
  188. for i=1,4 do
  189. fc()
  190. fc()
  191. turtle.turnRight()
  192. fc()
  193. turtle.turnRight()
  194. turtle.turnRight()
  195. forward()
  196. fc()
  197. turtle.turnRight()
  198. turtle.turnRight()
  199. forward()
  200. turtle.turnLeft()
  201.  
  202. fc()
  203. fc()
  204. turtle.turnRight()
  205. fc()
  206. fell()
  207. place()
  208. turtle.turnRight()
  209. turtle.turnRight()
  210. forward()
  211. fc()
  212. fell()
  213. place()
  214. turtle.turnRight()
  215. turtle.turnRight()
  216. fc()
  217. turtle.turnLeft()
  218. end
  219. end
  220.  
  221. function Baumlinie1()
  222. turtle.turnRight()
  223. forward()
  224. weg1()
  225. forward()
  226. forward()
  227. forward()
  228. forward()
  229. turtle.turnRight()
  230. turtle.turnRight()
  231. weg1()
  232. forward()
  233. forward()
  234. forward()
  235. forward()
  236. forward()
  237. turtle.turnRight()
  238. end
  239.  
  240. function Baumlinie2()
  241. turtle.turnRight()
  242. turtle.turnRight()
  243. forward()
  244. weg1()
  245. forward()
  246. forward()
  247. forward()
  248. forward()
  249. turtle.turnRight()
  250. turtle.turnRight()
  251. weg1()
  252. forward()
  253. forward()
  254. forward()
  255. forward()
  256. forward()
  257. end
  258.  
  259. --(ofen)----------------------------------------------------------------
  260.  
  261. function Steinofenbef()
  262. if turtle.getItemCount(13) > 20 then
  263. turtle.select(13)
  264. turtle.dropDown(19)
  265. turtle.select(1)
  266. end
  267. end
  268.  
  269. function Steinofenent()
  270. if turtle.getItemCount(14) < 50 then
  271. turtle.select(14)
  272. turtle.suckUp(10)
  273. turtle.select(1)
  274. end
  275. end
  276.  
  277. function ofenbef()
  278. if turtle.getItemCount(16) > 5 then
  279. turtle.select(16)
  280. turtle.drop(4)
  281. turtle.select(1)
  282. end
  283. end
  284.  
  285. function Holzofenbef()
  286. if turtle.getItemCount(8) > 10 then
  287. turtle.select(8)
  288. turtle.dropDown(9)
  289. turtle.select(1)
  290. end
  291. end
  292.  
  293. function Holzofenent()
  294. if turtle.getItemCount(16) < 50 then
  295. turtle.select(16)
  296. turtle.suckUp(10)
  297. turtle.select(1)
  298. end
  299. end
  300.  
  301. --(Sortieren)----------------------------------------------------------------
  302.  
  303. function Drop()
  304.  
  305. for i=1,16 do
  306. if turtle.getItemCount(i) > 0 then
  307. turtle.select(i)
  308. turtle.dropUp()
  309. end
  310. end
  311. end
  312.  
  313. function Suck()
  314. turtle.select(1)
  315. for i=1,16 do
  316. turtle.suckUp()
  317. end
  318. end
  319.  
  320.  
  321. function Sortieren1(x,z)
  322.  
  323. if turtle.getItemCount(x) > 0 then
  324. for j=1,16 do
  325. turtle.select(x)
  326. turtle.transferTo(j)
  327. end
  328. end
  329.  
  330. for i=1,16 do
  331. if turtle.getItemCount(i) > 0 then
  332. if turtle.getItemDetail(i).name == z then
  333. turtle.select(i)
  334. turtle.transferTo(x)
  335. end
  336. end
  337. end
  338. end
  339.  
  340. function Sortieren()
  341. Sortieren1(13,"minecraft:cobblestone")
  342. Sortieren1(14,"minecraft:stone")
  343. Sortieren1(15,"minecraft:stonebrick")
  344. Sortieren1(16,"minecraft:coal")
  345. Sortieren1(4,"minecraft:sapling")
  346. Sortieren1(8,"minecraft:log")
  347. Sortieren1(12,"minecraft:planks")
  348.  
  349. print("Sortiert")
  350. end
  351.  
  352. function Dropa()
  353. forward()
  354. forward()
  355. turtle.select(1)
  356. turtle.dropUp()
  357. turtle.select(2)
  358. turtle.dropUp()
  359. turtle.select(3)
  360. turtle.dropUp()
  361. turtle.select(5)
  362. turtle.dropUp()
  363. turtle.select(6)
  364. turtle.dropUp()
  365. turtle.select(7)
  366. turtle.dropUp()
  367. turtle.select(9)
  368. turtle.dropUp()
  369. turtle.select(10)
  370. turtle.dropUp()
  371. turtle.select(11)
  372. turtle.dropUp()
  373. turtle.select(1)
  374.  
  375. back()
  376. back()
  377. end
  378.  
  379. function Dropb()
  380. turtle.select(4)
  381. turtle.dropUp()
  382. turtle.select(8)
  383. turtle.dropUp()
  384. turtle.select(12)
  385. turtle.dropUp()
  386. turtle.select(13)
  387. turtle.dropUp()
  388. turtle.select(14)
  389. turtle.dropUp()
  390. turtle.select(15)
  391. turtle.dropUp()
  392. turtle.select(16)
  393. turtle.dropUp()
  394. turtle.select(1)
  395. end
  396. --(Craft)------------------------------------------------------------------------------------------------
  397. function CraftStein()
  398. y = 0
  399. if turtle.getItemCount(14) > 5 and turtle.getItemCount(15) < 60 then
  400. turtle.select(14)
  401. turtle.transferTo(1)
  402. Dropb()
  403. turtle.select(1)
  404. turtle.transferTo(14)
  405. end
  406.  
  407. while turtle.getItemCount(14) > 5 and turtle.getItemCount(15) < 60 do
  408.  
  409. y = 1
  410. turtle.select(14)
  411. turtle.transferTo(1,1)
  412. turtle.select(14)
  413. turtle.transferTo(2,1)
  414. turtle.select(14)
  415. turtle.transferTo(5,1)
  416. turtle.select(14)
  417. turtle.transferTo(6,1)
  418.  
  419. end
  420. turtle.select(15)
  421. Dropb()
  422. turtle.craft()
  423. turtle.select(1)
  424. if y > 0 then
  425. Drop()
  426. Suck()
  427. Sortieren()
  428. Dropa()
  429. print("Steinziegel hergestellt")
  430. y = 0
  431. end
  432. end
  433.  
  434. function CraftBretter()
  435. z = 0
  436. if turtle.getItemCount(8) > 5 and turtle.getItemCount(12) < 60 then
  437. turtle.select(8)
  438. turtle.transferTo(1)
  439. Dropb()
  440. turtle.select(1)
  441. turtle.transferTo(8)
  442. end
  443.  
  444. while turtle.getItemCount(8) > 5 and turtle.getItemCount(12) < 60 do
  445.  
  446. turtle.select(8)
  447. turtle.transferTo(1,1)
  448.  
  449. z = 1
  450. end
  451. turtle.select(8)
  452. Dropb()
  453. turtle.craft()
  454. turtle.select(1)
  455. if z > 0 then
  456. Drop()
  457. Suck()
  458. Sortieren()
  459. Dropa()
  460. print("Bretter hergestellt")
  461. z = 0
  462. end
  463. end
  464.  
  465. function CraftStoneslab()
  466. turtle.select(16)
  467. turtle.refuel(3)
  468. up()
  469. up()
  470. turtle.select(13)
  471. turtle.transferTo(1)
  472. Dropb()
  473. turtle.select(1)
  474. turtle.transferTo(13)
  475.  
  476. turtle.select(13)
  477. turtle.transferTo(1,3)
  478. turtle.select(13)
  479. turtle.transferTo(2,3)
  480. turtle.select(13)
  481. turtle.transferTo(3,3)
  482.  
  483. turtle.select(5)
  484. Dropb()
  485. turtle.craft()
  486. down()
  487. down()
  488. end
  489.  
  490. function Invi()
  491.  
  492. up()
  493. up()
  494. Drop()
  495. Suck()
  496. Sortieren()
  497. Dropa()
  498. CraftStein()
  499. CraftBretter()
  500. Drop()
  501. Suck()
  502. Sortieren()
  503. Dropa()
  504. down()
  505. down()
  506.  
  507. end
  508.  
  509. function Ofen()
  510. up()
  511. turtle.turnRight()
  512. --(Kohle nr1)--
  513. ofenbef()
  514. turtle.turnRight()
  515. --(Kohle nr.2)--
  516. ofenbef()
  517.  
  518. up()
  519. forward()
  520. --(Ofen nr1)--
  521. Steinofenbef()
  522. turtle.turnRight()
  523. turtle.turnRight()
  524. forward()
  525.  
  526. turtle.turnRight()
  527. forward()
  528. --(Ofen nr2)--
  529. Holzofenbef()
  530. turtle.turnRight()
  531. turtle.turnRight()
  532. forward()
  533. turtle.turnRight()
  534. down()
  535. down()
  536. back()
  537. Steinofenent()
  538. forward()
  539. turtle.turnRight()
  540. forward()
  541. Holzofenent()
  542. back()
  543. turtle.turnLeft()
  544. end
  545.  
  546. function ring()
  547. turtle.select(13)
  548. for i= 1,4 do
  549. turtle.turnRight()
  550. turtle.place()
  551. end
  552. turtle.select(1)
  553. end
  554.  
  555. function baucobble()
  556. turtle.turnLeft()
  557. forward()
  558. forward()
  559. ring()
  560. up()
  561. ring()
  562. up()
  563. turtle.turnRight()
  564. forward()
  565. forward()
  566. turtle.turnRight()
  567. forward()
  568. forward()
  569. down()
  570. down()
  571. ring()
  572. up()
  573. ring()
  574. up()
  575.  
  576. forward()
  577. turtle.turnRight()
  578. forward()
  579. down()
  580.  
  581. turtle.select(13)
  582. turtle.placeDown()
  583.  
  584. up()
  585. forward()
  586. forward()
  587. turtle.turnRight()
  588. down()
  589. down()
  590. forward()
  591.  
  592. turtle.select(13)
  593. turtle.place()
  594.  
  595. turtle.turnRight()
  596. forward()
  597. turtle.select(1)
  598. print("Cobblegenerator gebaut !!")
  599. end
  600.  
  601. function baukiste()
  602.  
  603. Sortieren1(1,"minecraft:chest")
  604. Sortieren1(2,"minecraft:furnace")
  605. Sortieren1(13,"minecraft:cobblestone")
  606.  
  607. if turtle.getItemCount(1) > 1 and turtle.getItemCount(2) > 1 and turtle.getItemCount(13) > 17 then
  608.  
  609. up()
  610. up()
  611. turtle.select(1)
  612. turtle.placeUp()
  613. forward()
  614. forward()
  615. turtle.placeUp()
  616. back()
  617. back()
  618. down()
  619. turtle.turnRight()
  620. turtle.select(2)
  621. turtle.place()
  622. turtle.turnRight()
  623. turtle.select(2)
  624. turtle.place()
  625. turtle.turnRight()
  626. turtle.turnRight()
  627. down()
  628. else
  629. print("------------------------------")
  630. print("WARNUNG")
  631. print("Fuege 2 Kisten und 2 Ofen hinzu")
  632. print("Zudem mindistens 18 Cobblestone")
  633. print("ein paar Setzlinge")
  634. print("und genug Fuel")
  635. print("------------------------------")
  636. sleep(5)
  637. baukiste()
  638. end
  639. end
  640.  
  641. function baublockup()
  642. for i= 1,4 do
  643. forward()
  644. forward()
  645. forward()
  646. forward()
  647. turtle.placeUp()
  648. end
  649. end
  650.  
  651. function baufarm()
  652.  
  653. if turtle.getItemCount(13) > 8 then
  654. CraftStoneslab()
  655. back()
  656. back()
  657. up()
  658. up()
  659. up()
  660. up()
  661. up()
  662. turtle.turnRight()
  663. forward()
  664. baublockup()
  665. turtle.turnLeft()
  666. forward()
  667. forward()
  668. forward()
  669. forward()
  670. turtle.placeUp()
  671. turtle.turnLeft()
  672.  
  673. for i= 1,3 do
  674. forward()
  675. forward()
  676. forward()
  677. forward()
  678. turtle.placeUp()
  679. end
  680. forward()
  681. forward()
  682. forward()
  683.  
  684.  
  685. turtle.turnLeft()
  686. forward()
  687. forward()
  688. forward()
  689. baublockup()
  690.  
  691. turtle.turnRight()
  692. forward()
  693. forward()
  694. forward()
  695. forward()
  696. turtle.turnRight()
  697. turtle.placeUp()
  698. for i= 1,3 do
  699. forward()
  700. forward()
  701. forward()
  702. forward()
  703. turtle.placeUp()
  704. end
  705. forward()
  706. forward()
  707. forward()
  708. down()
  709. down()
  710. down()
  711. down()
  712. down()
  713. turtle.turnRight()
  714. forward()
  715. forward()
  716. turtle.turnLeft()
  717. forward()
  718. forward()
  719. else
  720. Start()
  721. end
  722. end
  723.  
  724.  
  725. --(Start)---------------------------------------------------
  726. function Start()
  727. turtle.turnRight()
  728. forward()
  729. turtle.turnLeft()
  730. success, data = turtle.inspect()
  731. if (success and data.name==steinblock) then
  732. print("Cobblegenerator vorhanden")
  733. turtle.turnLeft()
  734. forward()
  735. turtle.turnRight()
  736. else
  737. turtle.turnLeft()
  738. forward()
  739. turtle.turnRight()
  740. baukiste()
  741. Invi()
  742. baucobble()
  743. Invi()
  744. abbauen()
  745. Invi()
  746. baufarm()
  747.  
  748. --- bau cobble baum farm usw.
  749. end
  750. end
  751.  
  752. --(Programm)------------------------------------------
  753.  
  754. Start()
  755.  
  756. while true do
  757. Invi()
  758. abbauen()
  759. Ofen()
  760. Invi()
  761. Baumlinie1()
  762. Invi()
  763. abbauen()
  764. Ofen()
  765. Invi()
  766. Baumlinie2()
  767. zaehler = zaehler +1
  768. print("-------------------------------")
  769. print("-------------------------------")
  770. print("Runde " ..zaehler.. "")
  771. print("Schritte " ..zaehler1.. "")
  772. print("-------------------------------")
  773. print("-------------------------------")
  774.  
  775. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement