Skip to content

Instantly share code, notes, and snippets.

@ibaaj ibaaj/auto.js
Created Nov 3, 2014

Embed
What would you like to do?
game.ioxapp.com/color/
setInterval(function(){
var list = document.getElementById("box").getElementsByTagName("span"), bgUsed={};
for (var i = 0, len = list.length; i < len; i++) {
var e = list[i].style.backgroundColor;
if(Object.keys(bgUsed).length==0){bgUsed[e]=i; continue;}
if(!bgUsed.hasOwnProperty(e)) {bgUsed[e]=i; continue; }
else if(Object.keys(bgUsed).length > 1) { delete bgUsed[e]; break;}
}
list[bgUsed[Object.keys(bgUsed)[0]]].style.backgroundColor="black"; // bg en black
list[bgUsed[Object.keys(bgUsed)[0]]].click();
},700);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.