Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local writer
- if component.isAvailable("os_cardwriter") then
- writer = component.os_cardwriter
- elseif component.isAvailable("OSCardWriter") then
- writer = component.OSCardWriter
- else
- print("Подключите CardWriter к компьтеру")
- os.exit()
- end
- local success
- local args = table.pack(...)
- if #args < 3 then
- print("Data - Данные карты для открытия")
- print("Name - Имя карты")
- print("isLock - можно_перезаписать_или_нет(true/false)")
- print("Использование: RfidWrite Data Name isLock")
- os.exit()
- end
- local Data = args[1]
- local Name = args[2]
- local isLock = args[3]
- if isLock == "true" then
- success = writer.write(Data, Name, true)
- elseif isLock == "false" then
- success = writer.write(Data, Name, false)
- else
- print("isLock не true и не false")
- os.exit()
- end
- if success then
- print("Данные успешно записаны")
- else
- print("Карта не вставлена")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement