Just a cps counter

Shows the number of clicks per second

  1. // ==UserScript==
  2. // @name Just a cps counter
  3. // @namespace -
  4. // @version 0.1
  5. // @description Shows the number of clicks per second
  6. // @author Nudo#3310
  7. // @license MIT
  8. // @match *://sploop.io/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=sploop.io
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function anonymous() {
  14. const Cps = {}
  15.  
  16. Cps.log = console.log
  17.  
  18. Cps.count = 0
  19.  
  20. Cps.reduce = function() {
  21. this.count -= 1
  22.  
  23. this.element.setText(this.count)
  24. }
  25.  
  26. Cps.increase = function() {
  27. this.count += 1
  28.  
  29. this.element.setText(this.count)
  30. }
  31.  
  32. Cps.sleep = function() {
  33. return new Promise((resolve) => {
  34. setTimeout(resolve, 1000)
  35. })
  36. }
  37.  
  38. Cps.createElement = function() {
  39. this.element = document.createElement("div")
  40.  
  41. this.element.setText = (count) => {
  42. const countNum = parseInt(count)
  43.  
  44. if (countNum < 0) {
  45. count = 0
  46.  
  47. Cps.log("bug...")
  48. }
  49.  
  50. this.element.textContent = `Cps: ${count}`
  51. }
  52.  
  53. this.element.setText(0)
  54.  
  55. this.style = this.element.style
  56.  
  57. this.element.classList.add("text-shadowed-3")
  58.  
  59. this.style.position = "absolute"
  60. this.style.top = "20px"
  61.  
  62. this.style.width = "100%"
  63.  
  64. this.style.pointerEvents = "none"
  65.  
  66. this.style.textAlign = "center"
  67. this.style.color = "white"
  68. this.style.fontSize = "20px"
  69.  
  70. document.body.appendChild(this.element)
  71. }
  72.  
  73. Cps.createElement()
  74.  
  75. Cps.update = async function() {
  76. this.increase()
  77. await this.sleep()
  78. this.reduce()
  79. }
  80.  
  81. document.addEventListener("mousedown", () => {
  82. Cps.update()
  83. })
  84.  
  85. Cps.spaceActive = false
  86.  
  87. document.addEventListener("keydown", (event) => {
  88. if (event.code !== "Space" || Cps.spaceActive) {
  89. return void 0
  90. }
  91.  
  92. Cps.update()
  93. Cps.spaceActive = true
  94. })
  95.  
  96. document.addEventListener("keyup", (event) => {
  97. if (event.code !== "Space") {
  98. return void 0
  99. }
  100.  
  101. Cps.spaceActive = false
  102. })
  103. })()

QingJ © 2025

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