Advertisement
Guest User

OS

a guest
Dec 29th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.69 KB | None | 0 0
  1. --Load AI Image
  2. bGround = paintutils.loadImage(".AI")
  3. --Stop Termination
  4. os.pullEvent = os.pullEventRaw
  5. --Clear Terminal
  6. function loadAI()
  7. paintutils.drawImage(bGround,18,2)
  8. end
  9. function logIn()
  10. term.clear()
  11. term.setTextColor(colors.white)
  12. paintutils.drawImage(bGround,18,2)
  13. term.setCursorPos(1,1)
  14. print("Please Login")
  15. term.setCursorPos(1,2)
  16. term.write("Username : ")
  17. user = read()
  18. term.setCursorPos(1,3)
  19. term.write("Password : ")
  20. pass = read("*")
  21. --Verify
  22. term.setCursorPos(1,4)
  23. textutils.slowPrint("Verifying Information...")
  24. sleep(2)
  25. end
  26. logIn()
  27. function Verify()
  28. if (user == "Kami") or (user == "Delloga") then
  29.   if (pass == "4793") then
  30.     term.clear()
  31.     paintutils.drawImage(bGround,18,2)
  32.     term.setCursorPos(15,10)
  33.     term.setTextColor(colors.lime)
  34.     textutils.slowPrint("WELCOME MASTER")
  35.     sleep(2)
  36.   else
  37.     term.clear()
  38.     paintutils.drawImage(bGround,18,2)
  39.     term.setCursorPos(15,10)
  40.     term.setTextColor(colors.red)
  41.     textutils.slowPrint("WRONG PASSWORD")
  42.     sleep(2)
  43.     logIn()
  44.   end
  45. else
  46.   term.clear()
  47.   paintutils.drawImage(bGround,18,2)
  48.   term.setCursorPos(15,10)
  49.   term.setTextColor(colors.red)
  50.   textutils.slowPrint("WRONG USERNAME")
  51.   sleep(2)
  52.   logIn()
  53. end
  54. end
  55. Verify()
  56. --Mainmenu
  57. function mainMenu()  
  58. term.clear()
  59. Commands()
  60. end
  61. --Commands
  62. function Commands()
  63. term.clear()
  64. loadAI()
  65. term.setTextColor(colors.pink)
  66. term.setCursorPos(1,1)
  67. textutils.slowPrint("WHAT ARE WE GOING TO DO TODAY, MASTER?")
  68. term.setTextColor(colors.white)
  69. local optn = read()
  70. if (optn == "Programs") or (optn == "programs") then
  71.   term.clear()
  72.   loadAI()
  73.   term.setCursorPos(1,1)
  74.   term.setTextColor(colors.pink)
  75.   textutils.slowPrint("HERE IS A LIST OF AVAILABLE PROGRAMS")
  76.   term.setCursorPos(1,2)
  77.   print("------------------------------------")
  78.   term.setCursorPos(1,3)
  79.   term.setTextColor(colors.blue)
  80.   print("Lights --- Toggles the lights on or off.")
  81.   print("Danger --- Locks down all doors.")
  82.   print("Back   --- Brings you back to the main menu.")
  83.   print("Logout --- Logs the current user out.")
  84.   print("Programs --- Prints a list of available programs.")
  85.   term.setTextColor(colors.pink)
  86.   print("------------------------------------")
  87.   sleep(10)
  88.   Commands()
  89. elseif (optn == "Back") or (optn == "back") then
  90.     Commands()
  91. elseif (optn == "Logout") or (optn == "logout") then
  92.   term.clear()
  93.   loadAI()
  94.   term.setTextColor(colors.pink)
  95.   term.setCursorPos(2,10)
  96.   textutils.slowPrint("I AM NOW LOGGING YOU OUT, MASTER.")
  97.   sleep(2)
  98.   term.clear()
  99.   loadAI()
  100.   term.setCursorPos(8,10)
  101.   term.setTextColor(colors.pink)
  102.   textutils.slowPrint("ITTERASSHAI GOSHUJINSAMA!")
  103.   sleep(2)
  104.   logIn()
  105. elseif (optn == "Lights") or (optn == "lights") then
  106.   term.clear()
  107.   loadAI()
  108.   term.setTextColor(colors.pink)
  109.   term.setCursorPos(1,1)
  110.   textutils.slowPrint("I WILL NOW TURN THE LIGHTS OFF...")
  111.   sleep(3)
  112.   term.setCursorPos(1,5)
  113.   textutils.slowPrint("LIGHTS HAVE BEEN TURNED OFF.")
  114.   sleep(2)
  115.   Commands()
  116. elseif (optn == "Danger") or (optn == "danger") then
  117.   term.clear()
  118.   loadAI()
  119.   term.setTextColor(colors.red)
  120.   term.setCursorPos(1,1)
  121.   textutils.slowPrint("LABORATORY NOW GOING INTO QUARANTINE...")
  122.   sleep(1)
  123.   term.clear()
  124.   loadAI()
  125.   sleep(1)
  126.   term.setCursorPos(1,1)
  127.   print("LABORATORY NOW GOING INTO QUARANTINE...")
  128.   sleep(1)
  129.   term.clear()
  130.   loadAI()
  131.   sleep(1)
  132.   term.setCursorPos(1,1)
  133.   print("LABORATORY NOW GOING INTO QUARANTINE...")
  134.   sleep(2)
  135.   sleep(1)
  136.   term.setCursorPos(1,3)
  137.   term.setTextColor(colors.pink)
  138.   textutils.slowPrint("TO UNLOCK THE DOORS:")
  139.   term.setCursorPos(1,4)
  140.   textutils.slowPrint("PRESS")
  141.   term.setTextColor(colors.blue)
  142.   term.setCursorPos(6,4)
  143.   textutils.slowPrint(" ENTER.")
  144.   term.setTextColor(colors.white)
  145.   local enterKey = read()
  146.   if (enterKey == " ") or (enterKey == "  ") then
  147.     term.setTextColor(colors.pink)
  148.     term.setCursorPos(1,6)
  149.     textutils.slowPrint("NOW UNLOCKING ALL DOORS.")
  150.     sleep(3)
  151.     term.setCursorPos(1,8)
  152.     textutils.slowPrint("NOW RETURNING TO MAIN MENU...")
  153.     sleep(3)
  154.     Commands()
  155.   else
  156.     term.setTextColor(colors.pink)
  157.     term.setCursorPos(1,6)
  158.     textutils.slowPrint("NOW UNLOCKING ALL DOORS")
  159.     sleep(3)
  160.     term.setCursorPos(1,8)
  161.     textutils.slowPrint("NOW RETURNING TO MAIN MENU...")
  162.     sleep(3)
  163.     Commands()
  164.   end
  165. else
  166.   term.clear()
  167.   loadAI()
  168.   term.setTextColor(colors.pink)
  169.   term.setCursorPos(1,1)
  170.   textutils.slowPrint("NO PROGRAM CALLED "..optn.." FOUND")
  171.   term.setCursorPos(1,2)
  172.   textutils.slowPrint("MASTER, PLEASE TRY THE KEYWORD:")  
  173.   term.setTextColor(colors.blue)
  174.   term.setCursorPos(1,3)
  175.   textutils.slowPrint("PROGRAMS")
  176.   sleep(5)
  177.   Commands()
  178. end
  179. end  
  180. mainMenu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement