Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- write("Number of stair groups: ")
- local num = read()
- local st = 0
- local numSteps = 0
- local returnToTop = "no"
- for i=1,num do
- for ii=1,3 do
- turtle.forward()
- turtle.down()
- turtle.placeDown()
- if not turtle.placeDown() then
- print("Error - could not place block")
- print("Check fuel level or existing blocks")
- break
- end
- end
- turtle.turnRight()
- st = st+1
- if st == num then
- print(st.." stair(s) complete!")
- end
- end
- write("Return to top? (yes/no) ")
- returnToTop = read()
- if returnToTop == "yes" then
- numSteps = num*3
- print("Returning to top - "..numSteps.." stairs")
- turtle.turnRight()
- for i=1,numSteps do
- turtle.up()
- turtle.detect()
- if turtle.detect() then
- turtle.turnLeft()
- end
- turtle.forward()
- end
- print("Return to top complete")
- end
Advertisement
Add Comment
Please, Sign In to add comment