Advertisement
MuChT007

Reactors control deck V2.0

Apr 22nd, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.34 KB | None | 0 0
  1. local modem = peripheral.wrap("bottom") -- Modem position --
  2.  
  3. function clearScreen()
  4.             term.clear()
  5.             term.setCursorPos(1, 1)
  6.          end
  7.  
  8. function confirm()
  9.         clearScreen()
  10.         print("send")
  11.     sleep(2)
  12. end
  13.  
  14. while true do
  15.  
  16. clearScreen()
  17. term.setCursorPos(1,1)
  18. term.setTextColor(colors.white)
  19. print("Reactor 1: ON=11 OFF=12 Door open=13 Door close=14")
  20. term.setCursorPos(1,2)
  21. print("Reactor 2: ON=21 OFF=22 Door open=23 Door close=24")
  22. term.setCursorPos(1,3)
  23. print("Reactor 3: ON=31 OFF=32 Door open=33 Door close=34")
  24. term.setCursorPos(1,4)
  25. print("Reactor 4: ON=41 OFF=42 Door open=43 Door close=44")
  26. term.setCursorPos(12,16)
  27. print("REACTOR CONTROL V2.0 ")
  28.  
  29. term.setCursorPos(1,5)
  30. print("Select :")
  31. term.setCursorPos(10,5)
  32. local input = read()
  33.  
  34. --R1--
  35.  
  36. if input == "11" then
  37.     clearScreen()
  38.         modem.transmit(65001, 65002, "on1")
  39.         term.setTextColor(colors.white)
  40.         confirm()
  41. end
  42.        
  43.  
  44. if input == "12" then
  45.     clearScreen()
  46.         modem.transmit(65001, 65002, "off1")
  47.         term.setTextColor(colors.white)
  48.         confirm()
  49. end
  50.        
  51.  
  52. if input == "13" then
  53.     clearScreen()
  54.         modem.transmit(65001, 65002, "open1")
  55.         term.setTextColor(colors.white)
  56.         confirm()
  57. end
  58.        
  59.  
  60. if input == "14" then
  61.     clearScreen()
  62.         modem.transmit(65001, 65002, "close1")
  63.         term.setTextColor(colors.white)
  64.         confirm()
  65. end
  66.        
  67.  
  68. --R2--
  69.  
  70. if input == "21" then
  71.     clearScreen()
  72.         modem.transmit(65001, 65002, "on2")
  73.         term.setTextColor(colors.white)
  74.         confirm()
  75. end
  76.        
  77.  
  78. if input == "22" then
  79.     clearScreen()
  80.         modem.transmit(65001, 65002, "off2")
  81.         term.setTextColor(colors.white)
  82.         confirm()
  83. end
  84.        
  85.  
  86. if input == "23" then
  87.     clearScreen()
  88.         modem.transmit(65001, 65002, "open2")
  89.         term.setTextColor(colors.white)
  90.         confirm()
  91. end
  92.        
  93.  
  94. if input == "24" then
  95.     clearScreen()
  96.         modem.transmit(65001, 65002, "close2")
  97.         term.setTextColor(colors.white)
  98.         confirm()
  99. end
  100.  
  101. --R3--
  102.  
  103. if input == "31" then
  104.     clearScreen()
  105.         modem.transmit(65001, 65002, "on3")
  106.         term.setTextColor(colors.white)
  107.         confirm()
  108. end
  109.        
  110.  
  111. if input == "32" then
  112.     clearScreen()
  113.         modem.transmit(65001, 65002, "off3")
  114.         term.setTextColor(colors.white)
  115.         confirm()
  116. end
  117.        
  118.  
  119. if input == "33" then
  120.     clearScreen()
  121.         modem.transmit(65001, 65002, "open3")
  122.         term.setTextColor(colors.white)
  123.         confirm()
  124. end
  125.        
  126.  
  127. if input == "34" then
  128.     clearScreen()
  129.         modem.transmit(65001, 65002, "close3")
  130.         term.setTextColor(colors.white)
  131.         confirm()
  132. end
  133.  
  134. --R4--
  135.  
  136. if input == "41" then
  137.     clearScreen()
  138.         modem.transmit(65001, 65002, "on4")
  139.         term.setTextColor(colors.white)
  140.         confirm()
  141. end
  142.        
  143.  
  144. if input == "42" then
  145.     clearScreen()
  146.         modem.transmit(65001, 65002, "off4")
  147.         term.setTextColor(colors.white)
  148.         confirm()
  149. end
  150.        
  151.  
  152. if input == "43" then
  153.     clearScreen()
  154.         modem.transmit(65001, 65002, "open4")
  155.         term.setTextColor(colors.white)
  156.         confirm()
  157. end
  158.        
  159.  
  160. if input == "44" then
  161.     clearScreen()
  162.         modem.transmit(65001, 65002, "close4")
  163.         term.setTextColor(colors.white)
  164.         confirm()
  165. end
  166.  
  167. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement