Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local com =require("component")
- local event =require("event")
- local reader = com.os_magreader
- local door =com.os_door
- local pc = require("computer")
- local whitelist = {marko_rus ="5d2719f6-1b8a-40a7-8648-514e8c4f3957",
- chokopypsik ="1"}
- while true do
- _,_, name, data, uid = event.pull("magData")
- if whitelist[name] == uid then print("yes")
- if name == string.gsub(data,string.gsub(data, name, ""), "") then
- local lvl = string.gsub(data, name, "")
- if lvl == " 1" or lvl == " 2" or lvl == " 3" or lvl == " 4" or lvl == " 5" then
- door.toggle()
- pc.beep(800)
- pc.beep(880)
- os.sleep(1,5)
- pc.beep(880)
- pc.beep(800)
- door.toggle()
- else pc.beep(500, 1) end
- else pc.beep(500)
- os.sleep(0,25)
- pc.beep(500)end
- print(whitelist[name])
- else pc.beep(800)
- pc.beep(880)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement