Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not fs.exists("github") then
- shell.run("pastebin get fneHBM66 github")
- end
- if not fs.exists("lib/objectJSON") or not fs.exists("lib/json") then
- error("objectJSON or json does not exist.")
- end
- os.loadAPI("lib/objectJSON")
- objectJSON.init()
- local version = objectJSON.decodeFromFile("version").version
- print("Actual version : " .. tostring(version))
- local newVersion
- while true do
- newVersion = objectJSON.decodeHTTP("https://raw.githubusercontent.com/DaikiKaminari/thaumcraft/master/version").version
- if newVersion ~= nil and version ~= newVersion then
- print("New version :" .. tostring(newVersion))
- for _,f in pairs(fs.list("downloads/thaumcraft")) do
- shell.run("rm " .. f)
- end
- shell.run("github DaikiKaminari thaumcraft")
- shell.run("cp downloads/thaumcraft/* .")
- return
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement