Advertisement
Nik2580

kizuhgd

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