Advertisement
Guest User

MMLogin

a guest
Feb 3rd, 2015
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.14 KB | None | 0 0
  1. --local arg = { ... }
  2. --local pkt = arg[1]
  3. --local pData = pkt[2]
  4. local pData = {
  5.   cody,
  6.   pass,
  7. }
  8.  
  9. function generateKey()
  10.  
  11.   local str = ""
  12.   local all = {"0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g", "h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","!","#","$","%","&","/","(",")","="}
  13.   local from = from or all
  14.   for i=1, 10 do
  15.  
  16.     str = str..from[math.random(1, #all)]
  17.    
  18.   end
  19.  
  20.   return str
  21.  
  22. end
  23.  
  24. local file = fs.open("/database/users", "r")
  25. local dat = file.readAll()
  26. users = textutils.unserialize(dat)
  27. file.close()
  28.  
  29. if users.pData[1] == nil then
  30.  
  31.   print("[MountianLion Mail] [Login] [userNotExist]")
  32.  
  33.   data = false
  34.  
  35. else
  36.  
  37.   if users.pData[1] == pData[2] then
  38.    
  39.      uKey = generateKey()
  40.    
  41.      print("[MountianLion Mail] [Login] [Generated Key] [" .. uKey .. "]")      
  42.      
  43.      data = uKey
  44.  
  45.   else
  46.    
  47.     print(users.pData[1])
  48.    
  49.     print("[MountianLion Mail] [Login] [Failed]")
  50.    
  51.     data = false
  52.  
  53.   end
  54.  
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement