Created
February 26, 2013 21:31
-
-
Save error454/5042407 to your computer and use it in GitHub Desktop.
Scans for and destroys all zerglings in half second intervals. Meant to be used as a greasemonkey script in chrome but you could just paste the code into a console while playing the game.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Zerg Defense | |
// @namespace http://mobilecoder.wordpress.com | |
// @version 1.0 | |
// @description The Zerg Rush is coming, prepare yourself! | |
// @match https://www.google.com/search?q=zerg+rush* | |
// ==/UserScript== | |
var doMouseEvent = function(element, args) { | |
var event = document.createEvent("MouseEvents"); | |
event.initEvent.apply(event, Array.prototype.slice.call(arguments, 1)); | |
element.dispatchEvent(event); | |
}; | |
setInterval(seekAndDestroy, 500); | |
function seekAndDestroy(){ | |
var zergs = document.getElementsByClassName("zr_zergling_container") | |
for(var zergI = 0; zergI < zergs.length; zergI++){ | |
for(clickI = 0; clickI < 3; clickI++){ | |
doMouseEvent(zergs[zergI], 'mousedown'); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment