Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Web Decompressor
- Just Does Games
- --]]
- local args = {...}
- local web = "http://www.example.com"
- local function c(t) print("[WD] "..t) end
- web = args[1] or web
- if not http then return printError("Http is not enabled.") end
- local h = http.get(web)
- if h then
- local t = {}
- c("Connected to '"..web.."'!")
- c("Downloading...") local i=1
- while true do
- local tmp = h.readLine()
- if not tmp then break end
- t[i] = tmp i=i+1
- end i=nil
- h.close()
- c("Download Complete!")
- c("Decompressing...")
- local w = false
- local f = fs.open("wd_out.lua", "w")
- for i=1, #t do
- local tmp = ""
- for ii=1, t[i]:len() do
- if t[i]:sub(ii,ii) == "<" or t[i]:sub(ii,ii) == ">" then
- w = not w
- else
- if w then tmp = tmp..t[i]:sub(ii,ii) end
- end
- end
- if tmp:len() > 0 then f.writeLine(tmp) end
- end
- f.close()
- c("Complete. Output to 'wd_out.lua'")
- else
- return printError("Failed to connect to '"..web.."'.")
- end
Advertisement
Add Comment
Please, Sign In to add comment