Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement