Heart Clicker Game Cheats

Cheat GUI for Heart Clicker Game with Functional Cheats and Modern Design

  1. // ==UserScript==
  2. // @name Heart Clicker Game Cheats
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.4
  5. // @description Cheat GUI for Heart Clicker Game with Functional Cheats and Modern Design
  6. // @match https://heart-io.github.io/Heart/
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. (function() {
  11. 'use strict';
  12.  
  13. // Create the cheat GUI container
  14. const cheatMenu = document.createElement('div');
  15. cheatMenu.id = 'cheat-menu';
  16. cheatMenu.style.position = 'fixed';
  17. cheatMenu.style.top = '10px';
  18. cheatMenu.style.right = '10px';
  19. cheatMenu.style.backgroundColor = '#ffffff';
  20. cheatMenu.style.border = '2px solid #ddd';
  21. cheatMenu.style.borderRadius = '10px';
  22. cheatMenu.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.1)';
  23. cheatMenu.style.padding = '20px';
  24. cheatMenu.style.zIndex = '10000';
  25. cheatMenu.style.display = 'none';
  26. cheatMenu.style.width = '300px';
  27. cheatMenu.style.fontFamily = 'Arial, sans-serif';
  28. cheatMenu.style.cursor = 'move'; // Set cursor to indicate draggable
  29. document.body.appendChild(cheatMenu);
  30.  
  31. // Make the cheat menu draggable
  32. let isDragging = false;
  33. let offsetX, offsetY;
  34.  
  35. cheatMenu.addEventListener('mousedown', (e) => {
  36. isDragging = true;
  37. offsetX = e.clientX - cheatMenu.getBoundingClientRect().left;
  38. offsetY = e.clientY - cheatMenu.getBoundingClientRect().top;
  39. document.addEventListener('mousemove', onMouseMove);
  40. document.addEventListener('mouseup', onMouseUp);
  41. });
  42.  
  43. function onMouseMove(e) {
  44. if (isDragging) {
  45. cheatMenu.style.left = `${e.clientX - offsetX}px`;
  46. cheatMenu.style.top = `${e.clientY - offsetY}px`;
  47. }
  48. }
  49.  
  50. function onMouseUp() {
  51. isDragging = false;
  52. document.removeEventListener('mousemove', onMouseMove);
  53. document.removeEventListener('mouseup', onMouseUp);
  54. }
  55.  
  56. // Add close button for cheat menu
  57. const closeButton = document.createElement('button');
  58. closeButton.innerText = 'Close';
  59. closeButton.style.backgroundColor = '#e74c3c';
  60. closeButton.style.color = '#fff';
  61. closeButton.style.border = 'none';
  62. closeButton.style.padding = '10px 20px';
  63. closeButton.style.borderRadius = '5px';
  64. closeButton.style.cursor = 'pointer';
  65. closeButton.style.marginBottom = '10px';
  66. closeButton.onclick = () => {
  67. cheatMenu.style.display = 'none';
  68. };
  69. cheatMenu.appendChild(closeButton);
  70.  
  71. // Add Set Hearts
  72. const setHeartsContainer = document.createElement('div');
  73. setHeartsContainer.style.marginBottom = '10px';
  74. setHeartsContainer.innerHTML = `
  75. <label for="set-heart-count">Set Hearts:</label>
  76. <input type="number" id="set-heart-count" min="0" style="width: 100%; padding: 5px;">
  77. <button id="set-heart-btn" style="width: 100%; padding: 10px; background-color: #3498db; color: #fff; border: none; border-radius: 5px; cursor: pointer;">Set Hearts</button>
  78. `;
  79. cheatMenu.appendChild(setHeartsContainer);
  80.  
  81. document.getElementById('set-heart-btn').addEventListener('click', () => {
  82. const heartCount = document.getElementById('set-heart-count').value;
  83. window.heartCount = parseInt(heartCount);
  84. updateHeartsDisplay();
  85. });
  86.  
  87. // Add Change Character
  88. const changeCharacterContainer = document.createElement('div');
  89. changeCharacterContainer.style.marginBottom = '10px';
  90. changeCharacterContainer.innerHTML = `
  91. <label for="character-select">Select Heart Character:</label>
  92. <select id="character-select" style="width: 100%; padding: 5px;">
  93. <option value="❤️">❤️</option>
  94. <option value="💛">💛</option>
  95. <option value="💚">💚</option>
  96. <option value="💙">💙</option>
  97. <option value="💜">💜</option>
  98. <option value="🖤">🖤</option>
  99. <!-- Add more heart characters here -->
  100. </select>
  101. <button id="change-character-btn" style="width: 100%; padding: 10px; background-color: #3498db; color: #fff; border: none; border-radius: 5px; cursor: pointer;">Change Character</button>
  102. `;
  103. cheatMenu.appendChild(changeCharacterContainer);
  104.  
  105. document.getElementById('change-character-btn').addEventListener('click', () => {
  106. const character = document.getElementById('character-select').value;
  107. window.character = character;
  108. updateCharacterDisplay();
  109. });
  110.  
  111. // Add Buy Upgrade
  112. const buyUpgradeContainer = document.createElement('div');
  113. buyUpgradeContainer.style.marginBottom = '10px';
  114. buyUpgradeContainer.innerHTML = `
  115. <label for="upgrade-select">Select Upgrade:</label>
  116. <select id="upgrade-select" style="width: 100%; padding: 5px;">
  117. <option value="auto-clicker">Auto-Clicker</option>
  118. <option value="double-hearts">Double Hearts</option>
  119. <option value="heart-multiplier">Heart Multiplier</option>
  120. <!-- Add more upgrades here -->
  121. </select>
  122. <button id="buy-upgrade-btn" style="width: 100%; padding: 10px; background-color: #3498db; color: #fff; border: none; border-radius: 5px; cursor: pointer;">Buy Upgrade</button>
  123. `;
  124. cheatMenu.appendChild(buyUpgradeContainer);
  125.  
  126. document.getElementById('buy-upgrade-btn').addEventListener('click', () => {
  127. const upgrade = document.getElementById('upgrade-select').value;
  128. buyUpgrade(upgrade);
  129. });
  130.  
  131. // Additional cheats
  132. const cheats = [
  133. { id: 'cheat1', text: 'Unlock All Upgrades', action: unlockAllUpgrades },
  134. { id: 'cheat2', text: 'Add 10,000 Hearts', action: () => { window.heartCount += 10000; updateHeartsDisplay(); } },
  135. { id: 'cheat3', text: 'Set Hearts to Max', action: () => { window.heartCount = Number.MAX_SAFE_INTEGER; updateHeartsDisplay(); } },
  136. { id: 'cheat4', text: 'Enable Double Clicks', action: () => { window.doubleClicksEnabled = true; } },
  137. { id: 'cheat5', text: 'Disable Click Limit', action: () => { window.clickLimitDisabled = true; } },
  138. { id: 'cheat6', text: 'Reset Game Progress', action: () => { window.heartCount = 0; updateHeartsDisplay(); } },
  139. { id: 'cheat7', text: 'Add 1 Million Hearts', action: () => { window.heartCount += 1000000; updateHeartsDisplay(); } },
  140. { id: 'cheat8', text: 'Grant All Achievements', action: grantAllAchievements },
  141. { id: 'cheat9', text: 'Set Heart Multiplier to 10x', action: () => { window.heartMultiplier = 10; } },
  142. { id: 'cheat10', text: 'Unlock VIP Heart Character', action: unlockVIPHeart },
  143. { id: 'cheat11', text: 'Instant Auto-Clicker', action: () => { window.autoClickerEnabled = true; } },
  144. { id: 'cheat12', text: 'Double Upgrade Speed', action: () => { window.upgradeSpeed *= 2; } },
  145. { id: 'cheat13', text: 'Set All Upgrades to Max Level', action: setAllUpgradesToMax },
  146. { id: 'cheat14', text: 'Change Background Color', action: () => document.body.style.backgroundColor = '#f0f0f0' },
  147. { id: 'cheat15', text: 'Enable Infinite Hearts', action: () => { window.infiniteHearts = true; } },
  148. { id: 'cheat16', text: 'Grant Extra Lives', action: () => { window.lives += 5; } },
  149. { id: 'cheat17', text: 'Unlock All Characters', action: unlockAllCharacters },
  150. { id: 'cheat18', text: 'Set Game Speed to Fast', action: () => { window.gameSpeed = 2; } },
  151. { id: 'cheat19', text: 'Apply Random Upgrade', action: applyRandomUpgrade },
  152. { id: 'cheat20', text: 'Reset to Default Settings', action: resetToDefaultSettings }
  153. ];
  154.  
  155. cheats.forEach((cheat) => {
  156. const cheatButton = document.createElement('button');
  157. cheatButton.id = cheat.id;
  158. cheatButton.innerText = cheat.text;
  159. cheatButton.style.backgroundColor = '#3498db';
  160. cheatButton.style.color = '#fff';
  161. cheatButton.style.border = 'none';
  162. cheatButton.style.padding = '10px';
  163. cheatButton.style.margin = '5px';
  164. cheatButton.style.borderRadius = '5px';
  165. cheatButton.style.cursor = 'pointer';
  166. cheatButton.onclick = cheat.action;
  167. cheatMenu.appendChild(cheatButton);
  168. });
  169.  
  170. // Add the cheat menu toggle button
  171. const toggleCheatButton = document.createElement('button');
  172. toggleCheatButton.innerText = 'Open Cheats';
  173. toggleCheatButton.style.position = 'fixed';
  174. toggleCheatButton.style.bottom = '10px';
  175. toggleCheatButton.style.right = '10px';
  176. toggleCheatButton.style.backgroundColor = '#e74c3c';
  177. toggleCheatButton.style.color = '#fff';
  178. toggleCheatButton.style.border = 'none';
  179. toggleCheatButton.style.padding = '10px 20px';
  180. toggleCheatButton.style.borderRadius = '5px';
  181. toggleCheatButton.style.cursor = 'pointer';
  182. toggleCheatButton.onclick = () => {
  183. cheatMenu.style.display = (cheatMenu.style.display === 'none') ? 'block' : 'none';
  184. };
  185. document.body.appendChild(toggleCheatButton);
  186.  
  187. // Example implementations of cheat actions
  188. function unlockAllUpgrades() {
  189. // Implement logic to unlock all upgrades
  190. alert('All upgrades unlocked!');
  191. }
  192.  
  193. function grantAllAchievements() {
  194. // Implement logic to grant all achievements
  195. alert('All achievements granted!');
  196. }
  197.  
  198. function unlockVIPHeart() {
  199. // Implement logic to unlock VIP Heart Character
  200. alert('VIP Heart Character unlocked!');
  201. }
  202.  
  203. function setAllUpgradesToMax() {
  204. // Implement logic to set all upgrades to max level
  205. alert('All upgrades set to max level!');
  206. }
  207.  
  208. function unlockAllCharacters() {
  209. // Implement logic to unlock all characters
  210. alert('All characters unlocked!');
  211. }
  212.  
  213. function applyRandomUpgrade() {
  214. // Implement logic to apply a random upgrade
  215. alert('Random upgrade applied!');
  216. }
  217.  
  218. function resetToDefaultSettings() {
  219. // Implement logic to reset game to default settings
  220. alert('Game settings reset to default!');
  221. }
  222.  
  223. function updateHeartsDisplay() {
  224. // Update hearts display with the new count
  225. alert(`Hearts updated: ${window.heartCount}`);
  226. }
  227.  
  228. function updateCharacterDisplay() {
  229. // Update the character display with the new character
  230. alert(`Character updated to: ${window.character}`);
  231. }
  232.  
  233. function buyUpgrade(upgrade) {
  234. // Implement logic to buy upgrade
  235. alert(`Bought upgrade: ${upgrade}`);
  236. }
  237.  
  238. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址