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.1 --
- t = turtle
- local anzahl = 0
- 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("Alternativ koennen die Bloecke mithilfe von Applied Energistics Annihilation Planes abgebaut 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 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("- unten: Drachenherzen (1 Stk.)")
- print("- rechts: Draconic Cores (16 Stk.)")
- print("- oben: TNT (1 Stk.)")
- getEnter()
- term.clear()
- term.setCursorPos(1,1)
- 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 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")
- while not (t.getFuelLevel() > 100) do
- t.refuel()
- end
- 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()
- 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()
- -- error("Nicht genug Charged Draconium Blöcke.")
- -- end
- t.turnLeft()
- -- Drachenherz
- t.select(6)
- local success2 = t.suckDown(1)
- -- if not success2 then
- -- t.turnRight()
- -- t.select(5)
- -- t.drop()
- -- t.turnRight()
- -- 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()
- -- 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()
- -- error("Nicht genug TNT")
- -- end
- anzahl = 1
- end
- function placeAll()
- for i=1,anzahl,1 do
- term.clear()
- term.setCursorPos(1,1)
- print("Durchlauf "..i.."/"..anzahl)
- print("Bitte Magnten o.a. ausschalten!")
- print()
- 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()
- -- 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(2)
- rs.setOutput("front",false)
- t.back()
- t.back()
- t.select(1)
- t.place()
- -- Warte bis TNT gezündet ist
- print("Warte 10 Sekunden...")
- sleep(10)
- -- 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()
- print("Warte auf naechsten Durchlauf... (30 Sec.)")
- sleep(30)
- if i < anzahl then
- takeItems()
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- end
- function checkContent()
- term.setCursorPos(1,1)
- local c1 = peripheral.wrap("left")
- local c2 = peripheral.wrap("bottom")
- local c3 = peripheral.wrap("right")
- local c4 = peripheral.wrap("top")
- c1.condenseItems()
- c2.condenseItems()
- c3.condenseItems()
- c4.condenseItems()
- if c1.getAllStacks()[1] == nil then print("Kein Draconium! ") return false end
- if c2.getAllStacks()[1] == nil then print("Keine Drachenherzen! ") return false end
- if c3.getAllStacks()[1] == nil then print("Keine Draconic Cores! ")return false end
- if c4.getAllStacks()[1] == nil then print("Kein TNT! ") return false end
- local c1con = c1.getAllStacks()[1].all()
- local c2con = c2.getAllStacks()[1].all()
- local c3con = c3.getAllStacks()[1].all()
- local c4con = c4.getAllStacks()[1].all()
- local check1 = false
- local check2 = false
- local check3 = false
- local check4 = false
- if c1con.name == "draconium" and c1con.dmg == 2 and c1con.dmg == 2 and c1con.qty >= 4 then
- check1 = true
- print("Draconium OK. ")
- else print("Zu wenig Draconium! ") end
- if c2con.name == "dragonHeart" then
- check2 = true
- print("Drachenherzen OK. ")
- else print("Zu wenig Drachenherzen! ") end
- if c3con.name == "draconicCore" and c3con.qty >= 16 then
- check3 = true
- print("Draconic Cores OK. ")
- else print("Zu wenig Draconic Cores! ") end
- if c4con.name == "tnt" then
- check4 = true
- print("TNT OK. ")
- else print("Zu wenig TNT! ") end
- if check1 and check2 and check3 and check4 then
- return true
- end
- return false
- end
- term.clear()
- term.setCursorPos(1,1)
- if t.getFuelLevel() < 100 then fuelInput() end
- while true do
- term.setCursorPos(1,1)
- if checkContent() then
- takeItems()
- placeAll()
- end
- sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment