Posted 18 October 2012 - 11:59 AM
Hi!
i have a question, i want 2 if statements and then a else statement.
this is the code
————————————————-
if input == ""on"" then
term.clear()
term.setCursorPos(12,4)
print("TURNING ON NUCLEAR REACTOR")
sleep(3)
rs.setOutput("back", true)
shell.run("nuclear") – same program so you can turn it off again
if input == "off" then
term.clear()
term.setCursorPos(12,4)
print("TURNING OFF NUCLEAR REACTOR")
rs.setOutput("back', false)
shell.run("nuclear")
end
else
term.clear()
term.setCursorPos(12,4)
print("COMMAND NOT RECONIZED!")
sleep(3)
shell.run("nuclear")
end
——————————————————–
please help
if i type on, it does work
and when i type off it says the print("COMMAND NOT RECONIZED")
i have a question, i want 2 if statements and then a else statement.
this is the code
————————————————-
if input == ""on"" then
term.clear()
term.setCursorPos(12,4)
print("TURNING ON NUCLEAR REACTOR")
sleep(3)
rs.setOutput("back", true)
shell.run("nuclear") – same program so you can turn it off again
if input == "off" then
term.clear()
term.setCursorPos(12,4)
print("TURNING OFF NUCLEAR REACTOR")
rs.setOutput("back', false)
shell.run("nuclear")
end
else
term.clear()
term.setCursorPos(12,4)
print("COMMAND NOT RECONIZED!")
sleep(3)
shell.run("nuclear")
end
——————————————————–
please help
if i type on, it does work
and when i type off it says the print("COMMAND NOT RECONIZED")