28 lines
556 B
Lua
28 lines
556 B
Lua
--[[Tree Chopping program by Sascha
|
|
Chops down the tree in front of turtle.]]
|
|
|
|
if not turtle.detect() then
|
|
error('Could not find tree!')
|
|
end
|
|
|
|
print('Chopping tree...')
|
|
|
|
if not turtle.dig() then -- chop base of tree
|
|
error('Turtle needs a digging tool!')
|
|
end
|
|
|
|
os.sleep(5) -- Wait until everything droppen from the tree
|
|
for j = 1, 4 do
|
|
for i = 1, 4 do
|
|
if not turtle.suck() then -- Suck up all Wood
|
|
print('Did not find something to suck')
|
|
end
|
|
turtle.turnLeft()
|
|
end
|
|
turtle.forward()
|
|
end
|
|
|
|
for i = 1, 4 do
|
|
turtle.back()
|
|
end
|