Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Name: Discover App Installer
- Author: DannySMc (dannysmc95)
- ]]
- --// Define Functions
- function clear()
- term.clear();
- term.setCursorPos(1,1);
- end
- function setColour(tc, bc)
- term.setTextColor(colours[tc]);
- term.setBackgroundColour(colours[bc]);
- end
- --// Start Code
- clear(); setColour('cyan', 'black');
- print("DiscoverApp Installer");
- setColour("orange", "black");
- print("Please choose the path to install the file to:");
- setColour("red", "black");
- write("> ");
- setColour("white", "black");
- local path = tostring(read());
- setColour("orange", "black");
- print("Checking, please wait...");
- if fs.exists(path) then
- error("File already exists in that path...");
- end
- print("Installing, please wait...");
- local url = 'http://discoverapi.xyz/files/download/discoverapp/lua';
- local d = http.get(url)
- local data = d.readAll()
- local f = fs.open(path, "w")
- f.write(data)
- f.close();
- print("Success!! Discover is installed as: " .. path);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement