because it worked perfectly until i did a to long editing session.
my program is a control panel used to control 5 different systems.
and it works just as i want it to, until i return to the main control panel after using a sub-page
if i try to enter the same sub page i have used before it just ignores my command, but it still works for my other sub pages.
local function AddOutput(sSide, ...)
local c = colors.combine(rs.getBundledOutput(sSide), ...)
rs.setBundledOutput(sSide, c)
end
local function RemoveOutput(sSide, ...)
local c = colors.subtract(rs.getBundledOutput(sSide), ...)
rs.setBundledOutput(sSide, c)
end
while x1 ~= "consol" do
term.clear()
print("-------------------------------------------")
print("----------------Main menu:-----------------")
print("-------------------------------------------")
print("Options:")
print("-------------------------------------------")
print("Querry")
if rs.testBundledInput("back", colors.lime ) == true then
print("Status: Online")
else
print("Status: Offline")
end
print("OilPump")
if rs.testBundledInput("back", colors.pink ) == true then
print("Status: Online")
else
print("Status: Offline")
end
print("Cooling")
if rs.testBundledInput("back", colors.gray ) == true then
print("Status: Online")
else
print("Status: Offline")
end
print("Security")
if rs.testBundledInput("back", colors.lightGray ) == true then
print("Status: Online")
else
print("Status: Offline")
end
print("MobFarm")
if rs.testBundledInput("back", colors.cyan ) == true then
print("Status: Online")
else
print("Status: Offline")
end
print("Consol")
print("-------------------------------------------")
write("Enter menu command: ")
x1 = io.read()
if x1 == "querry" then
while x2 ~= "back" do
term.clear()
print("-------------------------------------------")
print("----------------Querry menu:---------------")
print("-------------------------------------------")
if rs.testBundledInput("back", colors.lime ) == true then
print("Status: Online")
else
print("Status: Offline")
end
print("To turn Querry on, type on.")
print("To turn Querry off, type off.")
print("To get back to the main menu, type back.")
print("-------------------------------------------")
write("Enter querry command: ")
x2 = io.read()
if x2 == "on" then
AddOutput("back", colors.white )
term.clear()
print("------------------------------------------")
print("The querry is now on.")
print("------------------------------------------")
sleep(1)
elseif x2 == "off" then
RemoveOutput("back", colors.white )
print("------------------------------------------")
print("The querry is now off.")
print("------------------------------------------")
end -- if x2 = on/off
end -- while x2
end -- if Querry
if x1 == "oilpump" then
while x3 ~= "back" do
term.clear()
print("-------------------------------------------")
print("---------------Oilpump menu:---------------")
print("-------------------------------------------")
if rs.testBundledInput("back", colors.pink ) == true then
print("Status: Online")
else
print("Status: Offline")
end
print("To turn on the oilpumps, type on.")
print("To turn off the oilpumps, type off.")
print("To get back to the main menu, type back.")
print("-------------------------------------------")
write("Enter oilpump command: ")
x3 = io.read()
if x3 == "on" then
AddOutput("back", colors.orange )
term.clear()
print("------------------------------------------")
print("The oilpumps are now on.")
print("------------------------------------------")
sleep(1)
elseif x3 == "off" then
RemoveOutput("back", colors.orange )
term.clear()
print("------------------------------------------")
print("The oilpumps are now off.")
print("------------------------------------------")
sleep(1)
end -- if x3 = on/off
end -- while x3
end -- if oilpumps
if x1 == "cooling" then
while x4 ~= "back" do
term.clear()
print("-------------------------------------------")
print("---------------Cooling menu:---------------")
print("-------------------------------------------")
if rs.testBundledInput("back", colors.gray ) == true then
print("Status: Online")
else
print("Status: Offline")
end
print("To turn on the Cooling, type on.")
print("To turn off the Cooling, type off.")
print("To get back to the main menu, type back.")
print("-------------------------------------------")
write("Enter Cooling command: ")
x4 = io.read()
if x4 == "on" then
AddOutput("back", colors.magenta )
term.clear()
print("------------------------------------------")
print("The cooling is now on.")
print("------------------------------------------")
sleep(1)
elseif x4 == "off" then
RemoveOutput("back", colors.magenta )
term.clear()
print("------------------------------------------")
print("The Cooling is now off.")
print("------------------------------------------")
sleep(1)
end -- if x4 = on/off
end -- while x4
end -- if Cooling
if x1 == "security" then
while x5 ~= "back" do
term.clear()
print("-------------------------------------------")
print("---------------Security menu:--------------")
print("-------------------------------------------")
if rs.testBundledInput("back", colors.lightGray ) == true then
print("Status: Online")
else
print("Status: Offline")
end
print("To turn security on, type on.")
print("To turn security off, type off.")
print("To get back to the main menu, type back.")
print("-------------------------------------------")
write("Enter security command: ")
x5 = io.read()
if x5 == "on" then
AddOutput("back", colors.lightBlue )
term.clear()
print("------------------------------------------")
print("The security is now on.")
print("------------------------------------------")
sleep(1)
elseif x5 == "off" then
RemoveOutput("back", colors.lightBlue )
term.clear()
print("------------------------------------------")
print("The security is now off.")
print("------------------------------------------")
sleep(1)
end -- if x5 = on/off
end -- while x5
end -- if security
if x1 == "mobfarm" then
while x6 ~= "back" do
term.clear()
print("-------------------------------------------")
print("---------------MobFarm menu:---------------")
print("-------------------------------------------")
if rs.testBundledInput("back", colors.cyan ) == true then
print("Status: Online")
else
print("Status: Offline")
end
print("To turn on the Mob farm, type on.")
print("To turn off the Mob farm, type off.")
print("To get back to the main menu, type back.")
print("-------------------------------------------")
write("Enter command: ")
x6 = io.read()
if x6 == "on" then
AddOutput("back", colors.yellow )
term.clear()
print("------------------------------------------")
print("The Mob farm is now on.")
print("------------------------------------------")
sleep(1)
elseif x6 == "off" then
RemoveOutput("back", colors.yellow )
term.clear()
print("------------------------------------------")
print("The Mob farm is now off.")
print("------------------------------------------")
sleep(1)
end -- if x6 = on/off
end -- while x6
end -- if modfarm
end -- Main end