Posted 26 March 2013 - 09:33 AM
Hello,
As many of you might know, developing programs on a server is a complete pain with the continuous editing of your Pastebins. I've found a pretty fair workaround that allows me to edit my programs in my favorite editor and have them automatically sync to my Computercraft computers and turtles.
Dropbox, a service that allows you to upload files to the "cloud" is a free service that comes with a desktop client that allows for automagic syncing of folders to your Dropbox account. You can create and edit files in the synced folders and have them uploaded almost instantaneously. I've written a few functions that can help you achieve a similar setup.
Using this, one can make a universal updater similarly to what I have done here http://pastebin.com/0DJP0AaL
Also you'll have to replace baseLink with the link to your personal Dropbox folder
This assumes that there is a script name "scripts" in your Dropbox folder with three lists like
Although all the code is pretty rough and I understand it can all be optimized or prettied up this is merely just an example to show you how easy this can be to setup
Anyways happy coding and if you want to try this and don't have a Dropbox account yet feel free to use my referral code http://db.tt/LzMYARpz it can help me get some more space:)
As many of you might know, developing programs on a server is a complete pain with the continuous editing of your Pastebins. I've found a pretty fair workaround that allows me to edit my programs in my favorite editor and have them automatically sync to my Computercraft computers and turtles.
Dropbox, a service that allows you to upload files to the "cloud" is a free service that comes with a desktop client that allows for automagic syncing of folders to your Dropbox account. You can create and edit files in the synced folders and have them uploaded almost instantaneously. I've written a few functions that can help you achieve a similar setup.
Spoiler
local baseLink = "http://dl.dropbox.com/u/<Your Dropbox public folder>/"
function updateScript(n)
local response = http.get(baseLink..n)
if response then
print("Huzzaaa we got the script")
else
print("You broke it.... shutting down")
error()
end
local script = response.readAll()
response.close()
local file = fs.open(n, "w")
file.write(script)
file.close()
print("script updated")
end
Using this, one can make a universal updater similarly to what I have done here http://pastebin.com/0DJP0AaL
Also you'll have to replace baseLink with the link to your personal Dropbox folder
This assumes that there is a script name "scripts" in your Dropbox folder with three lists like
Spoiler
-- Name of script in folder
s = {
"flaxfarmer",
"Exit"
}
-- Menu entry name
n = {
"Flax Farmer",
"Exit Updater"
}
-- Description
d = {
"Heh, it farms flax. DUH",
"Exit the updater"
}
Although all the code is pretty rough and I understand it can all be optimized or prettied up this is merely just an example to show you how easy this can be to setup
Anyways happy coding and if you want to try this and don't have a Dropbox account yet feel free to use my referral code http://db.tt/LzMYARpz it can help me get some more space:)