navyseal421

Bridge building code V.2

Dec 29th, 2012
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.40 KB | None | 0 0
  1. function stairUp()
  2.  
  3. turtle.select(1)
  4. turtle.up()
  5. turtle.forward()
  6. turtle.select(1)
  7. turtle.placeDown()
  8. turtle.place()
  9. turtle.turnLeft()
  10. turtle.forward()
  11. turtle.turnRight()
  12. turtle.placeDown()
  13. turtle.place()
  14. turtle.turnRight()
  15. turtle.forward()
  16. turtle.forward()
  17. turtle.turnLeft()
  18. turtle.placeDown()
  19. turtle.place()
  20. turtle.up()
  21. turtle.forward()
  22. turtle.forward()
  23. end
  24.  
  25. function platform()
  26.  
  27. turtle.select(2)
  28. for i = 2, times do
  29. turtle.placeDown()
  30. turtle.forward()
  31.  
  32. end
  33. end
  34.  
  35. function stairDown()
  36.  
  37. turtle.select(1)
  38. function stairDown()
  39. turtle.turnRight()
  40. turtle.turnRight()
  41. turtle.down()
  42. turtle.placeDown()
  43. turtle.place()
  44. turtle.turnLeft()
  45. turtle.forward()
  46. turtle.turnRight()
  47. turtle.placeDown()
  48. turtle.place()
  49. turtle.turnLeft()
  50. turtle.forward()
  51. turtle.turnRight()
  52. turtle.placedown()
  53. turtle.place()
  54. turtle.turnRight()
  55. turtle.turnRight()
  56. turtle.forward()
  57. turtle.down()
  58. end
  59.  
  60. print("WELCOME TO THE BRIDGE BUILDING PROGRAM")
  61. print("PLEASE PUT STAIRS IN THE FIRST SLOT")
  62. print("PUT THE MAIN BRIDGE MATERIALS IN THE SECOUND SLOT")
  63. term.write("HOW LONG IS THE DESIRED BRIDGE? ")
  64. times = read()
  65.  
  66. stairUp()
  67. platform()
  68. turtle.placeDown()
  69. turtle.turnLeft()
  70. turtle.forward()
  71. turtle.turnLeft()
  72. platform()
  73. turtle.placeDown()
  74. turtle.turnRight()
  75. turtle.forward()
  76. turtle.turnRight()
  77. platform()
  78. turtle.placeDown()
  79. turtle.forward()
  80. turtle.forward()
  81. stairDown()
  82. print("BRIDGE COMPLETE")
Advertisement
Add Comment
Please, Sign In to add comment