Advertisement
Guest User

Pumpen

a guest
Jan 21st, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.09 KB | None | 0 0
  1. local p = peripheral.wrap("back")
  2. mon = peripheral.wrap("top")
  3.  
  4. local bool1 = false
  5. local bool2 = false
  6. local bool3 = false
  7. local bool4 = false
  8. local bool5 = false
  9. local bool6 = false
  10.  
  11. mon.clear()
  12.  
  13. while true do
  14.  
  15.  
  16. mon.setTextScale(1)
  17. mon.setCursorPos(1,1)
  18. mon.setTextColor(colors.yellow)
  19. mon.write("System Motoren")
  20.  
  21. mon.setTextScale(1)
  22. mon.setCursorPos(1,2)
  23. mon.setTextColor(colors.white)
  24. mon.write("Anlage 1")
  25. mon.setCursorPos(1,3)
  26. mon.write("Pumpe1 :")
  27. mon.setCursorPos(1,4)
  28. mon.write("Pumpe2 :")
  29.  
  30. mon.setCursorPos(16,2)
  31. mon.write("Anlage2")
  32. mon.setCursorPos(16,3)
  33. mon.write("Pumpe1 :")
  34. mon.setCursorPos(16,4)
  35. mon.write("Pumpe2 :")
  36.  
  37. mon.setCursorPos(1,6)
  38. mon.write("Speicher")
  39. mon.setCursorPos(1,7)
  40. mon.write("Pumpe1 :")
  41. mon.setCursorPos(1,8)
  42. mon.write("Pumpe2 :")
  43.  
  44. mon.setCursorPos(16,6)
  45. mon.write("Tank")
  46. mon.setCursorPos(16,7)
  47. mon.write("Tank1 :")
  48. mon.setCursorPos(16,8)
  49. mon.write("Tank2 ;")
  50.  
  51. if bool1 == true then
  52. mon.setCursorPos(10,3)
  53. mon.setTextColor(colors.green)
  54. mon.write("ON ")
  55. elseif bool1 == false then
  56. mon.setCursorPos(10,3)
  57. mon.setTextColor(colors.red)
  58. mon.write("OFF")
  59. end
  60.  
  61. if bool2 == true then
  62. mon.setCursorPos(10,4)
  63. mon.setTextColor(colors.green)
  64. mon.write("ON ")
  65. elseif bool2 == false then
  66. mon.setCursorPos(10,4)
  67. mon.setTextColor(colors.red)
  68. mon.write("OFF")
  69. end
  70.  
  71. if bool3 == true then
  72. mon.setCursorPos(26,3)
  73. mon.setTextColor(colors.green)
  74. mon.write("ON ")
  75. elseif bool3 == false then
  76. mon.setCursorPos(26,3)
  77. mon.setTextColor(colors.red)
  78. mon.write("OFF")
  79. end
  80.  
  81. if bool4 == true then
  82. mon.setCursorPos(26,4)
  83. mon.setTextColor(colors.green)
  84. mon.write("ON ")
  85. elseif bool4 == false then
  86. mon.setCursorPos(26,4)
  87. mon.setTextColor(colors.red)
  88. mon.write("OFF")
  89. end
  90.  
  91. if bool5 == true then
  92. mon.setCursorPos(10,7)
  93. mon.setTextColor(colors.green)
  94. mon.write("ON ")
  95. elseif bool5 == false then
  96. mon.setCursorPos(10,7)
  97. mon.setTextColor(colors.red)
  98. mon.write("OFF")
  99. end
  100.  
  101. if bool6 == true then
  102. mon.setCursorPos(10,8)
  103. mon.setTextColor(colors.green)
  104. mon.write("ON ")
  105. elseif bool6 == false then
  106. mon.setCursorPos(10,8)
  107. mon.setTextColor(colors.red)
  108. mon.write("OFF")
  109. end
  110.  
  111. event,top,x,y = os.pullEvent()
  112. if event == "monitor_touch" then
  113. if x == 10 and y == 3 then
  114. if bool1 == false then
  115. bool1 = true
  116. else
  117. bool1 = false
  118. end
  119. end
  120. end
  121.  
  122. event,top,x,y = os.pullEvent()
  123. if event == "monitor_touch" then
  124. if x == 10 and y == 4 then
  125. if bool2 == false then
  126. bool2 = true
  127. else
  128. bool2 = false
  129. end
  130. end
  131. end
  132.  
  133. event,top,x,y = os.pullEvent()
  134. if event == "monitor_touch" then
  135. if x == 26 and y == 3 then
  136. if bool3 == false then
  137. bool3 = true
  138. else
  139. bool3 = false
  140. end
  141. end
  142. end
  143.  
  144. event,top,x,y = os.pullEvent()
  145. if event == "monitor_touch" then
  146. if x == 26 and y == 4 then
  147. if bool4 == false then
  148. bool4 = true
  149. else
  150. bool4 = false
  151. end
  152. end
  153. end
  154.  
  155. event,top,x,y = os.pullEvent()
  156. if event == "monitor_touch" then
  157. if x == 10 and y == 7 then
  158. if bool5 == false then
  159. bool5 = true
  160. else
  161. bool5 = false
  162. end
  163. end
  164. end
  165.  
  166. event,top,x,y = os.pullEvent()
  167. if event == "monitor_touch" then
  168. if x == 10 and y == 8 then
  169. if bool6 == false then
  170. bool6 = true
  171. else
  172. bool6 = false
  173. end
  174. end
  175. end
  176.  
  177.  
  178.  
  179. if bool1 == true then
  180. p.setBundledOutput(colors.white)
  181. end
  182. if bool2 == true then
  183. p.setBundledOutput(colors.orange)
  184. end
  185. if bool1 == true and bool2 == true then
  186. p.setBundledOutput(colors.white + colors.orange + colors.brown + colors.purple)
  187. end
  188. if bool1 == false or bool2 == false then
  189. p.setBundledOutput(colors.blue)
  190. end
  191.  
  192. if bool3 == true then
  193. p.setBundledOutput(colors.yellow)
  194. end
  195. if bool4 == true then
  196. p.setBundledOutput(colors.lime)
  197. end
  198. if bool3 == true and bool4 == true then
  199. p.setBundledOutput(colors.yellow + colors.lime + colors.brown + colors.purple)
  200. end
  201. if bool3 == false or bool4 == false then
  202. p.setBundledOutput(colors.red)
  203. end
  204.  
  205. if bool5 == true then
  206. p.setBundledOutput(colors.purple)
  207. end
  208. if bool6 == true then
  209. p.setBundledOutput(colors.brown)
  210. end
  211. if bool5 == true and bool6 == true then
  212. p.setBundledOutput(colors.brown + colors.purple)
  213. end
  214. if bool5 == false or bool6 == false then
  215. p.setBundledOutput(colors.red)
  216. end
  217.  
  218.  
  219.  
  220.  
  221. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement