Created
March 4, 2015 11:58
-
-
Save romainberger/b08d1e5ae09f33ee3598 to your computer and use it in GitHub Desktop.
Javascript cheat for http://colorrun.pl
This file contains 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
var c1 = $('#color-1'), | |
c2 = $('#color-2') | |
setInterval(function() { | |
var co1 = c1.css('background-color').replace('rgb(', '').replace(')', '').split(', '), | |
co2 = c2.css('background-color').replace('rgb(', '').replace(')', '').split(', ') | |
t1 = 0, | |
t2 = 0 | |
co1.forEach(function(x) { | |
t1 += parseInt(x, 10) | |
}) | |
co2.forEach(function(x) { | |
t2 += parseInt(x, 10) | |
}) | |
if (t1 < t2) { | |
c2.click() | |
} | |
else { | |
c1.click() | |
} | |
}, 100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment