darmod

cc init apps install

Aug 3rd, 2025 (edited)
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.38 KB | None | 0 0
  1. -- install_pine_packages.lua
  2. -- Runs a sequence of installers from Pinestore, with clear logging and error handling.
  3. -- Requires: CC:Tweaked with the HTTP API enabled in config (http.enable=true).
  4.  
  5. -- Helper: pretty logger with timestamps
  6. local function log(level, msg)
  7.   local time = textutils.formatTime(os.time(), true)
  8.   print((" [%s] %-5s %s"):format(time, level, msg))
  9. end
  10.  
  11. -- Sanity check: HTTP must be available
  12. if not http then
  13.   log("ERROR", "HTTP API is disabled. Enable it in the ComputerCraft/CC:Tweaked config and reboot.")
  14.   return
  15. end
  16.  
  17. -- Helper: run `wget run <url>` safely and report outcome
  18. local function wget_run(url)
  19.   -- `shell.run` executes the shell program `wget` with args `run` and the URL.
  20.   -- Using `pcall` prevents a crash if the download/execution fails.
  21.   local ok, err = pcall(function()
  22.     shell.run("wget", "run", url)
  23.   end)
  24.   if ok then
  25.     log("INFO", "Installed via " .. url)
  26.     return true
  27.   else
  28.     log("ERROR", "Failed for " .. url .. " :: " .. tostring(err))
  29.     return false
  30.   end
  31. end
  32.  
  33. -- ──────────────────────────────────────────────────────────────────────────────
  34. -- # GUI Library
  35. -- # https://pinestore.cc/projects/15/basalt
  36. -- wget run https://pinestore.cc/d/15
  37. wget_run("https://pinestore.cc/d/15")
  38.  
  39. -- # Telemetry Library
  40. -- # https://pinestore.cc/projects/14/telem
  41. -- wget run https://pinestore.cc/d/14
  42. wget_run("https://pinestore.cc/d/14")
  43.  
  44. -- # Audio Visualizer
  45. -- # https://pinestore.cc/projects/99/waveflow-visualizer
  46. -- wget run https://pinestore.cc/d/99
  47. wget_run("https://pinestore.cc/d/99")
  48.  
  49. -- # Text Editor: cons
  50. -- # https://pinestore.cc/projects/20/consult
  51. -- wget run https://pinestore.cc/d/20
  52. wget_run("https://pinestore.cc/d/20")
  53.  
  54. -- # Fancy Fonts
  55. -- # https://pinestore.cc/projects/37/more-fonts
  56. -- wget run https://pinestore.cc/d/37
  57. wget_run("https://pinestore.cc/d/37")
  58.  
  59. -- # Jukebox Works 08/01/25
  60. -- # https://pinestore.cc/projects/143/jukebox
  61. -- wget run https://pinestore.cc/d/143
  62. wget_run("https://pinestore.cc/d/143")
  63.  
  64. shell.run("mv", "startup.lua", "jukebox")
  65. shell.run("rm","startup.lua")
  66.  
  67. shell.run("mv", "startup", "jukebox")
  68. shell.run("rm","startup")
  69.  
  70. log("INFO", "All installers attempted. Review any ERROR lines above.")
  71.  
Advertisement
Add Comment
Please, Sign In to add comment