Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Installer Script for Your Files
- local files = {
- {url = "https://raw.githubusercontent.com/MentaalAchtergesteld/CC-SCRIPTS/refs/heads/main/scripts/autominer.lua", path = "/autominer.lua"},
- {url = "https://raw.githubusercontent.com/MentaalAchtergesteld/CC-SCRIPTS/refs/heads/main/lib/ecdysis.lua", path = "/lib/ecdysis.lua"},
- {url = "https://raw.githubusercontent.com/MentaalAchtergesteld/CC-SCRIPTS/refs/heads/main/lib/tabula.lua", path = "/lib/tabula.lua"}
- }
- -- Ensure /lib directory exists
- if not fs.exists("/lib") then
- print("[INFO] Creating /lib directory...")
- fs.makeDir("/lib")
- end
- -- Download Function
- local function download_file(url, path)
- print(string.format("[START] Downloading %s...", url))
- local response = http.get(url)
- if not response then
- print(string.format("[ERROR] Failed to fetch %s. Check your connection!", url))
- return false
- end
- local content = response.readAll()
- response.close()
- local file = fs.open(path, "w")
- file.write(content)
- file.close()
- print(string.format("[SUCCESS] File saved to %s", path))
- return true
- end
- -- Main Installation Process
- print("Starting file installation process...\n")
- for _, file in ipairs(files) do
- if download_file(file.url, file.path) then
- print(string.format("[OK] %s installed at %s", file.url, file.path))
- else
- print(string.format("[FAIL] Could not install %s.", file.url))
- end
- print()
- end
- print("All done! Give 'em a go, mate!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement