Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Egg Protector
console.log("Protecting Your Egg");
$("#egg-clock-text").bind("DOMSubtreeModified",function(){
console.log("Change!");
if($("#egg-clock-text").text() == 5){
console.log("Vote nearly over! Time to act");
protectEggs();
}
});
function protectEggs () {
var widestTalleyBar = $(".egg-action").find(".egg-action-tally-bar")[0];
$(".egg-action").each(function () {
if($(this).find( "button" ).text() == "Restart"){
return true;
} else {
var talleyBar = $(this).find(".egg-action-tally-bar");
if( $(widestTalleyBar).width() < $(talleyBar).width()){
widestTalleyBar = talleyBar;
}
}
});
console.log($(widestTalleyBar).parents(".egg-action"));
console.log($(widestTalleyBar).parents(".egg-action").find("button")[0]);
var btnTarget = $(widestTalleyBar).parents(".egg-action").find("button")[0];
$(btnTarget).trigger( "click" );
}protectEggs()
@GiantCowFilms

This comment has been minimized.

Copy link
Owner Author

@GiantCowFilms GiantCowFilms commented Apr 1, 2015

Egg Protector

Copy into your browser console to install, votes for most popular not restart option.
Defaults to higher up the list during conflict/no vote

@GiantCowFilms

This comment has been minimized.

Copy link
Owner Author

@GiantCowFilms GiantCowFilms commented Apr 1, 2015

Steps

  • F12
  • Console
  • Paste all the code
  • Hit enter check to see it is filling the console with messages
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.