ComputerCraft/Tree_Farm/choptree.lua

25 lines
501 B
Lua
Raw Normal View History

2020-11-06 15:05:04 +00:00
--[[Tree Chopping program by Sascha
Chops down the tree in front of turtle.]]
os.loadAPI('modules.lua') -- Load the modules module
2020-11-06 15:05:04 +00:00
print('Chopping tree...')
if not turtle.dig() then -- chop base of tree
error('Turtle needs a digging tool!')
end
os.sleep(3) -- Wait until everything droppen from the tree
2020-11-06 15:05:04 +00:00
for j = 1, 4 do
for i = 1, 4 do
turtle.suck() -- Suck up everything
turtle.turnLeft()
end
check_fuel()
turtle.forward()
2020-11-06 15:05:04 +00:00
end
for i = 1, 4 do
check_fuel()
turtle.back()
2020-11-06 15:05:04 +00:00
end