Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local internet = require("internet")--Подключаем internet
- local io = require("io")
- local filesystem = require("filesystem")
- local computer = require("computer")
- function split(s, delimiter) --Разделитель
- result = {};
- for match in (s..delimiter):gmatch("(.-)"..delimiter) do
- table.insert(result, match);
- end
- return result;
- end
- function download(url, directory)
- filesystem.makeDirectory(directory)
- local filesStr = "" --Фалы
- for i in internet.request(url) do
- filesStr = i --Получаем ссылки на фалы
- end
- local files = split(filesStr,";") --Получаем массив
- for i=1,#files do
- local value = ""
- for i in internet.request(files[i]) do
- value = value..i
- end
- local is, di = string.find(files[i], "/[^/]*$")
- local filename = string.sub(files[i], is + 1)
- local file = io.open(directory.."/"..filename,"w")
- print(directory.."/"..filename) --Строчку использовать по жиланию
- file:write(value)
- file:close()
- end
- end
- print("Install RedOS 1.1? [Y/n]")
- local ans = io.read()
- if (ans == "Y") or (ans == "y") then
- download("https://raw.githubusercontent.com/LexaDriver/RedOS_1.1/master/Downloads/list_1.txt","/etc")
- download("https://raw.githubusercontent.com/LexaDriver/RedOS_1.1/master/Downloads/list_2.txt","/home")
- download("https://raw.githubusercontent.com/LexaDriver/RedOS_1.1/master/Downloads/list_3.txt","/lib/core")
- download("https://raw.githubusercontent.com/LexaDriver/RedOS_1.1/master/Downloads/list_4.txt","/lib")
- download("https://raw.githubusercontent.com/LexaDriver/RedOS_1.1/master/Downloads/list_5.txt","/RedOS")
- download("https://raw.githubusercontent.com/LexaDriver/RedOS_1.1/master/Downloads/list_1.txt","/ISO/etc")
- download("https://raw.githubusercontent.com/LexaDriver/RedOS_1.1/master/Downloads/list_2.txt","/ISO/home")
- download("https://raw.githubusercontent.com/LexaDriver/RedOS_1.1/master/Downloads/list_3.txt","/ISO/lib/core")
- download("https://raw.githubusercontent.com/LexaDriver/RedOS_1.1/master/Downloads/list_4.txt","/ISO/lib")
- download("https://raw.githubusercontent.com/LexaDriver/RedOS_1.1/master/Downloads/list_5.txt","/ISO/RedOS")
- print("Reboot now? [Y/n]")
- ans = io.read()
- if (ans == "Y") or (ans == "y") then
- computer.shutdown(true)
- end
- end
Add Comment
Please, Sign In to add comment