Posted 12 October 2012 - 09:45 PM
So started with CC yesterday and have been following some tutorials.
but this time i made my own program from what i have learned. and i made a lumberjack.
there is maybe something that could have been made a bit better but i'am pretty happy about it.
but would love to get better anyone got some suggestions.
but this time i made my own program from what i have learned. and i made a lumberjack.
there is maybe something that could have been made a bit better but i'am pretty happy about it.
but would love to get better anyone got some suggestions.
--defines how many tree to harvest
local times = 0
term.write("Number of trees to cut: ")
times = read()
for u = 1, times do
-- sets a vari for use when cutting the tree
local x = 0
--plants and bonemeals the tree
turtle.select(1)
turtle.place()
turtle.select(2)
turtle.place()
-- moves the turtle up
while turtle.detect() do
turtle.digUp()
turtle.up()
x = x+1
end
--moves the turlte over the log
turtle.forward()
--cuts the tree and moves down depending on the vari x
for i = 1, x do
turtle.digDown()
turtle.down()
end
-- sets vari x to 0
x = 0
-- moves turtle over to chest and turns it around
turtle.back()
turtle.turnLeft()
turtle.turnLeft()
-- puts any tree and saplings into the chest
turtle.select(3)
turtle.drop()
turtle.select(4)
turtle.drop()
turtle.select(1)
-- turns the turtle around to the start position
turtle.turnLeft()
turtle.turnLeft()
end