postrach

turtlequarrybuild

Feb 5th, 2017
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. print(" PLATFORM BITCH")
  2. print("choose your build?(choose between line,retangle, wall, cube, square, platform stair or tower)")
  3. local choise = io.read()
  4. if choise == "retangle" then
  5. print("what size horizontaly?")
  6. sleep(2)
  7. h = io.read()
  8. h = h-1
  9. h = tonumber(h)
  10. print("what size vertical?")
  11. v = io.read()
  12. v = tonumber(v)
  13. if h <= 0 then
  14. print("error it can not be 0")
  15. end
  16. if v <= 0 then
  17. print("error it can not be 0")
  18. end
  19. if turtle.detectDown()then
  20. turtle.up()
  21. end
  22. for i=1,v do
  23. print(i)
  24. turtle.placeDown()
  25. turtle.forward()
  26. end
  27. turtle.turnRight()
  28. for i=1,h do
  29. print(i)
  30. turtle.placeDown()
  31. turtle.forward()
  32. end
  33. turtle.turnRight()
  34. for i=1,v do
  35. print(i)
  36. turtle.placeDown()
  37. turtle.forward()
  38. end
  39. turtle.turnRight()
  40. for i=1,h do
  41. print(i)
  42. turtle.placeDown()
  43. turtle.forward()
  44. end
  45. if choise == "square" then
  46. print("how long does it need to be?")
  47. local s = io.read()
  48. local x = s-1
  49. s = tonumber(s)
  50. x = tonumber(x)
  51. if s <= 0 then
  52. print("error length can not be 0")
  53. sleep(2)
  54. end
  55. if turtle.detectDown()then
  56. turtle.up()
  57. end
  58. for i=1,s do
  59. print(i)
  60. turtle.placeDown()
  61. turtle.forward()
  62. end
  63. turtle.back()
  64. turtle.turnRight()
  65. for i=1,s do
  66. print(i)
  67. turtle.placeDown()
  68. turtle.forward()
  69. end
  70. turtle.back()
  71. turtle.turnRight()
  72. for i=1,s do
  73. print(i)
  74. turtle.placeDown()
  75. turtle.forward()
  76. end
  77. turtle.back()
  78. turtle.turnRight()
  79. for i=1,x do
  80. print(i)
  81. turtle.placeDown()
  82. turtle.forward()
  83. end
  84. os.shutdown()
  85. end
  86. end
  87. if choise == "line" then
  88. print("how long does the line need to be?")
  89. local ll = io.read()
  90. ll = tonumber(ll)
  91. if ll <= 0 then
  92. print("error length line can not be 0")
  93. os.shutdown()
  94. end
  95. if turtle.detectDown() then
  96. turtle.up()
  97. end
  98. for i=1, ll do
  99. print(i)
  100. turtle.placeDown()
  101. turtle.forward()
  102. end
  103. end
  104. if choise == "stair" then
  105. print("how long does it need to be?")
  106. local wl = io.read()
  107. wl = tonumber(wl)
  108. print("how high does it need to be?")
  109. local wh = io.read()
  110. wh = tonumber(wh)
  111. if  wh <= 0 then
  112. print("error the higth can not be zero")
  113. sleep(1)
  114. os.shutdown()
  115. end
  116. if wl <= 0 then
  117. print("error the length can not be 0")
  118. sleep(1)
  119. os.shutdown()
  120. end
  121. if turtle.detectDown() then
  122. turtle.up()
  123. end
  124. turtle.turnRight()
  125. for i=1 , wh do
  126. for i=1 , wh do
  127. print(i)
  128. turtle.placeDown()
  129. turtle.up()
  130. turtle.forward()
  131. end
  132. for i=1 , wh do
  133. turtle.down()
  134. end
  135. end
  136. end
  137. if choise == "tower" then
  138. print("how long does it need to be?")
  139. local cl = io.read()
  140. cl = tonumber(cl)
  141. print("how high does it need to be?")
  142. local ch = io.read()
  143. ch = tonumber(ch)
  144. local clt = cl-1
  145. clt = tonumber(clt)
  146. local cltr = cl-2
  147. cltr = tonumber(cltr)
  148. if ch <= 0 then
  149. print("error the higth can not be 0")
  150. os.shutdown()
  151. end
  152. if cl <= 0 then
  153. print("error it can not 0")
  154. os.shutdown()
  155. end
  156. if turtle.detectDown() then
  157. turtle.up()
  158. end
  159. for i=1 , cl do
  160. for i=1, ch do
  161. turtle.placeDown()
  162. turtle.up()
  163. end
  164. turtle.forward()
  165. for i=1, ch do
  166. turtle.down()
  167. end
  168. end
  169. turtle.turnLeft()
  170. turtle.forward()
  171. turtle.turnLeft()
  172. turtle.forward()
  173. turtle.turnRight()
  174. for i=1 , clt do
  175. for i=1, ch do
  176. turtle.placeDown()
  177. turtle.up()
  178. end
  179. turtle.forward()
  180. for i=1, ch do
  181. turtle.down()
  182. end
  183. end
  184. turtle.turnLeft()
  185. turtle.forward()
  186. turtle.turnLeft()
  187. turtle.forward()
  188. turtle.turnRight()
  189. for i=1 , clt do
  190. for i=1, ch do
  191. turtle.placeDown()
  192. turtle.up()
  193. end
  194. turtle.forward()
  195. for i=1, ch do
  196. turtle.down()
  197. end
  198. end
  199. turtle.turnLeft()
  200. turtle.forward()
  201. turtle.turnLeft()
  202. turtle.forward()
  203. turtle.turnRight()
  204. for i=1 , cltr do
  205. for i=1, ch do
  206. turtle.placeDown()
  207. turtle.up()
  208. end
  209. turtle.forward()
  210. turtle.forward()
  211. for i=1, ch do
  212. turtle.down()
  213. end
  214. end
  215. end
  216. if choise == "wall" then
  217. print("how long does it need to be?")
  218. local wl = io.read()
  219. wl = tonumber(wl)
  220. print("how high does it need to be?")
  221. local wh = io.read()
  222. wh = tonumber(wh)
  223. if  wh <= 0 then
  224. print("error the higth can not be zero")
  225. sleep(1)
  226. os.shutdown()
  227. end
  228. if wl <= 0 then
  229. print("error the length can not be 0")
  230. sleep(1)
  231. os.shutdown()
  232. end
  233. if turtle.detectDown() then
  234. turtle.up()
  235. end
  236. turtle.turnRight()
  237. for i=1 , wh do
  238. for i=1 , wh do
  239. print(i)
  240. turtle.placeDown()
  241. turtle.up()
  242. end
  243. turtle.forward()
  244. for i=1 , wh do
  245. turtle.down()
  246. end
  247. end
  248. end
  249. if choise == "cube" then
  250. print("how long does it need to be?")
  251. local cl = io.read()
  252. cl = tonumber(cl)
  253. print("how high does it need to be?")
  254. local ch = io.read()
  255. ch = tonumber(ch)
  256. local clt = cl-1
  257. clt = tonumber(clt)
  258. local cltr = cl-2
  259. cltr = tonumber(cltr)
  260. if ch <= 0 then
  261. print("error the higth can not be 0")
  262. os.shutdown()
  263. end
  264. if cl <= 0 then
  265. print("error it can not 0")
  266. os.shutdown()
  267. end
  268. if turtle.detectDown() then
  269. turtle.up()
  270. end
  271. for i=1 , cl do
  272. for i=1, ch do
  273. turtle.placeDown()
  274. turtle.up()
  275. end
  276. turtle.forward()
  277. for i=1, ch do
  278. turtle.down()
  279. end
  280. end
  281. turtle.turnLeft()
  282. turtle.forward()
  283. turtle.turnLeft()
  284. turtle.forward()
  285. turtle.turnRight()
  286. for i=1 , clt do
  287. for i=1, ch do
  288. turtle.placeDown()
  289. turtle.up()
  290. end
  291. turtle.forward()
  292. for i=1, ch do
  293. turtle.down()
  294. end
  295. end
  296. turtle.turnLeft()
  297. turtle.forward()
  298. turtle.turnLeft()
  299. turtle.forward()
  300. turtle.turnRight()
  301. for i=1 , clt do
  302. for i=1, ch do
  303. turtle.placeDown()
  304. turtle.up()
  305. end
  306. turtle.forward()
  307. for i=1, ch do
  308. turtle.down()
  309. end
  310. end
  311. turtle.turnLeft()
  312. turtle.forward()
  313. turtle.turnLeft()
  314. turtle.forward()
  315. turtle.turnRight()
  316. for i=1 , cltr do
  317. for i=1, ch do
  318. turtle.placeDown()
  319. turtle.up()
  320. end
  321. turtle.forward()
  322. turtle.forward()
  323. for i=1, ch do
  324. turtle.down()
  325. end
  326. end
  327. end
  328. if choise == "platform" then
  329. if turtle.detectDown() then
  330. turtle.up()
  331. end
  332. term.clear()
  333. term.setCursorPos(1,1)
  334. print("how Long?")
  335. a=tonumber(read())
  336. term.setCursorPos(1,3)
  337. term.clearLine()
  338. print("how Wide?")
  339. b=tonumber(read())
  340. turtle.placeDown()
  341. x=1
  342. y=0
  343. s=1
  344. print("using slot " ..s)
  345.   while y<b do
  346.    y=y+1
  347.             while x<a do
  348.             x=x+1
  349.                             turtle.forward()
  350.                             turtle.placeDown()
  351.                                    if turtle.getItemCount(s)==0 then
  352.                                    s=s+1
  353.                  print("now using slot " ..s)
  354. turtle.select(s)
  355. end
  356. end
  357. x=1
  358. q=tonumber(y)
  359. if q%2==1 then
  360. turtle.turnRight()
  361. turtle.forward()
  362. turtle.placeDown()
  363. turtle.turnRight()
  364. elseif q%2==0 then
  365. turtle.turnLeft()
  366. turtle.forward()
  367. turtle.placeDown()
  368. turtle.turnLeft()
  369. end
  370. end
  371. term.clear()
  372. term.setCursorPos(1,1)
  373. print("done")
  374. end
Advertisement
Add Comment
Please, Sign In to add comment