Posted 15 March 2016 - 09:02 PM
I'm making an ATM program, the server send this info through rednet:
And for some reason, the part that is suppost to show that isn't working..
Thanks!
{"<Dylan Washington>","<#56>","<345$>"}
And for some reason, the part that is suppost to show that isn't working..
-- ATM for CC-Oyster by hiperbolt (X3ME/X3ME03) and ry00000
-- Var
reader = peripheral.wrap("top")
modem = "back"
-- Func
local function cprint(text)
local x,y = term.getSize()
local x2,y2 = term.getCursorPos()
term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
write(text)
end
local function clear()
term.clear()
term.setCursorPos(1,1)
end
local function readmag()
while true do
reader.setInsertCardLight(true)
local event,arg1,arg2,arg3 = os.pullEvent()
if event == "mag_swipe" then
reader.setInsertCardLight(false)
break
end
end
end
local function rednetmessage()
while true do
rednet.open(modem)
local event,arg1,arg2,arg3 = os.pullEvent()
if event == "rednet_message" then
if arg1 == "2" then
rednet.close(modem)
arg2 = info
break
end
end
end
end
-- Init
clear()
cprint("Please enter your CC-Oyster Card")
readmag()
clear()
rednet.open(modem)
rednet.send(2,"hi")
rednet.close(modem)
rednetmessage()
clear()
write("Name:")
cprint(info[1])
write("\n")
write("Card Number:")
cprint(info[2])
write("\n")
write("Account Ballance:")
cprint(info[3])
write("\n")
write("\n")
write("\n")
write("\n")
write("\n")
cprint("Press (q) to quit:")
input = read()
if input == "q" then
error()
end
Thanks!