Greasy Fork镜像 支持简体中文。

Sploop Improver

Improves Sploop

  1. // ==UserScript==
  2. // @name Sploop Improver
  3. // @namespace -
  4. // @version -
  5. // @description Improves Sploop
  6. // @author Carolina Reaper
  7. // @match *://sploop.io/*
  8. // @match *://lostworld.io/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=sploop.io
  10. // @grant none
  11. // ==/UserScript==
  12. // Start Injection
  13. let inject1 = Date.now();
  14. console.log("Injecting Script, Sploop Improver.");
  15.  
  16. // Remove annoying pop-up before tab is closed
  17. window.onbeforeunload = null;
  18.  
  19. //Element Remover
  20. function remove(e) {
  21. e.forEach(t => document.getElementById(t) && document.getElementById(t).remove());
  22. };
  23.  
  24. // Removes unnessecary stuff
  25. setInterval(function() {
  26. remove(["google_play", "cross-promo", "da-bottom", "bottom-wrap", "right-content", "lostworld-io_970x250", "lostworld-io_300x250", "lostworld-io_300x250_1", "lostworld-io_300x250_2", "shop-io-games", "webgames-text", "da-right", "da-left"]);
  27. }, 0);
  28.  
  29. // Create New Elements
  30. let progress = document.createElement("div"), progressBar = document.createElement("div"), progressTitle = document.createElement("div"),
  31. percentageValue = document.createElement("div"), scoreValue = document.createElement("div"), rightTextKills = document.createElement("div"),
  32. rightTextDeaths = document.createElement("div"), killDeathRatio = document.createElement("div");
  33.  
  34. // Variables for menu parts
  35. let bottom = document.getElementById("game-bottom-content"), right = document.getElementById("game-right-content-main"), left = document.getElementById("game-left-content-main");
  36.  
  37. // Provide ID and Class to elements
  38. progress.classList.add("progress");
  39. progressBar.classList.add("progressBar");
  40. progressTitle.id = "progressTitle";
  41. percentageValue.id = "percentageValue";
  42. scoreValue.id = "scoreValue";
  43. rightTextKills.id = "rightTextKills";
  44. rightTextDeaths.id = "rightTextDeaths";
  45. killDeathRatio.id = "killDeathRatio";
  46. bottom.classList.add("boldBorders");
  47. right.classList.add("boldBorders");
  48. left.classList.add("boldBorders");
  49.  
  50. // Append elements to bottom
  51. bottom.appendChild(progressTitle);
  52. bottom.appendChild(progress);
  53. progress.appendChild(progressBar);
  54. progressBar.appendChild(percentageValue);
  55. bottom.appendChild(scoreValue);
  56.  
  57. // Append elements to right
  58. right.appendChild(rightTextKills);
  59. right.appendChild(rightTextDeaths);
  60. right.appendChild(killDeathRatio);
  61.  
  62. // Add innerHTML
  63. progressTitle.innerHTML = "Rank Progress";
  64.  
  65. // Interval
  66. setInterval(function() {
  67. let percentage = Math.round((parseInt(document.getElementById("total-score").innerText, 1e1) / (parseInt(document.getElementById("score-left-value").innerText, 1e1) + parseInt(document.getElementById("total-score").innerText, 1e1))) * 1e2);
  68. progressBar.style.width = percentage.toString() + "%";
  69. percentageValue.innerHTML = progressBar.style.width;
  70. scoreValue.innerHTML = "(" + document.getElementById("total-score").innerText + " / " + (parseInt(document.getElementById("score-left-value").innerText) + parseInt(document.getElementById("total-score").innerText)).toString() + ")";
  71. rightTextKills.innerHTML = "Total Kills<br>" + document.getElementById("total-kill").innerText;
  72. rightTextDeaths.innerHTML = "Total Deaths<br>" + document.getElementById("total-death").innerText;
  73. killDeathRatio.innerHTML = Math.round(parseInt(document.getElementById("total-kill").innerText) / parseInt(document.getElementById("total-death").innerText)) + " kills per death";
  74. }, 0);
  75.  
  76. // Add CSS
  77. let styleSheet = document.createElement("style");
  78. styleSheet.innerText = `
  79. .boldBorders {
  80. border: 5px solid rgb(20 20 20 / 30%);
  81. border-radius: 10px;
  82. }
  83.  
  84. #game-bottom-content {
  85. width: 1000px;
  86. height: 225px;
  87. }
  88.  
  89. #progressTitle {
  90. font-size: 25px;
  91. text-align: center;
  92. color: rgba(255, 255, 255, 0.8);
  93. border: 7px solid rgba(0,0,0,0);
  94. }
  95.  
  96. .progress {
  97. background-color: rgb(20 20 20 / 40%);
  98. border-radius: 25px;
  99. border: 5px solid rgb(20 20 20 / 80%);
  100. height: 50px;
  101. width: 700px;
  102. margin: auto;
  103. }
  104.  
  105. .progressBar {
  106. display: flex;
  107. align-items: center;
  108. justify-content: center;
  109. border-radius: 25px;
  110. background-color: rgb(20 20 20 / 60%);
  111. height: 100%;
  112. width: 0%;
  113. transition: 1s ease 0.25s;
  114. }
  115.  
  116. #percentageValue {
  117. color: rgba(255, 255, 255, 0.8);
  118. font-size: 18px;
  119. text-align: center;
  120. }
  121.  
  122. #scoreValue {
  123. font-size: 18px;
  124. text-align: center;
  125. color: rgba(255, 255, 255, 0.8);
  126. border: 5px solid rgba(0,0,0,0);
  127. }
  128.  
  129. #rightTextKills {
  130. font-size: 20px;
  131. color: rgba(255, 255, 255, 0.8);
  132. border: 10px solid rgba(0,0,0,0);
  133. text-align: center;
  134. float: left;
  135. }
  136.  
  137. #rightTextDeaths {
  138. font-size: 20px;
  139. color: rgba(255, 255, 255, 0.8);
  140. border: 10px solid rgba(0,0,0,0);
  141. text-align: center;
  142. float: right;
  143. }
  144.  
  145. #killDeathRatio {
  146. font-size: 20px;
  147. color: rgba(255, 255, 255, 0.8);
  148. border: 5px solid rgba(0,0,0,0);
  149. text-align: center;
  150. }
  151. `;
  152. document.head.appendChild(styleSheet);
  153.  
  154. // FPS + Server
  155. (function() {
  156. 'use strict';
  157. try {
  158. window.admob = {
  159. requestInterstitialAd: () => {},
  160. showInterstitialAd: () => {}
  161. };
  162. } catch (e) {
  163. console.warn(e)
  164. };
  165.  
  166. let UPDATE_DELAY = 7e2;
  167. let UPDATE_DELAY1 = 1e2;
  168. let frames = 0;
  169. let frames1 = 0;
  170. let lastUpdate = 0;
  171. let lastUpdate1 = 0;
  172.  
  173. function updateCounter1() {
  174. let bgColor = getComputedStyle(document.body, null).getPropertyValue("background-color");
  175. let bgColorValues = cssColorToRGB(bgColor);
  176. let textColor = getInvertedRGB(bgColorValues);
  177. let displayBg = getOpaqueRGB(bgColorValues);
  178. let now = Date.now();
  179. let elapsed = now - lastUpdate1;
  180.  
  181. if (elapsed < UPDATE_DELAY1) frames1++;
  182. else {
  183. frames1 = 0;
  184. lastUpdate1 = now;
  185. };
  186.  
  187. requestAnimationFrame(updateCounter1);
  188. };
  189.  
  190. lastUpdate1 = Date.now();
  191. requestAnimationFrame(updateCounter1);
  192.  
  193. let displayElement = document.createElement("div");
  194. displayElement.style.padding = "20px";
  195. displayElement.style = "font-size:20px;"
  196. displayElement.style.display = "block";
  197. displayElement.style.position = "absolute";
  198. displayElement.style.top = "1px";
  199. displayElement.style.left = "50%";
  200. displayElement.style.transform = "translateX(-50%)";
  201. displayElement.textContent = "Loading...";
  202. displayElement.style.color = "#fff";
  203. displayElement.style.background = "rgba(255, 255, 255, 0)";
  204. document.body.appendChild(displayElement);
  205.  
  206. function cssColorToRGB(color) {
  207. let values;
  208.  
  209. if (color.startsWith("rgba")) {
  210. values = color.substring(5, color.length - 1).split(",");
  211. } else if (color.startsWith("rgb")) {
  212. values = color.substring(4, color.length - 1).split(",");
  213. } else if (color.startsWith("#") && color.length === 4) {
  214. values = [];
  215. values[0] = "" + parseInt("0x" + color.substr(1, 1));
  216. values[1] = "" + parseInt("0x" + color.substr(2, 1));
  217. values[2] = "" + parseInt("0x" + color.substr(3, 1));
  218. } else if (color.startsWith("#") && color.length === 7) {
  219. values = [];
  220. values[0] = "" + parseInt("0x" + color.substr(1, 2));
  221. values[1] = "" + parseInt("0x" + color.substr(3, 2));
  222. values[2] = "" + parseInt("0x" + color.substr(5, 2));
  223. } else return {
  224. r: 255,
  225. g: 255,
  226. b: 255
  227. };
  228.  
  229. return {
  230. r: Number(values[0]),
  231. g: Number(values[1]),
  232. b: Number(values[2])
  233. };
  234. };
  235.  
  236. function getInvertedRGB(values) {
  237. return "rgb(" + (255 - values.r) + "," + (255 - values.g) + "," + (255 - values.b) + ")";
  238. };
  239.  
  240. function getOpaqueRGB(values) {
  241. return "rgba(" + values.r + "," + values.g + "," + values.b + ", 0.7)";
  242. };
  243.  
  244. const dropDown = document.querySelector("#server-select");
  245.  
  246. function updateCounter() {
  247. let bgColor = getComputedStyle(document.body, null).getPropertyValue("background-color");
  248. let bgColorValues = cssColorToRGB(bgColor);
  249. let textColor = getInvertedRGB(bgColorValues);
  250. let displayBg = getOpaqueRGB(bgColorValues);
  251. let now = Date.now();
  252. let elapsed = now - lastUpdate;
  253.  
  254. if (elapsed < UPDATE_DELAY) frames++;
  255. else {
  256. let fps = Math.round(frames / (elapsed / 1e3));
  257. frames = 0;
  258. lastUpdate = now;
  259. displayElement.textContent = `Fps: ${fps} \n ${dropDown.value.split(" -")[0]}`;
  260. };
  261.  
  262. requestAnimationFrame(updateCounter);
  263. };
  264.  
  265. lastUpdate = Date.now();
  266. requestAnimationFrame(updateCounter);
  267. })();
  268.  
  269. // Complete Injection
  270. let injectionTime = Date.now() - inject1;
  271. console.log("Injection Complete, Sploop Improver.\nInjection Time: " + injectionTime + "ms");

QingJ © 2025

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