5
I have a code rescue system, in case I would put something like this in a text file:
HFGD65,{2454,2454},1,1
would be:
CODE to redeem -- string {items} -- items within the table in numbers points -- numbers days -- number
Then I open it up: for example
local file = 'data/logs/codes.txt'
local f = io.open(file, "rb")
for k, v in pairs(f) do
-- retorna aquela linha
end
and I use
local v = ":JH2F36;:{{2173,1},{2160,2}};:0;:1;"
local var = v:gsub(':', ''):explode(';')
to be able to separate, but then I have to use the txt file like this:
:JH2F36;:{{2173,1},{2160,2}};:0;:1;
there’s some different way to call that line?
the code would have to return string and the most in numbers?
if I sort by "," when you check the table cuts in half and ends there.
wanted to simplify and find a way to put the code for example:
HB7S5S;{2173,2160}:1:1
how are 4 items there / separate by ":"
the first would return string(the code) -- HB7S5S
and the others(3) would return:
numbers:
(table)
1
1
Have you considered using regular expressions?
– Woss
I don’t know how to use it, I don’t know if there’s a way to explain to me how to do it.
– Lua Team 91