Skip to content

Instantly share code, notes, and snippets.

@GiantCowFilms
Created April 1, 2015 00:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GiantCowFilms/836d4cb31de8ae87ab7f to your computer and use it in GitHub Desktop.
Save GiantCowFilms/836d4cb31de8ae87ab7f to your computer and use it in GitHub Desktop.
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
Copy link
Author

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
Copy link
Author

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