term.clear()
term.setCursorPos(1,1)
print("Please insert your username and password")
print("User:")
print("Password:")
local choice = 1
term.setCursorPos(6,2)
while true do
local e,e1,e2,e3,e4,e5 = os.pullEvent()
if e == "key" then
if e1 == 200 then
if choice == 2 then
choice = 1
else
choice = choice+1
end
end
if e1 == 208 then
if choice == 1 then
choice = 2
else
choice = choice-1
end
end
if e1 == 14 then
term.clearLine()
if choice == 1 then
term.setCursorPos(1,2)
write("User:")
end
if choice == 2 then
term.setCursorPos(1,3)
write("Password:")
end
end
if choice == 1 then
term.setCursorPos(6,2)
if username == "" then
username = read()
else
username = ""
username = read()
end
if choice == 2 then
term.setCursorPos(10,3)
if password == "" then
password = read()
else
password = ""
password = read()
end
end
end
end
end
This script is spost to ask for a user name, and when they press up or down it would select
the username or password input, and when you typed it it would save it in a var if username
or password already had a input and you pressed backspace while having one selected it would
clear it, but now im stuck, it wont let me type in the space like before so if i selected user
it would not let me type there even if i pressed backspace can someone help?