Posted 13 November 2012 - 06:31 AM
This ComputerCraft program downloads any number of files from dropbox and saves them.
I made this program because I hated using the in game editor, and didn't want to go to the trouble of pastebining and downloading a file each time I wanted to make a change.
First, you will need a dropbox account and dropbox set up on your computer. Google dropbox to figure out how to do this.
The program code is here. http://pastebin.com/3KDyEKJe
In game you can use "pastebin get 3KDyEKJe dropbox" to get the code on your computer.
Put the code you are writing somewhere in the public folder in your dropbox folder. Right click the file go to the dropbox menu. Click copy public link.
Create a file called "dropboxfiles" and put the public url you got on one line.
Repeat putting each url on one line for each file you want to copy.
The dropbox program will download every file found at the url's in "dropboxfiles".
The files will be named based on the last part of the url. This is typically the filename.
On the first line of each program you can put a comment like so.
"–name myprogram"
This will instead name the program "myprogram"
You can also put another comment on the next line with the version.
"–version 1.2"
This is just a method to confirm the file updated properly.
You can pass in "true" to suppress the print statements. This is so dropbox does not spam your screen every time you use it.
You can then edit the files on your computer. When you save them, dropbox will automatically upload them.
Then just run the dropbox program again to redownload them.
I made this program because I hated using the in game editor, and didn't want to go to the trouble of pastebining and downloading a file each time I wanted to make a change.
First, you will need a dropbox account and dropbox set up on your computer. Google dropbox to figure out how to do this.
The program code is here. http://pastebin.com/3KDyEKJe
In game you can use "pastebin get 3KDyEKJe dropbox" to get the code on your computer.
Put the code you are writing somewhere in the public folder in your dropbox folder. Right click the file go to the dropbox menu. Click copy public link.
Create a file called "dropboxfiles" and put the public url you got on one line.
Repeat putting each url on one line for each file you want to copy.
The dropbox program will download every file found at the url's in "dropboxfiles".
The files will be named based on the last part of the url. This is typically the filename.
On the first line of each program you can put a comment like so.
"–name myprogram"
This will instead name the program "myprogram"
You can also put another comment on the next line with the version.
"–version 1.2"
This is just a method to confirm the file updated properly.
You can pass in "true" to suppress the print statements. This is so dropbox does not spam your screen every time you use it.
You can then edit the files on your computer. When you save them, dropbox will automatically upload them.
Then just run the dropbox program again to redownload them.