Advertisement
Guest User

windows-logon

a guest
Jan 28th, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. --START OF CONFIG
  2.  
  3. YourLogin = "user" --This is your login
  4. YourPassword = "pass" --This is your password
  5.  
  6. --END OF CONFIG
  7.  
  8. back = paintutils.loadImage("Windows7/wallpaper.nfp")
  9. paintutils.drawImage(back, 1, 1)
  10.  
  11. window = paintutils.loadImage("Windows7/logon-window.nfp")
  12. paintutils.drawImage(window, 2, 2)
  13.  
  14. while true do
  15. term.setTextColour(colours.black)
  16. term.setBackgroundColour(colours.lightBlue)
  17. term.setCursorPos(2, 2)
  18. print("Login to SosOS")
  19.  
  20. term.setCursorPos(14, 8)
  21. term.setBackgroundColour(colours.red)
  22. term.setTextColour(colours.white)
  23. print(":CANCEL")
  24. term.setCursorPos(21, 8)
  25. term.setBackgroundColour(colours.green)
  26. print(":OK")
  27.  
  28. term.setBackgroundColour(colours.white)
  29. term.setTextColour(colours.black)
  30. term.setCursorPos(3, 4)
  31. print("Login: ")
  32. term.setCursorPos(10, 4)
  33. loginRead = read()
  34. term.setCursorPos(3, 5)
  35. print("Password: ")
  36. term.setCursorPos(13, 5)
  37. passRead = read()
  38.  
  39. event, button, xPos, yPos = os.pullEvent("mouse_click")
  40.  
  41. if xPos == 21 and yPos == 8 then
  42. if loginRead == YourLogin and passRead == YourPassword then
  43. shell.run("windows-welcome")
  44. else
  45. term.setCursorPos(3, 6)
  46. print("Bad login. Try again.")
  47. sleep(6)
  48. shell.run("windows-logon")
  49. end
  50. elseif xPos == 14 and yPos == 8 then
  51. shell.run("clear")
  52. os.reboot()
  53. end
  54. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement