Dino Game Hack with GUI, Speed Control, Auto Jump and Point Hack

Hack the Chrome Dino game with a GUI to make the dinosaur invincible, control speed, auto jump over obstacles, and hack points.

  1. // ==UserScript==
  2. // @name Dino Game Hack with GUI, Speed Control, Auto Jump and Point Hack
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.7
  5. // @description Hack the Chrome Dino game with a GUI to make the dinosaur invincible, control speed, auto jump over obstacles, and hack points.
  6. // @author Max Stewie
  7. // @match *://chromedino.com/*
  8. // @match chrome://dino
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. let autoJumpEnabled = false;
  16.  
  17. // Function to override the gameOver function
  18. function makeInvincible() {
  19. Runner.prototype.gameOver = function() {};
  20. }
  21.  
  22. // Function to reset the game to normal
  23. function resetGame() {
  24. location.reload();
  25. }
  26.  
  27. // Function to adjust speed
  28. function setSpeed(value) {
  29. Runner.instance_.setSpeed(value);
  30. }
  31.  
  32. // Function to enable auto jump
  33. function enableAutoJump() {
  34. autoJumpEnabled = true;
  35. autoJump();
  36. }
  37.  
  38. // Function to disable auto jump
  39. function disableAutoJump() {
  40. autoJumpEnabled = false;
  41. }
  42.  
  43. // Function to handle auto jump
  44. function autoJump() {
  45. if (autoJumpEnabled) {
  46. const obstacles = Runner.instance_.horizon.obstacles;
  47. if (obstacles.length > 0) {
  48. const obstacle = obstacles[0];
  49. const obstacleXPos = obstacle.xPos;
  50. const dinoXPos = Runner.instance_.tRex.xPos;
  51. const obstacleWidth = obstacle.width;
  52.  
  53. // Jump when the obstacle is close to the dinosaur
  54. if (obstacleXPos < dinoXPos + obstacleWidth + 20 && obstacleXPos > dinoXPos) {
  55. Runner.instance_.tRex.startJump(Runner.instance_.currentSpeed);
  56. }
  57. }
  58. }
  59. requestAnimationFrame(autoJump);
  60. }
  61.  
  62. // Function to set points
  63. function setPoints(value) {
  64. Runner.instance_.distanceMeter.setHighScore(value);
  65. Runner.instance_.distanceRan = value / Runner.instance_.distanceMeter.config.COEFFICIENT;
  66. }
  67.  
  68. // Create GUI
  69. function createGUI() {
  70. const guiContainer = document.createElement('div');
  71. guiContainer.style.position = 'fixed';
  72. guiContainer.style.top = '10px';
  73. guiContainer.style.right = '10px';
  74. guiContainer.style.zIndex = '1000';
  75. guiContainer.style.backgroundColor = '#fff';
  76. guiContainer.style.border = '1px solid #ccc';
  77. guiContainer.style.padding = '10px';
  78. guiContainer.style.borderRadius = '5px';
  79. guiContainer.style.boxShadow = '0 0 10px rgba(0,0,0,0.5)';
  80. guiContainer.style.display = 'flex';
  81. guiContainer.style.flexDirection = 'column';
  82. guiContainer.style.gap = '10px';
  83.  
  84. const invincibleButton = document.createElement('button');
  85. invincibleButton.textContent = 'Invincible Mode';
  86. invincibleButton.onclick = makeInvincible;
  87. guiContainer.appendChild(invincibleButton);
  88.  
  89. const resetButton = document.createElement('button');
  90. resetButton.textContent = 'Reset Game';
  91. resetButton.onclick = resetGame;
  92. guiContainer.appendChild(resetButton);
  93.  
  94. const speedLabel = document.createElement('label');
  95. speedLabel.textContent = 'Set Speed:';
  96. guiContainer.appendChild(speedLabel);
  97.  
  98. const speedSlider = document.createElement('input');
  99. speedSlider.type = 'range';
  100. speedSlider.min = '1';
  101. speedSlider.max = '100';
  102. speedSlider.value = '10';
  103. speedSlider.oninput = function() {
  104. setSpeed(speedSlider.value);
  105. };
  106. guiContainer.appendChild(speedSlider);
  107.  
  108. const autoJumpButton = document.createElement('button');
  109. autoJumpButton.textContent = 'Enable Auto Jump';
  110. autoJumpButton.onclick = function() {
  111. if (autoJumpEnabled) {
  112. disableAutoJump();
  113. autoJumpButton.textContent = 'Enable Auto Jump';
  114. } else {
  115. enableAutoJump();
  116. autoJumpButton.textContent = 'Disable Auto Jump';
  117. }
  118. };
  119. guiContainer.appendChild(autoJumpButton);
  120.  
  121. const pointsLabel = document.createElement('label');
  122. pointsLabel.textContent = 'Set Points:';
  123. guiContainer.appendChild(pointsLabel);
  124.  
  125. const pointsInput = document.createElement('input');
  126. pointsInput.type = 'number';
  127. pointsInput.min = '0';
  128. pointsInput.value = '0';
  129. pointsInput.oninput = function() {
  130. setPoints(pointsInput.value);
  131. };
  132. guiContainer.appendChild(pointsInput);
  133.  
  134. document.body.appendChild(guiContainer);
  135. }
  136.  
  137. // Wait for the game to load
  138. window.addEventListener('load', createGUI);
  139. })();