Posted 14 September 2013 - 12:05 AM
I plan on using rednet to pass messages between computers to tell them what items are being transported. I plan to do this by saving it as a file so that it will be accessible after the world is closed and reloaded. When the table is updated (either by a new item being received or an item currently on the list being sent off) I will have to edit the table. I'm currently a little confused on how the Fs api works to do this.
1. Do I need to use a specific path as the beginning part before I add my directories/files
2. If I wish to have all files in a specific directory to keep it manageable, how does that change the path
Ex. If I had a directory called "Item Transport Lists" with lets say two files in it called, "com1List" and "com2List"
3. I'm am confused on how to edit a table after using the fs.open() function, although I am assuming I need to use "a" as the mode.
Thank you for any help provided. In the table I intend to have strings that will have info containing the item's id, id of computer the item is coming from, id of the next computer to send to, id of final computer and the number of items being transported.
So if I want to send 10 dirt from computer 0 to computer 5 passing from computer 0 to 1 to 2 to 3 to 4 to 5. Computer 0 will send a message to computer 1 saying "3;0;2;5;10", at which point computer 1 will update it's list so that it knows to wait for the 10 dirt and when it gets it to send it on.
I'm hoping this explanation will help anyone who reads this to understand what I'm attempting to do, if it has any relevance to the questions I asked. Once again, thank you for the help.
1. Do I need to use a specific path as the beginning part before I add my directories/files
2. If I wish to have all files in a specific directory to keep it manageable, how does that change the path
Ex. If I had a directory called "Item Transport Lists" with lets say two files in it called, "com1List" and "com2List"
3. I'm am confused on how to edit a table after using the fs.open() function, although I am assuming I need to use "a" as the mode.
Thank you for any help provided. In the table I intend to have strings that will have info containing the item's id, id of computer the item is coming from, id of the next computer to send to, id of final computer and the number of items being transported.
So if I want to send 10 dirt from computer 0 to computer 5 passing from computer 0 to 1 to 2 to 3 to 4 to 5. Computer 0 will send a message to computer 1 saying "3;0;2;5;10", at which point computer 1 will update it's list so that it knows to wait for the 10 dirt and when it gets it to send it on.
I'm hoping this explanation will help anyone who reads this to understand what I'm attempting to do, if it has any relevance to the questions I asked. Once again, thank you for the help.