Created
October 27, 2017 03:42
-
-
Save Inobtenio/0b68b9985a8a1c30bef83d64b11a9871 to your computer and use it in GitHub Desktop.
A bot for the Google Chrome dinosaur 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
var checkPixels = function(){ | |
var pixelData = document.getElementsByClassName('runner-canvas')[0].getContext('2d').getImageData(220, 230, 1, 1).data; | |
if (pixelData.some(function(e) {return e>0})){ | |
Runner.instance_.tRex.startJump() | |
} | |
} | |
var interval = setInterval(checkPixels, 10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How do I use it?