Beta adapter Ping/Fps! (v3)

This is a beta adapter for your ping/FPS in MooMoo.io! + Remove Ad

当前为 2023-11-23 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Beta adapter Ping/Fps! (v3)
  3. // @name:ru Бета адаптер Ping/Fps! (v3)
  4. // @namespace none
  5. // @version 3.1.0
  6. // @description This is a beta adapter for your ping/FPS in MooMoo.io! + Remove Ad
  7. // @description:ru Это бета-адаптер для вашего ping/FPS в MooMoo.io! + Удалить Рекламу
  8. // @author @nudoo
  9. // @match *://moomoo.io/*
  10. // @match *://*.moomoo.io/*
  11. // @icon https://www.google.com/s2/favicons?sz=64&domain=moomoo.io
  12. // @grant none
  13. // @run-at document-start
  14. // ==/UserScript==
  15. (function() {
  16. "use strict"
  17.  
  18. const adSelectors = [
  19. "#adCard", "#adBlock", "#promoImgHolder",
  20. "#pre-content-container"
  21. ]
  22. const meaninglessSelectors = [
  23. "#joinPartyButton", "#partyButton", "#settingsButton",
  24. `script[src="./libs/howler.core.min.js"]`, "#errorNotification",
  25. "#youtubeFollow", "#linksContainer2", "#twitterFollow",
  26. "#followText", "#youtuberOf", "#mobileInstructions",
  27. "#downloadButtonContainer", "#mobileDownloadButtonContainer", ".downloadBadge",
  28. "#altServer"
  29. ]
  30. const stateColors = {
  31. enabled: "#7ee559",
  32. disabled: "#e55959"
  33. }
  34.  
  35. function removeElement(selector) {
  36. const elements = [ ...document.querySelectorAll(selector) ]
  37.  
  38. for (const element of elements) {
  39. if (!element) continue
  40.  
  41. if (!(element.remove instanceof Function)) {
  42. element.style.display = "none !important"
  43. element.style.visiblity = "hidden !important"
  44.  
  45. continue
  46. }
  47.  
  48. element.remove()
  49. }
  50. }
  51.  
  52. function removeElements(selectors) {
  53. for (const selector of selectors) {
  54. if (!selector) continue
  55.  
  56. removeElement(selector)
  57. }
  58. }
  59.  
  60. function getCustomId(id) {
  61. id = id.toLowerCase().replace(/(\-|\s)/g, "_")
  62.  
  63. return `beta_adapter_${id}`
  64. }
  65.  
  66. function getGameDefaultButton(id) {
  67. const button = document.createElement("div")
  68.  
  69. button.classList.add("menuButton")
  70.  
  71. button.id = id
  72.  
  73. return button
  74. }
  75.  
  76. function addButtonToSetupCard(name, state, listener) {
  77. const setupCard = document.getElementById("setupCard")
  78. const id = getCustomId(name)
  79. const button = getGameDefaultButton(id)
  80.  
  81. button.innerHTML = `<span>${name}</span>`
  82. button.style.marginTop = "16px"
  83.  
  84. setupCard.appendChild(button)
  85.  
  86. button.setState = function(_state) {
  87. const stateColor = stateColors[_state ? "enabled" : "disabled"]
  88.  
  89. button.style.backgroundColor = stateColor
  90. }
  91.  
  92. button.setState(state)
  93.  
  94. if (!(listener instanceof Function)) return
  95.  
  96. button.addEventListener("click", listener.bind(null, button))
  97. }
  98.  
  99. function getRemoveStoreHatsState() {
  100. return JSON.parse(localStorage.getItem("remove_store_hats"))
  101. }
  102.  
  103. function setRemoveStoreHatsState(_state) {
  104. localStorage.setItem("remove_store_hats", JSON.stringify(_state))
  105. }
  106.  
  107. function onDOMLoaded() {
  108. removeElements(adSelectors)
  109. removeElements(meaninglessSelectors)
  110.  
  111. addButtonToSetupCard("Remove store hats", getRemoveStoreHatsState(), (button) => {
  112. const state = !getRemoveStoreHatsState()
  113.  
  114. button.setState(state)
  115. setRemoveStoreHatsState(state)
  116. })
  117.  
  118. const storeButton = document.getElementById("storeButton")
  119. const storeTabs = document.querySelectorAll(".storeTab")
  120. const removeHatsButtons = [ storeButton, ...storeTabs ]
  121.  
  122. removeHatsButtons.forEach((button) => {
  123. button.addEventListener("click", () => {
  124. if (!getRemoveStoreHatsState()) return
  125.  
  126. const interval = setInterval(() => {
  127. const mainMenu = document.getElementById("mainMenu")
  128. const hatPreview = document.querySelector(".hatPreview")
  129.  
  130. if (mainMenu) return clearInterval(interval)
  131. if (!hatPreview) return
  132.  
  133. removeElement(".hatPreview")
  134. clearInterval(interval)
  135. })
  136. })
  137. })
  138. }
  139.  
  140. window.location.native_resolution = true
  141.  
  142. const oldReqAnimFrame = window.requestAnimationFrame
  143.  
  144. window.requestAnimationFrame = function(callback) {
  145. if (callback.toString().length === 69) {
  146. return window.setTimeout(callback, 1e3 / 200)
  147. }
  148.  
  149. return oldReqAnimFrame(callback)
  150. }
  151.  
  152. Object.defineProperty(HTMLImageElement.prototype, "src", {
  153. get() {
  154. return this[Symbol("src")]
  155. },
  156. set(value) {
  157. if (this.classList.contains("hatPreview")) {
  158. if (getRemoveStoreHatsState() && (/\/hats\/hat\_/.test(value) || /\/accessories\/access\_/.test(value))) {
  159. return this.remove()
  160. }
  161. }
  162.  
  163. this.setAttribute("src", value)
  164.  
  165. this[Symbol("src")] = value
  166. },
  167. configurable: true
  168. })
  169.  
  170. Object.defineProperty(Object.prototype, "turnSpeed", {
  171. get() {
  172. return 0
  173. },
  174. set(value) {
  175. this[Symbol("turnSpeed")] = 0
  176. },
  177. configurable: true
  178. })
  179.  
  180. const maxScreenWidth = 1920
  181. const maxScreenHeight = 1080
  182. const { lineTo, moveTo } = CanvasRenderingContext2D.prototype
  183. const gridAlpha = 0.06
  184.  
  185. CanvasRenderingContext2D.prototype.moveTo = function(x, y) {
  186. if (this.globalAlpha === gridAlpha) return
  187.  
  188. return moveTo.apply(this, arguments)
  189. }
  190.  
  191. CanvasRenderingContext2D.prototype.lineTo = function(x, y) {
  192. if (this.globalAlpha === gridAlpha && (y === maxScreenHeight || x === maxScreenWidth)) return
  193.  
  194. return lineTo.apply(this, arguments)
  195. }
  196.  
  197. window.addEventListener("DOMContentLoaded", onDOMLoaded)
  198. })()