Skip to content

Instantly share code, notes, and snippets.

@Inobtenio
Created October 27, 2017 03:42
Show Gist options
  • Save Inobtenio/0b68b9985a8a1c30bef83d64b11a9871 to your computer and use it in GitHub Desktop.
Save Inobtenio/0b68b9985a8a1c30bef83d64b11a9871 to your computer and use it in GitHub Desktop.
A bot for the Google Chrome dinosaur game
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)
@Not-Mystify
Copy link

How do I use it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment