Posted 22 April 2013 - 10:19 AM
hello guys. i know that there are a lot of these types of programs but I want to show you what i have made. i present to you, the Tree-chopper
term.setCursorPos(1,1)
print("TREE CHOPPER v 3.0")
print("-Made by KrafterKing")– (me)
turtle.refuel(5)
print("place me by a tree then press C to chop down tree")
local event, param1 = os.pullEvent ("char")
if param1 == "c" then do
turtle.detect()
turtle.dig()
turtle.forward()
while turtle.detectUp() do
turtle.digUp()
turtle.up()
end
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
end
print("hello, the job is done.")
print("do you want to craft into planks? press Y for yes or N for no")
local event, param2 = os.pullEvent ("char")
local event, param3 = os.pullEvent ("char")
if param2 == "y" then do
turtle.craft()
turtle.select(2)
turtle.transferTo(12,64)
end
else
if param3 == "n" then do
print("not crafting, you may take your wood now.")
end
end
end
endnow, it only chops down single trees but i will update it to make a building that will collect the saplings, and possibly replant them. i hope you liked it. :D/>
if you have any thing that might help, like codes that would make it easier to code this then feel free to say so in the comments. :D/>
PS: you will need a crafty turtle if you want to do the wood into planks.
PSS: here is the pastebin for it: http://pastebin.com/UMmdStDv
Spoiler
term.clear()term.setCursorPos(1,1)
print("TREE CHOPPER v 3.0")
print("-Made by KrafterKing")– (me)
turtle.refuel(5)
print("place me by a tree then press C to chop down tree")
local event, param1 = os.pullEvent ("char")
if param1 == "c" then do
turtle.detect()
turtle.dig()
turtle.forward()
while turtle.detectUp() do
turtle.digUp()
turtle.up()
end
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
end
print("hello, the job is done.")
print("do you want to craft into planks? press Y for yes or N for no")
local event, param2 = os.pullEvent ("char")
local event, param3 = os.pullEvent ("char")
if param2 == "y" then do
turtle.craft()
turtle.select(2)
turtle.transferTo(12,64)
end
else
if param3 == "n" then do
print("not crafting, you may take your wood now.")
end
end
end
end
if you have any thing that might help, like codes that would make it easier to code this then feel free to say so in the comments. :D/>
PS: you will need a crafty turtle if you want to do the wood into planks.
PSS: here is the pastebin for it: http://pastebin.com/UMmdStDv