Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Logging program
- -- Not finished
- function check()
- local success, data = turtle.inspect()
- return data.name
- end
- function checkUp()
- local success, data = turtle.inspectUp()
- return data.name
- end
- function checkDown()
- local success, data = turtle.inspectDown()
- return data.name
- end
- if check() == "log" then
- turtle.dig()
- turtle.forward()
- while checkUp() == "log" do
- turtle.digup()
- if check() == "log" then
- turtle.dig()
- end
- turtle.up()
- end
- turtle.turnRight()
- if check() == "log" then -- check if its a 2x2 tree on the right
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- while checkDown() == "log" do
- turtle.digDown()
- if check() == "log" then
- turtle.dig()
- end
- turtle.down()
- end
- if check() == "log" then
- turtle.dig()
- end
- end
- turtle.turnLeft()
- turtle.turnLeft()
- if check() == "log" then -- check if its a 2x2 tree on the left
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- while checkDown() == "log" do
- turtle.digDown()
- if check() == "log" then
- turtle.dig()
- end
- turtle.down()
- end
- if check() == "log" then
- turtle.dig()
- end
- else
- turtle.turnLeft()
- while turtle.down()
- -- nothing
- end
- end
- turtle.back()
- else
- print("no tree found?")
- print("Place me against a tree please.")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement