Advertisement
Paullie

doorPass

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