Advertisement
Nik2580

Untitled

Jan 23rd, 2018
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.13 KB | None | 0 0
  1. print(os.getComputerID())
  2. local p = peripheral.wrap("back")
  3. mon = peripheral.wrap("top")
  4. rednet.open("top")
  5.  
  6. local bool1 = false
  7. local bool2 = false
  8. local bool3 = false
  9. local bool4 = false
  10. local bool5 = false
  11. local bool6 = false
  12.  
  13. local CID1 = 1
  14. local CID2 = 1
  15. local CID3 = 1
  16. local CID4 = 1
  17. local CID5 = 1
  18. local CID6 = 1
  19.  
  20. local A = "A1P1"
  21. local B = "A1P2"
  22. local C = "A2P1"
  23. local D = "A2P2"
  24. local E = "P0P1"
  25. local F = "P0P2"
  26. local G = "NotStop"
  27. local H = "AlleAn"
  28.  
  29.  
  30. mon.clear()
  31.  
  32. while true do
  33.  
  34. if bool1 == true and bool2 == true then
  35. bool5 = true
  36. bool6 = true
  37. end
  38.  
  39. local input = read()
  40.  
  41.  
  42.  
  43. if input == G then
  44. os.reboot()
  45. end
  46.  
  47. if input == H then
  48. rednet.send(CID1, "ON")
  49. rednet.send(CID2, "ON")
  50. rednet.send(CID3, "ON")
  51. rednet.send(CID4, "ON")
  52. rednet.send(CID5, "ON")
  53. rednet.send(CID6, "ON")
  54. end
  55.  
  56. if input == A then
  57. if bool1 == false then
  58. bool1 = true
  59. print(bool1)
  60. else
  61. bool1 = false
  62. print(bool1)
  63. end
  64. end
  65.  
  66. if input == B then
  67. if bool2 == false then
  68. bool2 = true
  69. print(bool2)
  70. else
  71. bool2 = false
  72. print(bool2)
  73. end
  74. end
  75.  
  76. if input == C then
  77. if bool3 == false then
  78. bool3 = true
  79. else
  80. bool3 = false
  81. end
  82. end
  83.  
  84. if input == D then
  85. if bool4 == false then
  86. bool4 = true
  87. else
  88. bool4 = false
  89. end
  90. end
  91.  
  92. if input == E then
  93. if bool5 == false then
  94. bool5 = true
  95. else
  96. bool5 = false
  97. end
  98. end
  99.  
  100. if input == F then
  101. if bool6 == false then
  102. bool6 = true
  103. else
  104. bool6 = false
  105. end
  106. end
  107.  
  108.  
  109. mon.setTextScale(1)
  110. mon.setCursorPos(1,1)
  111. mon.setTextColor(colors.yellow)
  112. mon.write("System Motoren")
  113.  
  114. mon.setTextScale(1)
  115. mon.setCursorPos(1,2)
  116. mon.setTextColor(colors.white)
  117. mon.write("Anlage 1")
  118. mon.setCursorPos(1,3)
  119. mon.write("Pumpe1 :")
  120. mon.setCursorPos(1,4)
  121. mon.write("Pumpe2 :")
  122.  
  123. mon.setCursorPos(1,6)
  124. mon.write("Anlage 2")
  125. mon.setCursorPos(1,7)
  126. mon.write("Pumpe1 :")
  127. mon.setCursorPos(1,8)
  128. mon.write("Pumpe2 :")
  129.  
  130. mon.setCursorPos(1,10)
  131. mon.write("Speicher")
  132. mon.setCursorPos(1,11)
  133. mon.write("Pumpe1 :")
  134. mon.setCursorPos(1,12)
  135. mon.write("Pumpe2 :")
  136.  
  137. mon.setCursorPos(16,2)
  138. mon.write("Tank")
  139. mon.setCursorPos(16,3)
  140. mon.write("Tank1 :")
  141. mon.setCursorPos(16,4)
  142. mon.write("Tank2 ;")
  143.  
  144. if bool1 == true then
  145. mon.setCursorPos(10,3)
  146. mon.setTextColor(colors.green)
  147. mon.write("ON ")
  148. elseif bool1 == false then
  149. mon.setCursorPos(10,3)
  150. mon.setTextColor(colors.red)
  151. mon.write("OFF")
  152. end
  153.  
  154. if bool2 == true then
  155. mon.setCursorPos(10,4)
  156. mon.setTextColor(colors.green)
  157. mon.write("ON ")
  158. elseif bool2 == false then
  159. mon.setCursorPos(10,4)
  160. mon.setTextColor(colors.red)
  161. mon.write("OFF")
  162. end
  163.  
  164. if bool3 == true then
  165. mon.setCursorPos(10,7)
  166. mon.setTextColor(colors.green)
  167. mon.write("ON ")
  168. elseif bool3 == false then
  169. mon.setCursorPos(10,7)
  170. mon.setTextColor(colors.red)
  171. mon.write("OFF")
  172. end
  173.  
  174. if bool4 == true then
  175. mon.setCursorPos(10,8)
  176. mon.setTextColor(colors.green)
  177. mon.write("ON ")
  178. elseif bool4 == false then
  179. mon.setCursorPos(10,8)
  180. mon.setTextColor(colors.red)
  181. mon.write("OFF")
  182. end
  183.  
  184. if bool5 == true then
  185. mon.setCursorPos(10,11)
  186. mon.setTextColor(colors.green)
  187. mon.write("ON ")
  188. elseif bool5 == false then
  189. mon.setCursorPos(10,11)
  190. mon.setTextColor(colors.red)
  191. mon.write("OFF")
  192. end
  193.  
  194. if bool6 == true then
  195. mon.setCursorPos(10,12)
  196. mon.setTextColor(colors.green)
  197. mon.write("ON ")
  198. elseif bool6 == false then
  199. mon.setCursorPos(10,12)
  200. mon.setTextColor(colors.red)
  201. mon.write("OFF")
  202. end
  203.  
  204. if bool1 == true and bool2 == true then
  205. bool5 = true
  206. bool6 = true
  207. end
  208.  
  209.  
  210. if bool1 == true then
  211. rednet.send(CID1, "ON")
  212. else
  213. rednet.send(CID1, "OFF")
  214. end
  215. if bool2 == true then
  216. rednet.send(CID2, "ON")
  217. else
  218. rednet.send(CID2, "OFF")
  219. end
  220. if bool1 == true and bool2 == true then
  221. rednet.send(CID5, "ON")
  222. rednet.send(CID6, "ON")
  223. end
  224.  
  225.  
  226. if bool3 == true then
  227. rednet.send(CID3, "ON")
  228. else
  229. rednet.send(CID3, "OFF")
  230. end
  231. if bool4 == true then
  232. rednet.send(CID4, "ON")
  233. else
  234. rednet.send(CID4, "OFF")
  235. end
  236. if bool3 == true and bool4 == true then
  237. rednet.send(CID5, "ON")
  238. rednet.send(CID6, "ON")
  239. end
  240.  
  241.  
  242. if bool5 == true then
  243. rednet.send(CID5, "ON")
  244. else
  245. rednet.send(CID5, "OFF")
  246. end
  247. if bool6 == true then
  248. rednet.send(CID6, "ON")
  249. else
  250. rednet.send(CID6, "OFF")
  251. end
  252.  
  253.  
  254.  
  255.  
  256.  
  257. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement