Advertisement
CCninja86

ComputerCraft House Control Program

Jan 14th, 2013
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.16 KB | None | 0 0
  1. textutils.slowPrint ("What would you like to do?")
  2.  
  3. local event XY = os.pullEvent("mouse_click")
  4.  
  5. XY = X ..",".. Y
  6. sleep(0.5)
  7. print ("")
  8. print ("|Harvest Wheat|")
  9. print ("|Harvest Sugarcane|")
  10. print ("|Open Doors|")
  11. print ("|Turn On Quarry|")
  12. print ("|Turn Off Quarry|")
  13. print ("|Enable Golems|")
  14. print ("|Disable Golems|")
  15. print ("|Turn On Automatic Sugarcane Harvesting|")
  16. print ("|Turn Off Automatic Sugarcane Harvesting|")
  17.  
  18. if XY == "1,3" -- Harvest Wheat
  19. or XY == "2,3"
  20. or XY == "3,3"
  21. or XY == "4,3"
  22. or XY == "5,3"
  23. or XY == "6,3"
  24. or XY == "7,3"
  25. or XY == "8,3"
  26. or XY == "9,3"
  27. or XY == "10,3"
  28. or XY == "11,3"
  29. or XY == "12,3"
  30. or XY == "13,3"
  31. or XY == "14,3"
  32. or XY == "15,3" then
  33.  
  34. term.clear()
  35. term.setCursorPos(1,1)
  36. textutils.slowPrint ("Harvesting Wheat...")
  37. sleep(1)
  38. rs.setOutput("left", true)
  39. sleep(2)
  40. rs.setOutput("left", false)
  41. textutils.slowPrint ("Done!")
  42. end
  43.  
  44. if XY == "1,4" -- Harvest Sugarcane
  45. or XY == "2,4"
  46. or XY == "3,4"
  47. or XY == "4,4"
  48. or XY == "5,4"
  49. or XY == "6,4"
  50. or XY == "7,4"
  51. or XY == "8,4"
  52. or XY == "9,4"
  53. or XY == "10,4"
  54. or XY == "11,4"
  55. or XY == "12,4"
  56. or XY == "13,4"
  57. or XY == "14,4"
  58. or XY == "15,4"
  59. or XY == "16,4"
  60. or XY == "17,4"
  61. or XY == "18,4"
  62. or XY == "19,4" then
  63.  
  64. term.clear()
  65. term.setCursorPos(1,1)
  66. textutils.slowPrint ("Harvesting Sugarcane...")
  67. sleep(1)
  68. rs.setOutput("right", true)
  69. sleep(2)
  70. rs.setOutput("right", false)
  71. textutils.slowPrint ("Done!")
  72. end
  73.  
  74. if XY == "1,5" -- Open Doors
  75. or XY == "2,5"
  76. or XY == "3,5"
  77. or XY == "4,5"
  78. or XY == "5,5"
  79. or XY == "6,5"
  80. or XY == "7,5"
  81. or XY == "8,5"
  82. or XY == "9,5"
  83. or XY == "10,5"
  84. or XY == "11,5"
  85. or XY == "12,5" then
  86.  
  87. term.clear()
  88. term.setCursorPos(1,1)
  89. textutils.slowPrint ("Opening Doors...")
  90. sleep(1)
  91. rs.setOutput("bottom", true)
  92. sleep(2)
  93. rs.setOutput("bottom", false)
  94. textutils.slowPrint ("Done!")
  95. end
  96.  
  97. if XY == "1,6" -- Turn On Quarry
  98. or XY == "2,6"
  99. or XY == "3,6"
  100. or XY == "4,6"
  101. or XY == "5,6"
  102. or XY == "6,6"
  103. or XY == "7,6"
  104. or XY == "8,6"
  105. or XY == "9,6"
  106. or XY == "10,6"
  107. or XY == "11,6"
  108. or XY == "12,6"
  109. or XY == "13,6"
  110. or XY == "14,6"
  111. or XY == "15,6"
  112. or XY == "16,6" then
  113.  
  114. term.clear()
  115. term.setCursorPos(1,1)
  116. textutils.slowPrint ("Turning On Quarry...")
  117. sleep(2)
  118. rs.setBundledOutput("back", 1)
  119. textutils.slowPrint ("Done!")
  120. end
  121.  
  122. if XY == "1,7" -- Turn Off Quarry
  123. or XY == "2,7"
  124. or XY == "3,7"
  125. or XY == "4,7"
  126. or XY == "5,7"
  127. or XY == "6,7"
  128. or XY == "7,7"
  129. or XY == "8,7"
  130. or XY == "9,7"
  131. or XY == "10,7"
  132. or XY == "11,7"
  133. or XY == "12,7"
  134. or XY == "13,7"
  135. or XY == "14,7"
  136. or XY == "15,7"
  137. or XY == "16,7"
  138. or XY == "17,7" then
  139.  
  140. term.clear()
  141. term.setCursorPos(1,1)
  142. textutils.slowPrint ("Turning Off Quarry...")
  143. sleep(2)
  144. rs.setOutput("back", false)
  145. textutils.slowPrint ("Done!")
  146. end
  147.  
  148. if XY == "1,8" -- Enable Golems
  149. or XY == "2,8"
  150. or XY == "3,8"
  151. or XY == "4,8"
  152. or XY == "5,8"
  153. or XY == "6,8"
  154. or XY == "7,8"
  155. or XY == "8,8"
  156. or XY == "9,8"
  157. or XY == "10,8"
  158. or XY == "11,8"
  159. or XY == "12,8"
  160. or XY == "13,8
  161. or XY == "14,8"
  162. or XY == "15,8" then
  163.  
  164. term.clear()
  165. term.setCursorPos(1,1)
  166. textutils.slowPrint ("Enabling Golems...")
  167. sleep(1)
  168. rs.setOutput("top", true)
  169. sleep(1)
  170. rs.setOutput("top", false)
  171. textutils.slowPrint ("Done!")
  172. end
  173.  
  174. if XY == "1,9" -- Disable Golems
  175. or XY == "2,9"
  176. or XY == "3,9"
  177. or XY == "4,9"
  178. or XY == "5,9"
  179. or XY == "6,9"
  180. or XY == "7,9"
  181. or XY == "8,9"
  182. or XY == "9,9"
  183. or XY == "10,9"
  184. or XY == "11,9"
  185. or XY == "12,9"
  186. or XY == "13,9"
  187. or XY == "14,9"
  188. or XY == "15,9"
  189. or XY == "16,9" then
  190.  
  191. term.clear()
  192. term.setCursorPos(1,1)
  193. textutils.slowPrint ("Disabling Golems...")
  194. sleep(1)
  195. rs.setOutput("top", true)
  196. sleep(1)
  197. rs.setOutput("top", false)
  198. textutils.slowPrint ("Done!")
  199. end
  200.  
  201. if XY == "1,10" -- Turn On Automatic Sugarcane Harvesting
  202. or XY == "2,10"
  203. or XY == "3,10"
  204. or XY == "4,10"
  205. or XY == "5,10"
  206. or XY == "6,10"
  207. or XY == "7,10"
  208. or XY == "8,10"
  209. or XY == "9,10"
  210. or XY == "10,10"
  211. or XY == "11,10"
  212. or XY == "12,10"
  213. or XY == "13,10"
  214. or XY == "14,10"
  215. or XY == "15,10"
  216. or XY == "16,10"
  217. or XY == "17,10"
  218. or XY == "18,10"
  219. or XY == "19,10"
  220. or XY == "20,10"
  221. or XY == "21,10"
  222. or XY == "22,10"
  223. or XY == "23,10"
  224. or XY == "24,10"
  225. or XY == "25,10"
  226. or XY == "26,10"
  227. or XY == "27,10"
  228. or XY == "28,10"
  229. or XY == "29,10"
  230. or XY == "30,10"
  231. or XY == "31,10"
  232. or XY == "32,10"
  233. or XY == "33,10"
  234. or XY == "34,10"
  235. or XY == "35,10"
  236. or XY == "36,10"
  237. or XY == "37,10"
  238. or XY == "38,1""
  239. or XY == "39,10"
  240. or XY == "40,10" then
  241.  
  242. textutils.slowPrint ("Turning On Automatic Sugarcane Harvesting...")
  243. sleep(1)
  244. rs.setOutput("right", true)
  245. textutils.slowPrint ("Done!")
  246. end
  247.  
  248. if XY == "1,11" -- Turn Off Automatic Sugarcane Harvesting
  249. or XY == "2,11"
  250. or XY == "3,11"
  251. or XY == "4,11"
  252. or XY == "5,11"
  253. or XY == "6,11"
  254. or XY == "7,11"
  255. or XY == "8,11"
  256. or XY == "9,11"
  257. or XY == "10,11"
  258. or XY == "11,11"
  259. or XY == "12,11"
  260. or XY == "13,11"
  261. or XY == "14,11"
  262. or XY == "15,11"
  263. or XY == "16,11"
  264. or XY == "17,11"
  265. or XY == "18,11"
  266. or XY == "19,11"
  267. or XY == "20,11"
  268. or XY == "21,11"
  269. or XY == "22,11"
  270. or XY == "23,11"
  271. or XY == "24,11"
  272. or XY == "25,11"
  273. or XY == "26,11"
  274. or XY == "27,11"
  275. or XY == "28,11"
  276. or XY == "29,11"
  277. or XY == "30,11"
  278. or XY == "31,11"
  279. or XY == "32,11"
  280. or XY == "33,11"
  281. or XY == "34,11"
  282. or XY == "35,11"
  283. or XY == "36,11"
  284. or XY == "37,11"
  285. or XY == "38,11"
  286. or XY == "39,11"
  287. or XY == "40,11"
  288. or XY == "41,11" then
  289.  
  290. textutils.slowPrint ("Turning Off Automatic Sugarcane Harvesting...")
  291. sleep(1)
  292. rs.setOutput("right", false)
  293. textutils.slowPrint ("Done!")
  294. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement