From 6c67a7f2ad3731bb44b9705ce2c4e5036c00434d Mon Sep 17 00:00:00 2001 From: minecartchris Date: Sun, 1 Feb 2026 10:46:53 -0600 Subject: [PATCH] One of the rcc admins sent me the code thx alex --- prog2/CardBuilder.lua | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/prog2/CardBuilder.lua b/prog2/CardBuilder.lua index 655f66b..82c85c9 100644 --- a/prog2/CardBuilder.lua +++ b/prog2/CardBuilder.lua @@ -1 +1,35 @@ ---dima sends me code it goes here \ No newline at end of file +--[[ + Casino ATM and Card Creator + Copyright Herr Katze and minecartchris + License: MIT +]] +local nfc = peripheral.find("nfc_reader") +local modem = peripheral.find("modem", function(n,w) return not w.isWireless() end) + +rednet.open(peripheral.getName(modem)) + +local function createCard(cardId) + local timer = os.startTimer(60) + local done = false + nfc.write("casinoAccount_"..cardId, "Casino Card") + while not done do + local ev, id = os.pullEvent() + print(ev) + if ev == "timer" and id == timer then + nfc.cancelWrite() + rednet.broadcast({type="card_timeout"}, "casinoATMC2S") + end + if ev == "nfc_write" then done = true end + end + rednet.broadcast({type="card_created"}, "casinoATMC2S") +end + +local function rednetListener() + rednet.host("nfc_atm_write",tostring(os.getComputerID())) + while true do + local id, message =rednet.receive("nfc_atm_write") + createCard(message) + end +end + +rednetListener()