Greasy Fork镜像 支持简体中文。

Moomoo.io - 1.8.0 AntiKickSystem

It shields you from the kick system by performing a kind of dash to prevent you from getting kicked.

  1. // ==UserScript==
  2. // @name Moomoo.io - 1.8.0 AntiKickSystem
  3. // @author Seryo
  4. // @description It shields you from the kick system by performing a kind of dash to prevent you from getting kicked.
  5. // @version 1
  6. // @match *://*.moomoo.io/*
  7. // @namespace https://gf.qytechs.cn/users/1190411
  8. // @icon https://cdn.glitch.com/82ae8945-dcc6-4276-98a9-665381b4cd2b/cursor12.png
  9. // @require https://gf.qytechs.cn/scripts/423602-msgpack/code/msgpack.js
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (() => {
  15. const { msgpack } = window;
  16. const antiKick = {
  17. resetDelay: 500,
  18. packetsLimit: 40,
  19. ignoreTypes: new Set(["10", "0"]),
  20. ignoreQueuePackets: new Set(["G", "d", "a", "D", "K", "c"]),
  21. packetsStorage: new Map(),
  22. tmpPackets: [],
  23. packetsQueue: [],
  24. lastSent: Date.now(),
  25. onSend(data) {
  26. const parsed = msgpack.decode(new Uint8Array(data));
  27. if (Date.now() - this.lastSent > this.resetDelay) {
  28. this.tmpPackets.length = 0;
  29. this.lastSent = Date.now();
  30. }
  31. if (!this.ignoreTypes.has(parsed[0])) {
  32. const oldPacket = this.packetsStorage.get(parsed[0]);
  33. if (oldPacket && (parsed[0] === "D" || parsed[0] === "a") && oldPacket[0] === parsed[1][0]) {
  34. return true;
  35. }
  36. if (this.tmpPackets.length > this.packetsLimit) {
  37. if (!this.ignoreQueuePackets.has(parsed[0])) {
  38. this.packetsQueue.push(data);
  39. }
  40. return true;
  41. }
  42. this.tmpPackets.push({ type: parsed[0], data: parsed[1] });
  43. this.packetsStorage.set(parsed[0], parsed[1]);
  44. }
  45. return false;
  46. }
  47. };
  48.  
  49. let firstSend = false;
  50.  
  51. window.WebSocket.prototype.send = new Proxy(window.WebSocket.prototype.send, {
  52. apply(target, _this, args) {
  53. if (!firstSend) {
  54. _this.addEventListener("message", (event) => {
  55. if (!antiKick.packetsQueue.length) return;
  56. const parsed = msgpack.decode(new Uint8Array(event.data));
  57. if (parsed[0] === "a") {
  58. _this.send(antiKick.packetsQueue.shift());
  59. }
  60. });
  61. firstSend = true;
  62. }
  63. if (antiKick.onSend(args[0])) return;
  64. return Reflect.apply(target, _this, args);
  65. }
  66. });
  67. })();

QingJ © 2025

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