PopCat Auto Clicker + Menu (Improved)

Automatically clicks the cat on the PopCat website at a faster rate and provides additional features when the Z key is pressed.

当前为 2023-12-26 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name PopCat Auto Clicker + Menu (Improved)
  3. // @namespace https://popcat.click
  4. // @version 4.5
  5. // @description Automatically clicks the cat on the PopCat website at a faster rate and provides additional features when the Z key is pressed.
  6. // @author HiraganaDev
  7. // @match https://popcat.click/*
  8. // @grant none
  9. // @icon https://popcat.click/icons/favicon.ico
  10. // ==/UserScript==
  11.  
  12.  
  13. (function () {
  14. var autoClickInterval = null;
  15. var autoClickTimer = null;
  16. var autoClickEnabled = false;
  17. var isActiveMenu = false;
  18. var menuElement = null;
  19. var clickCount = 0;
  20.  
  21.  
  22. document.addEventListener("keydown", function (event) {
  23. if (event.key === "z") {
  24. toggleMenu();
  25. }
  26. });
  27.  
  28.  
  29. document.addEventListener("click", function (event) {
  30. var target = event.target;
  31.  
  32. if (isActiveMenu && target !== menuElement && !menuElement.contains(target)) {
  33. closeMenu();
  34. }
  35. });
  36.  
  37. function toggleMenu() {
  38. if (!isActiveMenu) {
  39. showMenu();
  40. } else {
  41. closeMenu();
  42. }
  43. }
  44.  
  45. function startAutoClick() {
  46. autoClickEnabled = true;
  47. autoClickInterval = setInterval(function () {
  48. clickCat();
  49. }, 1);
  50.  
  51. autoClickTimer = setTimeout(function () {
  52. clearInterval(autoClickInterval);
  53. autoClickEnabled = false;
  54. showAutoClickStats();
  55. resetClickStats();
  56. }, 60000);
  57. }
  58.  
  59. function stopAutoClick() {
  60. autoClickEnabled = false;
  61. clearInterval(autoClickInterval);
  62. clearTimeout(autoClickTimer);
  63. }
  64.  
  65. function clickCat() {
  66. document.dispatchEvent(new KeyboardEvent("keydown", {
  67. key: "a",
  68. ctrlKey: true
  69. }));
  70. document.dispatchEvent(new KeyboardEvent("keyup", {
  71. key: "a"
  72. }));
  73. clickCount++;
  74. }
  75.  
  76. function showMenu() {
  77. isActiveMenu = true;
  78.  
  79. menuElement = document.createElement("div");
  80. menuElement.style.position = "fixed";
  81. menuElement.style.top = "50%";
  82. menuElement.style.left = "50%";
  83. menuElement.style.transform = "translate(-50%, -50%)";
  84. menuElement.style.width = "400px";
  85. menuElement.style.background = "#ffffff";
  86. menuElement.style.boxShadow = "0 0 10px rgba(0,0,0,0.3)";
  87. menuElement.style.borderRadius = "20px";
  88. menuElement.style.textAlign = "center";
  89. menuElement.style.padding = "20px";
  90. menuElement.style.color = "#333333";
  91. menuElement.style.fontFamily = "Arial, sans-serif";
  92.  
  93. var title = document.createElement("h1");
  94. title.innerText = "⭐ POPCAT AUTO-CLICKER MENU ⭐";
  95. title.style.marginTop = "0";
  96. title.style.marginBottom = "20px";
  97. title.style.color = "#ff0000";
  98. title.style.fontSize = "28px";
  99.  
  100. var autoClickToggle = document.createElement("div");
  101. autoClickToggle.innerText = "AutoClicker: " + (autoClickEnabled ? "ON (" + clickCount + " clicks)" : "OFF");
  102. autoClickToggle.style.cursor = "pointer";
  103. autoClickToggle.style.marginBottom = "20px";
  104. autoClickToggle.style.fontSize = "24px";
  105. autoClickToggle.style.color = autoClickEnabled ? "#00ff00" : "#ff0000";
  106.  
  107. autoClickToggle.addEventListener("click", function () {
  108. if (autoClickEnabled) {
  109. stopAutoClick();
  110. autoClickToggle.innerText = "AutoClicker: OFF";
  111. autoClickToggle.style.color = "#ff0000";
  112. } else {
  113. startAutoClick();
  114. autoClickToggle.innerText = "AutoClicker: ON (" + clickCount + " clicks)";
  115. autoClickToggle.style.color = "#00ff00";
  116. }
  117. });
  118.  
  119. var resetStatsButton = document.createElement("button");
  120. resetStatsButton.innerText = "Reset Clicks";
  121. resetStatsButton.style.backgroundColor = "#ff0000";
  122. resetStatsButton.style.color = "#ffffff";
  123. resetStatsButton.style.border = "none";
  124. resetStatsButton.style.cursor = "pointer";
  125. resetStatsButton.style.fontSize = "18px";
  126. resetStatsButton.style.padding = "10px 20px";
  127. resetStatsButton.style.borderRadius = "10px";
  128. resetStatsButton.style.marginTop = "20px";
  129.  
  130. resetStatsButton.addEventListener("click", function () {
  131. resetClickStats();
  132. });
  133.  
  134. var newFeature = document.createElement("p");
  135. newFeature.innerText = "💥 NEW FEATURE: The style of the menu has been improved 💥";
  136. newFeature.style.marginTop = "40px";
  137. newFeature.style.fontSize = "20px";
  138. newFeature.style.fontWeight = "bold";
  139.  
  140. var credits = document.createElement("p");
  141. credits.innerText = "Developed by HiraganaDev";
  142. credits.style.fontSize = "16px";
  143. credits.style.marginTop = "20px";
  144.  
  145. menuElement.appendChild(title);
  146. menuElement.appendChild(autoClickToggle);
  147. menuElement.appendChild(resetStatsButton);
  148. menuElement.appendChild(newFeature);
  149. menuElement.appendChild(credits);
  150.  
  151. document.body.appendChild(menuElement);
  152. }
  153.  
  154. function showAutoClickStats() {
  155. var popupElement = document.createElement("div");
  156. popupElement.style.position = "fixed";
  157. popupElement.style.top = "50%";
  158. popupElement.style.left = "50%";
  159. popupElement.style.transform = "translate(-50%, -50%)";
  160. popupElement.style.width = "240px";
  161. popupElement.style.height = "120px";
  162. popupElement.style.background = "#ffffff";
  163. popupElement.style.border = "1px solid #cccccc";
  164. popupElement.style.borderRadius = "8px";
  165. popupElement.style.padding = "20px";
  166. popupElement.style.textAlign = "center";
  167. popupElement.style.fontFamily = "Arial, sans-serif";
  168. popupElement.style.boxShadow = "0 0 10px rgba(0, 0, 0, 0.2)";
  169.  
  170. var clicksInfo = document.createElement("div");
  171. clicksInfo.style.fontSize = "16px";
  172. clicksInfo.style.marginBottom = "10px";
  173. clicksInfo.innerText = "Total Clicks: " + clickCount;
  174.  
  175. popupElement.appendChild(clicksInfo);
  176.  
  177. document.body.appendChild(popupElement);
  178.  
  179. setTimeout(function () {
  180. document.body.removeChild(popupElement);
  181. }, 3000);
  182. }
  183.  
  184. function resetClickStats() {
  185. clickCount = 0;
  186. }
  187.  
  188. function closeMenu() {
  189. isActiveMenu = false;
  190.  
  191. if (menuElement) {
  192. document.body.removeChild(menuElement);
  193. }
  194.  
  195. stopAutoClick();
  196. }
  197. })();