Untitled diff
0 removals
| Words removed | 0 |
| Total words | 90 |
| Words removed (%) | 0.00 |
23 lines
0 additions
| Words added | 0 |
| Total words | 90 |
| Words added (%) | 0.00 |
23 lines
local function GetMapsFromPath()
local function GetMapsFromPath()
print('>>> Getting Maps now!\n')
print('>>> Getting Maps now!\n')
Content = ''
Content = ''
local TMPFile = os.tmpname()
local TMPFile = os.tmpname()
if os.getenv('HOME') then
if os.getenv('HOME') then
local Result = os.execute('ls -a1 DemolitionDerbyMaps >' .. TMPFile)
local Result = os.execute('ls -a1 DemolitionDerbyMaps >' .. TMPFile)
else
else
local Result = os.execute('dir "DemolitionDerbyMaps" /b >' .. TMPFile)
local Result = os.execute('dir "DemolitionDerbyMaps" /b >' .. TMPFile)
end
end
local File = io.open(TMPFile, 'r')
local File = io.open(TMPFile, 'r')
Content = File:read('*a')
Content = File:read('*a')
File:close()
File:close()
os.remove(TMPFile)
os.remove(TMPFile)
local ContentSplitted = StringSplit(Content, '\n')
local ContentSplitted = StringSplit(Content, '\n')
for Index, Value in ipairs(ContentSplitted) do
for Index, Value in ipairs(ContentSplitted) do
if Value and Value ~= '.' and Value ~= '..' and Value ~= '' then
if Value and Value ~= '.' and Value ~= '..' and Value ~= '' then
local XMLStart, XMLFinish = Value:lower():find('xml')
local XMLStart, XMLFinish = Value:lower():find('xml')
if XMLStart and XMLFinish then
if XMLStart and XMLFinish then
table.insert(Maps, Value:sub(1, XMLFinish))
table.insert(Maps, Value:sub(1, XMLFinish))
end
end
end
end
end
end
end
end