Skip to content

Instantly share code, notes, and snippets.

@Alexx-G
Created September 23, 2014 06:55
Show Gist options
  • Save Alexx-G/5965e8a7e2bd8d508837 to your computer and use it in GitHub Desktop.
Save Alexx-G/5965e8a7e2bd8d508837 to your computer and use it in GitHub Desktop.
function searchBox() {
var box = $("#box");
if (box.length > 0) {
var elements = box.find("span");
var lvl = box.attr("class");
for(var i = 0; i < elements.length - 1; i++) {
if($(elements[i]).attr("style") != $(elements[i + 1]).attr("style")) {
$(elements[i]).click();
if(lvl == box.attr("class")) {
$(elements[i + 1]).click();
}
break;
}
}
if(!$("#dialog").is(":visible")) {
window.setTimeout(searchBox, Math.floor(Math.random() * 500) + 1);
}
}
};
@masterx2
Copy link

Dude, try this) setInterval(function(){Game.nextLv()},1)

@Alexx-G
Copy link
Author

Alexx-G commented Mar 10, 2015

Nice.
I didn't look at the source code of the game. I just opened inspector and wrote this function (and I copied the code as-is in this gist, without any refactoring).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment