Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function main()
- -- UPDATE
- local file = os.getenv('TEMP')..'/check.json'
- downloadUrlToFile('https://pastebin.com/raw/3MyzaR2J', file, function(id, status)
- if status == 6 then
- local f = io.open(file)
- while not f do f = io.open(file) end
- local info = decodeJson(f:read('*a'))
- if info then
- if tonumber(info.version) > tonumber(thisScript().version) then
- lua_thread.create(function(url)
- downloadUrlToFile(url, thisScript().path, function(id, status)
- if status == 6 then
- thisScript:reload()
- end
- end)
- end, info.url)
- end
- end
- f:close()
- end
- end)
- os.remove(file)
- -- UPDATE
- wait(-1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement