Jump to content




File Reading?


7 replies to this topic

#1 anidude98

  • New Members
  • 6 posts

Posted 08 February 2012 - 10:00 PM

I want to make a simple program that reads files inside a floppy.
It could be used for MANY things including money, locks, adventure maps, and a ton more!
But I haven't found any function that lets me read a file or set a variable as a line of a file. Anyone know what i could do?

I'm currently using labels for this with the disk api... Just to get a simple password type program going...

thanks for any help,
-anidude98

#2 Espen

    Curious Explorer

  • Members
  • 708 posts

Posted 09 February 2012 - 12:48 AM

Some starting pointers:
In ComputerCraft type: help fs

Read about I/O in LUA:
http://www.lua.org/pil/21.1.html

You can use ComputerCraft's fs.open() instead of LUA's io.open(), but with the latter you can do things like io.read("*a").
Don't know if you can do the latter in same other way with fs.open() as well though. Only know how it works with LUA.

K, hope this sets you on the right path. Have fun exploring! :P/>

#3 anidude98

  • New Members
  • 6 posts

Posted 09 February 2012 - 06:12 AM

View PostEspen, on 09 February 2012 - 12:48 AM, said:

Some starting pointers:
In ComputerCraft type: help fs

Read about I/O in LUA:
http://www.lua.org/pil/21.1.html

You can use ComputerCraft's fs.open() instead of LUA's io.open(), but with the latter you can do things like io.read("*a").
Don't know if you can do the latter in same other way with fs.open() as well though. Only know how it works with LUA.

K, hope this sets you on the right path. Have fun exploring! :P/>

Actually i found this out on irc, Now im going to learn about hiding information so it cant be read without being decoded. then i can make a real money system for a server... connect all the computers on my server to one computer holding all data for all users... basically a bank program...

#4 Selkitty

  • Members
  • 58 posts

Posted 09 February 2012 - 06:36 AM

theres a lock program designed that already uses this idea, you should look into it to see how the person reads the file
You can probably get some good ideas as to how to string it together
http://www.computerc...-misc-programs/

#5 anidude98

  • New Members
  • 6 posts

Posted 09 February 2012 - 06:30 PM

View PostSelkitty, on 09 February 2012 - 06:36 AM, said:

theres a lock program designed that already uses this idea, you should look into it to see how the person reads the file
You can probably get some good ideas as to how to string it together
http://www.computerc...-misc-programs/

are you refering to the reading files from a disk?
or the encoding the files?

#6 Selkitty

  • Members
  • 58 posts

Posted 10 February 2012 - 05:02 AM

View Postanidude98, on 09 February 2012 - 06:30 PM, said:

View PostSelkitty, on 09 February 2012 - 06:36 AM, said:

theres a lock program designed that already uses this idea, you should look into it to see how the person reads the file
You can probably get some good ideas as to how to string it together
http://www.computerc...-misc-programs/

are you refering to the reading files from a disk?
or the encoding the files?

this program reads the files on the disk looking for a passcode.

#7 jpzg

  • Members
  • 5 posts

Posted 31 May 2013 - 03:35 PM

View Postanidude98, on 09 February 2012 - 06:12 AM, said:

Actually i found this out on irc, Now im going to learn about hiding information so it cant be read without being decoded. then i can make a real money system for a server... connect all the computers on my server to one computer holding all data for all users... basically a bank program...
For encrypting information:
http://www.computerc...__fromsearch__1
Might be useful. Or:
http://www.computerc...__fromsearch__1
Which has AES and some others, as well as a Secure Rednet Tunnel api that might be good for sending data over rednet.

#8 W00dyR

  • Members
  • 135 posts

Posted 31 May 2013 - 03:49 PM

View Postjpzg, on 31 May 2013 - 03:35 PM, said:

Snap

Please look at the date of when this was posted. This is well over a year old ;)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users