Posted 18 January 2016 - 01:34 AM
So I created this program to automatically farm birch or pine trees.
It is a rather simple program, but I feel that it could be of use to beginners who want to start understanding code.
I provide a pretty thorough documentation of the program with my youtube video, which shows the program in application,
and explains the code in a step-by-step manner.
Here is the link: https://youtu.be/wpq5XyjWWM0
I hope you learn a bit from my work.
Thank you!! :D/>
It is a rather simple program, but I feel that it could be of use to beginners who want to start understanding code.
I provide a pretty thorough documentation of the program with my youtube video, which shows the program in application,
and explains the code in a step-by-step manner.
Here is the link: https://youtu.be/wpq5XyjWWM0
I hope you learn a bit from my work.
Thank you!! :D/>
--[[Version 1.0]]--
function fuelCheck()
local fuelLevel = turtle.getFuelLevel()
if fuelLevel < 20 then
turtle.select(1)
turtle.refuel(1)
print("Refueled!")
end
end
function chopTree()
local success, data = turtle.inspect()
if data.name == "minecraft:log" then
print("Tree detected... chopping.")
turtle.dig()
turtle.forward()
while turtle.detectUp() == true do
turtle.digUp()
turtle.up()
end
while turtle.detectDown() == false do
turtle.down()
end
turtle.back()
turtle.select(3)
turtle.place()
turtle.select(1)
end
end
local chopping = true
while chopping do
fuelCheck()
chopTree()
turtle.suck()
turtle.suckUp()
end
Edited on 18 January 2016 - 03:10 AM