Advertisement
Paullie

Untitled

Jun 29th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.54 KB | None | 0 0
  1. ------------------------------------------------------------
  2. --DOOR CONTROL PROGRAMME CODED BY PAULLIE [SWL]
  3. ------------------------------------------------------------
  4.  
  5.  
  6. user = "Will"
  7. password = "swl123"
  8.  
  9. function clearScreen()
  10.     term.clear()
  11.     term.setCursorPos(1,1)
  12. end --ends function clearScreen
  13.  
  14. function doorPass()
  15.     clearScreen()
  16.     textutils.slowPrint("Hello, please enter your Username")
  17.     term.setCursorPos(1,2)
  18.     write(": ")
  19.     userinput = read()
  20.     --------------------------------------------------------
  21.     --IF STATEMENT FOR USERNAME
  22.     --------------------------------------------------------
  23.     if userinput == user then
  24.         term.setCursorPos(1,4)
  25.         textutils.slowPrint("and your Password")
  26.         term.setCursorPos(1,5)
  27.         write(": ")
  28.         userinput1 = read("*")
  29.     --------------------------------------------------------
  30.     --IF STATEMENT FOR Password
  31.     --------------------------------------------------------
  32.     if userinput1 == password then
  33.         clearScreen()
  34.         textutils.slowPrint("Thank You "..userinput)
  35.         rs.setOutput("bottom", true)
  36.         sleep(5)
  37.         rs.setOutput("bottom", false)
  38.     else
  39.         clearScreen()
  40.         textutils.slowPrint("Sorry your password is incorrect please try again!")
  41.         sleep(3)
  42.         os.reboot()
  43.     end
  44.     else
  45.         clearScreen()
  46.         textutils.slowPrint("Sorry your username is incorrect please try again!")
  47.         sleep(3)
  48.         os.reboot()
  49.     end
  50. end
  51.  
  52. clearScreen()
  53. doorPass()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement