Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local files = {
- [1] = {
- "client",
- "https://raw.githubusercontent.com/CoolMan119/HousePost/master/client.lua"
- },
- [2] = {
- "server",
- "https://raw.githubusercontent.com/CoolMan119/HousePost/master/server.lua"
- },
- [3] = {
- "/images/main",
- "https://raw.githubusercontent.com/CoolMan119/HousePost/master/images/main"
- }
- }
- if term.isColor() == false then
- print("Sorry, But you need an Advanced PC to run this!")
- else
- term.setBackgroundColor(colors.red)
- term.clear()
- term.setCursorPos(18,8)
- print("HousePost")
- term.setCursorPos(11,10)
- term.setCursorPos(21,16)
- term.setBackgroundColor(colors.lightGray)
- print("Install")
- while true do
- local event, side, x, y = os.pullEvent("mouse_click")
- if x >= 21 and x < 28 and y == 16 then
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint("Installing HousePost...")
- local req
- local code
- local file
- for k,v in pairs(files) do
- print(v[1])
- req = http.get(v[2])
- if req ~= nil then
- code = req.readAll()
- req.close()
- else
- print("Failed!")
- end
- file = fs.open(v[1], "w")
- file.write(code)
- file.close()
- end
- end
- end
- end
- print("Sucessfully installed HousePost!")
- print("Rebooting...")
- os.sleep(1)
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement