Skip to content

Instantly share code, notes, and snippets.

@mistersourcerer
Last active August 29, 2015 14:01
Show Gist options
  • Save mistersourcerer/c402960edf9f9ceca6bb to your computer and use it in GitHub Desktop.
Save mistersourcerer/c402960edf9f9ceca6bb to your computer and use it in GitHub Desktop.
A "sane"(?) way to "play" http://game.notch.net/drowning
// go to http://game.notch.net/drowning
// open the console
// type this:
function sleep(millis, callback) {
setTimeout(function()
{ callback(); }
, millis);
}
var click = document.createEvent("HTMLEvents"); click.initEvent("click", true, true);
function clickAllTheThings() { var links = document.getElementsByTagName("a"); for(var i=0; i < document.getElementsByTagName("a").length; i++) { var link = links[i]; link.dispatchEvent(click) }; sleep(500, clickAllTheThings) }
clickAllTheThings();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment