Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local lSide = "right"
- local height = 0
- local red = redstone.getInput(lSide)
- local function forward()
- while not turtle.forward() do
- turtle.dig()
- turtle.attack()
- if turtle.getFuelLevel() < 1 then
- error("Out of Fuel!")
- end
- end
- end
- local function plant()
- turtle.select(1)
- forward()
- forward()
- turtle.turnRight()
- turtle.place()
- turtle.turnLeft()
- turtle.back()
- turtle.place()
- turtle.turnRight()
- turtle.place()
- turtle.turnLeft()
- turtle.back()
- turtle.place()
- turtle.select(2)
- turtle.place()
- end
- local function up()
- turtle.dig()
- while not turtle.up() do
- turtle.digUp()
- end
- turtle.dig()
- end
- local function new()
- forward()
- turtle.turnRight()
- forward()
- turtle.turnRight()
- end
- local function down()
- turtle.dig()
- while not turtle.down() do
- turtle.dig()
- turtle.digDown()
- end
- turtle.dig()
- end
- local function reset()
- forward()
- forward()
- turtle.turnRight()
- forward()
- turtle.turnRight()
- end
- if red then
- plant()
- turtle.dig()
- forward()
- repeat
- up()
- height = height + 1
- until not turtle.detectUp()
- new()
- repeat
- down()
- height = height - 1
- until height == 0
- reset()
- end
Advertisement
Add Comment
Please, Sign In to add comment