Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local k = ""
- local p = ""
- function chop()
- p = 0
- for i = 1, 20 do
- if turtle.detect()
- then
- turtle.digUp()
- turtle.dig()
- turtle.up()
- p = p + 1
- else
- for i = 1, p do
- turtle.down()
- end
- break
- end
- end
- end
- function check()
- turtle.up()
- while not turtle.detect() do
- sleep(5)
- end
- turtle.down()
- end
- function plant()
- turtle.place()
- redstone.setOutput( "right", true )
- sleep(1)
- redstone.setOutput( "right", false)
- end
- ---Mainprog
- term.write("How many trees you want chopped?: ")
- k = read()
- for i = 1, k do
- plant()
- check()
- chop()
- print("Timber!!!")
- sleep(3)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement