Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function reFuel()
- if turtle.getFuelLevel() < 20 then
- for i=1,5 do -- you were missing a 'do' here.
- turtle.refuel()
- end
- end
- end
- function uTurn()
- turtle.turnLeft() -- it's turtle.turnLeft() not ternLeft ;p
- turtle.turnLeft()
- end
- function toTree()
- for i=1,3 do
- turtle.forward()
- end
- end
- function cutTree()
- turtle.dig()
- turtle.forward()
- while turtle.detectUp() do
- turtle.digUp()
- turtle.up()
- end
- while not turtle.detectDown() do
- turtle.down()
- end
- end
- function toHome()
- uTurn()
- for i=1,3 do
- turtle.forward()
- end
- turtle.select(2)
- turtle.select(3)
- turtle.drop()
- turtle.select(1)
- end
- function replantTree() -- you were missing the'()' here.
- turtle.select(1)
- turtle.place()
- end
- --main script--
- while true do
- reFuel()
- toTree()
- cutTree()
- replantTree()
- toHome()
- sleep (300)
- end
Advertisement
Add Comment
Please, Sign In to add comment