static double autoRestart_interval = 10; static bool autoRestart_on, autoRestart_debug; static void autoRestart() { if (autoRestart_on) ret; set autoRestart_on; autoRestart_schedule(); preloadProgramTitle(); } svoid autoRestart_schedule { doLater_daemon(toMS(autoRestart_interval), f autoRestart_check); } svoid autoRestart_check { try { S newMD5 = loadPageSilently("http://ai1.lol/1010693/raw?id=759"); if (!isMD5(newMD5)) { if (autoRestart_debug) print("autoRestart: no server transpilation"); ret; } S localMD5 = md5(loadCachedTranspilation(programID())); if (neq(localMD5, newMD5)) { infoBox("Upgrading " + programTitle()); restartWithDelay(1000); sleep(); } } finally { if (autoRestart_debug) print("autoRestart: Done"); autoRestart_schedule(); } }