Files

> > CS2D > Lua Scripts > EasyIO [Light]
Files overviewCS2D overviewLua Scripts overview

English EasyIO [Light] >

13 comments522 b, 469 Downloads

old EasyIO [Light]

sixpack
User Off Offline

Hello Unreal Software scripters.
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
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
After:
1
l = readfile("test.txt") --You got it!

File Writting:
Before:
1
2
3
io.output(io.open("test.txt", "w+"))
io.write("HELLO WORLD")
io.close()
After:
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 Download

522 b, 469 Downloads

Comments

13 comments
To the start Previous 1 Next To the start

Log in!

You need to log in to be able to write comments!Log in

old Suggestions

sixpack
User Off Offline

Accepting suggestions for the Pro version here. Factis you're done!

old

Devil-Thanh
GAME BANNED Off Offline

thanks. i'm a scripter but i'm not good at making save/load systems
5*
I like it!

old Update

sixpack
User Off Offline

Thank you all for the 5*'s
I will work on a pro version soon enough as I am available.

old

HeavyWings
User Off Offline

oh thanks! i'm more of a map maker (but thier not very good) so i don't think i'll be using this but i dun wanna break 5/5 rating
I like it!

old

tom282f3
User Off Offline

I am a beginner so I need this! Thanks!
I like it!

old

DannyDeth
User Off Offline

@Epik Max:
IO stands for Input/Output. It varies from printing stuff to a console screen to writing and reading from files.

old Replies

sixpack
User Off Offline

@user Infinite Rain: Well dear Factis, I said this is for beginners, and I will make a pro edition if required. This just supports simple functions.
@user HeavyWings: IO is a system that helps lua write and read files. (Very noob explanation)
Imagine this: You tell IO to create a file in cs2d folder with this name and data, and tomorrow, you ask IO to tell you what is the content of the file.

old

Infinite Rain
Reviewer Off Offline

Lol you need add functions:
readfileline(line)
addfileline(text)
editfileline(line, text)
etc
Will be nicer

old

HeavyWings
User Off Offline

what is io? then maybe I'll rate
I like it!

old

DannyDeth
User Off Offline

Useful, but not exactly that much work put in. No rating because I'm tired and might click the wrong thing. lol.

old

Jynxxx
User Off Offline

wow this is really good it will make scripts shorter and reduce time of making it
I like it!

old Suggestion

sixpack
User Off Offline

Maybe I should name this to EasyIO Lite and make a Pro edition with more complicated stuff. No need for now since all pro's use the normal, long method.

old

Bowlinghead
User Off Offline

Looks. Very nice.
I will use them if I work with io. functions next time!
5 - Awesome!
I like it!
To the start Previous 1 Next To the start