Dino Game Hack - Ultimate Mod Menu with Show/Hide Button

Fully functional mods with a show/hide button and sound effects for Chrome Dino Game

  1. // ==UserScript==
  2. // @name Dino Game Hack - Ultimate Mod Menu with Show/Hide Button
  3. // @namespace http://tampermonkey.net/
  4. // @version 5.3
  5. // @description Fully functional mods with a show/hide button and sound effects for Chrome Dino Game
  6. // @author Your Name
  7. // @match https://chromedino.com/*
  8. // @include https://trex-runner.com/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function () {
  13. 'use strict';
  14.  
  15. // Sound effects
  16. const hideMenuSoundUrl = "https://www.myinstants.com/media/sounds/windows-xp-shutdown.mp3";
  17. const showMenuSoundUrl = "https://www.myinstants.com/media/sounds/windows-10-usb-connect-38512.mp3";
  18. const achievementSoundUrl = "https://www.myinstants.com/media/sounds/xbox-one-rare-achievement-45050.mp3";
  19.  
  20. // Wait for the game to load
  21. const waitForGame = setInterval(() => {
  22. if (window.Runner) {
  23. clearInterval(waitForGame);
  24. initHackMenu();
  25. }
  26. }, 100);
  27.  
  28. function playSound(url) {
  29. const audio = new Audio(url);
  30. audio.volume = 0.5;
  31. audio.play().catch(() => {
  32. console.warn("Sound playback blocked.");
  33. });
  34. }
  35.  
  36. function initHackMenu() {
  37. const runnerInstance = Runner.instance_;
  38.  
  39. // Create the menu container
  40. const menu = document.createElement('div');
  41. menu.style.position = 'fixed';
  42. menu.style.top = '10px';
  43. menu.style.left = '10px';
  44. menu.style.padding = '20px';
  45. menu.style.background = 'linear-gradient(135deg, #001f3f, #0074d9)';
  46. menu.style.color = '#ffffff';
  47. menu.style.fontFamily = '"Franklin Gothic", Arial, sans-serif';
  48. menu.style.zIndex = '9999';
  49. menu.style.border = '2px solid #00d9ff';
  50. menu.style.borderRadius = '15px';
  51. menu.style.boxShadow = '0 10px 20px rgba(0, 0, 0, 0.5)';
  52. document.body.appendChild(menu);
  53.  
  54. // Add content to the menu
  55. menu.innerHTML = `
  56. <h3 style="text-align:center; color:#00d9ff; font-size:24px;">Dino Hack Menu</h3>
  57. <hr style="border-color:#00d9ff;">
  58. <div style="margin-bottom:15px;">
  59. <strong>Invincibility:</strong>
  60. <label class="switch">
  61. <input type="checkbox" id="invincible">
  62. <span class="slider"></span>
  63. </label>
  64. </div>
  65. <div style="margin-bottom:15px;">
  66. <strong>Speed:</strong>
  67. <input type="number" id="speed" value="1" step="0.1" min="0.1" style="width:60px;">
  68. </div>
  69. <div style="margin-bottom:15px;">
  70. <strong>Jump Height:</strong>
  71. <input type="number" id="jumpHeight" value="10" step="1" min="1" style="width:60px;">
  72. </div>
  73. <button id="applyChanges" style="width:100%; background-color:#00d9ff; color:white; border:none; padding:12px; border-radius:8px; cursor:pointer; font-size:16px; transition: transform 0.2s ease;">Apply Changes</button>
  74. <hr style="border-color:#00d9ff;">
  75. <button id="hideMenu" style="width:100%; background-color:#ff4d4d; color:white; border:none; padding:10px; border-radius:8px; cursor:pointer;">Hide Menu</button>
  76. `;
  77.  
  78. // Create Show Menu button (initially hidden)
  79. const showMenuButton = document.createElement('button');
  80. showMenuButton.id = 'showMenu';
  81. showMenuButton.style.position = 'fixed';
  82. showMenuButton.style.top = '10px';
  83. showMenuButton.style.right = '10px';
  84. showMenuButton.style.backgroundColor = '#4CAF50';
  85. showMenuButton.style.color = 'white';
  86. showMenuButton.style.border = 'none';
  87. showMenuButton.style.padding = '12px 20px';
  88. showMenuButton.style.borderRadius = '8px';
  89. showMenuButton.style.cursor = 'pointer';
  90. showMenuButton.innerText = 'Show Menu';
  91. showMenuButton.style.display = 'none'; // Hidden by default
  92. document.body.appendChild(showMenuButton);
  93.  
  94. // Hide and Show buttons functionality
  95. const hideMenuButton = document.getElementById("hideMenu");
  96.  
  97. hideMenuButton.addEventListener("click", () => {
  98. // Play the sound first, then hide the menu after sound plays
  99. playSound(hideMenuSoundUrl);
  100. menu.style.display = "none"; // Hide the menu
  101. showMenuButton.style.display = "block"; // Show the "Show Menu" button
  102. });
  103.  
  104. showMenuButton.addEventListener("click", () => {
  105. // Play the sound first, then show the menu after sound plays
  106. playSound(showMenuSoundUrl);
  107. menu.style.display = "block"; // Show the menu
  108. showMenuButton.style.display = "none"; // Hide the "Show Menu" button
  109. });
  110.  
  111. // Invincibility toggle
  112. const invincibleCheckbox = document.getElementById("invincible");
  113. invincibleCheckbox.addEventListener("change", () => {
  114. if (invincibleCheckbox.checked) {
  115. runnerInstance.gameOver = function () {}; // Disable game over
  116. } else {
  117. runnerInstance.gameOver = Runner.prototype.gameOver; // Restore original
  118. }
  119. });
  120.  
  121. // Apply changes button functionality
  122. const applyChangesButton = document.getElementById("applyChanges");
  123.  
  124. // Disable the button when clicked and re-enable after animation
  125. applyChangesButton.addEventListener("click", () => {
  126. applyChangesButton.disabled = true; // Disable the button
  127.  
  128. const speedMultiplier = parseFloat(document.getElementById("speed").value);
  129. const jumpHeight = parseFloat(document.getElementById("jumpHeight").value);
  130.  
  131. runnerInstance.setSpeed(speedMultiplier); // Change game speed
  132. runnerInstance.tRex.setJumpVelocity(jumpHeight); // Change jump height
  133.  
  134. // Button scale animation after clicking
  135. applyChangesButton.style.transform = "scale(0.9)";
  136. setTimeout(() => {
  137. applyChangesButton.style.transform = "scale(1)";
  138. applyChangesButton.disabled = false; // Re-enable the button after animation
  139. }, 200);
  140. });
  141.  
  142. // Achievement sound for milestones
  143. let lastMilestone = 0;
  144. setInterval(() => {
  145. const score = Math.floor(runnerInstance.distanceRan / 10);
  146. if (score >= 100 && score !== lastMilestone && score % 500 === 0) {
  147. playSound(achievementSoundUrl);
  148. lastMilestone = score;
  149. }
  150. }, 1000);
  151. }
  152. })();