Advertisement
Guest User

startup

a guest
Feb 23rd, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. local user1 = "robin"
  3. local user2 = "batman"
  4. local password = "daledo"
  5. mon = peripheral.wrap("right")
  6. mon.clear()
  7. mon.setCursorPos(1,1)
  8. term.clear()
  9. term.setCursorPos(1,1)
  10. term.setTextColor(colors.red)
  11. print("Welcome to BatOS, please login")
  12. term.setCursorPos(1,2)
  13. local user = read()
  14.   if (user == user1) or (user == user2) then
  15.     term.setCursorPos(1,3)
  16.     print("Password: ")
  17.     local pass = read("*")
  18.       if (pass == password) then
  19.        print("Password Correct, Welcome!")
  20.      
  21.       else
  22.        print("Incorrect password")
  23.       end
  24.  
  25.  
  26.   else
  27.     print("Usernme not recognized.")
  28.     os.reboot()
  29.   end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement