Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p = peripheral.wrap("right")
- function refuel()
- if turtle.getFuelLevel() <= 20 then
- p.speak("Refilling fuel.")
- sleep(2)
- turtle.select(1)
- turtle.refuel(turtle.getItemCount(1) - 1)
- end
- end
- function checkItems()
- if turtle.getItemCount(2) == 0 then
- p.speak("Please place a log in slot 2 to help me identify the tree. I am very blind.")
- sleep(5)
- end
- if turtle.getItemCount(3) == 0 then
- end
- end
- function hasLogInfront()
- turtle.select(2)
- if turtle.compare() then
- return true
- end
- end
- function takeDownTree()
- turtle.select(2)
- while turtle.compare() do
- turtle.select(1)
- turtle.dig()
- turtle.select(2)
- turtle.digUp()
- turtle.up()
- end
- while not turtle.detectDown() do
- turtle.down()
- end
- end
- function placeSapling()
- if turtle.getItemCount(3) > 1 then
- turtle.select(3)
- turtle.place()
- end
- end
- function bonemeal()
- if turtle.getItemCount(4) > 1 then
- turtle.select(4)
- turtle.place()
- end
- end
- function suckItems()
- turtle.select(1)
- turtle.suckUp()
- turtle.suckDown()
- turtle.suck()
- end
- while true do
- checkItems()
- refuel()
- if hasLogInfront() then
- takeDownTree()
- end
- placeSapling()
- bonemeal()
- suckItems()
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement