Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function ChopTreeUp()
- while true do
- s1,data1 = turtle.inspectUp()
- if s1 then
- print("detect" , data1.name)
- if data1.name == "minecraft:log" then
- turtle.digUp()
- turtle.up()
- else
- print("detect not log")
- break
- end
- else
- print("detect nothing")
- break
- end
- end
- end
- local function FindTree()
- while true do
- print(" find a tree first")
- if turtle.detect() then
- turtle.dig()
- turtle.forward()
- s,data = turtle.inspectUp()
- if s then
- print("detect", data.name)
- if data.name == "minecraft:log" then
- break
- end
- end
- else
- turtle.turnLeft()
- local steps = math.random(1,4)
- for i=1,steps do
- turtle.dig()
- turtle.forward()
- end
- print("turtle turn left")
- end
- end
- end
- while true do
- FindTree()
- ChopTreeUp()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement