Macro Mod V-1.0

Macro Place , Macro Hat , And More!!!!

  1. // ==UserScript==
  2. // @name Macro Mod V-1.0
  3. // @namespace -
  4. // @version 1.0
  5. // @description Macro Place , Macro Hat , And More!!!!
  6. // @author 2k09__
  7. // @match https://sploop.io/
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11. let weaponKey;
  12.  
  13. const HATS = {
  14. BUSH_HAT: 0,
  15. BERSERKER: 1,
  16. JUNGLE_GEAR: 2,
  17. CRYSTAL_GEAR: 3,
  18. SPIKE_GEAR: 4,
  19. IMMUNITY_GEAR: 5,
  20. BOOST_HAT: 6,
  21. APPLE_HAT: 7,
  22. SCUBA_GEAR: 8,
  23. HOOD: 9,
  24. DEMOLIST: 10
  25. };
  26.  
  27. const KEYBINDS = {
  28. [HATS.BUSH_HAT]: "",
  29. [HATS.BERSERKER]: "KeyB",
  30. [HATS.JUNGLE_GEAR]: "",
  31. [HATS.CRYSTAL_GEAR]: "KeyC",
  32. [HATS.SPIKE_GEAR]: "KeyJ",
  33. [HATS.IMMUNITY_GEAR]: "Semicolon",
  34. [HATS.BOOST_HAT]: "ShiftLeft",
  35. [HATS.APPLE_HAT]: "",
  36. [HATS.SCUBA_GEAR]: "KeyK",
  37. [HATS.HOOD]: "KeyO",
  38. [HATS.DEMOLIST]: "KeyZ"
  39. };
  40.  
  41. // HAT EQUIP LOGIC GOES BELOW
  42.  
  43.  
  44.  
  45. const log = console.log;
  46. const storage = {
  47. get(key) {
  48. const value = localStorage.getItem(key);
  49. return value === null ? null : JSON.parse(value);
  50. },
  51. set(key, value) {
  52. localStorage.setItem(key, JSON.stringify(value));
  53. }
  54. };
  55.  
  56. function sleep(ms) {
  57. return new Promise(resolve => setTimeout(resolve, ms));
  58. }
  59.  
  60. function isInput() {
  61. return document.activeElement.tagName === "INPUT";
  62. }
  63.  
  64. function inGame() {
  65. const homepage = document.querySelector("#homepage");
  66. return homepage && homepage.style.display !== "flex";
  67. }
  68.  
  69. function canEquip() {
  70. return !isInput() && inGame();
  71. }
  72.  
  73. function createKeyboardEvent(type, code) {
  74. return new Proxy(new KeyboardEvent(type), {
  75. get(target, prop) {
  76. if (prop === "isTrusted") return true;
  77. if (prop === "target") return document.body;
  78. if (prop === "code") return code;
  79. return target[prop];
  80. }
  81. })
  82. }
  83.  
  84. function keypress(code) {
  85. const keydown = createKeyboardEvent("keydown", code);
  86. const keyup = createKeyboardEvent("keyup", code);
  87. window.onkeydown(keydown);
  88. window.onkeyup(keyup);
  89. }
  90.  
  91. function mouseup(target) {
  92. target.onmouseup(new Proxy(new MouseEvent("mouseup"), {
  93. get(target, prop) {
  94. if (prop === "isTrusted") return true;
  95. if (prop === "target") return target;
  96. return target[prop];
  97. }
  98. }));
  99. }
  100.  
  101. let equipToggle = false;
  102. async function equipHat(index) {
  103. if (!canEquip() || equipToggle) return;
  104. equipToggle = true;
  105.  
  106. const hatActionButton = document.querySelectorAll(".hat_action_button")[index];
  107. if (!hatActionButton) throw new Error("Failed to find hat with index: " + index);
  108.  
  109. const keybinds = storage.get("keybinds");
  110. const OpenShopKey = keybinds && keybinds[18] || "KeyN";
  111.  
  112. keypress(OpenShopKey);
  113. await sleep(150);
  114. if (hatActionButton.textContent === "BUY") {
  115. mouseup(hatActionButton);
  116. }
  117. mouseup(hatActionButton);
  118. await sleep(150);
  119. keypress(OpenShopKey);
  120.  
  121. await sleep(1500);
  122. equipToggle = false;
  123. }
  124.  
  125. window.addEventListener("keydown", function(event) {
  126. if (event.repeat) return;
  127.  
  128. for (const key in KEYBINDS) {
  129. if (event.code === KEYBINDS[key]) {
  130. equipHat(key);
  131. break;
  132. }
  133. }
  134. })
  135.  
  136. const grids = document.querySelector("#grid-toggle");
  137. setInterval(() => {
  138. if (grids.checked){grids.click();}
  139. }, 0);
  140.  
  141. const PLACE = {
  142. SPIKE: 0,
  143. SPIKE_HARD: 1,
  144. WINDMILL: 2,
  145. POWERMILL: 3,
  146. TRAP: 4,
  147. BOOST: 5,
  148. COSY_BED: 6,
  149. PLATFORM: 7,
  150. APPLE: 8,
  151. COOKIE: 9,
  152. WALL: 10,
  153. };
  154. const KEYBINDSPLACE = {
  155. [PLACE.SPIKE]: "KeyV",
  156. [PLACE.SPIKE_HARD]: "KeyV",
  157. [PLACE.WINDMILL]: "KeyN",
  158. [PLACE.POWERMILL]: "KeyN",
  159. [PLACE.TRAP]: "KeyF",
  160. [PLACE.BOOST]: "KeyF",
  161. [PLACE.COSY_BED]: "KeyL",
  162. [PLACE.PLATFORM]: "KeyH",
  163. [PLACE.APPLE]: "KeyQ",
  164. [PLACE.COOKIE]: "KeyQ",
  165. [PLACE.WALL]: "KeyT",
  166. };
  167.  
  168. //HEAL.PLACE
  169. this.key.press({code: "KeyQ"});
  170. this.key.press({code: "Space"});
  171. this.key.press({key: weaponKey});
  172.  
  173. //SPIKE.PLACE
  174. this.key.press({code: "KeyV"});
  175. this.key.press({code: "Space"});
  176. this.key.press({key: weaponKey});
  177. //WINDMILL'S.PLACE
  178. this.key.press({code: "KeyN"});
  179. this.key.press({code: "Space"});
  180. this.key.press({key: weaponKey});
  181. //TRAP/BOOST.PLACE'S
  182. this.key.press({code: "KeyF"});
  183. this.key.press({code: "Space"});
  184. this.key.press({key: weaponKey});
  185. //COSYBED/SPAWN.PLACE
  186. this.key.press({code: "KeyL"});
  187. this.key.press({code: "Space"});
  188. this.key.press({key: weaponKey});
  189. //PLATFORM.PLACE
  190. this.key.press({code: "KeyH"});
  191. this.key.press({code: "Space"});
  192. this.key.press({key: weaponKey});
  193. //WALL.PLACE
  194. this.key.press({code: "KeyT"});
  195. this.key.press({code: "Space"});
  196. this.key.press({key: weaponKey});

QingJ © 2025

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