This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Watchful11's profile picture

Dropbox powered autocopy system

Started by Watchful11, 13 November 2012 - 05:31 AM
Watchful11 #1
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.
Espen #2
Posted 13 November 2012 - 08:03 AM
If you're playing SSP, then you can edit the files directly. They are in .minecraft/saves/YOURWORLD/computer
Every number-folder in there is the id of an ingame computer.

Just if you didn't know about the local method.
But for SMP the dropbox-method is nice, of course. :P/>/>
Edited on 13 November 2012 - 07:06 AM
Watchful11 #3
Posted 13 November 2012 - 08:19 AM
Yeah, I was aware of that.
Curious, I have spent some time looking, but you look like you've been around here awhile.
Are there other programs that do this same thing?
Espen #4
Posted 13 November 2012 - 10:12 AM
Off the top of my head I don't currently have any progams in my short-term-memory I could remember doing the same.
I've been registered a while, that's true, but I was a few months absent and have just recently resurfaced.
So I couldn't say for sure what has been made during that time and might still linger in the depths of the forums.
I'm afraid only some clever "advanced search" kung-fu will help there. :P/>/>
MaHuJa #5
Posted 16 November 2012 - 12:58 AM
A while back, I built a system with a similar purpose.

First part was
http://dl.dropbox.com/u/16193576/minecraft/archiver.lua
which was not made to run inside CC. I don't expect it to work in CC, I probably.

It takes several files, (usually containing lua code), and make a single new lua file that, when run, creates the files in question as they originally were. That new file could run on CC computers.

Then I could just run it through a program that entered that entire file into minecraft as if I typed it. Alternatively it would be a single pastebin upload rather than several.


I set out to have a solution that would work even on mc servers where http is locked down - which would be needed not to make them easy hacking proxies.