local lines = text:split("\n")
for _, line in pairs(lines) do
local current_materials, max_materials = line:match("%[(%d+) / (%d+)%]")
local bank = line:match("%$(%d+)")
end
function string:split(sep, reallen)
local result = {}
local len = reallen or #sep
local substring_start_index = 1
for i = 1, #self do
---@diagnostic disable-next-line: param-type-mismatch
if self:sub(i, i + len):match('^' .. sep) then
---@diagnostic disable-next-line: param-type-mismatch
local substr = self:sub(substring_start_index, i - 1)
if #substr > 0 then
table.insert(result, substr)
end
substring_start_index = i + len
end
end
---@diagnostic disable-next-line: param-type-mismatch
local last_substr = self:sub(substring_start_index, #self)
if #last_substr > 0 then
table.insert(result, last_substr)
end
return result
end