Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local writer = require("component").os_cardwriter
- local component = require("component")
- local term = require("term")
- local event = require("event")
- local Data = component.data
- local m = component.modem
- local PortO = 123
- local ServerA = "158e29fe-4f83-42b5-8837-1bddad8fadc4"
- local function myFunction(eventName, address, playerName, cardData,
- cardUniqueId, isCardLocked, side)
- print(
- "player" .. playerName .. " used card " .. cardUniqueId .. ", data: " ..
- cardData)
- term.clear()
- os.exit()
- end
- term.clear()
- io.write("The name of the card: ")
- Name = io.read()
- io.write("Enter a Password for the card: ")
- UnPass = io.read()
- Pass = Data.encode64(UnPass)
- writer.write(Pass, Name, false)
- m.open(PortO)
- m.send(ServerA, PortO, Name, Pass)
- term.clear()
- io.write("Take the card and swipe it to activate it. \n")
- event.listen("magData", myFunction)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement