Description
This is the component provided by the Magnetic Card Reader block.
Component name: os_magreader
.
This is the component provided by the Magnetic Card Reader block.
Component name: os_magreader
.
setEventName(eventName:string)
Sets the event name returned when you click it with a card, default is magData
swipeIndicator(enableLights:boolean)
Enables/disables automatic lights on the magreader. If true, it will function as it normally does when clicked with a card. If false, you have to call setLightState to change the lights on the magreader. default is true.
setLightState(lightState:number)
Sets the light state of the magreader. Takes in a number from 0 to 7. default is 0
magData(address: string, playerName: string, cardData: string, cardUniqueId : string, isCardLocked : boolean, side : number)
This signal is queued by the Magnetic Card reader when it is clicked with a Magnetic Cards.
address
is the address of the reader
playerName
is name of the player that used the card
cardData
is the data stored on the card
cardUniqueId
is the unique card id
isCardLocked
is the writelock state of card
side
is the block side of card reader which the player used the card on
-- https://github.com/PC-Logix/OpenSecurity/wiki/BiometricReader
event = require("event") -- require event
reader = require("component").os_biometric -- require the biometric reader
function onRead(address, reader_uuid, player_uuid) -- function to call once the reader is used.
print(player_uuid .. " entered!") -- print the UUID of the player that was scanned.
end
event.listen("bioReader", onRead) -- listen to the bioReader event