Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --REFID Door with automatic card creation
- --configuration
- writer = peripheral.wrap("rfid writer_0");
- reader = peripheral.wrap("rfid reader_0");
- redside = "back";
- label = "GateKey";
- data = "This is the gate key";
- range = 5;
- print("Simple in-secure RFID door!");
- print("Key name: " .. label);
- print("Scanning Range " .. range);
- function main()
- while true do
- --If there is a card in the writer
- -- and it is blank
- -- and we are not currently writing
- if writer.isPresent() and (not writer.isCoded())
- --make a key
- then writer.encode(data,label);
- end
- redstone.setOutput(redside,readerloop());
- os.sleep(.5); --let the redstone settle
- os.queueEvent("marker_event"); --clear the event
- repeat
- e = os.pullEvent();
- until e == "marker_event";
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement