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

Program Installer

Started by PointlessSpike, 01 August 2015 - 12:58 PM
PointlessSpike #1
Posted 01 August 2015 - 02:58 PM
I've just completed a program that will allow you to download from the internet (assuming HTTP is enabled, of course) a file and then save it. This is meant to be used for programs, but could really be used for anything. It's really simple, and meant so that you only have to write a program once (could even be written on a real world computer and put online).

Obviously, you won't be able to modify the programs on the site this is downloading from, but you can use my ones if you like, although I haven't done anything terribly impressive. You'd probably want your own, and there are sites that do hosting like this for free. You literally just put the file on a server (I've tended to just upload my CC files straight from where they're stored in my save files).

Simple as could be, but a big time saver if you use a lot of computers and programs.


local fileName = ...
local getResponse = http.get("http://www.ccprograms.netne.net/" .. fileName)
local file = fs.open(fileName, "w")
file.write(getResponse.readAll())
file.close()
getResponse.close()
MKlegoman357 #2
Posted 01 August 2015 - 05:23 PM
I don't know if you are aware of this, but ComputerCraft has built-in support for pastebin.com, through the program 'pastebin'. Anyway, don't be shy to post such programs, everyone has to start somewhere!
AoD #3
Posted 01 August 2015 - 10:37 PM
I like this program its a good idea for a Disk Installer, I'm gonna use it for my Space Development Project I want to Build :)/>, it may be a good Idea to put it on pastebin to allow users to get it into minecraft that way we dont have to create the file and paste the code to run it
Edited on 02 August 2015 - 02:31 PM
flaghacker #4
Posted 02 August 2015 - 09:04 AM
I like this program its a good idea for a Disk Installer, I'm gonna use it for my Space Development Project I want to Build :)/>/>, Pointless it may be a good Idea to put it on pastebin to allow users to get it into minecraft that way we dont have to create the file and paste the code to run it

Or you could post your own code on pastebin and download it using the pastebin program…
AoD #5
Posted 02 August 2015 - 04:28 PM
I dont remember typing half of that post lol