MooMoo.io Auto-heal

Need much food solo moomoo.io

  1. // ==UserScript==
  2. // @name MooMoo.io Auto-heal
  3. // @namespace MooMoo.io Auto-Heal
  4. // @version 1.0
  5. // @description Need much food solo moomoo.io
  6. // @author The Lag Killer
  7. // @match *://moomoo.io/*
  8. // @match *://sandbox.moomoo.io/*
  9. // @grant none
  10. // @require https://cdn.jsdelivr.net/npm/msgpack-lite@0.1.26/dist/msgpack.min.js
  11. // @require https://cdn.jsdelivr.net/npm/fontfaceobserver@2.1.0/fontfaceobserver.standalone.min.js
  12. // ==/UserScript==
  13.  
  14. window.onbeforeunload = null;
  15. let mouseX;
  16. let mouseY;
  17. let width;
  18. let height;
  19. let coreURL = new URL(window['location']['href']);
  20. window['sessionStorage']['force'] = coreURL['searchParams']['get']('fc');
  21. var foodType;
  22. var ws;
  23. var msgpack5 = msgpack;
  24. let myPlayer = {
  25. 'id': null,
  26. 'x': null,
  27. 'y': null,
  28. 'dir': null,
  29. 'object': null,
  30. 'weapon': null,
  31. 'clan': null,
  32. 'isLeader': null,
  33. 'hat': null,
  34. 'accessory': null,
  35. 'isSkull': null
  36. };
  37. document.msgpack = msgpack;
  38. function n(){
  39. this.buffer = new Uint8Array([0]);
  40. this.buffer.__proto__ = new Uint8Array;
  41. this.type = 0;
  42. }
  43. WebSocket.prototype.oldSend = WebSocket.prototype.send;
  44. WebSocket.prototype.send = function(m){
  45. if (!ws){
  46. document.ws = this;
  47.  
  48. ws = this;
  49. socketFound(this);
  50. }
  51. this.oldSend(m);
  52. };
  53. function socketFound(a) {
  54. a['addEventListener']('message', function (b) {
  55. handleMessage(b);
  56. });
  57. }
  58. function handleMessage(a) {
  59. let b = msgpack5['decode'](new Uint8Array(a['data']));
  60. let c;
  61. if (b['length'] > 0x1) {
  62. c = [b[0x0], ...b[0x1]];
  63. if (c[0x1] instanceof Array) {
  64. c = c;
  65. }
  66. } else {
  67. c = b;
  68. }
  69. let d = c[0x0];
  70. if (!c) {
  71. return;
  72. };
  73. if (d === 'io-init') {
  74. let e = document['getElementById']('gameCanvas');
  75. width = e['clientWidth'];
  76. height = e['clientHeight'];
  77. $(window)['resize'](function () {
  78. width = e['clientWidth'];
  79. height = e['clientHeight'];
  80. });
  81. e['addEventListener']('mousemove', f => {
  82. mouseX = f['clientX'];
  83. mouseY = f['clientY'];
  84. });
  85. }
  86. if (d == '1' && myPlayer['id'] == null) {
  87. myPlayer['id'] = c[0x1];
  88. }
  89. if (d == 'h' && c[0x1] == myPlayer['id']) {
  90. if (c[0x2] < 0x64 && c[0x2] > 0x0) {
  91. setTimeout(() => {
  92. sendws(foodType, null);
  93. }, 0x82);
  94. }
  95. }
  96. update();
  97. }
  98.  
  99.  
  100. function socketsender(a) {
  101. ws['send'](new Uint8Array(Array['from'](msgpack5['encode'](a))));
  102. }
  103. function sendws(id, angle = Math.atan2(mouseY - height / 2, mouseX - width / 2)) {
  104. socketsender(["5", [id, null]]);
  105. socketsender(["c", [1, angle]]);
  106. socketsender(["c", [0, angle]]);
  107. (["5", [myPlayer.weapon, true]]);
  108. }
  109. function isElementVisible(a) {
  110. return a['offsetParent'] !== null;
  111. }
  112. function update() {
  113. for (let a = 0x10; a < 0x13; a++) {
  114. if (isElementVisible(document['getElementById']('actionBarItem' + a['toString']()))) {
  115. foodType = a - 0x10;
  116. }
  117. }
  118. }

QingJ © 2025

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