MooMoo.io - Fun tool!

Goodies for you :D

  1. // ==UserScript==
  2. // @name MooMoo.io - Fun tool!
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Goodies for you :D
  6. // @author CorruptoDev
  7. // @match *://*.moomoo.io/*
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @grant none
  10. // @require https://cdn.jsdelivr.net/npm/msgpack-lite@0.1.26/dist/msgpack.min.js
  11. // @require http://code.jquery.com/jquery-3.3.1.min.js
  12. // @require https://code.jquery.com/ui/1.12.0/jquery-ui.min.js
  13. // @require https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.js
  14. // @grant none
  15. // @run-at document-end
  16. // @grant unsafeWindow
  17. // ==/UserScript==
  18.  
  19. function dns(data) {
  20. newSend(data);
  21. }
  22. setInterval(()=>{
  23. WebSocket.prototype.close = function(){return 0};
  24. },10);
  25.  
  26. function doHatCycle() {
  27. dns(["13c", [0, 11, 0]]); dns(["13c", [0, 21, 1]]); setTimeout(function () {
  28. dns(["13c", [0, 12, 0]]); dns(["13c", [0, 18, 1]])
  29. }, 10); setTimeout(function () {
  30. dns(["13c", [0, 55, 0]]); dns(["13c", [0, 13, 1]])
  31. }, 80); setTimeout(function () {
  32. dns(["13c", [0, 40, 0]]); dns(["13c", [0, 19, 1]])
  33. }, 100); setTimeout(function () {
  34. dns(["13c", [0, 12, 0]]); dns(["13c", [0, 21, 1]])
  35. }, 150); setTimeout(function () {
  36. dns(["13c", [0, 26, 0]]); dns(["13c", [0, 13, 1]])
  37. }, 200); setTimeout(function () {
  38. dns(["13c", [0, 12, 0]]); dns(["13c", [0, 19, 1]])
  39. }, 250); setTimeout(function () {
  40. dns(["13c", [0, 21, 0]]); dns(["13c", [0, 18, 1]])
  41. }, 300); setTimeout(function () {
  42. dns(["13c", [0, 53, 0]]); dns(["13c", [0, 21, 1]])
  43. }, 350)
  44. };
  45.  
  46.  
  47. let {
  48. primary,
  49. secondary,
  50. foodType,
  51. wallType,
  52. spikeType,
  53. spawned,
  54. millType,
  55. autosecondary,
  56. mineType,
  57. boostType,
  58. turretType,
  59. spawnpadType,
  60. baitType
  61. } = {
  62. primary: null,
  63. secondary: null,
  64. foodType: null,
  65. wallType: null,
  66. spikeType: null,
  67. millType: null,
  68. mineType: null,
  69. boostType: null,
  70. turretType: null,
  71. spawnpadType: null,
  72. baitType: null
  73. }
  74. window.onbeforeunload = null;
  75. var nearestEnemy;
  76. var nearestEnemyAngle;
  77. function newSend(a) {
  78. socketsender(a);
  79. }
  80. function doNewSend(m) {
  81. newSend(m);
  82. }
  83. function wep(id){
  84. doNewSend(["5", [id, true]]);
  85. }
  86. function hit() {
  87. doNewSend(["c", [1]]);
  88. }
  89. function stophit() {
  90. doNewSend(["c", [0, null]]);
  91. }
  92. function chat(sender) {
  93. doNewSend(["ch", [sender]]);
  94. }
  95. function equip(hat,acc) {
  96. doNewSend(["13c", [1, hat, 0]]);
  97. doNewSend(["13c", [1, acc, 1]]);
  98. doNewSend(["13c", [0, hat, 0]]);
  99. doNewSend(["13c", [0, acc, 1]]);
  100. }
  101.  
  102. function aim(x, y){
  103. var cvs = document.getElementById("gameCanvas");
  104. cvs.dispatchEvent(new MouseEvent("mousemove", {
  105. clientX: x,
  106. clientY: y
  107.  
  108. }));
  109. }
  110. let mouseX;
  111. let mouseY;
  112. let width;
  113. let height;
  114. let enemiesNear;
  115. let isEnemyNear;
  116. let coreURL = new URL(window['location']['href']);
  117. window['sessionStorage']['force'] = coreURL['searchParams']['get']('fc');
  118. var ws;
  119. var msgpack5 = msgpack;
  120. let myPlayer = {
  121. 'id': null,
  122. 'x': null,
  123. 'y': null,
  124. 'dir': null,
  125. 'object': null,
  126. 'weapon': null,
  127. 'clan': null,
  128. 'isLeader': null,
  129. 'hat': null,
  130. 'accessory': null,
  131. 'isSkull': null
  132. };
  133. let enemy = {
  134. 'id': null,
  135. 'x': null,
  136. 'y': null,
  137. 'dir': null,
  138. 'object': null,
  139. 'weapon': null,
  140. 'clan': null,
  141. 'isLeader': null,
  142. 'hat': null,
  143. 'accessory': null,
  144. 'isSkull': null
  145. };
  146. document.msgpack = msgpack;
  147. function n(){
  148. this.buffer = new Uint8Array([0]);
  149. this.buffer.proto = new Uint8Array;
  150. this.type = 0;
  151. }
  152. WebSocket.prototype.oldSend = WebSocket.prototype.send;
  153. WebSocket.prototype.send = function(m){
  154.  
  155. if (!ws){
  156. document.ws = this;
  157.  
  158. ws = this;
  159. socketFound(this);
  160. }
  161. this.oldSend(m);
  162. };
  163. function socketFound(a) {
  164. a['addEventListener']('message', function (b) {
  165. handleMessage(b);
  166. });
  167. }
  168. var healing = false;
  169. var ah = true;
  170. function handleMessage(a) {
  171. let b = msgpack5['decode'](new Uint8Array(a['data']));
  172. let c;
  173. if (b['length'] > 0x1) {
  174. c = [b[0x0], ...b[0x1]];
  175. if (c[0x1] instanceof Array) {
  176. c = c;
  177. }
  178. } else {
  179. c = b;
  180. }
  181. let d = c[0x0];
  182. if (!c) {
  183. return;
  184. };
  185. if (d === 'io-init') {
  186. let e = document['getElementById']('gameCanvas');
  187. width = e['clientWidth'];
  188. height = e['clientHeight'];
  189. $(window)['resize'](function () {
  190. width = e['clientWidth'];
  191. height = e['clientHeight'];
  192. });
  193. e['addEventListener']('mousemove', f => {
  194. mouseX = f['clientX'];
  195. mouseY = f['clientY'];
  196. });
  197. }
  198. if (d == '1' && myPlayer['id'] == null) {
  199. myPlayer['id'] = c[0x1];
  200. }
  201. if (d == 'ch' && c[0x1] == ".a -heal") {
  202. ah = !ah
  203. chat("AutoHeal: " + ah);
  204.  
  205. }
  206. if (d == 'h' && c[0x1] == myPlayer['id'] && ah) {
  207. if (c[0x2] < 0x80 && c[0x2] > 0x0 && !healing) {
  208.  
  209. setTimeout(() => {
  210. sendws(foodType, null);
  211.  
  212. }, 0x100);
  213.  
  214. }
  215.  
  216.  
  217.  
  218.  
  219.  
  220. if (c[0x2] < 0x70 && c[0x2] > 0x0 && !healing) {
  221. doHatCycle();
  222. healing = true;
  223. setTimeout(()=>{
  224. sendws(foodType, null);
  225. healing = false;
  226. },80);
  227. sendws(foodType, null);
  228.  
  229.  
  230. }
  231. if (c[0x2] < 0x45 && c[0x2] > 0x0 && !healing) {
  232. healing = true;
  233. sendws(foodType, null);
  234. healing = false;
  235.  
  236.  
  237.  
  238. }
  239. if (c[0x2] < 0x32 && c[0x2] > 0x0 && !healing) {
  240. healing = true;
  241. sendws(foodType, null);
  242. sendws(foodType, null);
  243. sendws(foodType, null);
  244. healing = false;
  245.  
  246. }
  247. if (c[0x2] < 0x16 && c[0x2] > 0x0 && !healing) {
  248. healing = true;
  249. sendws(foodType, null);
  250. sendws(foodType, null);
  251. sendws(foodType, null);
  252. sendws(foodType, null);
  253. sendws(foodType, null);
  254. sendws(foodType, null);
  255. sendws(foodType, null);
  256. sendws(foodType, null);
  257. sendws(foodType, null);
  258. socketsender(["ch", ["!Trash insta detected!"]])
  259. healing = false;
  260.  
  261. }
  262. if (c[0x2] < 0x8 && c[0x2] > 0x0 && !healing) {
  263. healing = true;
  264. sendws(foodType, null);
  265. sendws(foodType, null);
  266. sendws(foodType, null);
  267. sendws(foodType, null);
  268. sendws(foodType, null);
  269. sendws(foodType, null);
  270. sendws(foodType, null);
  271. sendws(foodType, null);
  272. sendws(foodType, null);
  273. sendws(foodType, null);
  274. sendws(foodType, null);
  275. sendws(foodType, null);
  276. sendws(foodType, null);
  277. sendws(foodType, null);
  278. sendws(foodType, null);
  279. sendws(foodType, null);
  280. sendws(foodType, null);
  281. sendws(foodType, null);
  282. sendws(foodType, null);
  283. sendws(foodType, null);
  284. sendws(foodType, null);
  285. sendws(foodType, null);
  286. sendws(foodType, null);
  287. sendws(foodType, null);
  288. sendws(foodType, null);
  289. sendws(foodType, null);
  290. sendws(foodType, null);
  291. sendws(foodType, null);
  292. socketsender(["ch", ["!Mega insta detected!"]])
  293. healing = false;
  294.  
  295. }
  296.  
  297.  
  298. }
  299. if (d == "33") {
  300. enemiesNear = [];
  301. var f = 0;
  302.  
  303. for (; f < c[1].length / 13; f++) {
  304. var object = c[1].slice(13 * f, 13 * f + 13);
  305. if (object[0] == myPlayer.id) {
  306. myPlayer.x = object[1];
  307. myPlayer.y = object[2];
  308. myPlayer.dir = object[3];
  309. myPlayer.object = object[4];
  310. myPlayer.weapon = object[5];
  311. myPlayer.clan = object[7];
  312. myPlayer.isLeader = object[8];
  313. myPlayer.hat = object[9];
  314. myPlayer.accessory = object[10];
  315. myPlayer.isSkull = object[11];
  316. } else if(object[7] != myPlayer.clan || object[7] === null) {
  317. enemiesNear.push(object);
  318. enemy.x = object[1];
  319. enemy.y= object[2];
  320. enemy.dir = object[3];
  321. enemy.object = object[4];
  322. enemy.weapon = object[5];
  323. enemy.clan = object[7];
  324. enemy.isLeader = object[8];
  325. enemy.hat = object[9];
  326. enemy.accessory = object[10];
  327. enemy.isSkull = object[11];
  328.  
  329.  
  330. }
  331. }
  332. }
  333. isEnemyNear = ![];
  334. if (enemiesNear) {
  335. nearestEnemy = enemiesNear.sort(function(line, i) {
  336. return dist(line, myPlayer) - dist(i, myPlayer);
  337. })[0];
  338. }
  339. if(nearestEnemy) {
  340. nearestEnemyAngle = Math.atan2(nearestEnemy[2]-myPlayer.y, nearestEnemy[1]-myPlayer.x);
  341. if(Math.sqrt(Math.pow((myPlayer.y-nearestEnemy[2]), 2) + Math.pow((myPlayer.x-nearestEnemy[1]), 2)) < 300) {
  342. isEnemyNear = true;
  343. nearestEnemyAngle = enemy.dir
  344. boostDir = nearestEnemyAngle;
  345.  
  346. }
  347. }
  348.  
  349. if (!nearestEnemy) {
  350. nearestEnemyAngle = enemyAngelds;
  351.  
  352. }
  353. update();
  354. }
  355. var enemyAngelds;
  356. var el = top.document.createElement('div')
  357. el.style = "width:40px; height:42px; border-radius:5px;background:white;opacity:40%;z-index:99999999999999; position:fixed;bottom:2%;right:15%;";
  358. el.innerHTML="";
  359. el.onclick = insta;
  360. top.document.body.appendChild(el);
  361. function insta() {
  362. chat("LOADING STITCHES.");
  363. var iHat2 = 6,iAcc2 = 53,iHat1 = 7,iAcc1 = 21;
  364. dns(["13c", [0, 0, 1]])
  365. dns(["7", [!0]])
  366. dns(["5", [secondary, !0]])
  367. dns(["13c", [0, iHat2, 0]])
  368. dns(["13c", [0, iAcc2, 1]])
  369. setTimeout(function () {
  370. dns(["13c", [0, iHat1, 0]])
  371. dns(["13c", [0, iAcc1, 1]])
  372. var weapon = primary
  373. dns(["5", [primary, !0]])
  374. }, 60)
  375. dns(["5", [primary, !0]])
  376. dns(["13c", [0, iHat1, 0]])
  377. dns(["13c", [0, iAcc1, 1]])
  378. var weapon;
  379. setTimeout(function () {
  380. chat("RELOADING SECONDARY.");
  381. setTimeout(()=>{
  382. wep(secondary);
  383. setTimeout(()=>{
  384. wep(primary)
  385. },40);
  386. },50);
  387. setTimeout(()=>{
  388. dns(["13c", [0, iHat2, 0]])
  389. dns(["13c", [0, iAcc2, 1]])
  390. weapon = secondary
  391. dns(["5", [secondary, !0]])
  392. setTimeout(()=>{
  393. place(boostType,null);
  394. setTimeout(()=>{
  395. var angleuwu = Math.atan2(mouseY - height / 2, mouseX - width / 2);
  396. place(spikeType,angleuwu - ((100 * Math.PI) / 180));
  397. setTimeout(()=>{
  398. place(spikeType,angleuwu + ((100 * Math.PI) / 180));
  399. setTimeout(()=>{
  400. wep(secondary)
  401. setTimeout(()=>{
  402. wep(primary)
  403. hit()
  404. setTimeout(()=>{
  405. stophit();
  406. },30);
  407. },60);
  408. },30);
  409. },40);
  410. },60);
  411. chat("MAKING SPIKE INSTA.");
  412. },100);
  413. }, 470 / 2)
  414. },100);
  415. }
  416. var boostDir;
  417. function place(p__14702) {
  418. var angle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Math.atan2(mouseY - height / 2, mouseX - width / 2);
  419. newSend(['5', [p__14702, null]]);
  420. newSend(['c', [1, angle]]);
  421. newSend(['c', [0, angle]]);
  422. newSend(['5', [myPlayer.weapon, true]]);
  423. newSend(['5', [p__14702, null]]);
  424. newSend(['c', [1, angle]]);
  425. newSend(['c', [0, angle]]);
  426. newSend(['5', [myPlayer.weapon, true]]);
  427. newSend(['5',[myPlayer.weapon,false]]);
  428. wep(primary)
  429. }
  430. function boostSpike() {
  431. if (boostDir == null) {
  432. boostDir = Math.atan2(mouseY - height / 2, mouseX - width / 2);
  433. }
  434. place(spikeType, boostDir + -0.785398/2);
  435. place(spikeType, boostDir - -0.785398/2);
  436. place(boostType, boostDir);
  437. newSend(['33', [boostDir]]);
  438. }
  439. function sleep(ms) {
  440. return new Promise(resolve => setTimeout(resolve, ms));
  441. }
  442.  
  443. function dist(a) {
  444. return Math.sqrt(Math.pow((myPlayer.y - a[2]), 2) + Math.pow((myPlayer.x - a[1]), 2))
  445. }
  446. function socketsender(a) {
  447. ws['send'](new Uint8Array(Array['from'](msgpack5['encode'](a))));
  448. }
  449.  
  450. function sendws(id, angle = Math.atan2(mouseY - height / 2, mouseX - width / 2)) {
  451. socketsender(["5", [id, null]]);
  452. socketsender(["c", [1, angle]]);
  453. socketsender(["c", [0, angle]]);
  454. socketsender(["5", [myPlayer.weapon, true]]);
  455. socketsender(["5", [primary, true]]);
  456.  
  457. }
  458. function isElementVisible(a) {
  459. return a['offsetParent'] !== null;
  460.  
  461.  
  462. }
  463. window.addEventListener('contextmenu', function(ev) {
  464. ev.preventDefault();
  465. insta()
  466. return false;
  467. }, false);
  468. function update() {
  469. for (let a = 0x10; a < 0x13; a++) {
  470. if (isElementVisible(document['getElementById']('actionBarItem' + a['toString']()))) {
  471. foodType = a - 0x10;
  472. }
  473. }
  474. var event = 0;
  475. for (; event < 9; event++) {
  476. if (isElementVisible(document['getElementById']('actionBarItem' + event['toString']()))) {
  477. primary = event;
  478. }
  479. }
  480. var div = 9;
  481. for (; div < 16; div++) {
  482. if (isElementVisible(document['getElementById']('actionBarItem' + div['toString']()))) {
  483. secondary = div;
  484. }
  485. }
  486. var tobj = 16;
  487. for (; tobj < 19; tobj++) {
  488. if (isElementVisible(document['getElementById']('actionBarItem' + tobj['toString']()))) {
  489. foodType = tobj - 16;
  490. }
  491. }
  492. var props = 19;
  493. for (; props < 22; props++) {
  494. if (isElementVisible(document['getElementById']('actionBarItem' + props['toString']()))) {
  495. wallType = props - 16;
  496. }
  497. }
  498. var e = 22;
  499. for (; e < 26; e++) {
  500. if (isElementVisible(document['getElementById']('actionBarItem' + e['toString']()))) {
  501. spikeType = e - 16;
  502. }
  503. }
  504. var f = 26;
  505. for (; f < 29; f++) {
  506. if (isElementVisible(document['getElementById']('actionBarItem' + f['toString']()))) {
  507. millType = f - 16;
  508. }
  509. }
  510. var g = 29;
  511. for (; g < 31; g++) {
  512. if (isElementVisible(document['getElementById']('actionBarItem' + g['toString']()))) {
  513. mineType = g - 16;
  514. }
  515. }
  516. var h = 31;
  517. for (; h < 33; h++) {
  518. if (isElementVisible(document['getElementById']('actionBarItem' + h['toString']()))) {
  519. boostType = h - 16;
  520. }
  521. }
  522. var intval = 33;
  523. for (; intval < 39; intval++) {
  524. if (isElementVisible(document['getElementById']('actionBarItem' + intval['toString']())) && intval != 36) {
  525. turretType = intval - 16;
  526. }
  527. }
  528. spawnpadType = 36;
  529. }
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540. let freeHats = [51, 50, 28, 29, 30, 36, 37, 38, 44, 35, 42, 43, 49];
  541.  
  542.  
  543.  
  544.  
  545. async function hatLoop() {
  546.  
  547. for (var xware = 0; xware < freeHats.length; xware++) {
  548. storeEquip(freeHats[xware])
  549. await sleep(300)
  550.  
  551. }
  552. }
  553. setInterval(()=>{
  554.  
  555. //hatLoop()
  556.  
  557.  
  558. },1000);
  559.  
  560.  
  561. function Hat(id){
  562. storeBuy(id);
  563. storeEquip(id);
  564. }
  565.  
  566. document.addEventListener('keydown',function(e){
  567. switch(e.keyCode){
  568. case 86:
  569. if (document.activeElement.id.toLowerCase() !== 'chatbox') {
  570. place(spikeType);
  571. }
  572. break;
  573. case 66:
  574. if (document.activeElement.id.toLowerCase() !== 'chatbox') {
  575. var angle = Math.atan2(mouseY - height / 2, mouseX - width / 2)
  576. var deg90 = -0.785398/2
  577. var deg290 = 0.785398/2
  578. place(millType,angle);
  579. place(millType,angle-deg290);
  580. place(millType,angle+deg90);
  581. }
  582. break;
  583. case 71:
  584. if (document.activeElement.id.toLowerCase() !== 'chatbox') {
  585. place(spikeType,6.28319);
  586. place(spikeType,3.14159);
  587. place(spikeType,-3.14159);
  588. }
  589. break;
  590. case 70:
  591. if (document.activeElement.id.toLowerCase() !== 'chatbox') {
  592. place(boostType,0);
  593. place(boostType,6.28319);
  594. place(boostType,3.14159);
  595. place(boostType,-3.14159);
  596. place(boostType,1.5708);
  597. place(boostType,-1.5708);
  598.  
  599. }
  600. break;
  601.  
  602. }
  603. });
  604.  
  605.  
  606.  
  607. document.getElementById("enterGame").addEventListener('click', autohide);
  608. function autohide(){
  609. $("#ot-sdk-btn-floating").hide();
  610. }
  611. document.getElementById("moomooio_728x90_home").style.display = "none";
  612. $("#moomooio_728x90_home").parent().css({display: "none"});
  613. document.getElementById("promoImgHolder").remove();
  614. document.querySelector("#pre-content-container").remove(); //ANTI AD