Advertisement
AnonGaming

Untitled

Mar 2nd, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 KB | None | 0 0
  1. local userInterface = {}
  2.  
  3.  
  4.  
  5. function userInterface.init(side,ranks)
  6.    
  7.     userInterface.ranks = ranks
  8.     rednet.open(side)
  9.     rednet.broadcast("userServer")
  10.     senderID,message = rednet.receive(10)
  11.    
  12.     userInterface.serverID = senderID
  13.    
  14. end
  15.  
  16. function userInterface.login(user,pass)
  17.    
  18.     rednet.send(userInterface.serverID,"auth "..user.." "..pass.." "..userInterface.ranks)
  19.    
  20.     senderID,message = rednet.receive(10)
  21.    
  22.     if message == "Correct" then
  23.         return true
  24.     end
  25.     return false
  26. end
  27.  
  28.  
  29.  
  30. -- ranks = "owner,admin,mod,user"
  31.  
  32. userInterface.init("top","owner,,admin,mod,user")
  33.  
  34. while true do
  35.     term.clear()
  36.     print("========User Logon=========")
  37.     print("Version: 1.0")
  38.     print("Username: ")
  39.     local username = read()
  40.     print("Password: ")
  41.     local pass = read("*")
  42.    
  43.     local authed = userInterface.login(username,pass)
  44.    
  45.     if authed == false then
  46.         print("LOL No auth")
  47.     else
  48.         print("Authed")
  49.     end
  50.    
  51. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement