Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.12 KB | None | 0 0
  1. os.loadAPI("button")
  2. m = peripheral.wrap("right")
  3. m.clear()
  4.  
  5. function fillTable()
  6. button.setTable("White On", whiteon, 2,10,3,5)
  7. button.setTable("White Off", whiteoff, 12,20,3,5)
  8.  
  9. button.setTable("Orange On", orangeon, 2,10,7,9)
  10. button.setTable("Orange Off", orangeoff, 12,20,7,9)
  11.  
  12. button.setTable("Magenta On", magentaon, 2,10,11,13)
  13. button.setTable("Magenta Off", magentaoff, 12,20,11,13)
  14.  
  15. button.setTable("LBlue On", lblueon, 2,10,15,17)
  16. button.setTable("LBlue Off", lblueoff, 12,20,15,17)
  17.  
  18.  
  19.  
  20. button.setTable("Yellow On", yellowon, 22,30,3,5)
  21. button.setTable("Yellow Off", yellowoff, 32,40,3,5)
  22.  
  23. button.setTable("Lime On", limeon, 22,30,7,9)
  24. button.setTable("Lime Off", limeoff, 32,40,7,9)
  25.  
  26. button.setTable("Pink On", pinkon, 22,30,11,13)
  27. button.setTable("Pink Off", pinkoff, 32,40,11,13)
  28.  
  29. button.setTable("Grey On", greyon, 22,30,15,17)
  30. button.setTable("Grey Off", greyoff, 32,40,15,17)
  31.  
  32.  
  33.  
  34. button.setTable("LGrey On", lgreyon, 42,50,3,5)
  35. button.setTable("LGrey Off", lgreyoff, 52,60,3,5)
  36.  
  37. button.setTable("Cyan On", cyanon, 42,50,7,9)
  38. button.setTable("Cyan Off", cyanoff, 52,60,7,9)
  39.  
  40. button.setTable("Purple On", purpleon, 42,50,11,13)
  41. button.setTable("Purple Off", purpleoff, 52,60,11,13)
  42.  
  43. button.setTable("Blue On", blueon, 42,50,15,17)
  44. button.setTable("Blue Off", blueoff, 52,60,15,17)
  45.  
  46.  
  47.  
  48. button.setTable("Brown On", brownon, 62,70,3,5)
  49. button.setTable("Brown Off", brownoff, 72,80,3,5)
  50.  
  51. button.setTable("Green On", greenon, 62,70,7,9)
  52. button.setTable("Green Off", greenoff, 72,80,7,9)
  53.  
  54. button.setTable("Red On", redon, 62,70,11,13)
  55. button.setTable("Red Off", redoff, 72,80,11,13)
  56.  
  57. button.setTable("Black On", blackon, 62,70,15,17)
  58. button.setTable("Black Off", blackoff, 72,80,15,17)
  59. button.screen()
  60. end
  61.  
  62. function getClick()
  63. event,side,x,y = os.pullEvent("monitor_touch")
  64. button.checkxy(x,y)s
  65. end
  66.  
  67. function whiteon()
  68. button.flash("White On")
  69. print("White On")
  70. rednet.open("top")
  71. rednet.send(107, "whiteon")
  72. end
  73.  
  74. function whiteoff()
  75. button.flash("White Off")
  76. print("White Off")
  77. rednet.open("top")
  78. rednet.send(107, "whiteoff")
  79. end
  80.  
  81. function orangeon()
  82. button.flash("Orange On")
  83. print("Orange On")
  84. rednet.open("top")
  85. rednet.send(107, "orangeon")
  86. end
  87.  
  88. function orangeoff()
  89. button.flash("Orange Off")
  90. print("Orange Off")
  91. rednet.open("top")
  92. rednet.send(107, "orangeon")
  93. end
  94.  
  95. function magentaon()
  96. button.flash("Magenta On")
  97. print("Magenta On")
  98. rednet.open("top")
  99. rednet.send(107, "magentaon")
  100. end
  101.  
  102. function magentaoff()
  103. button.flash("Magenta Off")
  104. print("Magenta Off")
  105. rednet.open("top")
  106. rednet.send(107, "magentaoff")
  107. end
  108.  
  109. function lblueon()
  110. button.flash("LBlue On")
  111. print("LBlue On")
  112. rednet.open("top")
  113. rednet.send(107, "lblueon")
  114. end
  115.  
  116. function lblueoff()
  117. button.flash("LBlue Off")
  118. print("LBlue Off")
  119. rednet.open("top")
  120. rednet.send(107, "lblueon")
  121. end
  122.  
  123.  
  124.  
  125. function yellowon()
  126. button.flash("Yellow On")
  127. print("Yellow On")
  128. rednet.open("top")
  129. rednet.send(108, "yellowon")
  130. end
  131.  
  132. function yellowoff()
  133. button.flash("Yellow Off")
  134. print("Yellow Off")
  135. rednet.open("top")
  136. rednet.send(108, "yellowoff")
  137. end
  138.  
  139. function limeon()
  140. button.flash("Lime On")
  141. print("Lime On")
  142. rednet.open("top")
  143. rednet.send(108, "limeon")
  144. end
  145.  
  146. function limeoff()
  147. button.flash("Lime Off")
  148. print("Lime Off")
  149. rednet.open("top")
  150. rednet.send(108, "limeon")
  151. end
  152.  
  153. function pinkon()
  154. button.flash("Pink On")
  155. print("Pink On")
  156. rednet.open("top")
  157. rednet.send(108, "pinkon")
  158. end
  159.  
  160. function pinkoff()
  161. button.flash("Pink Off")
  162. print("Pink Off")
  163. rednet.open("top")
  164. rednet.send(108, "pinkoff")
  165. end
  166.  
  167. function greyon()
  168. button.flash("Grey On")
  169. print("Grey On")
  170. rednet.open("top")
  171. rednet.send(108, "greyon")
  172. end
  173.  
  174. function greyoff()
  175. button.flash("Grey Off")
  176. print("Grey Off")
  177. rednet.open("top")
  178. rednet.send(108, "greyon")
  179. end
  180.  
  181.  
  182.  
  183. function lgreyon()
  184. button.flash("LGrey On")
  185. print("LGrey On")
  186. rednet.open("top")
  187. rednet.send(109, "lgreyon")
  188. end
  189.  
  190. function lgreyoff()
  191. button.flash("LGrey Off")
  192. print("LGrey Off")
  193. rednet.open("top")
  194. rednet.send(109, "lgreyoff")
  195. end
  196.  
  197. function cyanon()
  198. button.flash("Cyan On")
  199. print("Cyan On")
  200. rednet.open("top")
  201. rednet.send(109, "cyanon")
  202. end
  203.  
  204. function cyanoff()
  205. button.flash("Cyan Off")
  206. print("Cyan Off")
  207. rednet.open("top")
  208. rednet.send(109, "cyanon")
  209. end
  210.  
  211. function purpleon()
  212. button.flash("Purple On")
  213. print("Purple On")
  214. rednet.open("top")
  215. rednet.send(109, "purpleon")
  216. end
  217.  
  218. function purpleoff()
  219. button.flash("Purple Off")
  220. print("Purple Off")
  221. rednet.open("top")
  222. rednet.send(109, "purpleoff")
  223. end
  224.  
  225. function blueon()
  226. button.flash("Blue On")
  227. print("Blue On")
  228. rednet.open("top")
  229. rednet.send(109, "blueon")
  230. end
  231.  
  232. function blueoff()
  233. button.flash("Blue Off")
  234. print("Blue Off")
  235. rednet.open("top")
  236. rednet.send(109, "blueon")
  237. end
  238.  
  239.  
  240.  
  241. function brownon()
  242. button.flash("Brown On")
  243. print("Brown On")
  244. rednet.open("top")
  245. rednet.send(109, "brownon")
  246. end
  247.  
  248. function brownoff()
  249. button.flash("Brown Off")
  250. print("Brown Off")
  251. rednet.open("top")
  252. rednet.send(109, "brownoff")
  253. end
  254.  
  255. function greenon()
  256. button.flash("Green On")
  257. print("Green On")
  258. rednet.open("top")
  259. rednet.send(109, "greenon")
  260. end
  261.  
  262. function greenoff()
  263. button.flash("Green Off")
  264. print("Green Off")
  265. rednet.open("top")
  266. rednet.send(109, "greenon")
  267. end
  268.  
  269. function redon()
  270. button.flash("Red On")
  271. print("Red On")
  272. rednet.open("top")
  273. rednet.send(109, "redon")
  274. end
  275.  
  276. function redoff()
  277. button.flash("Red Off")
  278. print("Red Off")
  279. rednet.open("top")
  280. rednet.send(109, "redoff")
  281. end
  282.  
  283. function blackon()
  284. button.flash("Black On")
  285. print("Black On")
  286. rednet.open("top")
  287. rednet.send(109, "blackon")
  288. end
  289.  
  290. function blackoff()
  291. button.flash("Black Off")
  292. print("Black Off")
  293. rednet.open("top")
  294. rednet.send(109, "blackon")
  295. end
  296.  
  297.  
  298. fillTable()
  299. button.heading("Central Core Control")
  300. while true do
  301. getClick()
  302. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement