Advertisement
Guest User

Untitled

a guest
Mar 12th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3. print("Please insert your username and password")
  4. print("User:")
  5. print("Password:")
  6.  
  7. local choice = 1
  8.  
  9. term.setCursorPos(6,2)
  10.  
  11. while true do
  12. local e,e1,e2,e3,e4,e5 = os.pullEvent()
  13. if e == "key" then
  14. if e1 == 200 then
  15. if choice == 2 then
  16. choice = 1
  17. else
  18. choice = choice+1
  19. end
  20. end
  21. if e1 == 208 then
  22. if choice == 1 then
  23. choice = 2
  24. else
  25. choice = choice-1
  26. end
  27. end
  28. if e1 == 14 then
  29. term.clearLine()
  30. if choice == 1 then
  31. term.setCursorPos(1,2)
  32. write("User:")
  33. end
  34. if choice == 2 then
  35. term.setCursorPos(1,3)
  36. write("Password:")
  37. end
  38. end
  39. if choice == 1 then
  40. term.setCursorPos(6,2)
  41. if username == "" then
  42. username = read()
  43. else
  44. username = ""
  45. username = read()
  46. end
  47. if choice == 2 then
  48. term.setCursorPos(10,3)
  49. if password == "" then
  50. password = read()
  51. else
  52. password = ""
  53. password = read()
  54. end
  55. end
  56. end
  57. end
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement