Last active
December 13, 2015 16:48
-
-
Save Spaider/4942870 to your computer and use it in GitHub Desktop.
Auto-start open races on Klavogonki.ru
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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