Last active
August 29, 2015 14:07
-
-
Save tothandras/d939b01b68726ad43fe2 to your computer and use it in GitHub Desktop.
cheat for game.ioxapp.com/color
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 fc; | |
fc = function() { | |
var b, boxes, bs, c, color, colors, _i, _len, _results; | |
boxes = $('#box span'); | |
bs = []; | |
boxes.each(function(k, v) { | |
var color; | |
color = $(v).css('background-color'); | |
return bs.push({ | |
v: v, | |
color: color | |
}); | |
}); | |
colors = []; | |
for (_i = 0, _len = bs.length; _i < _len; _i++) { | |
b = bs[_i]; | |
if (colors[b.color] != null) { | |
colors[b.color].count++; | |
colors[b.color].boxes.push(b.v); | |
} else { | |
colors[b.color] = { | |
count: 1, | |
boxes: [b.v] | |
}; | |
} | |
} | |
_results = []; | |
for (color in colors) { | |
c = colors[color]; | |
if (c.count === 1) { | |
_results.push($(c.boxes[0]).click()); | |
} else { | |
_results.push(void 0); | |
} | |
} | |
return _results; | |
}; | |
setInterval(fc, 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment