Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- if #tArgs ~= 1 then
- print( "Usage: rfid_door <redstone_side>" )
- return
- end
- if (tArgs[1] ~= "front") and (tArgs[1] ~= "back") and (tArgs[1] ~= "top") and (tArgs[1] ~= "bottom") and (tArgs[1] ~= "left") and (tArgs[1] ~= "right") then
- print( "Please specify a valid side: front, back, top, bottom, left or right" )
- return
- end
- local redstone_side = tArgs[1]
- local rfid_rw = peripheral.find("rfid_reader_writer")
- while true do
- local rfid = rfid_rw.search()
- if rfid ~= nil then
- print(rfid)
- if not redstone.getOutput(redstone_side) then
- redstone.setOutput(redstone_side, true)
- end
- else
- redstone.setOutput(redstone_side, false)
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment