Posted 06 March 2013 - 01:16 PM
How do you input data using read() when your in a while loop.
This is what I tried using but only the first line I enter after starting the program does something. For instance I can type in "Engage Code Room" and only the set of code under it will fire, anything else entered after that does nothing.
term.clear()
term.setCursorPos(1,1)
print("Enter Command:")
local password = read()
while true do
if password == "Engage Terminal" then
rs.setBundledOutput("bottom", colors.combine(rs.getBundledOutput("bottom"), colors.white))
read()
elseif password == "Engage Code Room" then
rs.setBundledOutput("bottom", colors.combine(rs.getBundledOutput("bottom"), colors.orange))
read()
elseif password == "Disengage All" then
rs.setBundledOutput("bottom", colors.subtract(rs.getBundledOutput("bottom"), colors.white, colors.orange))
read()
elseif password == "Shutdown" then
break
end
end
This is what I tried using but only the first line I enter after starting the program does something. For instance I can type in "Engage Code Room" and only the set of code under it will fire, anything else entered after that does nothing.
Edited by