Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Pastebin updater for the fern scanner
- fs.delete("downloads")
- shell.openTab("sh")
- local files = {
- {"MWY8mf12","startup.lua",false},
- {"mmcNfuBr","fern-data.lua",false},
- {"yTARGS6A","fern-scanner.lua",true}
- }
- --Clears out comments and whitespace
- local function saveSpace(path)
- if not fs.exists(path) or fs.isDir(path) then return false end
- local file = fs.open(path,"r")
- local data = file.readAll()
- file.close()
- data = data:gsub("%-%-.-\n","\n") --removes comments
- data = data:gsub("%s*\n%s*","\n")
- return data
- end
- local function update(pstbnCode,fileName,run,...)
- shell.run("pastebin get "..pstbnCode .. " /downloads/" .. fileName)
- local file = fs.open(fileName,"w+")
- file.write(saveSpace("/downloads/"..fileName))
- file.close()
- fs.delete("downloads")
- local args = {...}
- if run then pcall(function() shell.run(fileName,unpack(args))end) end
- end
- for k,v in pairs(files) do
- update(unpack(v))
- end
- sleep(5)
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment