Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.wrap("bottom") -- Modem position --
- function clearScreen()
- term.clear()
- term.setCursorPos(1, 1)
- end
- function confirm()
- clearScreen()
- print("send")
- sleep(2)
- end
- while true do
- clearScreen()
- term.setCursorPos(1,1)
- term.setTextColor(colors.white)
- print("Reactor 1: ON=11 OFF=12 Door open=13 Door close=14")
- term.setCursorPos(1,2)
- print("Reactor 2: ON=21 OFF=22 Door open=23 Door close=24")
- term.setCursorPos(1,3)
- print("Reactor 3: ON=31 OFF=32 Door open=33 Door close=34")
- term.setCursorPos(1,4)
- print("Reactor 4: ON=41 OFF=42 Door open=43 Door close=44")
- term.setCursorPos(12,16)
- print("REACTOR CONTROL V2.0 ")
- term.setCursorPos(1,5)
- print("Select :")
- term.setCursorPos(10,5)
- local input = read()
- --R1--
- if input == "11" then
- clearScreen()
- modem.transmit(65001, 65002, "on1")
- term.setTextColor(colors.white)
- confirm()
- end
- if input == "12" then
- clearScreen()
- modem.transmit(65001, 65002, "off1")
- term.setTextColor(colors.white)
- confirm()
- end
- if input == "13" then
- clearScreen()
- modem.transmit(65001, 65002, "open1")
- term.setTextColor(colors.white)
- confirm()
- end
- if input == "14" then
- clearScreen()
- modem.transmit(65001, 65002, "close1")
- term.setTextColor(colors.white)
- confirm()
- end
- --R2--
- if input == "21" then
- clearScreen()
- modem.transmit(65001, 65002, "on2")
- term.setTextColor(colors.white)
- confirm()
- end
- if input == "22" then
- clearScreen()
- modem.transmit(65001, 65002, "off2")
- term.setTextColor(colors.white)
- confirm()
- end
- if input == "23" then
- clearScreen()
- modem.transmit(65001, 65002, "open2")
- term.setTextColor(colors.white)
- confirm()
- end
- if input == "24" then
- clearScreen()
- modem.transmit(65001, 65002, "close2")
- term.setTextColor(colors.white)
- confirm()
- end
- --R3--
- if input == "31" then
- clearScreen()
- modem.transmit(65001, 65002, "on3")
- term.setTextColor(colors.white)
- confirm()
- end
- if input == "32" then
- clearScreen()
- modem.transmit(65001, 65002, "off3")
- term.setTextColor(colors.white)
- confirm()
- end
- if input == "33" then
- clearScreen()
- modem.transmit(65001, 65002, "open3")
- term.setTextColor(colors.white)
- confirm()
- end
- if input == "34" then
- clearScreen()
- modem.transmit(65001, 65002, "close3")
- term.setTextColor(colors.white)
- confirm()
- end
- --R4--
- if input == "41" then
- clearScreen()
- modem.transmit(65001, 65002, "on4")
- term.setTextColor(colors.white)
- confirm()
- end
- if input == "42" then
- clearScreen()
- modem.transmit(65001, 65002, "off4")
- term.setTextColor(colors.white)
- confirm()
- end
- if input == "43" then
- clearScreen()
- modem.transmit(65001, 65002, "open4")
- term.setTextColor(colors.white)
- confirm()
- end
- if input == "44" then
- clearScreen()
- modem.transmit(65001, 65002, "close4")
- term.setTextColor(colors.white)
- confirm()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement