Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Turtles do not always detect their tools upon reloading the turtle
- --unequiping and equiping the tools fixes this
- turtle.select(15)
- turtle.equipLeft()
- turtle.equipLeft()
- turtle.select(1)
- print("Please put a lava source to the right of the Turtle.")
- print("Put a lava bucket in the last slot (bottom right).")
- print("")
- print("How long is the farm?")
- length = read()
- function fuelCheck()
- print("Fuel check ran")
- fuel = turtle.getFuelLevel()
- while fuel < 4000 do
- turtle.turnRight()
- turtle.select(16)
- turtle.place()
- turtle.refuel()
- turtle.turnLeft()
- end
- end
- function farm()
- for i=1,length do
- turtle.dig()
- turtle.forward()
- turtle.digDown()
- end
- end
- function detectBlock()
- --Wait for farm to grow
- noBlock = true
- while noBlock do
- if noBlock == turtle.detect() then
- sleep(60)
- else
- return true
- end
- end
- end
- while true do
- if detectBlock() then
- --Check fuel before mining
- fuelCheck()
- farm()
- --Go to lane to the left
- turtle.turnLeft()
- turtle.forward(2)
- turtle.turnLeft()
- --Farm next lane
- farm()
- --Go back to starting position
- turtle.turnLeft()
- turtle.forward(2)
- turtle.turnLeft()
- --Reset detectBlock to restart system
- detectBlock = false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement