Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local inst = "on" ---- nach dem Bau auf off stellen
- auswahl = 0
- shutdown = 10
- --Bauprogramm Variable
- lang = 17
- breit = 12
- matOne = 1
- matTwo = 10
- matThree = 14
- turn = 1 -- Left Turn = 0 | Right Turn = 1
- matOneCount = 64
- matTwoCount = 64
- matThreeCount = 64
- matFourCount = 13
- --Farmprogramm Variable
- item = 1
- ItemCount =64
- turnFarm = 0
- benzin = turtle.getFuelLevel()
- function Header()
- shell.run("clear")
- print("_______________________________________")
- print()
- print(" Farmprogramm by Darknio ")
- print("_______________________________________")
- print()
- end
- function Auswahl()
- print("Bitte waehlen:")
- print()
- print(" [1]: Tutorial")
- print(" [2]: Bauprogramm")
- print(" [3]: Farmprogram")
- print ()
- write(" Bitte Waehlen sie jetzt: ")
- auswahl = io.read()
- end
- function Tutorial()
- shell.run("clear")
- Header()
- print (" Wilkommen zum Tutorial des ")
- print(" FarmE-Programms MKI")
- print()
- sleep(5)
- TutorialMats()
- sleep(10)
- end
- function TutorialMats()
- shell.run("clear")
- print("Fuer das Bauprogramm (Auswahl 2) ")
- print("Bitte folgendes einlegen:")
- print("_______________________________________")
- print("Slot 1-6 je ein Stack Stein")
- print("Slot 7 einen Lavaeimer")
- print("Slot 8 einen Hebel")
- print("Slot 9 zwei Truhen")
- print("Slot 10+11 je ein Stack Erde")
- print("Slot 12 eine Redstonefackel")
- print("Slot 13 einen Kolben")
- print("Slot 14-16 je einen Wassereimer")
- print("Programm mit der Auswahl 2 starten")
- sleep(10)
- TutorialFarmTwo()
- end
- function TutorialFarmOne()
- shell.run("clear")
- benzin = turtle.getFuelLevel()
- print(" Fuer das Farmprogram (Auswahl 3)")
- print("_______________________________________")
- print(" Bitte in die Kiste zur rechten Seite")
- print(" der Turtle Brennstoff einlegen")
- print()
- print("Setzlinge 5 Moves")
- print("Bretter und Staemme je 15 Moves")
- print("Kohle und Holzkohle je 80 Moves")
- print("Lavaeimer 1000 Moves")
- print()
- write("Momentan sind ")
- write(benzin)
- print(" Moves vorhanden")
- print("Es werden 125 Moves pro durchlauf benoetigt")
- sleep(10)
- Hinweis()
- end
- function TutorialFarmTwo()
- shell.run("clear")
- print(" Fuer das Farmprogram (Auswahl 3)")
- print("_______________________________________")
- print(" Bitte in die Kiste zur linken Seite")
- print(" der Turtle Farmmaterial einlegen")
- print()
- print("Diese Farm kann folgendes verarbeiten")
- print(" Kartoffeln ")
- print(" Weizensamen")
- print(" Karotten")
- print()
- sleep(5)
- TutorialFarmThree()
- end
- function TutorialFarmThree()
- shell.run("clear")
- print(" Fuer das Farmprogram (Auswahl 3)")
- print("_______________________________________")
- print(" Bitte in die Kiste zur linken Seite")
- print(" der Turtle Farmmaterial einlegen")
- print()
- print(" Fuer Samen aus Mods wird keine ")
- print(" Haftung Uebernommen")
- print(" das die Farm ")
- print(" ordnungsgemaes funktioniert")
- sleep(10)
- TutorialFarmOne()
- end
- function Hinweis()
- shell.run("clear")
- print(" Am Schluss noch ein paar Hinweise:")
- print("_______________________________________")
- print(" Bei einer normalen Turtle")
- print(" Bitte das Feld vorackern")
- print(" Bei einer Farming Turtle")
- print(" Einfach Starten")
- print()
- print(" Nach einem DC bitte Turtle abbauen ")
- print(" und auf die Ausgangsposition stellen")
- print(" mit der Front nach Vorne")
- sleep(10)
- HinweisTwo()
- end
- function HinweisTwo()
- shell.run("clear")
- print(" Wichtig")
- print(" Zum Bau der Farm benoetige ich ")
- print(" eine gerade Flaeche mit festen Boden")
- print("")
- print(" Bitte machen sie mir Platz")
- print(" Breit wird die Farm 11 Bloecke")
- print(" Lang wird sie 17 Bloecke")
- print(" Hoch wird sie 8 Bloecke")
- sleep(15)
- Header()
- Auswahl()
- end
- -- Anfang Bauprogramm
- function TankOne()
- if benzin < 700 then
- turtle.select (7)
- turtle.refuel()
- turtle.select (1)
- end
- end
- function Turn()
- if turn == 0 then
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- turn = 1
- elseif turn == 1 then
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turn = 0
- end
- end
- function Place()
- turtle.placeDown()
- turtle.forward()
- end
- function Double()
- matOneCount = turtle.getItemCount(matOne)
- if matOneCount == 0 then
- matOne = matOne + 1
- end
- turtle.select(matOne)
- turtle.placeDown()
- turtle.up()
- matOneCount = turtle.getItemCount(matOne)
- if matOneCount == 0 then
- matOne = matOne + 1
- end
- turtle.select(matOne)
- turtle.placeDown()
- turtle.forward()
- turtle.down()
- end
- function PlaceZero()
- turtle.forward()
- end
- function MatOne()
- matOneCount = turtle.getItemCount(matOne)
- if matOneCount == 0 then
- matOne = matOne + 1
- end
- turtle.select(matOne)
- Place()
- end
- function MatTwo()
- matTwoCount = turtle.getItemCount(matTwo)
- if matTwoCount == 0 then
- matTwo = matTwo + 1
- end
- turtle.select(matTwo)
- Place()
- end
- function MatThree()
- turtle.select(matThree)
- turtle.placeDown()
- matThree = matThree + 1
- end
- function ZeileOne()
- MatOne()
- PlaceZero()
- for i = 1,7 do
- MatTwo()
- end
- PlaceZero()
- MatOne()
- end
- function ZeileTwo()
- for j = 1,6 do
- MatOne()
- for i = 1,7 do
- PlaceZero()
- end
- MatOne()
- Turn()
- end
- end
- function MatOneEbene()
- for i = 1,11 do
- MatOne()
- end
- Turn()
- end
- function EbeneOne()
- sleep(0.5)
- turtle.up()
- for c = 1,11 do
- MatOne()
- end
- Turn()
- MatOne()
- MatOne()
- for k = 1,7 do
- PlaceZero()
- end
- MatOne()
- MatOne()
- Turn()
- for i = 1,7 do
- ZeileOne()
- Turn()
- end
- MatOne()
- PlaceZero()
- for u = 1,7 do
- MatOne()
- end
- PlaceZero()
- MatOne()
- Turn()
- for c = 1,7 do
- MatOneEbene()
- end
- end
- function EbeneTwo()
- turtle.up()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- turn = 1
- for i = 1,11 do
- MatOne()
- end
- Turn()
- for u = 1,7 do
- ZeileOne()
- Turn()
- end
- for t = 1,7 do
- MatOne()
- MatOne()
- for i = 1,7 do
- PlaceZero()
- end
- MatOne()
- MatOne()
- Turn()
- end
- end
- function EbeneThree()
- turn = 1
- turtle.forward()
- turtle.turnRight()
- turtle.up()
- for i = 1,8 do
- turtle.forward()
- end
- turtle.turnLeft()
- ZeileTwo()
- turtle.down()
- MatThree()
- sleep(0.25)
- turtle.up()
- sleep(0.25)
- MatOne()
- for t = 1,7 do
- PlaceZero()
- end
- turtle.down()
- MatThree()
- sleep(0.25)
- turtle.up()
- sleep(0.25)
- MatOne()
- Turn()
- for z = 1,9 do
- MatOne()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- end
- function EbeneFour()
- turn = 0
- turtle.up()
- turtle.forward()
- for i = 1,9 do
- MatOne()
- end
- Turn()
- MatOne()
- PlaceZero()
- PlaceZero()
- MatOne()
- PlaceZero()
- MatOne()
- PlaceZero()
- PlaceZero()
- MatOne()
- Turn()
- MatOne()
- for i = 1,7 do
- PlaceZero()
- end
- MatOne()
- end
- function EbeneFife()
- turn = 0
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.up()
- for i = 1,9 do
- MatOne()
- end
- Turn()
- MatOne()
- for z = 1,7 do
- PlaceZero()
- end
- MatOne()
- Turn()
- for i = 1,9 do
- MatOne()
- end
- end
- function EbeneSix()
- turtle.turnRight()
- turtle.turnRight()
- turtle.up()
- turtle.forward()
- turtle.forward()
- turn = 0
- for i = 1,7 do
- Double()
- end
- Turn()
- Double()
- turtle.forward()
- turtle.forward()
- turtle.select(13)
- turtle.placeDown()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- Double()
- Turn()
- Double()
- Double()
- Double()
- turtle.select(12)
- turtle.placeDown()
- turtle.up()
- turtle.select(matOne)
- turtle.placeDown()
- turtle.forward()
- turtle.down()
- Double()
- Double()
- Double()
- end
- function EbeneSeven()
- turtle.up()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.up()
- turn = 0
- turtle.forward()
- turtle.forward()
- for i = 1,5 do
- MatOne()
- end
- Turn()
- MatOne()
- MatOne()
- PlaceZero()
- MatOne()
- MatOne()
- Turn()
- for i = 1,5 do
- MatOne()
- end
- for i = 1,3 do
- turtle.back()
- end
- turtle.turnRight()
- turtle.forward()
- MatThree()
- end
- function BauHome()
- turtle.up()
- turtle.select(6)
- turtle.placeDown()
- turtle.select(1)
- for i = 1,3 do
- turtle.forward()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- for d = 1,5 do
- turtle.down()
- end
- turtle.select(8)
- turtle.place()
- turtle.turnLeft()
- turtle.turnLeft()
- for i = 1,12 do
- turtle.forward()
- end
- for u = 1,2 do
- turtle.down()
- end
- turtle.select(9)
- turtle.placeDown()
- turtle.turnLeft()
- for e = 1,4 do
- turtle.forward()
- end
- turtle.select(9)
- turtle.placeDown()
- item = 1
- for i = 1,16 do
- turtle.select(item)
- turtle.dropDown()
- item = item + 1
- end
- turtle.back()
- turtle.turnLeft()
- turtle.down()
- end
- function BauprogrammFunc()
- TankOne()
- turtle.turnLeft()
- EbeneOne()
- EbeneTwo()
- EbeneThree()
- EbeneFour()
- EbeneFife()
- EbeneSix()
- EbeneSeven()
- BauHome()
- turtle.select(1)
- --Ende Bauprogramm
- end
- function BauStart()
- print("Bitte folgendes einlegen:")
- print("Slot 1-6 je ein Stack Stein")
- print(" Slot 6 ein Glowstone ggf. Stein")
- print("Slot 7 einen Lavaeimer")
- print("Slot 8 einen Hebel")
- print("Slot 9 zwei Truhen")
- print("Slot 10+11 je ein Stack Erde")
- print("Slot 12 eine Redstonefackel")
- print("Slot 13 einen Kolben")
- print("Slot 14-16 je einen Wassereimer")
- write("Wollen sie das Programm starten y/n: ")
- start = io.read()
- if start == "y" then
- BauprogrammFunc()
- os.reboot()
- else
- shell.run("clear")
- print()
- print()
- print(" Falsche Eingabe")
- print(" Das System wird herruntergefahren")
- for i = 1,11 do
- shell.run("clear")
- print()
- print()
- print(" Falsche Eingabe")
- print(" Das System wird herruntergefahren")
- print()
- write(" ")
- print(shutdown)
- shutdown = shutdown-1
- sleep(1)
- end
- os.shutdown()
- end
- end
- --Anfang Farmprogramm
- function Tanktwo()
- if benzin < 125 then
- turtle.select(16)
- turtle.refuel()
- turtle.select(1)
- end
- end
- function Samen()
- ItemCount = turtle.getItemCount(item)
- if ItemCount == 0 then
- item = item + 1
- end
- turtle.select(item)
- turtle.digDown()
- turtle.placeDown()
- turtle.forward()
- end
- function StartFarm()
- print("2")
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.suck()
- turtle.suck()
- turtle.back()
- turtle.back()
- turtle.turnRight()
- turtle.up()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- end
- function ZeileFarm()
- for i = 1,6 do
- Samen()
- end
- end
- function TurnFarm()
- if turnFarm == 0 then
- turtle.select(item)
- turtle.digDown()
- turtle.placeDown()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- turnFarm = 1
- elseif turnFarm == 1 then
- turtle.select(item)
- turtle.digDown()
- turtle.placeDown()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- turnFarm = 0
- end
- end
- function EbeneOneFarm()
- for i = 1,6 do
- ZeileFarm()
- TurnFarm()
- end
- ZeileFarm()
- turtle.select(item)
- turtle.digDown()
- turtle.placeDown()
- turtle.up()
- TurnFarm()
- end
- function EbeneTwoFarm()
- for i = 1,6 do
- ZeileFarm()
- TurnFarm()
- end
- end
- function DropFarm()
- item = 1
- for i = 1,16 do
- turtle.select(item)
- turtle.dropDown()
- item = item +1
- end
- item = 1
- turtle.select(item)
- end
- function HomeFarm()
- turtle.turnRight()
- for i = 1,15 do
- turtle.forward()
- end
- turtle.down()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- DropFarm()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.down()
- end
- function FarmprogrammFunc()
- Tanktwo()
- StartFarm()
- EbeneOneFarm()
- EbeneTwoFarm()
- HomeFarm()
- os.reboot()
- end
- --Ende Farmprogramm
- if inst =="on" then
- Header()
- Auswahl()
- if auswahl == "1" then
- Tutorial()
- elseif auswahl == "2" then
- BauStart()
- elseif auswahl =="3" then
- shell.run("clear")
- Header()
- FarmprogrammFunc()
- else
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement