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

[Small 'n' Easy] Quick Installer Creator

Started by jesusthekiller, 20 May 2013 - 01:40 PM
jesusthekiller #1
Posted 20 May 2013 - 03:40 PM
Quick Installer Creator, It might help someone :)/>

Pastebin: Zh4wmkeR

Code:
Spoiler

term.clear()
term.setCursorPos(1,1)

local name = ""
local code = ""
local names = {}
local codes = {}
local count = 0

while true do
	term.clear()
	term.setCursorPos(1,1)
	print("To stop adding, type STOP in the \"name\" field.")
	print("Already added "..count.." downloads.")
	
	write("File name: ")
	name = read()
	
	if name == "STOP" then break end
	
	write("Pastebin code: ")
	code = read()
	
	count = count + 1
	
	names[count] = name
	codes[count] = code
end

if count == 0 then
	print("Add at least one file!")
	return
end

term.clear()
term.setCursorPos(1,1)
write("Save as: ")
name = read()

local file = fs.open(name, "w")

for i = 1, count do
	file.writeLine([[shell.run("pastebin", "get", "]]..codes[i]..[[", "]]..names[i]..[[")]])
	file.flush()
end

file.close()

print("Done! Saved as "..name)

Also, on my website: http://www.jesusthekiller.com/?p=24
Zudo #2
Posted 22 May 2013 - 01:51 AM
Ill have a look at this, I might use it for my operating system. :D/>
EDIT: Just tried it, not very useful for me:(
Edited on 21 May 2013 - 11:52 PM