Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program = { -- program name here
- [1] = "program1",
- [2] = "program2"
- }
- paste = { --pastebin code here
- [1] = "code1",
- [2] = "code2"
- }
- update = 1
- --1 = true
- --0 = false
- runProg = "..." --put the name of the program u want to run here
- if not #program == #paste then
- if #program > #paste then
- error("not enough pastebin codes")
- else
- error("more pastebin codes than program names")
- end
- end
- for x = 1, #programs do
- if update == 1 or update = false then
- term.setCursorPos(1,1)
- term.setTextColor(colors.white)
- term.write("Update mode is set to ")
- term.setTextColor(colors.lime)
- term.write("Enabled")
- term.setCursorPos(1,2)
- term.setTextColor(colors.blue)
- print("Updating "..program[x].." ...")
- sleep(.5)
- print(" ")
- term.setTextColor(colors.red)
- print("Deleting "..program[x])
- shell.run('delete'..program[x])
- print(" ")
- term.setTextColor(colors.lime)
- print("getting "..paste[x].." as "..program[x])
- shell.run('pastebin get '..paste[x]..' '..program[x])
- sleep(.5)
- else
- term.setCursorPos(1,1)
- term.setTextColor(colors.white)
- term.write("Update mode is ")
- term.setTextColor(colors.red)
- term.write(" Disabled")
- sleep(1)
- term.setCursorPos(1,2)
- term.setTextColor(colors.lightBlue)
- print("update will not commence")
- print("edit the program and change update to 1")
- print("if you would like to change this")
- print(" ")
- sleep(2)
- print("starting up "..program[x])
- sleep(.5)
- shell.run(program[x])
- end
- end
- shell.run(runProg)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement