Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Updater and downloader for Mat Programming Co ComputerCraft/LUA Software")
- print("Go to matprogramming.com/programs.php to see more programs")
- print(fs.getFreeSpace("/").."/"..fs.getSize("/").." bytes")
- print()
- function mkprg(id, pbcode, fname, name)
- prg = {""}
- prg[1] = id
- prg[2] = pbcode
- prg[3] = fname
- prg[4] = name
- return prg
- end
- ml2 = mkprg("1", "B7DMEc28", "ml2", "MotherLoad2")
- ht = mkprg("2", "NPAqsiCy", "httptest", "HTTP Tester")
- bs = mkprg("3", "tNp9mbrW", "boxs", "Box Shooter")
- ud = mkprg("4", "UrHwcU7L", "updater", "Updater")
- ms = mkprg("5", "HEtXTdeT", "ms", "Monitor Sign Thing")
- mct = mkprg("6", "4NDJSTu9", "mct", "Mine Chem Turtle")
- tgc = mkprg("7", "h6njt4cs", "tgc", "Terminal Glasses Console")
- iro = mkprg("8", "R6z2D51E", "netrouter", "Internet Router")
- ira = mkprg("9", "WyXRR9Fn", "netradio", "Internet Radio")
- icl = mkprg("10","7bTMwiV7", "netclient", "Internet Client")
- prog = {""}
- nop = 10
- prog[1] = ml2
- prog[2] = ht
- prog[3] = bs
- prog[4] = ud
- prog[5] = ms
- prog[6] = mct
- prog[7] = tgc
- prog[8] = iro
- prog[9] = ira
- prog[10]= icl
- fs.makeDir("mpc")
- for k, v in pairs(prog) do
- shell.run("rm mpc/"..v[3])
- shell.run("pastebin get "..v[2].." "..v[3])
- shell.run("mv "..v[3].." mpc/"..v[3])
- end
- print()
- print("Availible programs:")
- for k, v in pairs(prog) do
- print(v[1]..": "..v[4].." ("..v[2]..")")
- end
- write("Program number: ")
- a = read()
- if a == "exit" or a == "quit" or a == "console" then
- quit = true
- elseif a == "1" then
- shell.run("mpc/ml2")
- elseif a == "2" then
- shell.run("mpc/httptest")
- elseif a == "3" then
- shell.run("mpc/boxs")
- elseif a == "4" then
- shell.run("mpc/updater")
- elseif a == "5" then
- shell.run("mpc/ms")
- elseif a == "6" then
- shell.run("mpc/mct")
- elseif a == "7" then
- shell.run("mpc/tgc")
- elseif a == "8" then
- print("The internet router has to be used on a dedicated computer, so this computer has been set as the startup file. The previous startup file is called oldstartup")
- shell.run("cp startup oldstartup")
- shell.run("rm startup")
- shell.run("cp mpc/netrouter startup")
- shell.run("mpc/netrouter")
- elseif a == "9" then
- shell.run("mpc/netradio")
- elseif a == "10" then
- shell.run("mpc/netclient")
- else
- print("Invalid number")
- end
Advertisement
Add Comment
Please, Sign In to add comment