Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- BANCOMAT V2 aggiornato 2025 copyright lego11
- local tabr = {}
- function clear()
- term.clear()
- term.setCursorPos(1, 1)
- end
- function pinErrato()
- clear()
- print("Errore di verifica del PIN")
- print("")
- print("Premere un tasto per uscire")
- os.pullEvent("key")
- os.reboot()
- end
- function cartaNonValida()
- clear()
- print("Carta non valida o corrotta.")
- print("")
- print("Premere un tasto per uscire")
- os.pullEvent("key")
- os.reboot()
- end
- function cartaVuota()
- clear()
- print("Carta smagnetizzata o vuota.")
- print("")
- print("Premere un tasto per uscire")
- os.pullEvent("key")
- os.reboot()
- end
- function cartaNoSIB()
- clear()
- print("Carta non in sistema interbancario.")
- print("")
- print("Premere un tasto per uscire")
- os.pullEvent("key")
- os.reboot()
- end
- function sibFail()
- clear()
- print("Errore connessione sistema interbancario")
- print("")
- print("Premere un tasto per uscire")
- os.pullEvent("key")
- os.reboot()
- end
- function cartaVecchia()
- clear()
- print("CARTA NON SICURA. Convertire la carta presso lo sportello situato in:\n")
- print("\n Banco di Nebraska - P.zza Affari 3, New Radeon")
- print("")
- print("Premere un tasto per uscire")
- os.pullEvent("key")
- os.reboot()
- end
- function preleva(prelievo, uuid)
- clear()
- erogati = 0
- sibRaw = http.get("http://luanet.rgbcraft.com/servlets/carte_debito.php?richiesta=addebito&valore=" .. prelievo ..
- "&uuid=" .. uuid).readAll()
- sib = textutils.unserialize(sibRaw)
- if type(sib) ~= "table" then
- print("\n\n\nImpossibile comunicare con il server interbancario")
- sleep(5)
- os.reboot()
- end
- if sib.stato == "DI" then
- print("Disponibilità insufficiente")
- sleep(5)
- elseif sib.stato ~= "OK" then
- print(
- "\n\n\nLa carta non risulta nel sistema interbancario, potrebbe essere stata disabilitata per uso fraudolento")
- sleep(5)
- os.reboot()
- else
- print("Ritirare il denaro")
- print("")
- for i = prelievo, 1, -64 do
- redstone.setOutput("bottom", true)
- sleep(0.25)
- erogati = erogati + 64
- print("Erogati " .. erogati .. " IC")
- redstone.setOutput("bottom", false)
- end
- print("")
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- clear()
- print("Prelievo effettuato\n")
- print("Tra poco sarà possibile eseguire un'altra operazione.")
- term.setTextColor(colors.white)
- shell.run("pastebin get v84Q9wC1 startup2") -- Inserire paste di nPay
- if fs.exists("startup2") then
- shell.run("rm startup")
- shell.run("mv startup2 startup")
- end
- end
- end
- m = peripheral.wrap("right")
- lbl = "BN Credit"
- clear()
- print("Banco di NEBRASKA - Sistema BANCOMAT(R)")
- print("")
- print("Inserire la carta")
- m.setInsertCardLight(true)
- za, rawcarta = os.pullEvent("mag_swipe")
- m.setInsertCardLight(false)
- if rawcarta == nil then
- cartaVuota()
- end
- tab = textutils.unserialize(rawcarta)
- if type(tab) ~= "table" then
- cartaNonValida()
- end
- if tab.t == "cc" then
- cartaVecchia()
- end
- if tab.t ~= "cd" then
- cartaNonValida()
- end
- if tab.e ~= "BN" then
- cartaNonValida()
- end
- sibRaw = http.get("http://luanet.rgbcraft.com/servlets/carte_debito.php?richiesta=verifica&uuid=" .. tab.v).readAll()
- sib = textutils.unserialize(sibRaw)
- if type(sib) ~= "table" then
- sibFail()
- end
- if sib.stato ~= "OK" then
- cartaNoSIB()
- end
- credito = tonumber(sib.saldo)
- carta = string.sub(tostring(tab.v), -4)
- clear()
- while true do
- print("La carta *" .. carta .. " ha una disponibilità di " .. credito .. " IC.")
- print("")
- print("Per favore scegliere un'opzione utilizzando i tasti numerici e confermare con ENTER:")
- print("")
- print("[1] Preleva 64 IC")
- print("[2] Preleva 128 IC")
- print("[3] Preleva 256 IC")
- print("[4] Preleva 512 IC")
- print("[5] Preleva 4096 IC")
- print("[6] Esci senza prelevare")
- num = tonumber(read())
- if num == 1 then
- preleva(64, tab.v)
- break
- elseif num == 2 then
- preleva(128, tab.v)
- break
- elseif num == 3 then
- preleva(256, tab.v)
- break
- elseif num == 4 then
- preleva(512, tab.v)
- break
- elseif num == 5 then
- preleva(4096, tab.v)
- break
- elseif num == 6 then
- clear()
- break
- end
- end
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- clear()
- print("Tra poco sarà possibile eseguire un'altra operazione.")
- term.setTextColor(colors.white)
- shell.run("pastebin get v84Q9wC1 startup2") -- Inserire paste di nPay
- if fs.exists("startup2") then
- shell.run("rm startup")
- shell.run("mv startup2 startup")
- end
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment