marko_rus

Untitled

Aug 26th, 2018
351
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 ="1", chokopypsik ="1"}
  7. while true do
  8. _,_, name, data, uid = event.pull("magData")
  9. if whitelist[name] == "1" then print("yes")
  10. if name == string.gsub(data,string.gsub(data, name, ""), "") then
  11. local lvl = string.gsub(data, name, "")
  12. if lvl == " 1" or lvl == " 2" or lvl == " 3" or lvl == " 4" or lvl == " 5" then
  13. door.toggle()
  14. pc.beep(800)
  15. pc.beep(880)
  16. os.sleep(1,5)
  17. pc.beep(880)
  18. pc.beep(800)
  19. door.toggle()
  20. else pc.beep(500, 1) end
  21. else pc.beep(500)
  22. os.sleep(0,25)
  23. pc.beep(500)end
  24. print(whitelist[name])
  25. else pc.beep(800)
  26. pc.beep(880)
  27. end
  28. end
Add Comment
Please, Sign In to add comment