I think you don't need read(), since you just need to select an option, wich is just one key.
Use the char event to get it:
local evt, input = os.pullEvent("char") -- get the input from the user
write(input) -- write it (so the user can see the option he chose)
-- use it
if input == "1" then
...
Also, your calling read() twice, wich would overwrite the first input, and there's some other errors.
Try with this:
local function showGui()
term.clear()
term.setCursorPos(1, 1)
print(" ################################################")
print(" # #")
print(" # Lights System v0.1 #")
print(" # #")
print(" # #")
print(" # To turn the lights ON write [1] #")
print(" # #")
print(" # To turn the lights OFF write [2] #")
print(" # #")
print(" # To enter to the admin menu write [3] #")
print(" # #")
print(" # #")
print(" # ------------------- #")
print(" # Choose a option:| | #")
print(" # ------------------- #")
print(" ################################################")
term.setCursorPos(24, 15)
end
while true do
showGui()
local evt, input = os.pullEvent("char")
write(input)
if input == "1" then
rs.setOutput("back", true)
term.clearLine()
elseif input == "2" then
rs.setOutput("back", false)
elseif input == "3" then
break
end
end