Advertisement
marko_rus

security

Jun 9th, 2018
3,595
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local com =require("component")
  2. local event =require("event")
  3. local reader = com.os_magreader
  4. local door =com.os_door
  5. local pc = require("computer")
  6. local whitelist = {marko_rus ="5d2719f6-1b8a-40a7-8648-514e8c4f3957",
  7. chokopypsik ="1"}
  8. while true do
  9. _,_, name, data, uid = event.pull("magData")
  10. if whitelist[name] == uid then print("yes")
  11. if name == string.gsub(data,string.gsub(data, name, ""), "") then
  12. local lvl = string.gsub(data, name, "")
  13. if lvl == " 1" or lvl == " 2" or lvl == " 3" or lvl == " 4" or lvl == " 5" then
  14. door.toggle()
  15. pc.beep(800)
  16. pc.beep(880)
  17. os.sleep(1,5)
  18. pc.beep(880)
  19. pc.beep(800)
  20. door.toggle()
  21. else pc.beep(500, 1) end
  22. else pc.beep(500)
  23. os.sleep(0,25)
  24. pc.beep(500)end
  25. print(whitelist[name])
  26. else pc.beep(800)
  27. pc.beep(880)
  28. end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement