Advertisement
carydavid85

Untitled

Aug 28th, 2014
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.43 KB | None | 0 0
  1. os.loadAPI("button")
  2. m=peripheral.wrap("top")
  3.  
  4. local nasa = colors.red
  5. local circfab = colors.red
  6. local ecomp = colors.red
  7. local oxgear = colors.red
  8. local oxmach = colors.red
  9. local rocket = colors.red
  10. local para = colors.red
  11. local buggy = colors.red
  12. local rlp = colors.red
  13. local bfp = colors.red
  14. local rbf = colors.red
  15.  
  16.  
  17.  
  18. function writeList()
  19. m.clear()
  20. m.setTextColor(colors.white)
  21. m.setCursorPos(17,1)
  22. m.write("Mission: Moon Dash")
  23. m.setCursorPos(2,3)
  24. m.write("To Do:")
  25.  
  26.  
  27. m.setTextColor(nasa)
  28. m.setCursorPos(4,4)
  29. m.write("N.A.S.A Work Bench")
  30.  
  31. m.setTextColor(circfab)
  32. m.setCursorPos(4,5)
  33. m.write("Circuit Fabricator")
  34.  
  35. m.setTextColor(ecomp)
  36. m.setCursorPos(4,6)
  37. m.write("Electric Compressor")
  38.  
  39. m.setTextColor(oxgear)
  40. m.setCursorPos(4,7)
  41. m.write("Oxygen Gear")
  42.  
  43. m.setTextColor(oxmach)
  44. m.setCursorPos(4,8)
  45. m.write("Oxygen Machines")
  46.  
  47. m.setTextColor(rocket)
  48. m.setCursorPos(4,9)
  49. m.write("Rocket")
  50.  
  51. m.setTextColor(para)
  52. m.setCursorPos(4,10)
  53. m.write("Parachute")
  54.  
  55. m.setTextColor(buggy)
  56. m.setCursorPos(4,11)
  57. m.write("Moon Buggy")
  58.  
  59. m.setTextColor(rlp)
  60. m.setCursorPos(4,12)
  61. m.write("Rocket Launch Pad")
  62.  
  63. m.setTextColor(bfp)
  64. m.setCursorPos(4,13)
  65. m.write("Buggy Fuel Pad")
  66.  
  67. m.setTextColor(rbf)
  68. m.setCursorPos(4,14)
  69. m.write("Rocket and Buggy Fuel")
  70.  
  71. m.setTextColor(colors.white)
  72. end
  73.  
  74. function fillTable()
  75. m.setTextColor(colors.white)
  76. button.setTable("Silo Door", door, 4,16,16,18)
  77. button.screen()
  78. end
  79.  
  80. function getClick()
  81. event,side,x,y = os.pullEvent("monitor_touch")
  82. button.checkxy(x,y)
  83. end
  84.  
  85. function getClick2()
  86. event,side,x,y = os.pullEvent("monitor_touch")
  87. if (x>=3) and (x<=21) and (y==4) then
  88. print("NASA("..x..","..y..")")
  89. if nasa == colors.red then
  90. nasa = colors.green
  91. writeList()
  92. else
  93. nasa = colors.red
  94. writeList()
  95. end
  96. fillTable()
  97. end
  98. if (x>=4) and (x<=20) and (y==5) then
  99. print("CircFab("..x..","..y..")")
  100. if circfab == colors.red then
  101. circfab = colors.green
  102. writeList()
  103. else
  104. circfab = colors.red
  105. writeList()
  106. end
  107. fillTable()
  108. end
  109. if (x>=4) and (x<=22) and (y==6) then
  110. print("E-comp("..x..","..y..")")
  111. if ecomp == colors.red then
  112. ecomp = colors.green
  113. writeList()
  114. else
  115. ecomp = colors.red
  116. writeList()
  117. end
  118. fillTable()
  119. end
  120. if (x>=4) and (x<=14) and (y==7) then
  121. print("OxGear("..x..","..y..")")
  122. if oxgear == colors.red then
  123. oxgear = colors.green
  124. writeList()
  125. else
  126. oxgear = colors.red
  127. writeList()
  128. end
  129. fillTable()
  130. end
  131. if (x>=4) and (x<=18) and (y==8) then
  132. print("OxMach("..x..","..y..")")
  133. if oxmach == colors.red then
  134. oxmach = colors.green
  135. writeList()
  136. else
  137. oxmach = colors.red
  138. writeList()
  139. end
  140. fillTable()
  141. end
  142. if (x>=4) and (x<=9) and (y==9) then
  143. print("Rocket("..x..","..y..")")
  144. if rocket == colors.red then
  145. rocket = colors.green
  146. writeList()
  147. else
  148. rocket = colors.red
  149. writeList()
  150. end
  151. fillTable()
  152. end
  153. if (x>=4) and (x<=12) and (y==10) then
  154. print("Parachute("..x..","..y..")")
  155. if para == colors.red then
  156. para = colors.green
  157. writeList()
  158. else
  159. para = colors.red
  160. writeList()
  161. end
  162. fillTable()
  163. end
  164. if (x>=4) and (x<=13) and (y==11) then
  165. print("MoonBuggy("..x..","..y..")")
  166. if buggy == colors.red then
  167. buggy = colors.green
  168. writeList()
  169. else
  170. buggy = colors.red
  171. writeList()
  172. end
  173. fillTable()
  174. end
  175. if (x>=4) and (x<=20) and (y==12) then
  176. print("RLP("..x..","..y..")")
  177. if rlp == colors.red then
  178. rlp = colors.green
  179. writeList()
  180. else
  181. rlp = colors.red
  182. writeList()
  183. end
  184. fillTable()
  185. end
  186. if (x>=4) and (x<=17) and (y==13) then
  187. print("BFP("..x..","..y..")")
  188. if bfp == colors.red then
  189. bfp = colors.green
  190. writeList()
  191. else
  192. bfp = colors.red
  193. writeList()
  194. end
  195. fillTable()
  196. end
  197. if (x>=4) and (x<=24) and (y==14) then
  198. print("RBF("..x..","..y..")")
  199. if rbf == colors.red then
  200. rbf = colors.green
  201. writeList()
  202. else
  203. rbf = colors.red
  204. writeList()
  205. end
  206. fillTable()
  207. end
  208. end
  209.  
  210. function door()
  211. button.toggleButton("Silo Door")
  212. redstone.setOutput("back",true)
  213. print("Door")
  214. sleep(.25)
  215. redstone.setOutput("back",false)
  216. end
  217.  
  218. writeList()
  219. fillTable()
  220.  
  221. while true do
  222. getClick()
  223. getClick2()
  224. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement