MrKey2b

lock

Mar 28th, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.06 KB | None | 0 0
  1. --Programme Crée part @MrKey2b
  2.  
  3. local internet   = require("internet")
  4. local component  = require("component")
  5. local sides      = require("sides")
  6. local event      = require("event")
  7. local fs         = require("filesystem")
  8. local term       = require("term")
  9. local computer   = require("computer")
  10. local shell      = require("shell")
  11.  
  12. --Debut prog
  13.  
  14. if fs.exists('/lib/json.lua') == false then
  15.   shell.execute('wget -fq "https://pastebin.com/raw/4UWzY19u" "/lib/json.lua"')
  16. end
  17. local json = require("json")
  18.  
  19.   local shrc = io.open("/home/.shrc","a")
  20.   shrc:write("/home/lock.lua")
  21.   shrc:close()
  22.   computer.shutdown(true)
  23. end
  24.                                 shell.execute("clear")
  25.     print("Login session MrKey2b")
  26.     print("")
  27.     print("Password :")
  28.     print("")
  29. local ok, Password = pcall(term.read, { dobreak = false, pwchar = "*" })
  30. if ok then
  31. Password = string.sub(Password, 1, #Password - 1)
  32. end
  33. if Password == "admin" then
  34.                                 shell.execute("clear")
  35.     print("Password Accepted")
  36. else
  37.     print("Password Denied")
  38. os.sleep(1.5)
  39. computer.shutdown(true)
  40. end
  41. --End prog
Advertisement
Add Comment
Please, Sign In to add comment