You can split the user input by creating your own split function. Here is one I made that splits where it finds a comma, you can modify it rather easily to split at the spaces.
function pattern(text,pattern,start)
return string.sub(text,string.find(text,pattern,start)) end
function split(string)
local sep = {}
local done = false
local count,prevVars,tmp = 0,0,0
string = string..",|"
while not done do
count = count + 1
tmp = pattern(string,"[^,]+",count+prevVars)
if tmp == "|" then done = true return sep end
prevVars = prevVars + tmp:len()
table.insert(sep,count,tmp)
end
return sep
end
I would modify it but I have to go to work now and wont be able to test it. Figured I would give you something to play with.
You will want to capture the output of the function in a table so..
local tOutput = {}
write ("Enter Input")
local input = read()
tOutput = split(input)