Auto Heal for Mobile MooMoo.io

Auto heal mod for MooMoo.io with a button to enable auto heal and a chat message for mobile users

  1. // ==UserScript==
  2. // @name Auto Heal for Mobile MooMoo.io
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Auto heal mod for MooMoo.io with a button to enable auto heal and a chat message for mobile users
  6. // @author wat
  7. // @match *://*.moomoo.io/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Function to create and style the auto heal button
  16. function createHealButton() {
  17. const healButton = document.createElement('button');
  18. healButton.innerText = 'Enable Auto Heal';
  19. healButton.style.position = 'fixed';
  20. healButton.style.bottom = '20px';
  21. healButton.style.right = '20px';
  22. healButton.style.padding = '10px 20px';
  23. healButton.style.backgroundColor = '#4CAF50';
  24. healButton.style.color = 'white';
  25. healButton.style.border = 'none';
  26. healButton.style.borderRadius = '5px';
  27. healButton.style.cursor = 'pointer';
  28. healButton.style.zIndex = '10000';
  29. document.body.appendChild(healButton);
  30.  
  31. let autoHealEnabled = false;
  32.  
  33. // Event listener for the heal button
  34. healButton.addEventListener('click', () => {
  35. autoHealEnabled = !autoHealEnabled;
  36. healButton.innerText = autoHealEnabled ? 'Disable Auto Heal' : 'Enable Auto Heal';
  37.  
  38. // Notify the player via in-game chat
  39. if (autoHealEnabled) {
  40. sendMessageToChat('Auto heal enabled');
  41. }
  42. });
  43.  
  44. // Auto heal logic
  45. setInterval(() => {
  46. if (autoHealEnabled) {
  47. const player = window.player; // Assuming 'window.player' is the player object
  48. if (player && player.health < player.maxHealth) {
  49. player.health = player.maxHealth; // Set health to max
  50. }
  51. }
  52. }, 1000); // Check every second
  53. }
  54.  
  55. // Function to send a message to the in-game chat
  56. function sendMessageToChat(message) {
  57. const chatInput = document.querySelector('input[type="text"]'); // Assumes chat input is an <input> element
  58. if (chatInput) {
  59. chatInput.value = message;
  60. const event = new Event('input', { bubbles: true });
  61. chatInput.dispatchEvent(event);
  62.  
  63. // Simulate sending the message
  64. const sendButton = document.querySelector('button[type="submit"]'); // Assumes there's a send button
  65. if (sendButton) {
  66. sendButton.click();
  67. }
  68. }
  69. }
  70.  
  71. // Wait until the page loads completely
  72. window.addEventListener('load', createHealButton);
  73. })();

QingJ © 2025

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