Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function f(loc)
- while not turtle[loc]() do
- sleep(0.5)
- end
- end
- function up() f("up") end
- function down() f("down") end
- function fw() f("forward") end
- function back() f("back") end
- function l() f("turnLeft") end
- function r() f("turnRight") end
- function d() turtle.dig() end
- function du() turtle.digUp() end
- function dd() turtle.digDown() end
- function c(x)
- for i=1,x do d() fw() du() dd() end
- end
- function cutTree()
- print("tree cut")
- hi = 0
- while not turtle.detectUp() do
- up() hi=hi+1
- end
- du() up() du() up() du() l() l()
- c(1) r() c(2) r() c(4) r() c(4) r()
- c(4) r() c(1) r() c(3) l() c(2) l()
- c(2) back() l() c(1) l() down()
- for r=1,hi do dd() down() end
- dd() turtle.placeDown() back()
- down() down()
- print(hi)
- end
- cutTree()
- end
Advertisement
Add Comment
Please, Sign In to add comment