Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Automatic Dragonfarm - Draconic Evolution --
- -- Turtleprogram by Thor_s_Crafter --
- -- Version 1.1--
- t = turtle
- local fuel = 0
- local amount = 0
- -- Checks, how the current fuelLevel is
- function checkFuel()
- while t.getFuelLevel() < 100 do
- fuelInput()
- end
- end
- -- Asks the User to refuel the turtle
- function fuelInput()
- term.clear()
- term.setCursorPos(1,1)
- t.select(16)
- print("Please refuel the turtle!")
- print("Drop the fuel in slot 16!")
- write("Press Enter...")
- local leer = read()
- t.refuel()
- fuel = t.getFuelLevel()
- end
- -- Takes items out of the chests
- function takeItems()
- t.turnLeft()
- t.select(5)
- t.suck(1)
- t.turnLeft()
- t.select(6)
- t.suck(1)
- t.turnLeft()
- t.turnLeft()
- end
- -- Takes the Cobblestone (or other building material)
- function takeCobble()
- t.turnRight()
- t.select(7)
- t.suck()
- t.turnLeft()
- end
- -- Drops all items into the top chest
- function dropItems()
- for i=1,16,1 do
- t.select(i)
- t.dropUp()
- end
- t.select(1)
- end
- -- Moving
- function placeApiary()
- for i=0,7,1 do
- t.forward()
- end
- -- Taking the dragon egg
- t.select(1)
- t.dig()
- -- Placing the apiary
- t.select(5)
- t.place()
- -- Puts the bees into the apiary
- t.select(6)
- t.drop()
- -- Move back
- for i=0,7,1 do
- t.back()
- end
- end
- -- Placing the Cobblestone (or other building material)
- function placeCobble()
- for i=0,7,1 do
- t.forward()
- end
- t.select(9)
- t.dig()
- t.down()
- -- Remove the torch
- t.select(2)
- t.digDown()
- t.down()
- t.back()
- t.turnRight()
- -- Placing Cobblestone
- t.select(7)
- t.placeDown()
- t.forward()
- t.placeDown()
- t.forward()
- t.turnLeft()
- for i=0,2,1 do
- for i=0,3,1 do
- t.placeDown()
- t.forward()
- end
- t.placeDown()
- t.turnLeft()
- end
- t.forward()
- t.placeDown()
- t.turnLeft()
- t.forward()
- t.turnRight()
- for i=0,3,1 do
- for i=0,1,1 do
- t.placeDown()
- t.dig()
- t.forward()
- end
- t.turnLeft()
- end
- t.forward()
- t.turnLeft()
- t.up()
- t.up()
- -- Moving back
- for i=0,7,1 do
- t.back()
- end
- end
- -- Starts at the beginning
- function userInput()
- term.clear()
- term.setCursorPos(1,1)
- print("This program automatically spawns and kills Enderdragons.")
- print("The following setup is necessary: ")
- print("You need a Mining Turtle or an Advanced Mining Turtle.")
- print("4 Chest must be in place:")
- print("The left chest needs to contain an apiary.")
- print("The back chest needs to contain Phantasmal-Bees (Queens).")
- print("Press Enter...")
- local leer = read()
- term.clear()
- term.setCursorPos(1,1)
- print("The right chest needs to contain any building material.")
- print("The top chest should be empty.")
- print("The turtle drops all items into the top chest after every cycle.")
- print("The items should be routed from there.")
- print("Press Enter...")
- leer = read()
- term.clear()
- term.setCursorPos(1,1)
- print("How many cycles do you want to run?")
- write("Input: ")
- local input = read()
- amount = tonumber(input)
- end
- -- Installing a Startup
- function install()
- print("-- Dragonfarm program --")
- print("-- by Thor_s_Crafter --")
- print("-- Version 1.1 --")
- print()
- local input
- if not fs.exists("startup") then
- while not (input == "y" or input == "n") do
- term.clear()
- term.setCursorPos(1,1)
- print("Should the program start automatically (adding a startup) (y/n) ?")
- write("Input: ")
- input = read()
- if input == "y" then
- local file = fs.open("startup","w")
- file.writeLine("shell.run(\"rm dragon\")")
- file.writeLine("shell.run(\"pastebin get dBMCtQQR dragon\")")
- file.writeLine("shell.run(\"dragon\")")
- file.close()
- end
- end
- end
- end
- install()
- userInput()
- for i=1,amount,1 do
- checkFuel()
- takeItems()
- placeApiary()
- dropItems()
- rs.setOutput("bottom",true)
- sleep(40)
- rs.setOutput("bottom",false)
- takeCobble()
- placeCobble()
- end
- term.clear()
- term.setCursorPos(1,1)
- print("-- Done --")
- print("-- Program terminated --")
Advertisement
Add Comment
Please, Sign In to add comment