function removeLines(file, linesToRemove)
if doesFileExist(file) then
local lines = {}
for line in io.lines(file) do table.insert(lines, line) end
for k, v in ipairs(linesToRemove) do
if lines[v] ~= nil then
lines[v] = '**removedline**' -- через nil нихуя не работало, через table.remove удаляло не ту строку
end
end
local result = {}
for k, v in ipairs(lines) do
if v ~= '**removedline**' then table.insert(result, v) end
end
local handle = io.open(file, 'w')
handle:write(table.concat(result, '\n'))
handle:close()
end
end