Advertisement
bjohnston562

house

Jul 31st, 2013
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. function check()
  2. local g=2
  3. if turtle.getItemCount(s)==0
  4. then
  5. s=s+1
  6. if s<17
  7. then
  8. turtle.select(s)
  9. else
  10. s=1
  11. turtle.select(s)
  12. while g == 2
  13. do
  14. print("Waiting for supplies. Type 1 to continue building.")
  15. g=read()
  16. end
  17. end
  18. end
  19. end
  20.  
  21.  
  22. --main script
  23. print("Hello! What is the length of both sides of your house? The turtle will build your house in front of it and to the right.")
  24. x=read()
  25. tonumber(x)
  26. print("How high off the ground? (0 if at ground level)")
  27. y=read()
  28. tonumber(y)
  29. print("how tall from the base of the house do you want your house?")
  30. h=read()
  31. tonumber(h)
  32. print(" Building your house!")
  33.  
  34. --main script floor of house
  35. s=1 -- for check script
  36. tonumber(s)
  37. for i=1,y
  38. do
  39. turtle.up()
  40. end
  41. for i=1, x/2
  42. do
  43. for i=1,x-1
  44. do
  45. check()
  46. turtle.placeDown()
  47. sleep(.1)
  48. turtle.forward()
  49. end
  50. turtle.placeDown()
  51. turtle.turnRight()
  52. turtle.forward()
  53. turtle.turnRight()
  54.  
  55. for i=1,x-1
  56. do
  57. check()
  58. turtle.placeDown()
  59. sleep(.1)
  60. turtle.forward()
  61. end
  62. turtle.placeDown()
  63. turtle.turnLeft()
  64. turtle.forward()
  65. turtle.turnLeft()
  66. end
  67. turtle.turnLeft()
  68. turtle.forward()
  69. turtle.turnRight()
  70. turtle.up()
  71.  
  72. --building the walls of the house
  73. for i=1, h
  74. do
  75. for i=1,4
  76. do
  77. for i=1,x-1
  78. do
  79. check()
  80. turtle.placeDown()
  81. sleep(.1)
  82. turtle.forward()
  83. end
  84. turtle.turnLeft()
  85. end
  86. turtle.up()
  87. end
  88.  
  89. --ceiling of house
  90. turtle.down()
  91. turtle.forward()
  92. turtle.turnLeft()
  93. turtle.forward()
  94. for i=1, (x-2)/2
  95. do
  96. for i=1,x-3
  97. do
  98. check()
  99. turtle.placeDown()
  100. sleep(.1)
  101. turtle.forward()
  102. end
  103. turtle.placeDown()
  104. turtle.turnRight()
  105. turtle.forward()
  106. turtle.turnRight()
  107.  
  108. for i=1,x-3
  109. do
  110. check()
  111. turtle.placeDown()
  112. sleep(.1)
  113. turtle.forward()
  114. end
  115. turtle.placeDown()
  116. turtle.turnLeft()
  117. turtle.forward()
  118. turtle.turnLeft()
  119. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement