FPS Surviv.io

try to take over the world!

  1. // ==UserScript==
  2. // @name FPS Surviv.io
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description try to take over the world!
  6. // @author Quintec#0689
  7. // @match *://surviv.io/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. var first = true;
  12. (function() {
  13. 'use strict';
  14.  
  15. const times = [];
  16. let fps;
  17.  
  18. function refreshLoop() {
  19. window.requestAnimationFrame(() => {
  20. const now = performance.now();
  21. while (times.length > 0 && times[0] <= now - 1000) {
  22. times.shift();
  23. }
  24. times.push(now);
  25. fps = times.length;
  26. if (first) {
  27. var obj = document.createElement("P");
  28. var text = document.createTextNode(Math.round(fps).toString() + " FPS");
  29. obj.appendChild(text);
  30. obj.setAttribute("id", "fps");
  31. document.getElementById("ui-top-left").appendChild(obj);
  32. var credit = document.createElement("P");
  33. var txt = document.createTextNode("Created by Quintec#0689 on Discord");
  34. credit.appendChild(txt);
  35. document.getElementById("ui-top-left").appendChild(credit);
  36. first = false;
  37. } else {
  38. document.getElementById("fps").innerHTML = Math.round(fps).toString() + " FPS";
  39. }
  40. refreshLoop();
  41. });
  42. }
  43. refreshLoop();
  44. })();

QingJ © 2025

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