Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version = 2.0
- term.clear()
- term.setCursorPos(1,1)
- print("Welcome to Mr John Dowe's Stair Creator version " .. version)
- recursions = 1
- if turtle.getFuelLevel() ~= "unlimited" and turtle.getFuelLevel() < 1 then
- turtle.select(1)
- if turtle.getItemCount( turtle.getSelectedSlot() ) > 0 then
- print("Refuelling")
- turtle.refuel()
- else
- print("I'm out of fuel in slot 1.")
- end
- end
- print("Please Tell me how far down you want the stairs to go?")
- depth = read()
- term.clear()
- term.setCursorPos(1,1)
- print("Do you want to place torches: Yes/No")
- print("Please place torches in slot 16")
- torches = read()
- torches = tostring(torches)
- torches = string.lower(torches)
- term.clear()
- term.setCursorPos(1,1)
- print("Would you like me to place stairs?: Yes/No")
- print("Place stairs in slot 2")
- stairsPlacement = read()
- stairsPlacement = tostring(stairsPlacement)
- stairsPlacement = string.lower(stairsPlacement)
- term.clear()
- term.setCursorPos(1,1)
- print("Creating Stairs Going Down")
- for i=1,depth do
- if(stairsPlacement == "yes") then
- turtle.digDown()
- turtle.down()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.dig()
- turtle.select(2)
- turtle.place()
- turtle.turnRight()
- turtle.turnRight()
- else
- turtle.digDown()
- turtle.down()
- end
- for i=1,4 do
- if i == 4 then
- turtle.turnLeft()
- turtle.dig()
- turtle.turnRight()
- turtle.turnRight()
- turtle.dig()
- turtle.turnLeft()
- turtle.back()
- if (recursions % 5 == 0) and (torches == "yes") then
- turtle.select(16)
- turtle.place()
- turtle.back()
- else
- turtle.back()
- end
- else
- turtle.turnLeft()
- turtle.dig()
- turtle.turnRight()
- turtle.turnRight()
- turtle.dig()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- end
- recursions = recursions + 1
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- print("Stairs are Complete")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement