Skip to content

Instantly share code, notes, and snippets.

@Spaider
Last active December 13, 2015 16:48
Show Gist options
  • Save Spaider/4942870 to your computer and use it in GitHub Desktop.
Save Spaider/4942870 to your computer and use it in GitHub Desktop.
Auto-start open races on Klavogonki.ru
// ==UserScript==
// @name KlavogonkiAutoStart
// @namespace klavogonki.ru
// @version 0.0.2.0
// @description Auto start open races on Klavogonki.Ru site
// @author Spaider
// @grant none
// @include http://klavogonki.ru/*
// ==/UserScript==
(function (){
var divFinished = document.getElementById('finished');
var divPaused = document.getElementById('paused');
function tickReplay(){
var vis = divFinished.style['display'];
if (!vis || vis == ""){
window.location = "/g/" + game.id + ".replay";
return;
}
window.setTimeout(tickReplay, 1000);
}
// Start here
if (!divFinished || !divPaused){
return;
}
var vis = divPaused.style['display'];
if (!vis || vis == ""){
var start = document.getElementById('host_start');
if (start){
start.click();
window.setTimeout(tickReplay, 1000);
}
return;
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment