Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local computer = require("computer")
- local event = require("event")
- local inet = require("internet")
- while (1==1) do
- os.execute("cls")
- print("Please enter card!")
- local e = {event.pull("magData")}
- local cardname = ""
- local carddata = ""
- for k, v in pairs(e) do
- if (k == 3) then
- cardname = v
- end
- if (k == 4) then
- carddata = v
- end
- end
- local cardresponse = inet.request("http://secondary.infinity-servers.com:9000/card/get", tostring(carddata))
- local cardresponsebody = ""
- for chunk in cardresponse do
- cardresponsebody = cardresponsebody .. chunk
- end
- if (cardresponsebody == "True") then
- local cardnameresponse = inet.request("http://secondary.infinity-servers.com:9000/card/name", tostring(carddata))
- local cardnamebody = ""
- for chunk in cardnameresponse do
- cardnamebody = cardnamebody .. chunk
- end
- local response = inet.request("http://secondary.infinity-servers.com:9000/databaseget/" .. cardnamebody)
- local body = ""
- for chunk in response do
- body = body .. chunk
- end
- os.execute("cls")
- local Value = tonumber(body)
- if (Value > 0) then
- Value = -Value
- elseif (Value < 0) then
- Value = Value * -1
- end
- print("Card ending in " .. string.sub(carddata, -9, -7))
- print("Account Name: " .. cardnamebody)
- print("Current account balance: " .. tostring(Value))
- print("\nIf you have any questions or concerns about your balance please speak to a \ncustomer representative\n")
- print("Press Enter when done")
- io.read()
- else
- print("Card Declined")
- os.sleep(5)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement