Advertisement
Corbinhol

Tablet Beta Installer

Oct 2nd, 2022 (edited)
1,164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.22 KB | None | 0 0
  1. --Tablet Installer BETA
  2. function download(code, location)
  3.     url = http.get("https://www.pastebin.com/raw/"..code)
  4.     f = fs.open(location,"w") --#opens file in write mode, has to be specified with location
  5.     f.write(url.readAll()) --#reads every byte of url and writes it to location
  6.     f.close() --# always close the file >:c
  7.     return true --#return true so function can be used in ifs
  8. end
  9.  
  10. local dir = "/YagPadBeta/";
  11. print("Starting Beta Installer");
  12. fs.makeDir("YagPadBeta");
  13. fs.makeDir("/YagPadBeta/libraries");
  14. fs.makeDir("/YagPadBeta/libraries/basalt/init.lua")
  15. print("Installing Basalt Library...");
  16. download("rc5nFKZ6", "BasaltTempInstaller.lua");
  17. shell.run("BasaltTempInstaller.lua packed true /YagPadBeta/libraries/basalt/basalt");
  18. fs.delete("BasaltTempInstaller.lua")
  19. fs.delete("YagPadBeta/Beta.lua");
  20. download("VvCRFMRs", "YagPadBeta/Beta.lua");
  21. if fs.exists("/YagPadBeta/config/username.conf") == nil then
  22.     shell.run("clear");
  23.     print("Please enter the username");
  24.     print("> ")
  25.     term.setCursorPos(3, 2);
  26.     local name = read();
  27.     fs.makeDir("YagPadBeta/config");
  28.     local file = fs.open("/YagPadBeta/config/username.conf", "w");
  29.     file.write(name);
  30.     file.close();
  31. end
  32.  
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement