Posted 29 May 2014 - 07:11 AM
I am trying to make a nuclear reactor terminal. I have the menu working and the inputs working. I also have the bundled outputs working. What I need help with is I need a what that when the computer receives an input from the red bundled cable to stop all outputs except on the white cable. Then when the red cable no longer is receiving a signal to continue with the program.
below is the current program I have written the current rs.testbundledinput works but only if there is a signal once the machine has been rebooted.
while true do
if rs.testBundledInput("back", colors.red) then
term.clear()
term.setCursorPos(1,1)
print("Reactor Temperature Alarm Active")
print("Performing Emergency Shutdown")
rs.setBundledOutput("back", 0)
rs.setBundledOutput("back", colors.white)
sleep(5)
else
term.clear()
term.setCursorPos(1,1)
print("Nuclear Reactor Control Terminal")
print("Please Input Numerical Command")
print("1. Reactor Startup")
print("2. Reactor Shutdown")
print("3. Alarm Test")
input = read()
sleep(0.2)
if input == "1" then
term.clear()
term.setCursorPos(1,1)
print("Reactor Startup Sequence Initiating")
sleep(3)
print("Performing Reactor Alarm Function Test")
sleep(1)
rs.setBundledOutput("back", colors.white)
sleep(4.5)
print("Performing Chamber Lockout")
sleep(1)
rs.setBundledOutput("back", colors.black)
sleep(3)
print("Activating Reactor Coolant Flow")
sleep(1)
rs.setBundledOutput("back", colors.blue+colors.black)
sleep(3)
print("Performing Reactor Startup")
sleep(1)
rs.setBundledOutput("back", colors.blue+colors.black+colors.green)
sleep(3)
print("Reactor Startup Sequence Complete")
sleep(3)
print("Returning To Reactor Control Menu")
sleep(3)
elseif input == "2" then
term.clear()
term.setCursorPos(1,1)
print("Performing Reactor Shutdown Sequence")
sleep(3)
print("Performing Reactor Shutdown")
sleep(1)
rs.setBundledOutput("back", colors.black+colors.blue)
sleep(3)
print("Deactivating Reactor Coolant Flow")
sleep(1)
rs.setBundledOutput("back", colors.black)
sleep(3)
print("Deactivating Reactor Chamber Lockout")
sleep(1)
rs.setBundledOutput("back", 0)
sleep(3)
print("Reactor Shutdown Sequence Complete")
sleep(3)
print("Returning To Reactor Control Menu")
sleep(5)
elseif input == "3" then
term.clear()
term.setCursorPos(1,1)
print("Alarm Will Sound Three Times")
sleep(2)
rs.setBundledOutput("back", colors.white)
sleep(5.5)
rs.setBundledOutput("back", 0)
print("Alarm Function Test Complete")
sleep(3)
print("Returning To Reactor Control Menu")
sleep(5)
elseif input == "t" then
term.clear()
term.setCursorPos(1,1)
print("Entering Debug Mode")
sleep(3)
term.clear()
term.setCursorPos(1,1)
break
else
print("That Is Not A Valid Input")
sleep(2)
end
end
end
below is the current program I have written the current rs.testbundledinput works but only if there is a signal once the machine has been rebooted.
while true do
if rs.testBundledInput("back", colors.red) then
term.clear()
term.setCursorPos(1,1)
print("Reactor Temperature Alarm Active")
print("Performing Emergency Shutdown")
rs.setBundledOutput("back", 0)
rs.setBundledOutput("back", colors.white)
sleep(5)
else
term.clear()
term.setCursorPos(1,1)
print("Nuclear Reactor Control Terminal")
print("Please Input Numerical Command")
print("1. Reactor Startup")
print("2. Reactor Shutdown")
print("3. Alarm Test")
input = read()
sleep(0.2)
if input == "1" then
term.clear()
term.setCursorPos(1,1)
print("Reactor Startup Sequence Initiating")
sleep(3)
print("Performing Reactor Alarm Function Test")
sleep(1)
rs.setBundledOutput("back", colors.white)
sleep(4.5)
print("Performing Chamber Lockout")
sleep(1)
rs.setBundledOutput("back", colors.black)
sleep(3)
print("Activating Reactor Coolant Flow")
sleep(1)
rs.setBundledOutput("back", colors.blue+colors.black)
sleep(3)
print("Performing Reactor Startup")
sleep(1)
rs.setBundledOutput("back", colors.blue+colors.black+colors.green)
sleep(3)
print("Reactor Startup Sequence Complete")
sleep(3)
print("Returning To Reactor Control Menu")
sleep(3)
elseif input == "2" then
term.clear()
term.setCursorPos(1,1)
print("Performing Reactor Shutdown Sequence")
sleep(3)
print("Performing Reactor Shutdown")
sleep(1)
rs.setBundledOutput("back", colors.black+colors.blue)
sleep(3)
print("Deactivating Reactor Coolant Flow")
sleep(1)
rs.setBundledOutput("back", colors.black)
sleep(3)
print("Deactivating Reactor Chamber Lockout")
sleep(1)
rs.setBundledOutput("back", 0)
sleep(3)
print("Reactor Shutdown Sequence Complete")
sleep(3)
print("Returning To Reactor Control Menu")
sleep(5)
elseif input == "3" then
term.clear()
term.setCursorPos(1,1)
print("Alarm Will Sound Three Times")
sleep(2)
rs.setBundledOutput("back", colors.white)
sleep(5.5)
rs.setBundledOutput("back", 0)
print("Alarm Function Test Complete")
sleep(3)
print("Returning To Reactor Control Menu")
sleep(5)
elseif input == "t" then
term.clear()
term.setCursorPos(1,1)
print("Entering Debug Mode")
sleep(3)
term.clear()
term.setCursorPos(1,1)
break
else
print("That Is Not A Valid Input")
sleep(2)
end
end
end