1
2
3
4
5
6
7
8
9
10
11
12
function toTable(t,match)
	local cmd = {}
	if not match then
		match = "[^%s]+"
	else
		match = "[^"..match.."]+"
	end
	for word in string.gmatch(t, match) do
		table.insert(cmd, word)
	end
	return cmd
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function writetofile(path, mode, dl, ...)
	local file = io.open(path, mode)
	if file then
		for i,v in ipairs(arg) do
			file:write(v)
			if i<#arg then file:write(dl) end
		end
		file:close()
		return true
	else
		return false
	end
end
function readfromfile(path,dl)
	if not dl then dl = "\n" end
	local file = io.open(path,"r")
	if file then
		local tbl = toTable(file:read("*a"),dl)
		file:close()
		return tbl
	else
		return false
	end
end
Maybe you can guess what they do by yourself