Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- seeds, harvests, fuel = 1, 2, 16
- oddity = true
- function flush()
- i = 1
- while(i < 17)
- do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.select(1)
- end
- function try_flush()
- success, data = turtle.inspectDown();
- if(success)
- then
- if(data.name == "minecraft:chest")
- then
- flush()
- end
- end
- end
- function go()
- turtle.suckDown()
- try_flush()
- if(turtle.getFuelLevel() > 1)
- then
- turtle.forward()
- else
- turtle.select(fuel)
- turtle.refuel()
- turtle.select(seeds)
- end
- end
- function goToNextLine()
- if(oddity)
- then
- turtle.turnRight()
- go()
- turtle.turnRight()
- oddity = false
- else
- turtle.turnLeft()
- go()
- turtle.turnLeft()
- oddity = true
- end
- end
- function harvest()
- success, data = turtle.inspectDown()
- if(success)
- then
- if(data.state.age == 7)
- then
- turtle.digDown()
- turtle.suckDown()
- turtle.placeDown()
- end
- end
- if(not turtle.inspectDown())
- then
- seeds, harvests = harvests, seeds
- turtle.select(seeds)
- turtle.placeDown()
- end
- end
- function lineEndCheck()
- success, data = turtle.inspect()
- return data.name == "minecraft:cobblestone"
- end
- --Main loop
- while(true)
- do
- --Self refuel
- turtle.turnRight()
- turtle.turnRight()
- turtle.select(fuel)
- turtle.suck()
- turtle.refuel()
- turtle.drop()
- turtle.turnRight()
- turtle.turnRight()
- --First line harvest
- while(true)
- do
- try_flush()
- if(lineEndCheck())
- then
- break
- end
- harvest()
- go()
- end
- --Transition
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- --Next line harvest
- while(true)
- do
- try_flush()
- if(lineEndCheck())
- then
- break
- end
- harvest()
- go()
- end
- --Transition
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- --First line succ
- while(true)
- do
- try_flush()
- if(lineEndCheck())
- then
- break
- end
- turtle.suckDown()
- go()
- end
- --BIG transition
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- --Looped for the rest
- while(true)
- do
- --Harvest
- while(true)
- do
- try_flush()
- if(lineEndCheck())
- then
- break
- end
- harvest()
- go()
- end
- --Transition
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- --Succ
- while(true)
- do
- try_flush()
- if(lineEndCheck())
- then
- break
- end
- turtle.suckDown()
- go()
- end
- --BIG transition
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- end
- --[[
- while(true)
- do
- while(true)
- do
- success, data = turtle.inspectDown()
- if(lineEndCheck(data))
- then
- break
- end
- collect()
- go()
- end
- flush()
- succ, dat = turtle.inspect()
- if(dat.name == "minecraft:netherrack")
- then
- break
- end
- goToNextLine()
- end
- turtle.turnRight()
- while(true)
- do
- turtle.forward()
- succ, dat = turtle.inspect()
- if(dat.name == "minecraft:netherrack")
- then
- turtle.turnRight()
- break
- end
- end
- ]]--
- sleep(600)
- end
Add Comment
Please, Sign In to add comment