Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Automatische Awakened Draconium Farm --
- -- Draconic Evolution --
- -- von Thor_s_Crafter --
- -- Version 1.0 --
- t = turtle
- local anzahl = 0
- local withScreen = false
- local recID = 0
- local msg = {"","",""}
- shell.run("label set draconiumTurtle")
- function autoUpdate()
- if not fs.exists("startup") then
- local file = fs.open("startup","w")
- file.writeLine("shell.run(\"rm draconium\")")
- file.writeLine("shell.run(\"pastebin get u4B8E9DJ draconium\")")
- file.writeLine("shell.run(\"draconium\")")
- file.close()
- end
- end
- function start()
- term.clear()
- term.setCursorPos(1,1)
- print("-- Draconium Turtle --")
- print("Programmbeschreibung: ")
- print("Diese Turtle stellt automatisch Awakened Draconium her.")
- print("Nach Abschluss eines Durchlaufs muss jedoch das Awakened Draconium von Hand abgebaut werden.")
- print("Zusaetzlich koennen Statusinformationen des Programms auf einem PC mit Monitor ausgegeben werden.")
- getEnter()
- local yn = yesNoInput("Soll eine detaillierte Erklaerung ueber das Programm angezeigt werden (j/n)?")
- if yn then
- displayInfos()
- end
- end
- function displayInfos()
- term.clear()
- term.setCursorPos(1,1)
- print("-- Aufbau der Draconium Farm --")
- print("Benoetigte Materialien:")
- print("- 1 Mining- oder Advanced Mining Turtle")
- print("- 4 Kisten")
- print("- Obsidian")
- print("Optionale Materialien: ")
- print("- 1 Computer mit einem Wireless Modem")
- print("- 8 Monitore (4 breit,2 hoch)")
- print("- 1 Wireless Modem fuer die Turtle")
- getEnter()
- term.clear()
- term.setCursorPos(1,1)
- print("-- Aufbau der Draconium Farm --")
- print("Aufbau:")
- print("Ein Obsidianraum. Mindestmaß: 4x4x4 Bloecke (Außenmaß).")
- print("Die Turtle muss aussen vor eine Wand platziert werden. Hoehe: 2-3 Bloecke über dem Obsidian Boden")
- print("Die 4 Kisten muessen rechts,hinten,links und oberhalb der Turtle sein.")
- getEnter()
- term.clear()
- term.setCursorPos(1,1)
- print("-- Aufbau der Draconium Farm --")
- print("Inhalt der Kisten:")
- print("- links: Charged Draconium Bloecke (4 Stk.)")
- print("- hinten: Drachenherzen (1 Stk.)")
- print("- rechts: Draconic Cores (16 Stk.)")
- print("- oben: TNT (1 Stk.)")
- getEnter()
- term.clear()
- term.setCursorPos(1,1)
- print("-- Aufbau der Draconium Farm --")
- print("Optionaler Aufbau mit Bildschirm:")
- print("Einen extra Computer aufbauen (Position beliebig. Am Besten in der Naehe der Farm).")
- print("Einen Monitor (4 breit, 2 hoch) an eine Seite des Computers anschließen.")
- print("Den Computer und die Turtle mit einem Wireless Modem ausstatten.")
- print("Beim Computer muss das Modem an eine beliebige Seite hingebaut werden.")
- getEnter()
- term.clear()
- term.setCursorPos(1,1)
- print("-- Aufbau der Draconium Farm --")
- print("Die Turtle fuehrt einen selbststaendig durch diesen Prozess,")
- print("wenn der Modus \"Statusanzeige auf dem Bildschirm anzeigen\" gewaehlt wird.")
- print()
- print("Weitere Information + Bilder + Videos zum Aufbau findet ihr auf meinem YouTube-Kanal.:")
- print("https://www.youtube.com/channel/UCEG-Oq2LlJwkrqYu_AvfK0Q")
- print("oder Suche nach Thor_s_Crafter")
- getEnter()
- end
- function screen()
- local yn = yesNoInput("Soll das Programm Statusinformationen ueber einen Bildschirm anzeigen (j/n)?")
- if yn then
- withScreen = true
- term.clear()
- term.setCursorPos(1,1)
- --Suche Modem
- local pList = peripheral.getNames()
- for i=1,#pList do
- if peripheral.getType(pList[i]) == "modem" then
- rednet.open(pList[i])
- modem = pList[i]
- end
- end
- --Wenn Modem nicht gefunden bitte anschließen
- if modem == nil then
- print("Bitte die Turtle mit einem Wireless Modem ausstatten.")
- print("Dazu bitte ein Wireless Modem in Slot 16 legen.")
- t.select(16)
- getEnter()
- while not (t.getItemDetail().name == "ComputerCraft:CC-Peripheral") do
- term.clear()
- term.setCursorPos(1,1)
- print("Das ist kein Wireless Modem!")
- print("Bitte ein Wireless Modem in Slot 16 legen!")
- getEnter()
- end
- t.equipLeft()
- if t.getItemCount() > 0 then
- t.equipRight()
- end
- end
- --Suche Modem erneut
- local pList = peripheral.getNames()
- for i=1,#pList do
- if peripheral.getType(pList[i]) == "modem" then
- rednet.open(pList[i])
- modem = pList[i]
- end
- end
- local idPresent = loadID()
- if isPresent == false then
- term.clear()
- term.setCursorPos(1,1)
- print("Bitte einen Computer aufstellen und dort folgendes eingeben:")
- print("pastebin get ZYjNXvH5 draconium")
- print("und danach")
- print("draconium")
- print()
- local id,msg,protocol
- while not (msg == "test" and protocol == "draconium") do
- rednet.broadcast("test","draconium")
- id,msg,protocol = rednet.receive("draconium",3)
- end
- recID = id
- print("Einrichtung abgeschlossen.")
- sleep(0.5)
- term.clear()
- term.setCursorPos(1,1)
- local yn = yesNoInput("Soll die Computer ID gespeichert werden (j/n)?")
- if yn then
- local file = fs.open("id","w")
- file.writeLine(id)
- file.close()
- end
- end
- end
- end
- function loadID()
- if fs.exists("id") then
- local file = fs.open("id","r")
- recID = tonumber(file.readLine())
- file.close()
- return true
- else
- return false
- end
- end
- function userInput()
- if t.getFuelLevel() < 100 then
- fuelInput()
- end
- term.clear()
- term.setCursorPos(1,1)
- print("Wie viele Runden sollen durchlaufen werden?")
- write("Eingabe: ")
- local input = read()
- anzahl = tonumber(input)
- end
- function fuelInput()
- term.clear()
- term.setCursorPos(1,1)
- t.select(16)
- print("Bitte Fuel nachfuellen!")
- print("Fuel bitte in Slot 16 legen")
- write("Enter druecken...")
- getEnter()
- t.refuel()
- fuel = t.getFuelLevel()
- end
- function getEnter()
- write("Enter druecken...")
- local event,key = os.pullEvent("key")
- while key ~= 28 do
- sleep(0.5)
- event,key = os.pullEvent("key")
- end
- end
- function yesNoInput(msg)
- local input
- while not (input == "j" or input == "n") do
- term.clear()
- term.setCursorPos(1,1)
- print(msg)
- write("Eingabe: ")
- input = read()
- end
- if input == "j" then
- return true
- elseif input == "n" then
- return false
- end
- end
- ---
- function takeItems()
- if withScreen then
- msg[2] = "Nehme Items aus den Kisten"
- rednet.send(recID,msg)
- end
- t.turnLeft()
- -- Charged Draconium Blöcke
- t.select(5)
- local success = t.suck(4)
- if not (success and t.getItemCount() == 4) then
- t.drop()
- t.turnRight()
- if withScreen then
- msg[2] = "Nicht genug Charged Draconium Bloecke"
- rednet.send(recID,msg)
- end
- error("Nicht genug Charged Draconium Blöcke.")
- end
- t.turnLeft()
- -- Drachenherz
- t.select(6)
- local success2 = t.suck(1)
- if not success2 then
- t.turnRight()
- t.select(5)
- t.drop()
- t.turnRight()
- if withScreen then
- msg[2] = "Nicht genug Drachenherzen."
- rednet.send(recID,msg)
- end
- error("Nicht genug Drachenherzen.")
- end
- t.turnLeft()
- -- Draconic Cores
- t.select(7)
- local success3 = t.suck(16)
- if not (success3 and t.getItemCount() == 16) then
- t.drop()
- t.turnRight()
- t.select(6)
- t.drop()
- t.turnRight()
- t.select(5)
- t.drop()
- t.turnRight()
- if withScreen then
- msg[2] = "Nicht genug Draconic Cores"
- rednet.send(recID,msg)
- end
- error("Nicht genug Draconic Cores.")
- end
- t.turnLeft()
- -- TNT
- t.select(8)
- local success4 = t.suckUp(1)
- if not success4 then
- t.turnRight()
- t.select(7)
- t.drop()
- t.turnRight()
- t.select(6)
- t.drop()
- t.turnRight()
- t.select(5)
- t.drop()
- t.turnRight()
- if withScreen then
- msg[2] = "Nicht genug TNT"
- rednet.send(recID,msg)
- end
- error("Nicht genug TNT")
- end
- end
- function placeAll()
- for i=1,anzahl,1 do
- term.clear()
- term.setCursorPos(1,1)
- print("Durchlauf "..i.."/"..anzahl)
- print("Bitte Magnten o.ä. ausschalten!")
- print()
- if withScreen then
- msg[1] = i.."/"..anzahl
- msg[2] = "Setze Draconium Bloecke"
- rednet.send(recID,msg)
- end
- t.select(1)
- -- Obsidian abbauen
- t.dig()
- t.forward()
- t.forward()
- t.forward()
- print("Setze Bloecke/TNT/Drachenherz...")
- -- Draconium setzen
- t.select(5)
- t.placeDown()
- t.forward()
- t.placeDown()
- t.turnRight()
- t.forward()
- t.placeDown()
- t.turnRight()
- t.forward()
- t.placeDown()
- t.turnRight()
- if withScreen then
- msg[2] = "Setze TNT"
- rednet.send(recID,msg)
- end
- -- TNT setzen
- t.select(8)
- t.place()
- -- Drachenherz hinwerfen
- t.turnRight()
- t.back()
- t.select(6)
- t.drop(1)
- t.turnLeft()
- t.forward()
- -- TNT anzünden
- t.turnRight()
- rs.setOutput("front",true)
- sleep(1)
- rs.setOutput("front",false)
- t.back()
- t.back()
- t.select(1)
- t.place()
- if withScreen then
- msg[2] = "Warte auf aktiviertes Drachenherz"
- rednet.send(recID,msg)
- end
- -- Warte bis TNT gezündet ist
- print("Warte 10 Sekunden...")
- sleep(10)
- if withScreen then
- msg[2] = "Setze Draconic Cores"
- rednet.send(recID,msg)
- end
- -- Draconic Cores hinwerfen
- print("Setze Draconic Cores...")
- t.dig()
- t.forward()
- t.select(7)
- -- Zurück
- t.drop(16)
- t.back()
- t.select(1)
- t.place()
- if withScreen then
- msg[2] = "Bitte das Draconium abbauen!"
- rednet.send(recID,msg)
- end
- print("Warte auf naechsten Durchlauf...")
- sleep(30)
- if i < anzahl then
- takeItems()
- end
- end
- end
- autoUpdate()
- start()
- screen()
- userInput()
- if anzahl > 0 then
- takeItems()
- end
- placeAll()
- if withScreen then
- msg[1] = "0/0"
- msg[2] = "Fertig"
- rednet.send(recID,msg)
- end
- term.clear()
- term.setCursorPos(1,1)
- print("-- Fertig --")
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment