Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- update.lua (minimal Pastebin updater)
- local PASTEBIN_ID = "UVEGG7EK" -- <- deine ID hier
- local DEFAULT_FILE = "miner" -- <- optionaler Default
- local args = { ... }
- local target = args[1] or DEFAULT_FILE
- if not target or target == "" then
- print("Usage: update <filename>")
- return
- end
- if not http then
- print("HTTP is disabled.")
- return
- end
- local url = "https://pastebin.com/raw/" .. PASTEBIN_ID
- local h = http.get(url)
- if not h then
- print("Download failed: " .. url)
- return
- end
- local data = h.readAll()
- h.close()
- if not data or data == "" then
- print("Empty response.")
- return
- end
- local f = fs.open(target, "w")
- if not f then
- print("Cannot write file: " .. target)
- return
- end
- f.write(data)
- f.close()
- print("Updated: " .. target .. " (Pastebin " .. PASTEBIN_ID .. ")")
Advertisement
Add Comment
Please, Sign In to add comment