Advertisement
Marlingaming

Basic Keycard system

Sep 1st, 2021
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. passkey = "PASSWORD"
  2. doorside = “SIDE”
  3. cardslot = “SIDE”
  4. print(“Awaiting Keycard Input, please insert keycard into correct slot to continue”)
  5. while true do
  6. if disk.isPresent(cardslot) then
  7. h = fs.open("disk/passcode", "r")
  8. if h.readAll() == passkey then
  9. print("Accepted")
  10. rs.setOutput(doorside,1)
  11. else
  12. print("Denied")
  13. disk.eject(cardslot)
  14. end
  15. end
  16. end
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement