Skip to content

Lazy Coder, Happy Dino

Published:  at 10:45 AM

Why Spend 5 Minutes Doing it Manually When You Can Spend an Hour Automating it?

Here’s the code to paste into your console to make the magic happen 😁

const autoJump = () => {
  const instance = window.Runner.instance_;
  const dino = instance.tRex;

  const nextObstacle = instance.horizon.obstacles.filter(
    x => x.xPos > dino.xPos
  )[0];

  if (nextObstacle && nextObstacle.xPos - dino.xPos < 120) {
    dino.startJump(100);
  }

  requestAnimationFrame(autoJump);
};

requestAnimationFrame(autoJump);

By the way, you can play the T-Rex game even when you’re connected to the internet by going to chrome://dino/.