Bloxd Keystroke/CPS counter

Bloxd.io crosshair/cps counter

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

  1. // ==UserScript==
  2. // @name Bloxd Keystroke/CPS counter
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Bloxd.io crosshair/cps counter
  6. // @author GoldenDragonYT
  7. // @match https://bloxd.io/
  8. // @grant GM_addStyle
  9. // ==/UserScript==
  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. // ==UserScript==
  254. // @name Bloxd Keystroke/CPS counter
  255. // @namespace http://tampermonkey.net/
  256. // @version 1.0
  257. // @description Bloxd.io crosshair/cps counter
  258. // @author GoldenDragonYT
  259. // @match https://bloxd.io/
  260. // @grant GM_addStyle
  261. // ==/UserScript==
  262.  
  263. (function() {
  264. 'use strict';
  265.  
  266. let crosshairVisible = false;
  267.  
  268. function toggleCrosshair() {
  269. const crosshair = document.getElementById('crosshair');
  270. if (crosshair) {
  271. crosshair.remove();
  272. crosshairVisible = false;
  273. } else {
  274. addCrosshair();
  275. crosshairVisible = true;
  276. }
  277. }
  278.  
  279. function addCrosshair() {
  280. GM_addStyle(`
  281. #crosshair {
  282. position: fixed;
  283. top: 50%;
  284. left: 50%;
  285. transform: translate(-50%, -50%);
  286. width: 100px;
  287. height: 100px;
  288. border: 2px solid white;
  289. border-radius: 50%;
  290. box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0.8);
  291. animation: glow 1.5s ease-in-out infinite;
  292. z-index: 9999;
  293. pointer-events: none; /* Allow click events to pass through */
  294. }
  295.  
  296. #noa-canvas {
  297. position: relative;
  298. z-index: 9998;
  299. }
  300.  
  301. @keyframes glow {
  302. 0% {
  303. box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0.8);
  304. }
  305. 50% {
  306. box-shadow: 0 0 20px 20px rgba(255, 255, 255, 0.4);
  307. }
  308. 100% {
  309. box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0.8);
  310. }
  311. }
  312. `);
  313.  
  314. const crosshair = document.createElement('div');
  315. crosshair.id = 'crosshair';
  316.  
  317. document.body.appendChild(crosshair);
  318.  
  319. window.addEventListener('mousemove', (event) => {
  320. const mouseX = event.clientX;
  321. const mouseY = event.clientY;
  322. crosshair.style.left = mouseX + 'px';
  323. crosshair.style.top = mouseY + 'px';
  324. });
  325. }
  326.  
  327. function handleKeyPress(event) {
  328. if (event.key === 'g' || event.key === 'G') {
  329. toggleCrosshair();
  330. }
  331. }
  332.  
  333. if (document.readyState === 'loading') {
  334. document.addEventListener('DOMContentLoaded', addCrosshair);
  335. } else {
  336. addCrosshair();
  337. }
  338.  
  339. window.addEventListener('keydown', handleKeyPress);
  340. })();
  341.  
  342. (function() {
  343. 'use strict';
  344.  
  345. // Disable unnecessary animations
  346. document.body.style.animation = 'none';
  347.  
  348. // Disable image smoothing
  349. const canvasElements = document.getElementsByTagName('canvas');
  350. for (let i = 0; i < canvasElements.length; i++) {
  351. const canvas = canvasElements[i];
  352. const context = canvas.getContext('2d');
  353. context.imageSmoothingEnabled = false;
  354. }
  355.  
  356. // Disable shadows
  357. const styleElements = document.getElementsByTagName('style');
  358. for (let i = 0; i < styleElements.length; i++) {
  359. const style = styleElements[i];
  360. if (style.innerText.includes('box-shadow')) {
  361. style.innerText = style.innerText.replace(/box-shadow[^}]+}/g, '');
  362. }
  363. }
  364. })();
  365.  
  366.  
  367. function myFunction() {
  368. const myCrosshair = document.querySelector("#root > div.WholeAppWrapper > div > div.CrossHair")
  369. if (myCrosshair) {
  370. myCrosshair.textContent = '𖣨';
  371. }
  372. const annoyingIcons = document.querySelector("#root > div.WholeAppWrapper > div > div.BottomLeftIcons");
  373. if (annoyingIcons) {
  374. annoyingIcons.style.display = "none";
  375. annoyingIcons.style.visibility = 'hidden';
  376. }
  377. const annoyingIcons2 = document.querySelector("#root > div.WholeAppWrapper > div > div.TopRightElements")
  378. if (annoyingIcons2) {
  379. annoyingIcons2.style.display = "none";
  380. annoyingIcons2.style.visibility = 'hidden';
  381. }
  382. }
  383.  
  384. setInterval(myFunction, 1000)
  385.  
  386. const cpsCounter = document.querySelector("body > div:nth-child(10)")
  387. if (cpsCounter) {
  388. cpsCounter.style.fontSize = '40px';
  389. }

QingJ © 2025

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