Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function moveDown()
- while(not turtle.down()) do turtle.attackDown() end
- end
- function moveUp()
- while(not turtle.up()) do turtle.attackUp() end
- end
- function moveForward()
- while(not turtle.forward()) do turtle.attack() end
- end
- function moveBack()
- while(not turtle.back()) do sleep(1) end
- end
- function prepPlant()
- turtle.select(1)
- moveForward()
- turtle.suckDown()
- moveForward()
- turtle.suckDown()
- moveBack()
- moveBack()
- if(turtle.getItemCount(1) < 64) then error("Not enough saplings.") end
- if(turtle.getItemCount(2) < 64) then error("Not enough bonemeal.") end
- end
- function plant()
- moveBack()
- turtle.select(1)
- turtle.place()
- turtle.select(2)
- turtle.place()
- end
- function plant7()
- for i = 1,7 do
- plant()
- end
- end
- function plant8x8()
- for i = 1,4 do
- plant7()
- turtle.turnRight()
- plant()
- turtle.turnRight()
- plant7()
- turtle.turnLeft()
- plant()
- turtle.turnLeft()
- end
- end
- function harvest()
- turtle.dig()
- moveForward()
- turtle.digUp()
- turtle.digDown()
- turtle.suckDown()
- end
- function harvest7()
- for i = 1,7 do
- harvest()
- end
- end
- function harvest8x8()
- for i = 1,4 do
- harvest()
- turtle.turnRight()
- harvest7()
- turtle.turnLeft()
- harvest()
- turtle.turnLeft()
- harvest7()
- turtle.turnRight()
- end
- end
- function prepHarvest()
- turtle.select(1)
- turtle.digUp()
- moveUp()
- turtle.turnRight()
- end
- function to2ndLayer()
- turtle.turnLeft()
- turtle.dig()
- moveForward()
- for i = 1,3 do
- turtle.digUp()
- moveUp()
- end
- turtle.turnRight()
- turtle.turnRight()
- end
- function dropWood()
- for i = 1,16 do
- turtle.select(i)
- turtle.dropDown()
- end
- end
- function toStartPoint()
- turtle.turnLeft()
- turtle.dig()
- moveForward()
- for i = 1,4 do
- turtle.digDown()
- moveDown()
- end
- turtle.turnLeft()
- for i = 1,7 do
- moveForward()
- end
- dropWood()
- turtle.turnLeft()
- moveForward()
- turtle.turnRight()
- end
- while(turtle.getFuelLevel() > 500) do
- prepPlant()
- plant8x8()
- prepHarvest()
- harvest8x8()
- to2ndLayer()
- harvest8x8()
- toStartPoint()
- end
- print("Terminated: Low fuel level.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement