Keystroke/CPS counter

Adds a glowing crosshair with a circular shadow background to any website.

目前为 2024-02-20 提交的版本。查看 最新版本

  1. // ==Keystroke/CPS counter==
  2. // @name Keystroke/CPS counter
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description XD XD
  6. // @author by GoldDracoYT
  7. // @match https://bloxd.io/
  8. // @grant GM_addStyle
  9. // ==Keystroke/CPS counter(s)==
  10. //99% of work credit goes to aabhushan paudel and cyrex
  11. //They worked very hard on this
  12. //I hope you enjoy this script! :D
  13.  
  14. (function () {
  15. var container = document.createElement('div');
  16. container.style.position = 'fixed';
  17. container.style.bottom = '10px';
  18. container.style.left = '10px';
  19. container.style.backgroundColor = 'transparent';
  20. container.style.color = 'white';
  21. container.style.padding = '5px';
  22. container.style.fontFamily = 'Arial';
  23. container.style.fontSize = '14px';
  24. container.style.zIndex = '9999';
  25.  
  26. var row1 = document.createElement('div');
  27. row1.style.display = 'flex';
  28. row1.style.justifyContent = 'center';
  29.  
  30. var upKey = createKeyElement('W');
  31.  
  32. var row2 = document.createElement('div');
  33. row2.style.display = 'flex';
  34. row2.style.justifyContent = 'center';
  35.  
  36. var leftKey = createKeyElement('A');
  37. var sprintKey = createKeyElement('S');
  38. var rightKey = createKeyElement('D');
  39.  
  40. var row3 = document.createElement('div');
  41. row3.style.display = 'flex';
  42. row3.style.justifyContent = 'center';
  43.  
  44. var shiftKey = createKeyElement('Shift');
  45. var crouchKey = createKeyElement('Z/C');
  46. var spaceKey = createKeyElement('|_____|');
  47.  
  48. var row4 = document.createElement('div');
  49. row4.style.display = 'flex';
  50. row4.style.justifyContent = 'center';
  51.  
  52. var lmbKey = createKeyElement('LMB');
  53. var rmbKey = createKeyElement('RMB');
  54.  
  55. row1.appendChild(upKey);
  56. row2.appendChild(leftKey);
  57. row2.appendChild(sprintKey);
  58. row2.appendChild(rightKey);
  59. row3.appendChild(shiftKey);
  60. row3.appendChild(crouchKey);
  61. row3.appendChild(spaceKey);
  62. row4.appendChild(lmbKey);
  63. row4.appendChild(rmbKey);
  64. container.appendChild(row1);
  65. container.appendChild(row2);
  66. container.appendChild(row3);
  67. container.appendChild(row4);
  68.  
  69. document.body.appendChild(container);
  70.  
  71. var cpsButton = document.createElement('div');
  72. cpsButton.style.position = 'fixed';
  73. cpsButton.style.top = '10px';
  74. cpsButton.style.right = '10px';
  75. cpsButton.style.backgroundColor = 'black';
  76. cpsButton.style.color = 'white';
  77. cpsButton.style.padding = '5px';
  78. cpsButton.style.fontFamily = 'Arial';
  79. cpsButton.style.fontSize = '14px';
  80. cpsButton.style.zIndex = '9999';
  81. cpsButton.textContent = '';
  82.  
  83. var cpsLabel = document.createElement('span');
  84. cpsLabel.textContent = 'LMB CPS: ';
  85. var cpsValue = document.createElement('span');
  86. cpsValue.textContent = '0';
  87.  
  88. cpsButton.appendChild(cpsLabel);
  89. cpsButton.appendChild(cpsValue);
  90. document.body.appendChild(cpsButton);
  91.  
  92. cpsButton.addEventListener('click', function () {
  93. resetClickCount();
  94. });
  95.  
  96. var clickTimes = [];
  97.  
  98. document.addEventListener('keydown', function (event) {
  99. highlightKey(event.key, 'green');
  100. });
  101.  
  102. document.addEventListener('keyup', function (event) {
  103. highlightKey(event.key, 'black');
  104. });
  105.  
  106. document.addEventListener('mousedown', function (event) {
  107. if (event.button === 0) {
  108. lmbKey.style.backgroundColor = 'green';
  109. countClick();
  110. } else if (event.button === 2) {
  111. rmbKey.style.backgroundColor = 'green';
  112. }
  113. });
  114.  
  115. document.addEventListener('mouseup', function (event) {
  116. if (event.button === 0) {
  117. lmbKey.style.backgroundColor = 'black';
  118. } else if (event.button === 2) {
  119. rmbKey.style.backgroundColor = 'black';
  120. }
  121. });
  122.  
  123. function createKeyElement(keyText) {
  124. var keyElement = document.createElement('div');
  125. keyElement.style.backgroundColor = 'transparent';
  126. keyElement.style.color = 'white';
  127. keyElement.style.padding = '5px';
  128. keyElement.style.margin = '2px';
  129. keyElement.style.border = '1px solid white';
  130. keyElement.style.borderRadius = '5px';
  131. keyElement.style.fontFamily = 'Arial';
  132. keyElement.style.fontSize = '20px';
  133. keyElement.textContent = keyText;
  134. return keyElement;
  135. }
  136.  
  137. function highlightKey(key, color) {
  138. switch (key) {
  139. case 'w':
  140. upKey.style.backgroundColor = color;
  141. break;
  142. case 'a':
  143. leftKey.style.backgroundColor = color;
  144. break;
  145. case 's':
  146. sprintKey.style.backgroundColor = color;
  147. break;
  148. case 'd':
  149. rightKey.style.backgroundColor = color;
  150. break;
  151. case 'z':
  152. crouchKey.style.backgroundColor = color;
  153. break;
  154. case 'c':
  155. crouchKey.style.backgroundColor = color;
  156. break;
  157. case 'Shift':
  158. shiftKey.style.backgroundColor = color;
  159. break;
  160. case ' ':
  161. spaceKey.style.backgroundColor = color;
  162. break;
  163. default:
  164. break;
  165. }
  166. }
  167.  
  168. function countClick() {
  169. var currentTime = new Date().getTime();
  170. clickTimes.push(currentTime);
  171. updateCPS();
  172. }
  173.  
  174. function updateCPS() {
  175. var currentTime = new Date().getTime();
  176. var oneSecondAgo = currentTime - 1000;
  177. var count = 0;
  178.  
  179. for (var i = clickTimes.length - 1; i >= 0; i--) {
  180. if (clickTimes[i] >= oneSecondAgo) {
  181. count++;
  182. } else {
  183. break;
  184. }
  185. }
  186.  
  187. cpsValue.textContent = count;
  188. }
  189.  
  190. function resetClickCount() {
  191. clickTimes = [];
  192. updateCPS();
  193. }
  194. })();
  195.  
  196. const myCPS = document.querySelector("body > div:nth-child(10)");
  197. if (myCPS) {
  198. myCPS.style.fontSize = '40px';
  199. myCPS.style.backgroundColor = 'rgba(0, 0, 0, 0.5)'; // Set the background color to black with 50% transparency
  200. }
  201. // Create a div for right-click CPS
  202. var rmbCPSButton = document.createElement('div');
  203. rmbCPSButton.style.position = 'fixed';
  204. rmbCPSButton.style.top = '50px'; // Position it below the LMB CPS
  205. rmbCPSButton.style.right = '10px';
  206. rmbCPSButton.style.backgroundColor = 'black';
  207. rmbCPSButton.style.color = 'white';
  208. rmbCPSButton.style.padding = '5px';
  209. rmbCPSButton.style.fontFamily = 'Arial';
  210. rmbCPSButton.style.fontSize = '14px';
  211. rmbCPSButton.style.zIndex = '9999';
  212. rmbCPSButton.textContent = '';
  213.  
  214. var rmbCPSLabel = document.createElement('span');
  215. rmbCPSLabel.textContent = 'RMB CPS: ';
  216. var rmbCPSValue = document.createElement('span');
  217. rmbCPSValue.textContent = '0';
  218.  
  219. rmbCPSButton.appendChild(rmbCPSLabel);
  220. rmbCPSButton.appendChild(rmbCPSValue);
  221. document.body.appendChild(rmbCPSButton);
  222.  
  223. // Event listeners for right-click
  224. var rmbClickTimes = [];
  225.  
  226. document.addEventListener('mousedown', function (event) {
  227. if (event.button === 2) { // Check for right mouse button
  228. countRightClick(); // Function to track right-clicks
  229. }
  230. });
  231.  
  232. function countRightClick() {
  233. var currentTime = new Date().getTime();
  234. rmbClickTimes.push(currentTime);
  235. updateRightClickCPS();
  236. }
  237.  
  238. function updateRightClickCPS() {
  239. var currentTime = new Date().getTime();
  240. var oneSecondAgo = currentTime - 1000;
  241. var count = 0;
  242.  
  243. for (var i = rmbClickTimes.length - 1; i >= 0; i--) {
  244. if (rmbClickTimes[i] >= oneSecondAgo) {
  245. count++;
  246. } else {
  247. break;
  248. }
  249. }
  250.  
  251. rmbCPSValue.textContent = count;
  252. }
  253. // ... (existing code)
  254. // ==UserScript==
  255. // @name Keystroke/CPS counter
  256. // @namespace http://tampermonkey.net/
  257. // @version 1.0
  258. // @description Adds a glowing crosshair with a circular shadow background to any website.
  259. // @author GoldenDragonYT
  260. // @match https://bloxd.io/
  261. // @grant GM_addStyle
  262. // ==/UserScript==
  263.  
  264. (function() {
  265. 'use strict';
  266.  
  267. let crosshairVisible = false;
  268.  
  269. function toggleCrosshair() {
  270. const crosshair = document.getElementById('crosshair');
  271. if (crosshair) {
  272. crosshair.remove();
  273. crosshairVisible = false;
  274. } else {
  275. addCrosshair();
  276. crosshairVisible = true;
  277. }
  278. }
  279.  
  280. function addCrosshair() {
  281. GM_addStyle(`
  282. #crosshair {
  283. position: fixed;
  284. top: 50%;
  285. left: 50%;
  286. transform: translate(-50%, -50%);
  287. width: 100px;
  288. height: 100px;
  289. border: 2px solid white;
  290. border-radius: 50%;
  291. box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0.8);
  292. animation: glow 1.5s ease-in-out infinite;
  293. z-index: 9999;
  294. pointer-events: none; /* Allow click events to pass through */
  295. }
  296.  
  297. #noa-canvas {
  298. position: relative;
  299. z-index: 9998;
  300. }
  301.  
  302. @keyframes glow {
  303. 0% {
  304. box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0.8);
  305. }
  306. 50% {
  307. box-shadow: 0 0 20px 20px rgba(255, 255, 255, 0.4);
  308. }
  309. 100% {
  310. box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0.8);
  311. }
  312. }
  313. `);
  314.  
  315. const crosshair = document.createElement('div');
  316. crosshair.id = 'crosshair';
  317.  
  318. document.body.appendChild(crosshair);
  319.  
  320. window.addEventListener('mousemove', (event) => {
  321. const mouseX = event.clientX;
  322. const mouseY = event.clientY;
  323. crosshair.style.left = mouseX + 'px';
  324. crosshair.style.top = mouseY + 'px';
  325. });
  326. }
  327.  
  328. function handleKeyPress(event) {
  329. if (event.key === 'g' || event.key === 'G') {
  330. toggleCrosshair();
  331. }
  332. }
  333.  
  334. if (document.readyState === 'loading') {
  335. document.addEventListener('DOMContentLoaded', addCrosshair);
  336. } else {
  337. addCrosshair();
  338. }
  339.  
  340. window.addEventListener('keydown', handleKeyPress);
  341. })();
  342.  
  343. (function() {
  344. 'use strict';
  345.  
  346. // Disable unnecessary animations
  347. document.body.style.animation = 'none';
  348.  
  349. // Disable image smoothing
  350. const canvasElements = document.getElementsByTagName('canvas');
  351. for (let i = 0; i < canvasElements.length; i++) {
  352. const canvas = canvasElements[i];
  353. const context = canvas.getContext('2d');
  354. context.imageSmoothingEnabled = false;
  355. }
  356.  
  357. // Disable shadows
  358. const styleElements = document.getElementsByTagName('style');
  359. for (let i = 0; i < styleElements.length; i++) {
  360. const style = styleElements[i];
  361. if (style.innerText.includes('box-shadow')) {
  362. style.innerText = style.innerText.replace(/box-shadow[^}]+}/g, '');
  363. }
  364. }
  365. })();
  366.  
  367.  
  368. function myFunction() {
  369. const myCrosshair = document.querySelector("#root > div.WholeAppWrapper > div > div.CrossHair")
  370. if (myCrosshair) {
  371. myCrosshair.textContent = '𖣓';
  372. }
  373. const annoyingIcons = document.querySelector("#root > div.WholeAppWrapper > div > div.BottomLeftIcons");
  374. if (annoyingIcons) {
  375. annoyingIcons.style.display = "none";
  376. annoyingIcons.style.visibility = 'hidden';
  377. }
  378. const annoyingIcons2 = document.querySelector("#root > div.WholeAppWrapper > div > div.TopRightElements")
  379. if (annoyingIcons2) {
  380. annoyingIcons2.style.display = "none";
  381. annoyingIcons2.style.visibility = 'hidden';
  382. }
  383. }
  384.  
  385. setInterval(myFunction, 1000)
  386.  
  387. const cpsCounter = document.querySelector("body > div:nth-child(10)")
  388. if (cpsCounter) {
  389. cpsCounter.style.fontSize = '40px';
  390. }

QingJ © 2025

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