Detect Low Player Servers

A userscript that detects servers with a low amount of players in them, but also not 0 players.

当前为 2022-03-21 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Detect Low Player Servers
  3. // @description A userscript that detects servers with a low amount of players in them, but also not 0 players.
  4. // @author TheThreeBowlingBulbs
  5. // @match *://arras.io/*
  6. // @version 1.0.1
  7. // @namespace https://gf.qytechs.cn/users/812261
  8. // ==/UserScript==
  9.  
  10. // Modify setBar for client limit
  11. let setBar = 5;
  12.  
  13. async function detector() {
  14. let fetchN = await fetch('https://ak7oqfc2u4qqcu6i.uvwx.xyz:2222/status');
  15. let fetchC = await fetch('https://ak7oqfc2u4qqcu6i.uvwx.xyz:2222/clientCount');
  16. let server = await fetchN.json();
  17. let client = await fetchC.json();
  18. let clientCount = client.clients;
  19. let sum = 0;
  20. let servers = server.status;
  21. console.log(servers);
  22. let convertArray = [];
  23. for (let count in servers) {
  24. convertArray.push(servers[count]);
  25. }
  26. for (let c = 0; c < convertArray.length; c++) {
  27. if (convertArray[c].clients > setBar) {
  28. sum = sum + convertArray[c].clients;
  29. }
  30. if (convertArray[c].clients > 0 && convertArray[c].clients < setBar) {
  31. console.table(convertArray[c]);
  32. }
  33.  
  34. }
  35. console.log(clientCount - sum);
  36. }
  37. detector();

QingJ © 2025

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