Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- pastebin get FFpY2V5c worldeater
- i = 0
- block = "false"
- data = "false"
- height = 0
- ---------------------
- function bottom() --bottom out to find y level
- height = 0
- while true do
- block,data = turtle.digDown()
- if data == "Unbreakable block detected" then
- break
- end
- while turtle.dig() do
- end
- height = height + 1
- turtle.down()
- end
- end
- -----------------------
- function empty() -- place soryn chest and empty. this function is run after clear()
- while turtle.dig() do
- sleep(.2)
- end
- while turtle.digUp() do
- sleep(.2)
- end
- turtle.turnRight()
- turtle.turnRight()
- while turtle.dig() do
- sleep(.3)
- end
- turtle.select(16)
- turtle.place()
- for i = 1, 14 do
- turtle.select(i)
- turtle.drop()
- end
- turtle.turnRight()
- turtle.turnRight()
- turtle.select(1)
- while turtle.dig() do
- sleep(.2)
- end
- turtle.forward()
- while turtle.dig() do
- sleep(.2)
- end
- turtle.forward()
- end
- -----------------------
- function turtleRefuel()
- if turtle.getFuelLevel() < 5000 then
- for i=1,14 do
- turtle.select(i)
- turtle.refuel()
- turtle.select(1)
- end
- end
- end
- -----------------------
- function lowFuel() -- checks for low fuel and waits if at top of loop
- if turtle.getFuelLevel() < 200 then
- turtle.select(15)
- turtle.refuel(turtle.getItemCount(15)-1)
- turtle.select(1)
- print("WARNING: Low Fuel")
- if yLevel > height then
- print("Waiting for fuel")
- os.pullEvent("turtle_inventory")
- end
- end
- end
- ---------------------
- function self()
- turtleRefuel()
- lowFuel()
- lowFuel()
- turtle.getFuelLevel()
- end
- --------------------
- function minerUp() -- bottom to top mining
- for i=1,height do
- while turtle.digUp() do
- sleep(.2)
- end
- while turtle.dig() do
- sleep(.2)
- end
- turtle.up()
- end
- end
- -------------------
- function inventory() -- check for fuel and enderchest
- print("fuel in slot 15")
- print("64x chests in slot 16")
- turtle.dig() --just in case it is placed before a restart
- while turtle.getItemCount(16) == 0 do
- os.pullEvent("turtle_inventory")
- end
- end
- --------------------
- -- Main function
- -- start with going to bedrock
- inventory()
- -- the turtle miner is now ready
- while turtle.getItemCount(16) > 1 do
- bottom()
- self()-- fuel check
- empty()-- place chest, empty, "leave" chest, move into postion
- print("Mining Up")
- minerUp()
- self()-- fuel check
- empty()-- place chest, empty, "leave" chest, move into postion
- print("Mining Down")
- end
Advertisement
Add Comment
Please, Sign In to add comment