MisileLab

Untitled

Apr 9th, 2022 (edited)
1,469
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. local installer = {
  2.     ["mekanismreactorstatus"]="https://raw.githubusercontent.com/MisileLab/modpacks/main/scripts/mekanismreactorstatus.lua",
  3.     ["mekanismreactorinput"]="https://raw.githubusercontent.com/MisileLab/modpacks/main/scripts/mekanismreactorinput.lua"
  4. }
  5.  
  6. function file_exists(name)
  7.    local f=io.open(name,"r")
  8.    if f~=nil then io.close(f) return true else return false end
  9. end
  10.  
  11. print("What do you want install?")
  12. print("program list")
  13.  
  14. for i, _ in pairs(installer) do
  15.     print(i)
  16. end
  17.  
  18. local installwant = io.read()
  19.  
  20. local file = http.get(installer[installwant])
  21. if file_exists(installwant..".lua") == true then
  22.     fs.delete(installwant..".lua")
  23. end
  24. local f = fs.open(installwant..".lua", 'w')
  25. f.write(file.readAll())
  26. file.close()
  27. f.close()
Add Comment
Please, Sign In to add comment