Greasy Fork is available in English.

Moomoo.io Hat Macro (Normal + Sandbox)

Press F for Soldier Hat, G for Tank Gear (Works in Sandbox & Normal Mode)

  1. // ==UserScript==
  2. // @name Moomoo.io Hat Macro (Normal + Sandbox)
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.1
  5. // @description Press F for Soldier Hat, G for Tank Gear (Works in Sandbox & Normal Mode)
  6. // @author Your Name
  7. // @match *://moomoo.io/*
  8. // @match *://sandbox.moomoo.io/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. console.log("🎩 Hat Macro (Normal + Sandbox) Loaded!");
  16.  
  17. // Key bindings
  18. const KEY_SOLDIER_HAT = 'F';
  19. const KEY_TANK_GEAR = 'G';
  20.  
  21. // Listen for key presses
  22. document.addEventListener("keydown", function(event) {
  23. let key = event.key.toUpperCase();
  24.  
  25. if (key === KEY_SOLDIER_HAT) {
  26. console.log("🛡️ Switching to Soldier Hat...");
  27. selectHat(15); // Soldier Hat ID
  28. }
  29. if (key === KEY_TANK_GEAR) {
  30. console.log("💥 Switching to Tank Gear...");
  31. selectHat(7); // Tank Gear ID
  32. }
  33. });
  34.  
  35. // Function to select a hat
  36. function selectHat(hatID) {
  37. if (window.gameSocket) {
  38. window.gameSocket.send(new Uint8Array([255, 6, hatID]));
  39. } else {
  40. console.error("❌ gameSocket not found! Try reloading the page.");
  41. }
  42. }
  43.  
  44. })();