64 posts
Location
Denmark
Posted 22 January 2013 - 10:19 PM
Im have made a email system that can send and receive emails
but my problem is to save them
it can only be saved on the computer atm im wondering if there is a way to save them in a file and then read the line the email is at?
because there is some problems on servers so when the server restart the programs do to and then i reload everything
any help would be appreciated =)
2088 posts
Location
South Africa
Posted 22 January 2013 - 10:47 PM
Check out the fs api on the computercraft wiki.
Then to get the email, you would have to read everyline and save it into a table. Then have the first part of the email be [email]
..Email
Here
[/emai]
So you know where the emil exaxtly is. On my phone so xan't explain much
1522 posts
Location
The Netherlands
Posted 23 January 2013 - 01:00 AM
Save the message to another file temporarily
1548 posts
Location
That dark shadow under your bed...
Posted 23 January 2013 - 01:35 AM
firstly how are you storing the emails at the moment? do you keep one at a time, use a table or have separate variables for each email?
53 posts
Location
Adelaide, Australia.
Posted 23 January 2013 - 02:00 AM
Use the FS API. FS stands for File System. With this API you can write to a file and read a file! Its very helpful. I use it for storing information all the time!
64 posts
Location
Denmark
Posted 23 January 2013 - 05:27 AM
i have a few questions for that how do i tell what line i wanna write on in the file?
1548 posts
Location
That dark shadow under your bed...
Posted 23 January 2013 - 05:52 AM
there are better ways of storing it in a file than using line numbers. please tell us how you are storing the information so we can come up with a solution fitted to your needs