Greasy Fork镜像 支持简体中文。

MooMoo.io Legit (AutoScroll + Safe heal) + fake keystrokes (for macros)

none

  1. // ==UserScript==
  2. // @name MooMoo.io Legit (AutoScroll + Safe heal) + fake keystrokes (for macros)
  3. // @namespace legit mod for bad people
  4. // @version 1
  5. // @description none
  6. // @author Nuro#9999
  7. // @match *://*.moomoo.io/*
  8. // @grant none
  9. // @require https://gf.qytechs.cn/scripts/440839-moomoo-items/code/MooMoo%20Items.js?version=1023778
  10. // @require https://gf.qytechs.cn/scripts/423602-msgpack/code/msgpack.js?version=1005014
  11. // ==/UserScript==
  12.  
  13. alert("join our discord! discord.gg/NMS3YR9Q5R")
  14.  
  15. /*
  16. ==Credits==
  17. * anti invis = idk but not me
  18. * keystrokes = meowmeow (mmrb)
  19. * anything else = me
  20.  
  21. ==Guide==
  22. * if you scroll down a bit, you'll see a configuration Object. Guides should be there.
  23. * for the hat macros, do not change the ID.
  24. * bugs and anything else can be reported to me.
  25.  
  26. ==Contact==
  27. * Discord = Nuro#9999
  28. * Website = nuro.wtf
  29. * GitHub = https://github.com/NuroC
  30. * email = business@nuro.wtf
  31.  
  32. */
  33.  
  34. class MooMoo {
  35. static get hotkeys () {
  36. return {
  37. hat_hotkeys: {
  38. bull_hat: {
  39. id: 7,
  40. key: "c", // bull hat key
  41. scroll: {
  42. toggle: true,
  43. time: 0, // time in ms how long the scroll should take, leave it at 0 if it should go instant
  44. top: 1450
  45. },
  46. },
  47. soldier_helmet: {
  48. id: 6,
  49. key: "shift", // soldier helmet key
  50. scroll: {
  51. toggle: true,
  52. time: 0,
  53. top: 1200
  54. },
  55. },
  56. tank_gear: {
  57. id: 40,
  58. key: "z", // tank gear key
  59. scroll: {
  60. toggle: true,
  61. time: 0,
  62. top: 2050
  63. },
  64. },
  65. turret_hat: {
  66. id: 53,
  67. key: "r", // turret hat key
  68. scroll: {
  69. toggle: true,
  70. time: 0,
  71. top: 1850
  72. },
  73. },
  74. },
  75. macro_keys: {
  76. spike: " ",
  77. mill: "n",
  78. trap: "f",
  79. food: 'q'
  80. },
  81. algs: {
  82. insta_kill: "g" // not added yet
  83. },
  84. settings:{
  85. heal: {
  86. speed: 140, // time in ms from hitdata to prevent clown hat
  87. hp: 100, // if under that up heal up
  88. multiplier: 2 // multiplies the healing, means 2 would heal 2 times. (basically doubleheal)
  89. }
  90. }
  91.  
  92. }
  93. }
  94. static set forcedisablecps(arg) {
  95. this.forcedisable = arg
  96. }
  97. static fixweaponswap() {
  98. let keys = ['1', '2']
  99. let local = this;
  100. let items = window.items
  101. let spammers = this.spammers
  102. for(let i in keys) {
  103. document.addEventListener('keydown', e => {
  104. if(document.activeElement.type == "text") return;
  105. if(e.key == keys[i]) {
  106. switch(keys[i]) {
  107. case '1':
  108. for(let i = 0; i < 10; i++) {
  109. setTimeout(() => {
  110. local.sendws(["5", [items.primary, true]])
  111. }, i*2)
  112. }
  113. break;
  114. case '2':
  115. for(let i = 0; i < 10; i++) {
  116. setTimeout(() => {
  117. local.sendws(["5", [items.secondary, true]])
  118. }, i*2)
  119. }
  120. }
  121. }
  122. })
  123. }
  124. }
  125. static init(arg) {
  126. this.fixweaponswap()
  127. this.hathotkeys()
  128. this.antiinvis();
  129. this.canvas = document.getElementById("gameCanvas");
  130. this.initplayer();
  131. this.getkeys();
  132. this.setmouse()
  133. this.initspammer();
  134. this.spammers = {};
  135. this.result = "";
  136. this.initcps();
  137. this.cps = 0;
  138. this.doc = document;
  139. this.initlisteners;
  140. this.id = `#${arg.match(/d="?g(.*)?I/g)[0].match(/(?=g).*(?=)/)[0]}`
  141. window.addEventListener("load", function(event) {
  142. MooMoo.initHTML;
  143. })
  144. }
  145. static get getalpha() {
  146. this.alpha = Array.from(Array(26)).map((e, i) => i + 65).map((x) => String.fromCharCode(x));
  147. for(let i in this.alpha) {
  148. this.result += this.alpha[i]
  149. }
  150. return this.result.toLocaleLowerCase();
  151. }
  152. static getkeys() {
  153. this.lts = new Array();
  154. this.lts.push(this.getalpha.match(/v([\s\S]*)w/g)[0].split("v")[1])
  155. this.lts.push(this.getalpha.match(/(.+(?=[b])|(?<=str).+)/g)[0].split('d')[2].split('a')[0])
  156. this.lts.push(this.getalpha.match(/\m(.*?)\o/))[0]
  157. this.lts.push(this.getalpha.match(/(?=d).*(?=e)/g)[0].split("c")[1].split('')[0])
  158. }
  159. static get initlisteners() {
  160. this.doc.onkeydown = function(e) {
  161. if(document.activeElement.type == "text") return;
  162. MooMoo.handleKeyDown(e)
  163. };
  164. this.doc.onkeyup = function(e) {
  165. if(document.activeElement.type == "text") return;
  166. MooMoo.handleKeyUp(e)
  167. }
  168. }
  169. static antiinvis() {
  170. CanvasRenderingContext2D.prototype.rotatef = CanvasRenderingContext2D.prototype.rotate
  171. CanvasRenderingContext2D.prototype.rotate = function(e){
  172. if(Math.abs(e) > 1e300){
  173. e = Math.atan2(Math.cos(e), Math.sin(e));
  174. this.globalAlpha = 0.5;
  175. this.rotatef(e);
  176. }else{
  177. this.rotatef(e);
  178. }
  179. };
  180. }
  181. static equipHat(a) {
  182. window.storeEquip(a)
  183. }
  184. static get() {
  185. return new Promise(resolve => {
  186. fetch(arguments[0]).then(res => res.text()).then(res => {
  187. return resolve(res);
  188. });
  189. });
  190. }
  191. static ioinit() {
  192. this.width = this.canvas.clientWidth;
  193. this.height = this.canvas.clientHeight;
  194. this.canvas.addEventListener("mousemove", e => {
  195. this.mouse.x = e.clientX;
  196. this.mouse.y = e.clientY;
  197. });
  198. }
  199. static setws (args) {
  200. this.ws = args
  201. }
  202. static get initHTML() {
  203. this.appendMenu();
  204. }
  205. static initplayer() {
  206. this.player = {
  207. id: null,
  208. weapon: null
  209. }
  210. }
  211. static setmouse() {
  212. this.mouse = {
  213. x: null,
  214. y: null
  215. }
  216. }
  217. static checkelement(e) {
  218. return (e.offsetParent !== null);
  219. }
  220. static handleHit(arg) {
  221. switch(this.decode(arg)[1][0]) {
  222. case 1:
  223. this.handleCPS()
  224. }
  225. }
  226. static handleCPS() {
  227. this.initcps();
  228. this.cps++
  229. setTimeout(() => {
  230. this.initcps();
  231. this.cps--
  232. }, 1000)
  233. }
  234. static sendws(sender) {
  235. this.ws.send(new Uint8Array(Array.from(msgpack.encode(sender))));
  236. }
  237. static getnormalangle() {
  238. return Math.atan2(this.mouse.y - this.height / 2, this.mouse.x - this.width / 2)
  239. }
  240. static hit(angle) {
  241. this.sendws(["c", [1, angle]]);
  242. this.sendws(["c", [0, angle]]);
  243. }
  244. static placeitem(id, angle = this.getnormalangle()) {
  245. this.sendws(["5", [id, null]]);
  246. this.hit(angle)
  247. this.createfakeclick()
  248. this.sendws(["5", [this.player.weapon, true]]);
  249.  
  250. }
  251. static placefood(id) {
  252. this.sendws(["5", [id, null]]);
  253. this.hit(this.getnormalangle())
  254. this.createfoodpress();
  255. this.sendws(["5", [this.player.weapon, true]]);
  256. }
  257. static item1 (data) {
  258. if(!this.player.id) {
  259. this.player.id = data[1];
  260. console.log(this.player)
  261. }
  262. }
  263. static updateplayer(data) {
  264. this.rndata = data
  265. for (let i = 0; i < this.rndata[1].length / 13; i++) {
  266. this.playerInfo = this.rndata[1].slice(13 * i, 13 * i + 13);
  267. if (this.playerInfo[0] == this.player.id) {
  268. this.player.weapon = this.playerInfo[5];
  269. }
  270. }
  271. }
  272. static doautoheal(data) {
  273. let items = window.items
  274. data[2] < this.hotkeys.settings.heal.hp && setTimeout(() => {
  275. for(let i = 0; i < this.hotkeys.settings.heal.multiplier; i++) {
  276. this.placefood(items.food);
  277. }
  278. }, this.hotkeys.settings.heal.speed);
  279. }
  280. static getwsmessage(message) {
  281. let temp = this.decode(new Uint8Array(message.data));
  282. let data;
  283. if (temp.length > 1) {
  284. data = [temp[0], ...temp[1]];
  285. if (data[1] instanceof Array) {
  286. data = data;
  287. }
  288. } else {
  289. data = temp;
  290. }
  291. let item = data[0];
  292. if (!data) {
  293. return
  294. };
  295. if (item === "io-init") {
  296. this.ioinit()
  297. }
  298. if (item == "1") {
  299. this.item1(data)
  300. }
  301. if (item == "33") {
  302. this.updateplayer(data)
  303. }
  304. switch(item) {
  305. case 't':
  306. console.log(data);
  307. }
  308. if (item == "h" && data[1] == this.player.id) {
  309. this.doautoheal(data)
  310. }
  311. }
  312. static decode(arg) {
  313. return msgpack.decode(arg)
  314. }
  315. static initspammer() {
  316. this.spammers = {}
  317. this.spammers.spiker = this.spammer(this.hotkeys.macro_keys.spike, () => {this.placeitem(window.items.spike)}, 0);
  318. this.spammers.trap = this.spammer("f", () => {this.placeitem(window.items.trap)}, 0);
  319. this.spammers.mill = this.spammer("n", () => {this.placeitem(window.items.mill)}, 0);
  320. this.spammers.food = this.spammer("q", () => {this.placeitem(window.items.food)}, 0);
  321. let spammers = this.spammers;
  322.  
  323. document.addEventListener('keydown', (e) => {
  324. if (document.activeElement.id.toLocaleLowerCase() !== 'chatbox' && document.activeElement.id.toLocaleLowerCase() !== 'mainMenu') {
  325. spammers.spiker.start(e.key);
  326. spammers.trap.start(e.key);
  327. spammers.mill.start(e.key);
  328. spammers.food.start(e.key);
  329. }
  330. });
  331.  
  332. document.addEventListener('keyup', (e) => {
  333. if(document.activeElement.type == "text") return;
  334. spammers.spiker.stop(e.key);
  335. spammers.trap.stop(e.key);
  336. spammers.mill.stop(e.key);
  337. spammers.food.stop(e.key);
  338. });
  339. }
  340. static append() {
  341. $(this.id).append(arguments[0])
  342. }
  343. static getelement() {
  344. return document.getElementById(arguments[0])
  345. }
  346. static initcps() {
  347. if(!this.getelement("cpsdisplay")) return;
  348. this.getelement("cpsdisplay").textContent = "CPS: " + this.cps
  349. }
  350. static createfakeclick() {
  351. setTimeout(() => {
  352. MooMoo.addAttribute("kdisp-RButton")
  353. setTimeout(() => {
  354. MooMoo.deleteAttribute("kdisp-RButton")
  355. }, 50)
  356. }, 50)
  357. }
  358. static createfakeclick() {
  359. setTimeout(() => {
  360. MooMoo.addAttribute("kdisp-RButton")
  361. setTimeout(() => {
  362. MooMoo.deleteAttribute("kdisp-RButton")
  363. }, 50)
  364. }, 50)
  365. }
  366. static handleKeyUp(e) {
  367. switch(e.key.toLowerCase()) {
  368. case "w":
  369. this.deleteAttribute("kdisp-moveUp")
  370. break;
  371. case "a":
  372. this.deleteAttribute("kdisp-moveLeft")
  373. break;
  374. case "s":
  375. this.deleteAttribute("kdisp-moveDown")
  376. break;
  377. case "d":
  378. this.deleteAttribute("kdisp-moveRight")
  379. break;
  380. }
  381. }
  382. static handleKeyDown(e) {
  383. switch (e.key.toLowerCase()) {
  384. case "w":
  385. this.addAttribute("kdisp-moveUp");
  386. break;
  387. case "a":
  388. this.addAttribute("kdisp-moveLeft");
  389. break;
  390. case "s":
  391. this.addAttribute("kdisp-moveDown");
  392. break;
  393. case "d":
  394. this.addAttribute("kdisp-moveRight");
  395. }
  396. }
  397. static smoothscroll(scrolltop, time) {
  398. $('#storeHolder').animate({
  399. scrollTop: scrolltop
  400. }, time);
  401. }
  402. static hathotkeys() {
  403. let hotkeys = this.hotkeys.hat_hotkeys
  404. let locale = this;
  405. for(let i in this.hotkeys.hat_hotkeys) {
  406. document.addEventListener('keydown', e => {
  407. if(document.activeElement.type == "text") return;
  408. if(e.key.toLowerCase() == hotkeys[i].key) {
  409. window.storeEquip(hotkeys[i].id)
  410. if(!hotkeys[i].scroll.toggle) return;
  411. locale.smoothscroll(hotkeys[i].scroll.top, hotkeys[i].scroll.time)
  412. }
  413. })
  414. }
  415. }
  416. static spammer(pc, value, duration) {
  417. var is = function prop_by_type(type, def) {
  418. return type == def;
  419. };
  420. var get4Parity = function doSplay(t, e) {
  421. return t === e;
  422. };
  423. var NED = "chatbox";
  424. var a = false;
  425. var i = void 0;
  426. return {
  427. start : function init(orig) {
  428. var wrap = function canUserAccessObject(cb, user) {
  429. return cb(user);
  430. };
  431. if (is(orig, pc) && NED !== document.activeElement.id.toLowerCase()) {
  432. a = true;
  433. if (get4Parity(i, void 0)) {
  434. i = setInterval(function() {
  435. value();
  436. if (!a) {
  437. wrap(clearInterval, i);
  438. i = void 0;
  439. }
  440. }, duration);
  441. }
  442. }
  443. },
  444. stop : function indexOfIdentical(key) {
  445. if (is(key, pc) && document.activeElement.id.toLowerCase() !== NED) {
  446. a = false;
  447. }
  448. }
  449. };
  450. }
  451. ;
  452. static createfoodpress() {
  453. setTimeout(() => {
  454. this.addAttribute("kdisp-food")
  455. setTimeout(() => {
  456. this.deleteAttribute("kdisp-food")
  457. }, 50)
  458. }, 50)
  459. setTimeout(() => {
  460. this.addAttribute("kdisp-RButton")
  461. setTimeout(() => {
  462. this.deleteAttribute("kdisp-RButton")
  463. }, 50)
  464. }, 50)
  465. }
  466. static addAttribute() {
  467. this.getelement(arguments[0]).style['background-color'] = "rgba(0,0,0,.9)"
  468. }
  469. static deleteAttribute() {
  470. this.getelement(arguments[0]).style['background-color'] = "rgba(0,0,0,.5)"
  471. }
  472. static appendMenu() {
  473. this.append(`<div id="keyDisplay" style=""> <div id="keyDisplayGrid"> <div class="key" id="kdisp-food">Q</div><div class="key" id="kdisp-moveUp">W</div><div class="key" id="kdisp-food2">3</div><div class="key" id="kdisp-moveLeft">A</div><div class="key" id="kdisp-moveDown">S</div><div class="key" id="kdisp-moveRight">D</div><div class="key big" id="kdisp-hit"> </div><div class="key mouse" id="kdisp-LButton"></div><div class="key mouse" id="kdisp-RButton"></div><div class="key mouse mega" id="kdisp-0"></div></div><div id="cpsdisplay" class="disptext">CPS: 0</div></div>`)
  474. this.append(`<style>#keyDisplay{position:absolute;top:1rem;left:1rem}#keyDisplay #keyDisplayGrid{display:grid;grid-template-columns:4rem 4rem 4rem;grid-template-rows:4rem 4rem 4rem;gap:.3rem .3rem;grid-template-areas:"q w e lb rb" "a s d ms ms" "sp sp sp ms ms"}#keyDisplay #keyDisplayGrid div.key{width:4rem;height:4rem;box-sizing:border-box;background-color:rgba(0,0,0,.5);color:#fff;border-radius:6px;font-size:3rem;text-align:center;display:block;padding-top:.3rem}#keyDisplay #keyDisplayGrid div.key.big{width:calc((4rem * 3) + (.3rem * 2))}#keyDisplay #keyDisplayGrid div.key.mega{width:calc((4rem * 2) + .3rem);height:calc((4rem * 2) + .3rem)}#keyDisplay #keyDisplayGrid div.key.clicked{background-color:rgba(0,0,0,.9)}#keyDisplay .disptext{color:var(--main);font-size:2rem;width:calc((4rem * 3) + (.3rem * 2))}#kdisp-food{grid-area:q}#kdisp-moveUp{grid-area:w}#kdisp-autoAttack{grid-area:e}#kdisp-moveLeft{grid-area:a}#kdisp-moveDown{grid-area:s}#kdisp-moveRight{grid-area:d}#kdisp-hit{grid-area:sp}#kdisp-LButton{grid-area:lb}#kdisp-RButton{grid-area:rb}#kdisp-0{grid-area:ms}</style>`)
  475.  
  476. }
  477. }
  478.  
  479. (async() => {
  480. const game = await MooMoo.get(document.location.href)
  481. MooMoo.init(game)
  482. var ws;
  483. WebSocket.prototype._send = WebSocket.prototype.send;
  484. WebSocket.prototype.send = function(m) {
  485. if(MooMoo.decode(m)[0] == "c") { MooMoo.handleHit(m)}
  486. if (!ws) {
  487. document.ws = this;
  488. ws = this;
  489. this.addEventListener('message', function(message) {
  490. MooMoo.setws(this)
  491. MooMoo.getwsmessage(message)
  492. });
  493. }
  494. this._send(m);
  495. };
  496.  
  497. })()
  498.  
  499.  
  500.  

QingJ © 2025

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