Advertisement
ignzio

Untitled

Mar 26th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3. print("Tech Lab os 1.0 by Clothespin Fox")
  4.  
  5. os.pullEvent = os.pullEventRaw
  6. local w, h = term.getSize()
  7. --Variables
  8. local user = "ignzio"
  9. local pass = "ciccio"
  10. local uAllow = false
  11. local pAllow = false
  12. version = "1.0.0"
  13. --Functions
  14. function clear()
  15. term.setCursorPos(1,1)
  16. end
  17. function printCentered(msg, h)
  18. term.setCursorPos(w/2 - #msg/2, h)
  19. write(msg)
  20. end
  21. local function printHeader()
  22. printCentered("Benvenuto. inserisci id e Password V")
  23. printCentered("Tech Lab os 1.0 by Clothespin Fox", 2)
  24. end
  25. local function uCheck()
  26. write("Username: ")
  27. uInput = read()
  28. if uInput == user then
  29. uAllow = true
  30. else
  31. print("Username Scorretto!")
  32. sleep(2)
  33. os.reboot()
  34. end
  35. end
  36. local function pCheck()
  37. write("Password: ")
  38. pInput = read("*")
  39. if pInput == pass then
  40. pAllow = true
  41. else
  42. print("Password scorretta!")
  43. sleep(2)
  44. os.reboot()
  45. end
  46. end
  47. --Main Program
  48. clear()
  49. printHeader()
  50. term.setCursorPos(1,4)
  51. uCheck()
  52. if uAllow == true then
  53. term.setCursorPos(1,5)
  54. pCheck()
  55. end
  56. if uAllow == true and pAllow == true then
  57. textutils.slowPrint("Loging in...")
  58. sleep(2)
  59. clear()
  60. print("Logged in")
  61. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement