JustDoesGames

PH (Program Hub)

Jul 29th, 2020 (edited)
586
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.64 KB | None | 0 0
  1. --[[
  2.  
  3. PH
  4. Just Does Games
  5.  
  6. PH (Program Hub) is what the name implies.
  7. This is just a hub for programs, games, applications, and
  8. other items like OS and API items
  9.  
  10. There is something else like this out on the web, but
  11. currently I am in a discord chat where people post things
  12. on #creations and I have a feeling that nothing is
  13. being posted there anymore so... I created this.
  14.  
  15. These programs I do not own. I just make it easier to
  16. find and use them. (does not mean some of them are mine. just look at the owner)
  17.  
  18. --]]
  19.  
  20. local args = {...}
  21. if args[1] then
  22.     if args[1] == "-u" then
  23.         print("Updating...")
  24.         if fs.exists("/tmp-update.lua") then fs.delete("/tmp-update.lua") end
  25.         shell.run("pastebin get BCyqs0SP /tmp-update.lua")
  26.         if fs.exists("/tmp-update.lua") then
  27.             if fs.getSize("/tmp-update.lua") ~= fs.getSize(shell.getRunningProgram()) then
  28.                 print("Update found!")
  29.                 fs.delete(shell.getRunningProgram())
  30.                 fs.move("/tmp-update.lua", shell.getRunningProgram())
  31.                 print("Update Applied.")
  32.             else
  33.                 print("Already on latest update.")
  34.                 fs.delete("/tmp-update.lua")
  35.             end
  36.         else
  37.             print("Failed to obtain update.")
  38.         end
  39.     end
  40. end
  41.  
  42.  
  43. local w,h = term.getSize()
  44. local data = {}
  45.  
  46. function createApp(typ, name, owner, date, desc, link)
  47.     data[#data+1] = {
  48.         type = type,
  49.         name = name,
  50.         owner = owner,
  51.         date = date,
  52.         desc = desc,
  53.         link = link,
  54.     }
  55. end
  56.  
  57. createApp("Debug", "name", "owner", "date", "desc", "link")
  58.  
Add Comment
Please, Sign In to add comment