This is a developer release so if you're a server owner and not a scripter, you won't need this file.
This is a script all about making File IO easier. Nowadays reading and writing to files is too complicated making newbies (noobs) avoid it in their scripts. With this patch, they all become clearer. You have 2 'commands' (functions) you can use:
readfile(filepath)
savefile(text, filepath)
These are making the entire IO System much easier. Let me give you an example.
File Reading
Before:
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
if(io.open("test.txt")~=nil) then for p in io.lines("test.txt") do l = p if(l~=nil)then --You got it end end end
1
l = readfile("test.txt") --You got it!
File Writting:
Before:
1
2
3
2
3
io.output(io.open("test.txt", "w+")) io.write("HELLO WORLD") io.close()
1
savefile("HELLO WORLD", "test.lua")
Well these are for newbies as I said and they do not have advanced functions such as modes of write etc. so they wont be complicated. Writting is w+.
To use these functions, place easyio.lua to your scripts folder and use the following code to the TOP of the script that runs FIRST!
1
dofile("sys/lua/easyio.lua")--ByDaKnOb :P
I renamed this to light since I made a pro version that can be found here!
edited 3×, last 23.10.11 08:20:03 pm
Approved by Seekay
Download
522 b, 505 Downloads