Custom Mod with Auto Heal and Key Binds

A custom mod with auto healing and key bindings to switch hats and place traps.

  1. // ==UserScript==
  2. // @name Custom Mod with Auto Heal and Key Binds
  3. // @version 1.0
  4. // @author II
  5. // @match *://moomoo.io/*
  6. // @grant none
  7. // @namespace https://greasyfork.org/users/805514
  8. // @description A custom mod with auto healing and key bindings to switch hats and place traps.
  9. // ==/UserScript==
  10.  
  11. let autoHealSpeed = 100; // Speed of auto healing
  12. let trapCount = 4; // Number of traps to place
  13. let tankHats = [1, 2]; // Example IDs for tank hats
  14. let soldierHats = [3, 4]; // Example IDs for soldier hats
  15. let currentHatType = 'soldier'; // Starting with soldier hats
  16.  
  17. // Function to add styles
  18. function addStyle(styleItem) {
  19. if (typeof GM_addStyle != "undefined") {
  20. GM_addStyle(styleItem);
  21. } else {
  22. var node = document.createElement("style");
  23. node.type = "text/css";
  24. node.appendChild(document.createTextNode(styleItem));
  25. var heads = document.getElementsByTagName("head");
  26. if (heads.length > 0) {
  27. heads[0].appendChild(node);
  28. } else {
  29. document.documentElement.appendChild(node);
  30. }
  31. }
  32. }
  33.  
  34. // Auto Heal Function
  35. function autoHeal() {
  36. let myHealth = player.health; // Assuming player object exists
  37. let myMaxHealth = player.maxHealth;
  38. if (myHealth < myMaxHealth) {
  39. player.health += Math.min(autoHealSpeed, myMaxHealth - myHealth); // Heal quickly
  40. }
  41. }
  42.  
  43. // Key Binding to Switch Hats
  44. document.addEventListener('keydown', function(event) {
  45. if (event.key === 't') {
  46. currentHatType = currentHatType === 'soldier' ? 'tank' : 'soldier';
  47. let newHat = (currentHatType === 'tank') ? tankHats[Math.floor(Math.random() * tankHats.length)] : soldierHats[Math.floor(Math.random() * soldierHats.length)];
  48. player.skinIndex = newHat; // Update player's hat
  49. }
  50. });
  51.  
  52. // Key Binding to Place Traps
  53. document.addEventListener('keydown', function(event) {
  54. if (event.key === 'y') {
  55. placeTraps(); // Call function to place traps
  56. }
  57. });
  58.  
  59. // Function to Place Traps Around Player
  60. function placeTraps() {
  61. for (let i = 0; i < trapCount; i++) {
  62. let angle = (i * (Math.PI / 2)); // Distributing traps in a square
  63. let trapX = player.x + Math.cos(angle) * 50; // Adjust distance as needed
  64. let trapY = player.y + Math.sin(angle) * 50; // Adjust distance as needed
  65. if (canPlaceTrap(trapX, trapY)) { // Check if we can place a trap
  66. placeTrap(trapX, trapY); // Assuming placeTrap is a function that places a trap at the specified coordinates
  67. }
  68. }
  69. }
  70.  
  71. // Bypass Captcha Placeholder
  72. function bypassCaptcha() {
  73. // Implement captcha bypass logic here
  74. }
  75.  
  76. // Main function to keep everything running
  77. (function() {
  78. let styleItem = `
  79. /* Add custom styles here */
  80. `;
  81.  
  82. addStyle(styleItem);
  83. setInterval(() => {
  84. autoHeal(); // Call auto heal function periodically
  85. bypassCaptcha(); // Call captcha bypass function
  86. }, 1000); // Adjust interval as needed
  87. })();