🏠 Home 

AntiKickSystem

At least this system should protect you from the kick system


ติดตั้งสคริปต์นี้?
  1. // ==UserScript==
  2. // @name AntiKickSystem
  3. // @namespace https://github.com/Nudo-o
  4. // @version 1
  5. // @description At least this system should protect you from the kick system
  6. // @author @nudoo
  7. // @match *://moomoo.io/*
  8. // @match *://*.moomoo.io/*
  9. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  10. // @require https://greasyfork.org/scripts/423602-msgpack/code/msgpack.js
  11. // @grant none
  12. // @license MIT
  13. // ==/UserScript==
  14. (function() {
  15. const { msgpack } = window
  16. function AntiKick() {
  17. this.resetDelay = 500
  18. this.packetsLimit = 40
  19. this.ignoreTypes = [ "pp", "rmd" ]
  20. this.ignoreQueuePackets = [ "5", "c", "33", "2", "7", "13c" ]
  21. this.packetsStorage = new Map()
  22. this.tmpPackets = []
  23. this.packetsQueue = []
  24. this.lastSent = Date.now()
  25. this.onSend = function(data) {
  26. const binary = new Uint8Array(data)
  27. const parsed = msgpack.decode(binary)
  28. if (Date.now() - this.lastSent > this.resetDelay) {
  29. this.tmpPackets = []
  30. this.lastSent = Date.now()
  31. }
  32. if (!this.ignoreTypes.includes(parsed[0])) {
  33. if (this.packetsStorage.has(parsed[0])) {
  34. const oldPacket = this.packetsStorage.get(parsed[0])
  35. switch (parsed[0]) {
  36. case "2":
  37. case "33":
  38. if (oldPacket[0] == parsed[1][0]) return true
  39. break
  40. }
  41. }
  42. if (this.tmpPackets.length > this.packetsLimit) {
  43. if (!this.ignoreQueuePackets.includes(parsed[0])) {
  44. this.packetsQueue.push(data)
  45. }
  46. return true
  47. }
  48. this.tmpPackets.push({
  49. type: parsed[0],
  50. data: parsed[1]
  51. })
  52. this.packetsStorage.set(parsed[0], parsed[1])
  53. }
  54. return false
  55. }
  56. }
  57. const antiKick = new AntiKick()
  58. let firstSend = false
  59. window.WebSocket.prototype.send = new Proxy(window.WebSocket.prototype.send, {
  60. apply: function(target, _this) {
  61. if (!firstSend) {
  62. _this.addEventListener("message", (event) => {
  63. if (!antiKick.packetsQueue.length) return
  64. const binary = new Uint8Array(event.data)
  65. const parsed = msgpack.decode(binary)
  66. if (parsed[0] === "33") {
  67. _this.send(antiKick.packetsQueue[0])
  68. antiKick.packetsQueue.shift()
  69. }
  70. })
  71. firstSend = true
  72. }
  73. if (antiKick.onSend(arguments[2][0])) return
  74. return Reflect.apply(...arguments)
  75. }
  76. })
  77. })()