Guest User

password.lua

a guest
May 31st, 2019
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. password = 'sense'
  2. exitProgram = 'exitProgram'
  3. function clearTerm(x)
  4.     term.clear()
  5.     term.setCursorPos(1,1)
  6.     print(x)
  7. end
  8.  
  9. function enterPassword()
  10.     clearTerm('Julien\'s PC, please don\'t fiddle around!')
  11.     enteredText = io.read()
  12.     if enteredText == password then
  13.         rs.setOutput('bottom', true)
  14.         clearTerm('Welcome')
  15.         os.sleep(3)
  16.         rs.setOutput('bottom', false)
  17.         enterPassword()
  18.     elseif enteredText == exitProgram then
  19.         clearTerm('Exitting...')
  20.         return
  21.     else
  22.         clearTerm('Please stop')
  23.         os.sleep(3)
  24.         enterPassword()
  25.     end
  26.     return
  27. end
  28.  
  29. enterPassword()
Advertisement
Add Comment
Please, Sign In to add comment