Don't like ads? PRO users don't see any ads ;-)
Guest

Wireless Turtle

By: a guest on Aug 1st, 2012  |  syntax: None  |  size: 14.94 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function kv()
  2. turtle.forward()
  3. turtle.digUp()
  4. turtle.digDown()
  5. turtle.dig()
  6. turtle.forward()
  7. turtle.digUp()
  8. turtle.digDown()
  9. turtle.dig()
  10. turtle.forward()
  11. turtle.digUp()
  12. turtle.digDown()
  13. turtle.dig()
  14. end
  15. function ksh()
  16. turtle.forward()
  17. turtle.digUp()
  18. turtle.digDown()
  19. turtle.turnRight()
  20. turtle.dig()
  21. end
  22. function ksv()
  23. turtle.forward()
  24. turtle.digUp()
  25. turtle.digDown()
  26. turtle.turnLeft()
  27. turtle.dig()
  28. end
  29. function kg()
  30. turtle.forward()
  31. turtle.digDown()
  32. turtle.placeDown()
  33. end
  34. function tk()
  35. turtle.forward()
  36. turtle.placeDown()
  37. turtle.forward()
  38. turtle.placeDown()
  39. turtle.forward()
  40. turtle.placeDown()
  41. turtle.forward()
  42. turtle.placeDown()
  43. end
  44. function kallare()
  45. turtle.forward() --start pos
  46. turtle.turnLeft()
  47. turtle.forward()
  48. turtle.forward()
  49. turtle.turnRight() --block 1
  50. turtle.digDown()
  51. turtle.down()
  52. turtle.digDown()
  53. turtle.down()
  54. turtle.digDown()
  55. turtle.dig()
  56. kv() --block 2, 3, 4
  57. ksh() --block 5
  58. ksh() --block 6
  59. kv() --block 7, 8, 9
  60. ksv() --block 10
  61. ksv() --block 11
  62. kv() --block 12, 13, 14
  63. ksh() --block 15
  64. ksh() --block 16
  65. kv() --block 17, 18, 19
  66. ksv() --block 20
  67. ksv() --block 21
  68. kv() --block 22, 23, 24
  69. turtle.forward() --block 25
  70. turtle.digUp()
  71. turtle.digDown()
  72. turtle.turnLeft()
  73. turtle.down()
  74. turtle.forward()
  75. turtle.turnLeft()
  76. turtle.select(1)
  77. kg() --block 1
  78. kg() --block 2
  79. kg() --block 3
  80. turtle.turnRight()
  81. turtle.forward() --block 4
  82. turtle.turnRight()
  83. turtle.digDown()
  84. turtle.placeDown()
  85. kg() --block 5
  86. kg() --block 6
  87. turtle.turnLeft()
  88. turtle.forward() --block 7
  89. turtle.turnLeft()
  90. turtle.digDown()
  91. turtle.placeDown()
  92. kg() --block 8
  93. kg() --block 9
  94. turtle.forward()
  95. turtle.turnRight()
  96. turtle.forward() --block 1
  97. turtle.turnRight()
  98. turtle.up()
  99. turtle.select(9)
  100. turtle.placeDown()
  101. turtle.forward() --block 2
  102. turtle.select(1)
  103. turtle.placeDown()
  104. turtle.forward() --block 3
  105. turtle.placeDown()
  106. turtle.forward() --block 4
  107. turtle.placeDown()
  108. turtle.forward() --block 5
  109. turtle.turnRight()
  110. turtle.select(9)
  111. turtle.placeDown()
  112. turtle.forward() --block 6
  113. turtle.select(1)
  114. turtle.placeDown()
  115. turtle.forward() --block 7
  116. turtle.placeDown()
  117. turtle.forward() --block 8
  118. turtle.placeDown()
  119. turtle.forward() --block 9
  120. turtle.turnRight()
  121. turtle.select(9)
  122. turtle.placeDown()
  123. turtle.forward() --block 10
  124. turtle.select(1)
  125. turtle.placeDown()
  126. turtle.forward() --block 11
  127. turtle.placeDown()
  128. turtle.forward() --block 12
  129. turtle.placeDown()
  130. turtle.forward() --block 13
  131. turtle.turnRight()
  132. turtle.select(9)
  133. turtle.placeDown()
  134. turtle.forward() --block 14
  135. turtle.select(1)
  136. turtle.placeDown()
  137. turtle.forward() --block 15
  138. turtle.placeDown()
  139. turtle.forward() --block 16
  140. turtle.placeDown()
  141. turtle.forward() --block 17
  142. turtle.turnRight()
  143. turtle.select(9)
  144. turtle.up()
  145. turtle.placeDown()
  146. turtle.forward() --block 18
  147. turtle.select(1)
  148. turtle.placeDown()
  149. turtle.forward() --block 19
  150. turtle.placeDown()
  151. turtle.forward() --block 20
  152. turtle.placeDown()
  153. turtle.forward() --block 21
  154. turtle.turnRight()
  155. turtle.select(9)
  156. turtle.placeDown()
  157. turtle.forward() --block 22
  158. turtle.select(1)
  159. turtle.placeDown()
  160. turtle.forward() --block 23
  161. turtle.placeDown()
  162. turtle.forward() --block 24
  163. turtle.placeDown()
  164. turtle.forward() --block 25
  165. turtle.turnRight()
  166. turtle.select(9)
  167. turtle.placeDown()
  168. turtle.forward() --block 26
  169. turtle.select(1)
  170. turtle.placeDown()
  171. turtle.forward() --block 27
  172. turtle.placeDown()
  173. turtle.forward() --block 28
  174. turtle.placeDown()
  175. turtle.forward() --block 29
  176. turtle.turnRight()
  177. turtle.select(9)
  178. turtle.placeDown()
  179. turtle.forward() --block 30
  180. turtle.select(1)
  181. turtle.placeDown()
  182. turtle.forward() --block 31
  183. turtle.placeDown()
  184. turtle.forward() --block 32
  185. turtle.placeDown()
  186. turtle.forward() --block 33
  187. turtle.turnRight()
  188. turtle.select(9)
  189. turtle.up()
  190. turtle.placeDown()
  191. turtle.forward() --block 34
  192. turtle.select(1)
  193. turtle.placeDown()
  194. turtle.forward() --block 35
  195. turtle.placeDown()
  196. turtle.forward() --block 36
  197. turtle.placeDown()
  198. turtle.forward() --block 37
  199. turtle.turnRight()
  200. turtle.select(9)
  201. turtle.placeDown()
  202. turtle.forward() --block 38
  203. turtle.select(1)
  204. turtle.placeDown()
  205. turtle.forward() --block 39
  206. turtle.placeDown()
  207. turtle.forward() --block 40
  208. turtle.placeDown()
  209. turtle.forward() --block 41
  210. turtle.turnRight()
  211. turtle.select(9)
  212. turtle.placeDown()
  213. turtle.forward() --block 42
  214. turtle.select(1)
  215. turtle.placeDown()
  216. turtle.forward() --block 43
  217. turtle.placeDown()
  218. turtle.forward() --block 44
  219. turtle.placeDown()
  220. turtle.forward() --block 45
  221. turtle.turnRight()
  222. turtle.select(9)
  223. turtle.placeDown()
  224. turtle.forward() --block 46
  225. turtle.select(1)
  226. turtle.placeDown()
  227. turtle.forward() --block 47
  228. turtle.placeDown()
  229. turtle.forward() --block 48
  230. turtle.select(2)
  231. turtle.placeDown()
  232. turtle.turnRight()
  233. turtle.forward()
  234. turtle.down()
  235. turtle.down()
  236. turtle.down()
  237. turtle.forward()
  238. turtle.turnRight()
  239. turtle.forward()
  240. turtle.turnLeft()
  241. turtle.turnLeft()
  242. turtle.select(5)
  243. turtle.place()
  244. turtle.turnRight()
  245. turtle.turnRight()
  246. turtle.select(8)
  247. turtle.place()
  248. turtle.up()
  249. turtle.place()
  250. turtle.turnLeft()
  251. turtle.turnLeft()
  252. turtle.select(4)
  253. turtle.place()
  254. turtle.turnRight()
  255. turtle.turnRight()
  256. turtle.up()
  257. turtle.select(8)
  258. turtle.place()
  259. turtle.up()
  260. turtle.turnRight()
  261. turtle.forward()
  262. turtle.forward()
  263. turtle.forward()
  264. turtle.turnLeft()
  265. turtle.turnLeft()
  266. end
  267. function golv1()
  268. turtle.forward()
  269. turtle.forward()
  270. turtle.turnLeft()
  271. turtle.forward() --block 1
  272. turtle.turnRight()
  273. turtle.select(2)
  274. turtle.placeDown()
  275. turtle.forward() --block 2
  276. turtle.placeDown()
  277. turtle.forward() --block 3
  278. turtle.placeDown()
  279. turtle.turnRight()
  280. turtle.forward()  --block 4
  281. turtle.turnRight()
  282. turtle.placeDown()
  283. turtle.forward() --block 5
  284. turtle.placeDown()
  285. turtle.forward() --block 6
  286. turtle.placeDown()
  287. turtle.turnLeft()
  288. turtle.forward() --block 7
  289. turtle.turnLeft()
  290. turtle.placeDown()
  291. turtle.forward() --block 8
  292. turtle.forward() --block 9
  293. turtle.placeDown()
  294. turtle.turnLeft()
  295. turtle.forward()
  296. turtle.turnLeft()
  297. turtle.forward()
  298. turtle.forward()
  299. turtle.forward()
  300. turtle.forward()
  301. turtle.turnRight()
  302. turtle.turnRight()
  303. end
  304. function golv2()
  305. turtle.forward()
  306. turtle.turnLeft()
  307. turtle.select(2)
  308. kg() --block 1
  309. turtle.turnRight()
  310. kg() --block 2
  311. kg() --block 3
  312. kg() --block 4
  313. turtle.turnRight()
  314. kg() --block 5
  315. turtle.turnRight()
  316. kg() --block 6
  317. kg() --block 7
  318. turtle.turnLeft()
  319. kg() --block 8
  320. turtle.turnLeft()
  321. kg() --block 9
  322. kg() --block 10
  323. turtle.turnLeft()
  324. turtle.forward()
  325. turtle.turnLeft()
  326. turtle.forward()
  327. turtle.forward()
  328. turtle.forward()
  329. turtle.forward()
  330. turtle.turnRight()
  331. turtle.turnRight()
  332. end
  333. function veggar()
  334. turtle.forward()
  335. turtle.turnLeft()
  336. turtle.forward()
  337. turtle.forward() --block 1
  338. turtle.turnRight()
  339. turtle.up()
  340. turtle.select(1)
  341. turtle.placeDown()
  342. turtle.forward() --block 2
  343. turtle.select(7)
  344. turtle.placeDown()
  345. turtle.forward() --block 3
  346. turtle.placeDown()
  347. turtle.forward() --block 4
  348. turtle.placeDown()
  349. turtle.forward() --block 5
  350. turtle.select(1)
  351. turtle.placeDown()
  352. turtle.turnRight()
  353. turtle.forward() --block 6
  354. turtle.select(7)
  355. turtle.placeDown()
  356. turtle.forward() --block 7
  357. turtle.placeDown()
  358. turtle.forward() --block 8
  359. turtle.placeDown()
  360. turtle.forward() --block 9
  361. turtle.select(1)
  362. turtle.placeDown()
  363. turtle.turnRight()
  364. turtle.forward() --block 10
  365. turtle.select(7)
  366. turtle.placeDown()
  367. turtle.forward() --block 11
  368. turtle.placeDown()
  369. turtle.forward() --block 12
  370. turtle.placeDown()
  371. turtle.forward() --block 13
  372. turtle.select(1)
  373. turtle.placeDown()
  374. turtle.turnRight()
  375. turtle.forward() --block 14
  376. turtle.select(7)
  377. turtle.placeDown()
  378. turtle.forward() --block 15
  379. turtle.placeDown()
  380. turtle.forward() --block 16
  381. turtle.forward() --block 1
  382. turtle.turnRight()
  383. turtle.up()
  384. turtle.select(1)
  385. turtle.placeDown()
  386. turtle.forward() --block 2
  387. turtle.select(7)
  388. turtle.placeDown()
  389. turtle.forward() --block 3
  390. turtle.select(3)
  391. turtle.placeDown()
  392. turtle.forward() --block 4
  393. turtle.select(7)
  394. turtle.placeDown()
  395. turtle.forward() --block 5
  396. turtle.select(1)
  397. turtle.placeDown()
  398. turtle.turnRight()
  399. turtle.forward() --block 6
  400. turtle.select(7)
  401. turtle.placeDown()
  402. turtle.forward() --block 7
  403. turtle.select(3)
  404. turtle.placeDown()
  405. turtle.forward() --block 8
  406. turtle.select(7)
  407. turtle.placeDown()
  408. turtle.forward() --block 9
  409. turtle.select(1)
  410. turtle.placeDown()
  411. turtle.turnRight()
  412. turtle.forward() --block 10
  413. turtle.select(7)
  414. turtle.placeDown()
  415. turtle.forward() --block 11
  416. turtle.select(3)
  417. turtle.placeDown()
  418. turtle.forward() --block 12
  419. turtle.select(7)
  420. turtle.placeDown()
  421. turtle.forward() --block 13
  422. turtle.select(1)
  423. turtle.placeDown()
  424. turtle.turnRight()
  425. turtle.forward() --block 14
  426. turtle.select(7)
  427. turtle.placeDown()
  428. turtle.forward() --block 15
  429. turtle.select(3)
  430. turtle.placeDown()
  431. turtle.forward() --block 16
  432. turtle.forward() --block 1
  433. turtle.turnRight()
  434. turtle.up()
  435. turtle.select(1)
  436. turtle.placeDown()
  437. turtle.forward() --block 2
  438. turtle.select(7)
  439. turtle.placeDown()
  440. turtle.forward() --block 3
  441. turtle.placeDown()
  442. turtle.forward() --block 4
  443. turtle.placeDown()
  444. turtle.forward() --block 5
  445. turtle.select(1)
  446. turtle.placeDown()
  447. turtle.turnRight()
  448. turtle.forward() --block 6
  449. turtle.select(7)
  450. turtle.placeDown()
  451. turtle.forward() --block 7
  452. turtle.placeDown()
  453. turtle.forward() --block 8
  454. turtle.placeDown()
  455. turtle.forward() --block 9
  456. turtle.select(1)
  457. turtle.placeDown()
  458. turtle.turnRight()
  459. turtle.forward() --block 10
  460. turtle.select(7)
  461. turtle.placeDown()
  462. turtle.forward() --block 11
  463. turtle.placeDown()
  464. turtle.forward() --block 12
  465. turtle.placeDown()
  466. turtle.forward() --block 13
  467. turtle.select(1)
  468. turtle.placeDown()
  469. turtle.turnRight()
  470. turtle.forward() --block 14
  471. turtle.select(7)
  472. turtle.placeDown()
  473. turtle.forward() --block 15
  474. turtle.placeDown()
  475. turtle.forward() --block 16
  476. turtle.placeDown()
  477. turtle.back()
  478. turtle.turnRight()
  479. turtle.back()
  480. turtle.down()
  481. turtle.down()
  482. turtle.down()
  483. end
  484. function tak()
  485. turtle.up()
  486. turtle.up()
  487. turtle.up()
  488. turtle.forward()
  489. turtle.turnLeft()
  490. turtle.forward()
  491. turtle.forward()
  492. turtle.turnRight()
  493. turtle.forward()
  494. turtle.forward()
  495. turtle.forward()
  496. turtle.forward() --brick 1
  497. turtle.turnRight()
  498. turtle.up()
  499. turtle.turnRight()
  500. turtle.select(6)
  501. turtle.placeDown()
  502. tk() --brick 2, 3, 4, 5
  503. turtle.turnLeft()
  504. turtle.forward() --brick 6
  505. turtle.select(2)
  506. turtle.placeDown()
  507. turtle.turnLeft()
  508. tk() --brick 7, 8, 9, 10
  509. turtle.turnRight()
  510. turtle.forward() --brick 11
  511. turtle.placeDown()
  512. turtle.turnRight()
  513. tk() --brick 12, 13, 14, 15
  514. turtle.turnLeft()
  515. turtle.forward() --brick 16
  516. turtle.placeDown()
  517. turtle.turnLeft()
  518. tk() --brick 17, 18, 19, 20
  519. turtle.turnRight()
  520. turtle.forward() --brick 21
  521. turtle.select(6)
  522. turtle.placeDown()
  523. turtle.turnRight()
  524. tk() --brick 22, 23, 24, 25
  525. turtle.turnRight()
  526. turtle.forward()
  527. turtle.forward()
  528. turtle.turnRight()
  529. turtle.back()
  530. turtle.down()
  531. turtle.down()
  532. turtle.down()
  533. turtle.down()
  534. end
  535. function inter()
  536. turtle.turnLeft()
  537. turtle.forward()
  538. turtle.turnRight()
  539. turtle.forward()
  540. turtle.forward()
  541. turtle.forward()
  542. turtle.forward()
  543. turtle.turnRight()
  544. turtle.forward()
  545. turtle.select(5)
  546. turtle.place()
  547. turtle.turnRight()
  548. turtle.forward()
  549. turtle.up()
  550. turtle.up()
  551. turtle.up()
  552. turtle.select(4)
  553. turtle.turnLeft()
  554. turtle.place()
  555. turtle.turnLeft()
  556. turtle.place()
  557. turtle.turnLeft()
  558. turtle.place()
  559. turtle.turnLeft()
  560. turtle.place()
  561. turtle.down()
  562. turtle.down()
  563. turtle.down()
  564. turtle.forward()
  565. turtle.turnRight()
  566. turtle.back()
  567. end
  568. os.pullEvent = os.pullEventRaw
  569. term.clear()
  570. term.setCursorPos(1,1)
  571. print("AUTOMATIC HOUSE PROCESS (AHP)")
  572. term.setCursorPos(5,2)
  573. print("VICTOR ANDERSON 2012")
  574. term.setCursorPos(1,12)
  575. sleep(3)
  576. term.setCursorPos(1,4)
  577. print("YOU CAN BUILD A HOUSE WITH OR WITHOUT A BASEMENT")
  578. term.setCursorPos(1,7)
  579. print("WITH     BASEMENT PRESS (1)")
  580. print("WITHOUT BASEMENT PRESS (2)")
  581. t = io.read()
  582. if t == "1" then
  583. term.clear()
  584. term.setCursorPos(1,1)
  585. print("BEFORE START MAKE SURE YOU HAVE")
  586. print("56 COBBLESTONE   YOU HAVE "..turtle.getItemCount(1))
  587. print("40 WOODEN PLANKS YOU HAVE "..turtle.getItemCount(2))
  588. print("4  GLASS          YOU HAVE "..turtle.getItemCount(3))
  589. print("5  TORCHES          YOU HAVE "..turtle.getItemCount(4))
  590. print("2  CHESTS                YOU HAVE "..turtle.getItemCount(5))
  591. print("10 WOODEN SLABS  YOU HAVE "..turtle.getItemCount(6))
  592. print("30 BRICKS                YOU HAVE "..turtle.getItemCount(7))
  593. print("3  LADDERS          YOU HAVE "..turtle.getItemCount(8))
  594. term.setCursorPos(1,11)
  595. print("PRESS ANY KEY TO CONTINUE")
  596.   local event, key = os.pullEvent("key")
  597.   if key ~= 1 then
  598.    term.clear()
  599.    term.setCursorPos(1,1)
  600.    print("HOUSE WITH BASEMENT INITIATED")
  601.    term.setCursorPos(1,3)
  602.    print("BASEMENT  STATUS: QUEUED")
  603.    print("FLOOR  STATUS: QUEUED")
  604.    print("WALLS  STATUS: QUEUED")
  605.    print("ROOF    STATUS: QUEUED")
  606.    print("INTERIOUR STATUS: QUEUED")
  607.    term.setCursorPos(19,3)
  608.    print("BUILDING")
  609.    kallare()
  610.    term.setCursorPos(19,3)
  611.    print("FINISHED")
  612.    sleep(1)
  613.    term.setCursorPos(19,4)
  614.    print("BUILDING")
  615.    golv1()
  616.    term.setCursorPos(19,4)
  617.    print("FINISHED")
  618.    sleep(1)
  619.    term.setCursorPos(19,5)
  620.    print("BUILDING")
  621.    veggar()
  622.    term.setCursorPos(19,5)
  623.    print("FINISHED")
  624.    sleep(1)
  625.    term.setCursorPos(19,6)
  626.    print("BUILDING")
  627.    tak()
  628.    term.setCursorPos(19,6)
  629.    print("FINISHED")
  630.    sleep(1)
  631.    term.setCursorPos(19,7)
  632.    print("BUILDING")
  633.    inter()
  634.    term.setCursorPos(19,7)
  635.    print("FINISHED")
  636.    sleep(1)
  637.    term.clear()
  638.    term.setCursorPos(1,1)
  639.    print("ENJOY YOUR NEW HOUSE!")
  640.    sleep(10)
  641.    os.reboot()
  642.   end
  643. elseif t == "2" then
  644. term.clear()
  645. term.setCursorPos(1,1)
  646. print("BEFORE START MAKE SURE YOU HAVE")
  647. print("12 COBBLESTONE   YOU HAVE "..turtle.getItemCount(1))
  648. print("25 WOODEN PLANKS YOU HAVE "..turtle.getItemCount(2))
  649. print("4  GLASS          YOU HAVE "..turtle.getItemCount(3))
  650. print("4  TORCHES          YOU HAVE "..turtle.getItemCount(4))
  651. print("1  CHEST          YOU HAVE "..turtle.getItemCount(5))
  652. print("10 WOODEN SLABS  YOU HAVE "..turtle.getItemCount(6))
  653. print("30 BRICKS                YOU HAVE "..turtle.getItemCount(7))
  654. term.setCursorPos(1,11)
  655. print("PRESS ANY KEY TO CONTINUE")
  656. local event, key = os.pullEvent("key")
  657. if key ~= 1 then
  658.    term.clear()
  659.    term.setCursorPos(1,1)
  660.    print("HOUSE WITHOUT BASEMENT INITIATED")
  661.    term.setCursorPos(1,3)
  662.    print("FLOOR  STATUS: QUEUED")
  663.    print("WALLS  STATUS: QUEUED")
  664.    print("ROOF    STATUS: QUEUED")
  665.    print("INTERIOUR STATUS: QUEUED")
  666.    term.setCursorPos(19,3)
  667.    print("BUILDING")
  668.    golv2()
  669.    term.setCursorPos(19,3)
  670.    print("FINISHED")
  671.    sleep(1)
  672.    term.setCursorPos(19,4)
  673.    print("BUILDING")
  674.    veggar()
  675.    term.setCursorPos(19,4)
  676.    print("FINISHED")
  677.    sleep(1)
  678.    term.setCursorPos(19,5)
  679.    print("BUILDING")
  680.    tak()
  681.    term.setCursorPos(19,5)
  682.    print("FINISHED")
  683.    sleep(1)
  684.    term.setCursorPos(19,6)
  685.    print("BUILDING")
  686.    inter()
  687.    term.setCursorPos(19,6)
  688.    print("FINISHED")
  689.    term.clear()
  690.    term.setCursorPos(1,1)
  691.    print("ENJOY YOUR NEW HOUSE!")
  692.    sleep(10)
  693.    os.reboot()
  694.   end
  695. else
  696. term.clear()
  697. term.setCursorPos(1,1)
  698. print("INCORRECT INPUT, SHUTTING DOWN")
  699. sleep(3)
  700. os.reboot()
  701. end