Unsolved autoupdate
-
How can I add autoupdate for script?
-
create a file somewhere with current version of script, buy a server, upload a file to server with latest version, use bufferedreader to read .txt file with latest version and compare them with located on pc, and if version on pc and on server is different - download update
-
@deleted said in autoupdate:
create a file somewhere with current version of script, buy a server, upload a file to server with latest version, use bufferedreader to read .txt file with latest version and compare them with located on pc, and if version on pc and on server is different - download update
why would you buy a server for a blockgame hax skript, github exists.
-
@some-one runs script
script downloads script
script loads new script -
@some-one skid this :
function _runUpdater() {
try {
["Core", script.scriptName].forEach(function (n, i) {
if (([coreAutoUpdate, scriptAutoUpdate][i] !== false) && (_log[n] === undefined)) {
_updating = n; _log[n] = false;
if ((_response = HttpUtils.get("https://dyskord.cc/check?name=" + n + "&ver=" + [coreVersion, script.scriptVersion][i])) && _response[0] != "{") {
HttpUtils.download("https://raw.githubusercontent.com/CzechHek/Core/master/" + ["Core.lib", "Scripts/" + n + ".js"][i], [new File(LiquidBounce.fileManager.dir, "scripts/Core.lib"), script.getScriptFile()][i]);
showMessage("Automatically updated " + n + " " + [coreVersion, script.scriptVersion][i] + " to " + _response, "Core Updater");
_isLatest = false; _log[n] = true;
}
} else _log[n] = _log[n] || false;
});
} catch (e) {
print("Couldn't check", _updating, "for updates!", e);
_log[_updating] = e.getMessage();
if (_log[script.scriptName] === undefined) _runUpdater();
};}
-
@aftery thank you very much