Posted 02 September 2012 - 04:21 AM
hello, here is what i got
but when i do print(sNames) it comes out in this format
and i want to know how to print it in this format
if not fs.exists("/request.txt") then
local file = io.open("/request.txt", "w")
file:write("{ }")
file:close()
end
if not fs.exists("/.submitted.txt") then
local file = io.open("/.submitted.txt", "w")
file:write("{ }")
file:close()
end
local function getList()
local file = io.open("/request.txt", "r")
sNames = file:read()
file:close()
print(sNames)
requestList = textutils.unserialize(sNames)
print(requestList)
end
local function getSubmitted()
local file = io.open("/.submitted.txt", "r")
sSubmitted = file:read()
file:close()
tSubmitted = textutils.unserialize(sSubmitted)
end
local function addPlayer( sName )
getList()
getSubmitted()
table.insert(requestList, sName)
sNames = textutils.serialize(requestList)
local file = io.open("/request.txt", "w")
file:write(sNames)
file:close()
table.insert(tSubmitted, sName )
sSubmitted = textutils.serialize(tSubmitted)
local file = io.open("/.submitted.txt", "w")
file:write(sSubmitted)
file:close()
print ("Request Sent.")
sleep(1)
end
shell.run("clear")
print("Type Name")
sName = io.read()
addPlayer(sName)
shell.run("clear")
getList()
the code is from a program that i had someone make for me a while ago.but when i do print(sNames) it comes out in this format
{[1]="25",[2]="10",[3]="26",}
and i want to know how to print it in this format
25,10,26