Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rfid = peripheral.wrap("back")
- other = peripheral.wrap("mag card reader_0")
- p = peripheral.wrap("bottom")
- data = "open_later"
- function on()
- rfid.setInsertCardLight(true)
- other.setInsertCardLight(true)
- end
- function off()
- rfid.setInsertCardLight(false)
- other.setInsertCardLight(false)
- end
- function hash(text)
- local a = p.hash("SHA512", text)
- return a
- end
- while true do
- rs.setOutput("left", true)
- event,arg1,arg2,arg3 = os.pullEvent()
- if event == "mag_swipe" then
- if arg1 == data then
- on()
- sleep(0.5)
- rs.setOutput("bottom", true)
- sleep(0.2)
- rs.setOutput("left", false)
- sleep(1.5)
- rs.setOutput("left", true)
- sleep(0.2)
- rs.setOutput("bottom", false)
- sleep(1)
- end
- end
- sleep(0.5)
- off()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement