Please disable your adblock and script blockers to view this page

Google Little Dinosaur Strategy

Time: 2023/06/27 By: Admin Update time: 2023/06/27

When there is no Internet, we often see the interface of the little dinosaur pop up in Google Chrome, but we now have the Internet, and we can use chrome://dino to open the web page.
The same effect can also run on the mobile phone, but I always lose when playing.

I like cheating, so I wrote some code. You can run the cheat code directly on your mobile phone and computer through this link.
You can also enter the following code on your computer:(Open chrome://dino and press F12 -> Console to enter.)

I. High jump code:

Runner.instance_.tRex.setJumpVelocity(100)

Note: Parameters in parentheses can be changed.

II. Running fast code:

Runner.instance_.setSpeed(10000)

Note: Parameters in parentheses can be changed as well.

III. Invincible code:

Runner.instance_.gameOver=function(){}

The effect:

IIII. Auto (The computer play the game automatically)

function TrexRunnerBot() {
  const makeKeyArgs = (keyCode) => {
    const preventDefault = () => void 0;
    return { keyCode, preventDefault };
  };

  const upKeyArgs = makeKeyArgs(38);
  const downKeyArgs = makeKeyArgs(40);
  const startArgs = makeKeyArgs(32);

  if (!Runner().playing) {
    Runner().onKeyDown(startArgs);
    setTimeout(() => {
      Runner().onKeyUp(startArgs);
    }, 500);
  }

  function conquerTheGame() {
    if (!Runner || !Runner().horizon.obstacles[0]) return;
    const obstacle = Runner().horizon.obstacles[0];
    if (obstacle.typeConfig && obstacle.typeConfig.type === 'SNACK') return;
    if (needsToTackle(obstacle) && closeEnoughToTackle(obstacle)) tackle(obstacle);
  }

  function needsToTackle(obstacle) {
    return obstacle.yPos !== 50;
  }

  function closeEnoughToTackle(obstacle) {
    return obstacle.xPos <= Runner().currentSpeed * 18;
  }

  function tackle(obstacle) {
    if (isDuckable(obstacle)) {
      duck();
    } else {
      jumpOver(obstacle);
    }
  }

  function isDuckable(obstacle) {
    return obstacle.yPos == 75;
  }

  function duck() {
    drop();
    Runner().onKeyDown(downKeyArgs);
    setTimeout(() => {
      Runner().onKeyUp(downKeyArgs);
    }, 500);
  }

  function drop() {
    Runner().onKeyDown(downKeyArgs);
    Runner().onKeyUp(downKeyArgs);
  }

  function jumpOver(obstacle) {
    if (isNextObstacleCloseTo(obstacle)) {
      jumpFast();
    } else {
      Runner().onKeyDown(upKeyArgs);
    }
  }

  function isNextObstacleCloseTo(currentObstacle) {
    const nextObstacle = Runner().horizon.obstacles[1];
    return nextObstacle && nextObstacle.xPos - currentObstacle.xPos <= Runner().currentSpeed * 42;
  }

  function jumpFast() {
    Runner().onKeyDown(upKeyArgs);
    Runner().onKeyUp(upKeyArgs);
  }

  return {
    conquerTheGame: conquerTheGame
  };
}
let bot = TrexRunnerBot();
let botInterval = setInterval(bot.conquerTheGame, 2);
        

I show the effect:

The combination of these codes is even more powerful!
Considering that the developer mode cannot be opened on the mobile phone, I provide the link on the site to play online. You can set the parameters of various codes. Have a good time!