Advertisement
dadragon84

Turtle Stairs

Jul 2nd, 2013 (edited)
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.06 KB | None | 0 0
  1. version = 2.0
  2. term.clear()
  3. term.setCursorPos(1,1)
  4. print("Welcome to Mr John Dowe's Stair Creator version " .. version)
  5. recursions = 1
  6. if turtle.getFuelLevel() ~= "unlimited" and turtle.getFuelLevel() < 1 then
  7.     turtle.select(1)
  8.     if turtle.getItemCount( turtle.getSelectedSlot() ) > 0 then
  9.         print("Refuelling")
  10.         turtle.refuel()
  11.     else
  12.         print("I'm out of fuel in slot 1.")
  13.     end
  14.    
  15. end
  16.  
  17.  
  18. print("Please Tell me how far down you want the stairs to go?")
  19. depth = read()
  20. term.clear()
  21. term.setCursorPos(1,1)
  22. print("Do you want to place torches: Yes/No")
  23. print("Please place torches in slot 16")
  24. torches = read()
  25. torches = tostring(torches)
  26. torches = string.lower(torches)
  27. term.clear()
  28. term.setCursorPos(1,1)
  29. print("Would you like me to place stairs?: Yes/No")
  30. print("Place stairs in slot 2")
  31. stairsPlacement = read()
  32. stairsPlacement = tostring(stairsPlacement)
  33. stairsPlacement = string.lower(stairsPlacement)
  34. term.clear()
  35. term.setCursorPos(1,1)
  36. print("Creating Stairs Going Down")
  37.  
  38. for i=1,depth do
  39.        
  40.         if(stairsPlacement == "yes") then
  41.        
  42.             turtle.digDown()
  43.             turtle.down()
  44.             turtle.turnLeft()
  45.             turtle.turnLeft()
  46.             turtle.dig()
  47.             turtle.select(2)
  48.             turtle.place()
  49.             turtle.turnRight()
  50.             turtle.turnRight()
  51.            
  52.         else
  53.             turtle.digDown()
  54.             turtle.down()
  55.         end
  56.            
  57.         for i=1,4 do
  58.                 if i == 4 then 
  59.                    
  60.                         turtle.turnLeft()
  61.                         turtle.dig()
  62.                         turtle.turnRight()
  63.                         turtle.turnRight()
  64.                         turtle.dig()
  65.                         turtle.turnLeft()
  66.                         turtle.back()
  67.                    
  68.                    
  69.                    
  70.                     if (recursions % 5 == 0) and (torches == "yes") then
  71.                             turtle.select(16)
  72.                             turtle.place()
  73.                             turtle.back()
  74.                     else
  75.                             turtle.back()
  76.                     end
  77.                 else
  78.    
  79.                     turtle.turnLeft()
  80.                     turtle.dig()
  81.                     turtle.turnRight()
  82.                     turtle.turnRight()
  83.                     turtle.dig()
  84.                     turtle.turnLeft()
  85.                     turtle.dig()
  86.                     turtle.forward()
  87.                    
  88.                 end
  89.                 recursions = recursions + 1
  90.         end
  91. end
  92. term.clear()
  93. term.setCursorPos(1,1)
  94. print("Stairs are Complete")
  95.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement