Advertisement
MarkFergus

install.lua

Apr 19th, 2021 (edited)
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. local arg = ...
  2. local past_versions = {
  3. "1.0",
  4. }
  5.  
  6. function main()
  7.     if fs.exists("/install") then fs.delete("/install") end
  8.     local content = http.get("https://raw.githubusercontent.com/MarkFerguss/portal/main/install.lua")
  9.     local h = fs.open("/install","w")
  10.     h.write(content.readAll())
  11.     h.close()
  12. end
  13.  
  14. function check(list,name)
  15.     local check = false
  16.     for i,v in pairs(list) do
  17.         if type(v) == "string" then
  18.             if string.find(name,v) ~= nil then check = true end
  19.             local array = i
  20.         end
  21.     end
  22.     return check, array
  23. end
  24.  
  25. if arg ~= nil and type(arg) == "string" then
  26.     if check(past_versions,arg) then
  27.         fs.delete("/install")
  28.         main()
  29.     end
  30. else
  31.     main()
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement