Moomoo.io | Hat Macro & Menu Script

HAT MACRO, Menu Key => B (By default, you can change it on the menu!)

  1. // ==UserScript==
  2. // @name Moomoo.io | Hat Macro & Menu Script
  3. // @version beta
  4. // @description HAT MACRO, Menu Key => B (By default, you can change it on the menu!)
  5. // @author DETIX || Discord => detixthegoat
  6. // @match *://*.moomoo.io/*
  7. // @namespace https://greatest.deepsurf.us/users/684614
  8. // ==/UserScript==
  9.  
  10. const keys = {};
  11. let SoldierHat = "c",
  12. TurretHat = "h",
  13. TankGear = "z",
  14. BullHelmet = "j",
  15. BarbarianArmor = "t",
  16. NoHat = "y",
  17. //Menu Key
  18. menuKey = "b"; // by Default
  19.  
  20. const Equip = (id) => {
  21. storeEquip(id);
  22. }
  23.  
  24. function hats() {
  25. if (keys[SoldierHat.toLowerCase()] === true || keys[SoldierHat.toUpperCase()] === true) {
  26. Equip(6);
  27. }
  28. if (keys[TurretHat.toLowerCase()] === true || keys[TurretHat.toUpperCase()] === true) {
  29. Equip(53);
  30. }
  31. if (keys[TankGear.toLowerCase()] === true || keys[TankGear.toUpperCase()] === true) {
  32. Equip(40);
  33. }
  34. if (keys[BullHelmet.toLowerCase()] === true || keys[BullHelmet.toUpperCase()] === true) {
  35. Equip(7);
  36. }
  37. if (keys[BarbarianArmor.toLowerCase()] === true || keys[BarbarianArmor.toUpperCase()] === true) {
  38. Equip(26);
  39. }
  40. if (keys[NoHat.toLowerCase()] === true || keys[NoHat.toUpperCase()] === true) {
  41. Equip(0);
  42. }
  43. }
  44.  
  45. function handleKeyDown(event) {
  46. keys[event.key] = true;
  47. hats();
  48.  
  49. if (event.key.toLowerCase() === menuKey || event.key.toUpperCase() === menuKey) {
  50. const menu = document.getElementById("hatMacroMenu");
  51. menu.style.display = menu.style.display === "none" ? "block" : "none";
  52. }
  53. }
  54.  
  55. function handleKeyUp(event) {
  56. keys[event.key] = false;
  57. }
  58.  
  59. const menu = document.createElement("div");
  60. menu.id = "hatMacroMenu";
  61. menu.innerHTML = `<div class="hatMacroMenu-container">
  62. <h1>Hat Macro Script<sub>By DETIX</sub></h1>
  63. <div class="hatMacroMenu-input">
  64. <label for="soldierHatInput">Soldier Hat:</label>
  65. <input type="text" id="soldierHatInput" value="${SoldierHat}">
  66. </div>
  67. <div class="hatMacroMenu-input">
  68. <label for="turretHatInput">Turret Hat:</label>
  69. <input type="text" id="turretHatInput" value="${TurretHat}">
  70. </div>
  71. <div class="hatMacroMenu-input">
  72. <label for="tankGearInput">Tank Gear:</label>
  73. <input type="text" id="tankGearInput" value="${TankGear}">
  74. </div>
  75. <div class="hatMacroMenu-input">
  76. <label for="bullHelmetInput">Bull Helmet:</label>
  77. <input type="text" id="bullHelmetInput" value="${BullHelmet}">
  78. </div>
  79. <div class="hatMacroMenu-input">
  80. <label for="barbarianArmorInput">Barbarian Armor:</label>
  81. <input type="text" id="barbarianArmorInput" value="${BarbarianArmor}">
  82. </div>
  83. <div class="hatMacroMenu-input">
  84. <label for="noHatInput">No Hat:</label>
  85. <input type="text" id="noHatInput" value="${NoHat}">
  86. </div>
  87. <div class="hatMacroMenu-input">
  88. <label for="menuKeyInput">Menu Key:</label>
  89. <input type="text" id="menuKeyInput" value="${menuKey}">
  90. </div>
  91. </div>`;
  92. menu.style.position = "absolute";
  93. menu.style.top = "10px";
  94. menu.style.right = "10px";
  95. menu.style.padding = "10px";
  96. menu.style.backgroundColor = "#f9f9f9";
  97. menu.style.border = "1.5px solid #000";
  98. menu.style.borderRadius = "8px";
  99. menu.style.boxShadow = "0 2px 4px rgba(0,0,0,0.2)";
  100. menu.style.zIndex = "9999";
  101. menu.style.display = "none";
  102. menu.style.maxWidth = "300px";
  103.  
  104. const style = document.createElement("style");
  105. style.innerHTML = `
  106. .hatMacroMenu-container h1 {
  107. margin: 0;
  108. padding: 10px 0;
  109. text-align: center;
  110. font-size: 24px;
  111. }
  112. .hatMacroMenu-input {
  113. margin: 15px 0;
  114. display: flex;
  115. align-items: center;
  116. }
  117. .hatMacroMenu-input label {
  118. width: 130px;
  119. font-size: 18px;
  120. }
  121. .hatMacroMenu-input input {
  122. flex: 1;
  123. padding: 5px;
  124. border: 1px solid #ddd;
  125. border-radius: 4px;
  126. font-size: 16px;
  127. }`;
  128.  
  129. document.head.appendChild(style);
  130. document.body.appendChild(menu);
  131.  
  132. function updateHatKeys() {
  133. SoldierHat = document.getElementById("soldierHatInput").value;
  134. TurretHat = document.getElementById("turretHatInput").value;
  135. TankGear = document.getElementById("tankGearInput").value;
  136. BullHelmet = document.getElementById("bullHelmetInput").value;
  137. BarbarianArmor = document.getElementById("barbarianArmorInput").value;
  138. NoHat = document.getElementById("noHatInput").value;
  139. }
  140.  
  141. function handleMenuKeyChange(event) {
  142. menuKey = event.target.value;
  143. event.target.style.backgroundColor = "#ffcc00";
  144. }
  145. const menuKeyInput = document.getElementById("menuKeyInput");
  146. menuKeyInput.addEventListener("input", handleMenuKeyChange);
  147.  
  148. menu.addEventListener("input", updateHatKeys);
  149.  
  150. window.addEventListener('keydown', handleKeyDown);
  151. window.addEventListener('keyup', handleKeyUp);