Advertisement
Guest User

Untitled

a guest
Jan 31st, 2018
4,855
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.31 KB | None | 0 0
  1. // ==UserScript==
  2. // @name MOOMOO.IO Insane Mod! *BETA* {Too fast? Read Description}
  3. // @namespace MOOMOO.IO Insane Mod! *BETA* {Too fast? Read Description}
  4. // @version 1
  5. // @description Better Minimap, Hat & Accessory Toolbar, Auto Heal, Double Hit, Easy Bow, Rainbow Hat, Hotkeys
  6. // @author TigerYT
  7. // @match http://moomoo.io/*
  8. // @match http://45.77.0.81/*
  9. // @match http://dev.moomoo.io/*
  10. // @require http://code.jquery.com/jquery-1.12.4.min.js
  11. // @grant none
  12. // @connect moomoo.io
  13. // @icon http://moomoo.io/img/icons/skull.png
  14. // ==/UserScript==
  15.  
  16. $("#youtuberOf").remove();
  17. $("#followText").remove();
  18. $("#twitterFollow").remove();
  19. $("#youtubeFollow").remove();
  20. $("#adCard").remove();
  21. $("#mobileInstructions").remove();
  22. $("#promoImgHolder").remove();
  23. $("#downloadButtonContainer").remove();
  24. $("#mobileDownloadButtonContainer").remove();
  25. $(".downloadBadge").remove();
  26. $("div[style*='inline-block']").css('display', 'block');
  27. $("#rightCardHolder").append("<div class='menuCard' id='guideCard'><div class='menuHeader'> Description of Mod: <br> <br> Special Thanks to: <br></div><div class='menuText'> Tuxxaman (Gave me Auto Heal) <br> lightningking (Made Upgrade Tree Image) <br> Areith/Ella (Edited Upgrade Tree Image)<br> Mudkip (ID's for items) <br> <br> <div class='menuHeader'> Read Below ⬇⬇⬇ </div><br>Please know that I do not advise you to hack because it will be unfair for other moomoo.io players. Also if you want to join a clan, if they find out you use hacks or have used hacks they will not accept you. <br> <br> <div class='menuHeader'> TIPS: </div> <br>If you want to survive as long as possible make sure you spam the weapon you are using! For exampe if I am using bow since it is a Second Weapon I would spam 2 (Or '.' If I am a Arrow Key User) <br></div></div>");
  28. $("#rightCardHolder").append("<div class='menuCard' id='guideCard'><div class='menuHeader'>How to use Mod <br></div><div class='menuText'> <br> <b> <center> For WASD Users </center> </b> <br> T = Windmill <br> <br> G = Spikes <br> <br> F = Pittrap/Booster Pad <br> <br> Z = Turret <br> <br> <b> <center> For Arrow Key Users </center> </b> <br> ] = Windmill <br> <br> ; = Spikes <br> <br> ' = Pittraps/Booster Pad <br> <br> # = Turret <br> <br> / = Main Weapon <br> <br> . = Second Weapon <br> <b> <center> For All Users </center> </b> <br> Home = Rainbow Hat <br> <br> Right Click = Easy Bow <br> (Any Weapon + Bow/Crossbow)<br> <br> Right Click = Double Hit <br> (Any Weapon + Hammer) <br> <br> P = Toggle Hat & Accessory Toolbar Off/On <br> <br> L = Toggle Upgrade Tree Off/On <br> <br> Click Auto Heal Checkbox = Toggle Autoheal Off/On </div></div>");
  29. $('body').prepend('<img class="UpgradeTree" src="https://cdn.discordapp.com/attachments/387753857687486464/389103386764509186/image.png" alt="Upgrade Tree" width="300" height="300" style="position:absolute; margin-top:100px; padding:10px; opacity:0.7;"/>' );
  30.  
  31.  
  32. (function () {
  33. var ITEM_TYPE = {
  34. WEAPON: 0,
  35. STONE: 1,
  36. FOOD: 2,
  37. PITTRAP: 3,
  38. WINDMAIL: 4,
  39. TWO_WEAPON: 5,
  40. SPIKES: 6,
  41. TURRET: 7,
  42. MINE: 8,
  43. EXTRAS: 9
  44. };
  45.  
  46. var ITEMS = [{
  47. id: 0,
  48. type: ITEM_TYPE.WEAPON,
  49. name: "Tool hammer"
  50. }, {
  51. id: 1,
  52. sid: 1,
  53. type: ITEM_TYPE.WEAPON,
  54. name: "Hand axe"
  55. }, {
  56. id: 2,
  57. sid: 2,
  58. type: ITEM_TYPE.WEAPON,
  59. name: "Great axe"
  60. }, {
  61. id: 3,
  62. type: ITEM_TYPE.WEAPON,
  63. sid: 3,
  64. name: "Short Sword"
  65. }, {
  66. id: 4,
  67. sid: 4,
  68. type: ITEM_TYPE.WEAPON,
  69. name: "Katana"
  70. }, {
  71. id: 5,
  72. sid: 5,
  73. type: ITEM_TYPE.WEAPON,
  74. name: "PoleArm"
  75. }, {
  76. id: 6,
  77. sid: 6,
  78. type: ITEM_TYPE.TWO_WEAPON,
  79. name: "Hunting bow"
  80. }, {
  81. id: 7,
  82. sid: 7,
  83. type: ITEM_TYPE.TWO_WEAPON,
  84. name: "Great hammer"
  85. }, {
  86. id: 8,
  87. sid: 8,
  88. type: ITEM_TYPE.TWO_WEAPON,
  89. name: "Wooden shield"
  90. }, {
  91. id: 9,
  92. sid: 9,
  93. type: ITEM_TYPE.TWO_WEAPON,
  94. name: "Crossbow"
  95. }, {
  96. id: 10,
  97. sid: 10,
  98. type: ITEM_TYPE.TWO_WEAPON,
  99. name: "Musket"
  100. }, {
  101. id: 0,
  102. sid: 11,
  103. type: ITEM_TYPE.FOOD,
  104. name: "Apple"
  105. }, {
  106. id: 1,
  107. sid: 12,
  108. type: ITEM_TYPE.FOOD,
  109. name: "Cookie"
  110. }, {
  111. id: 2,
  112. sid: 13,
  113. type: ITEM_TYPE.WALL,
  114. name: "Wood Wall"
  115. }, {
  116. id: 3,
  117. sid: 14,
  118. type: ITEM_TYPE.WALL,
  119. name: "Stone Wall"
  120. }, {
  121. id: 4,
  122. sid: 15,
  123. type: ITEM_TYPE.WALL,
  124. name: "Castle Wall"
  125. }, {
  126. id: 5,
  127. sid: 16,
  128. type: ITEM_TYPE.SPIKES,
  129. name: "Spikes"
  130. }, {
  131. id: 6,
  132. type: ITEM_TYPE.SPIKES,
  133. sid: 17,
  134. name: "Greater spikes"
  135. }, {
  136. id: 7,
  137. type: ITEM_TYPE.SPIKES,
  138. sid: 18,
  139. name: "Poison spikes"
  140. }, {
  141. id: 8,
  142. type: ITEM_TYPE.SPIKES,
  143. sid: 19,
  144. name: "Spinning spikes"
  145. }, {
  146. id: 9,
  147. sid: 20,
  148. type: ITEM_TYPE.WINDMAIL,
  149. name: "Windmill"
  150. }, {
  151. id: 10,
  152. type: ITEM_TYPE.WINDMAIL,
  153. sid: 21,
  154. name: "Faster windmill"
  155. }, {
  156. id: 11,
  157. type: ITEM_TYPE.MINE,
  158. sid: 22,
  159. name: "Mine"
  160. }, {
  161. id: 12,
  162. type: ITEM_TYPE.PITTRAP,
  163. sid: 23,
  164. name: "Pit trap"
  165. }, {
  166. id: 13,
  167. type: ITEM_TYPE.PITTRAP,
  168. sid: 24,
  169. name: "Boost pad "
  170. }, {
  171. id: 14,
  172. type: ITEM_TYPE.EXTRAS,
  173. sid: 25,
  174. name: "Turret"
  175. }, {
  176. id: 15,
  177. type: ITEM_TYPE.EXTRAS,
  178. sid: 26,
  179. name: "Platform"
  180. }, {
  181. id: 16,
  182. type: ITEM_TYPE.EXTRAS,
  183. sid: 27,
  184. name: "Healing Pad"
  185. }, {
  186. id: 17,
  187. type: ITEM_TYPE.EXTRAS,
  188. sid: 28,
  189. name: "Spawn Pad"
  190. }];
  191.  
  192. function getItemById(id, type) {
  193. if (type !== undefined && !Array.isArray(type)) {
  194. type = [type];
  195. }
  196. return ITEMS.find(function (item) {
  197. return type === undefined ? item.id == id && ![ITEM_TYPE.WEAPON, ITEM_TYPE.TWO_WEAPON].includes(item.type) : item.id == id && type.includes(item.type);
  198. });
  199. }
  200.  
  201. function getItemBySid(sid) {
  202. return ITEMS.find(function (item) {
  203. return item.sid !== undefined && sid !== undefined && item.sid == sid;
  204. });
  205. }
  206.  
  207. var ws;
  208. var player;
  209. var BOT_SETTINGS_TEMPLATE = '<style>.bot-settings{padding: 10px; background-color: rgba(0, 0, 0, 0.2); border-radius: 3px; position: absolute; left: 0px; top: 0px; min-width: 200px; max-width: 300px;aw}.equip-btn{display:inline-block; width: 25px; height: 25px; border: 1px solid grey; background-size: contain; cursor: pointer; background-color: lightgray;}.equip-btn.selected{background-color: lightgreen;}</style><div class="bot-settings"> <div> <div> <input type="checkbox" id="botAutoHealOn"/> <label for="botAutoHealOn">AutoHeal</label> </div></div><hr/> <div id="bot-equips-0"> </div><hr/><div id="bot-equips-1"> </div></div>';
  210. var autoHealStarted = true;
  211. var btnEnterGame = document.getElementById('enterGame');
  212.  
  213. function Player() {
  214. this.id = 0;
  215.  
  216. this.resources = {
  217. food: 0,
  218. gold: 0,
  219. wood: 0,
  220. stone:0,
  221. };
  222.  
  223. this.hp = 100;
  224.  
  225. this.hat = 0;
  226. this.accessory = 0;
  227.  
  228. this.items = {};
  229. this.items[ITEM_TYPE.WEAPON] = getItemById(0, ITEM_TYPE.WEAPON);
  230. this.items[ITEM_TYPE.SPIKES] = getItemById(5);
  231. this.items[ITEM_TYPE.WALL] = getItemById(2);
  232. this.items[ITEM_TYPE.FOOD] = getItemById(0);
  233. this.items[ITEM_TYPE.WINDMAIL] = getItemById(9);
  234. this.items[ITEM_TYPE.EXTRAS] = getItemById(14);
  235.  
  236. this.itemInHand = this.items[ITEM_TYPE.WEAPON];
  237. }
  238.  
  239. btnEnterGame.onmousedown = function () {
  240. StartBot();
  241. btnEnterGame.onmousedown = null;
  242. };
  243.  
  244. $('#adCard').remove();
  245.  
  246. document.addEventListener('keydown', function (e) {
  247. if (ws) {
  248. switch (e.keyCode) {
  249. // T
  250. case 84:
  251. if (player.items[ITEM_TYPE.WINDMAIL]) ws.send("42[\"5\"," + player.items[ITEM_TYPE.WINDMAIL].id + ",null]");
  252. break;
  253.  
  254. // G
  255. case 71:
  256. e.stopPropagation();
  257. if (player.items[ITEM_TYPE.SPIKES]) ws.send("42[\"5\"," + player.items[ITEM_TYPE.SPIKES].id + ",null]");
  258. break;
  259.  
  260. // Z
  261. case 90:
  262. e.stopPropagation();
  263. if (player.items[ITEM_TYPE.EXTRAS]) ws.send("42[\"5\"," + player.items[ITEM_TYPE.TURRET].id + ",null]");
  264. break;
  265.  
  266. // F
  267. case 70:
  268. e.stopPropagation();
  269. if (player.items[ITEM_TYPE.PITTRAP]) ws.send("42[\"5\"," + player.items[ITEM_TYPE.PITTRAP].id + ",null]");
  270. break;
  271.  
  272. // ]
  273. case 221:
  274. if (player.items[ITEM_TYPE.WINDMAIL]) ws.send("42[\"5\"," + player.items[ITEM_TYPE.WINDMAIL].id + ",null]");
  275. break;
  276.  
  277. // ;
  278. case 186:
  279. e.stopPropagation();
  280. if (player.items[ITEM_TYPE.SPIKES]) ws.send("42[\"5\"," + player.items[ITEM_TYPE.SPIKES].id + ",null]");
  281. break;
  282.  
  283. // '
  284. case 222:
  285. e.stopPropagation();
  286. if (player.items[ITEM_TYPE.EXTRAS]) ws.send("42[\"5\"," + player.items[ITEM_TYPE.TURRET].id + ",null]");
  287. break;
  288.  
  289. // #
  290. case 70:
  291. e.stopPropagation();
  292. if (player.items[ITEM_TYPE.PITTRAP]) ws.send("42[\"5\"," + player.items[ITEM_TYPE.PITTRAP].id + ",null]");
  293. break;
  294.  
  295. // /
  296. case 191:
  297. e.stopPropagation();
  298. if (player.items[ITEM_TYPE.WEAPON]) ws.send("42[\"5\"," + player.items[ITEM_TYPE.WEAPON].id + ",null]");
  299. break;
  300.  
  301. // .
  302. case 190:
  303. e.stopPropagation();
  304. if (player.items[ITEM_TYPE.TWO_WEAPON]) ws.send("42[\"5\"," + player.items[ITEM_TYPE.TWO_WEAPON].id + ",null]");
  305. break;
  306.  
  307. // P
  308. case 80:
  309. e.stopPropagation();
  310. $('.bot-settings').toggle();
  311. break;
  312.  
  313. // L
  314. case 76:
  315. e.stopPropagation();
  316. $('.UpgradeTree').toggle();
  317. break;
  318. }
  319. }
  320. }, true);
  321.  
  322. document.addEventListener('mousedown', function (e) {
  323. if (ws && e.button == 2) {
  324. e.stopPropagation();
  325. ws.send("42[\"4\",1,null]");
  326. setTimeout(function () {
  327. ws.send("42[\"5\"," + player.items[ITEM_TYPE.TWO_WEAPON].id + ",true]");
  328. }, 100);
  329. setTimeout(function () {
  330. ws.send("42[\"4\",0,null]");
  331. }, 100);
  332. setTimeout(function () {
  333. ws.send("42[\"5\"," + player.items[ITEM_TYPE.WEAPON].id + ",true]");
  334. }, 700);
  335. }
  336. }, true);
  337.  
  338. function Log(text) {
  339. return;
  340. }
  341.  
  342. function init() {
  343. $('body').append(BOT_SETTINGS_TEMPLATE);
  344.  
  345. $('#botAutoHealOn').prop("checked", autoHealStarted);
  346. $('#botAutoHealOn').change(function (e) {
  347. autoHealStarted = e.currentTarget.checked;
  348. });
  349.  
  350. addEquip(0, 28);
  351. addEquip(0, 29);
  352. addEquip(0, 30);
  353. addEquip(0, 36);
  354. addEquip(0, 37);
  355. addEquip(0, 38);
  356. addEquip(0, 44);
  357. addEquip(0, 35);
  358. addEquip(0, 42);
  359. addEquip(0, 43);
  360. addEquip(0, 49);
  361. }
  362.  
  363. function dead() {
  364. player = new Player();
  365. }
  366.  
  367. function botLaunched() {
  368. return $('#botAutoHealOn').prop('checked');
  369. }
  370.  
  371. function equipId(type, id) {
  372. return "bot-eq-" + type + id;
  373. }
  374.  
  375. function equipIsSelect(type, id) {
  376. return $("#" + equipId(type, id)).hasClass("selected");
  377. }
  378.  
  379. function equipSelect(type, id) {
  380. $("#" + equipId(type, id)).addClass("selected");
  381. }
  382.  
  383. function equipCancleSelect(type, id) {
  384. if (id == "all") {
  385. $("#bot-equips-" + type + ">.equip-btn").removeClass("selected");
  386. } else $("#" + equipId(type, id)).removeClass("selected");
  387. }
  388.  
  389. function equipExist(type, id) {
  390. return $("#bot-equips-" + type + ">#" + equipId(type, id)).length > 0;
  391. }
  392.  
  393. function addEquip(type, id) {
  394. if (equipExist(type, id)) {
  395. return;
  396. }
  397. var url = "http://moomoo.io/img";
  398.  
  399. if (type == 1) {
  400. url += "/accessories/access_" + id + ".png";
  401. } else {
  402. url += "/hats/hat_" + id + ".png";
  403. }
  404.  
  405. $("<div/>", {
  406. id: equipId(type, id),
  407. "class": "equip-btn",
  408. css: {
  409. "background-image": "url(" + url + ")"
  410. },
  411. click: function click() {
  412. if (!equipIsSelect(type, id)) ws.send("42[\"13\",0," + id + ", " + type + "]");else ws.send("42[\"13\",0,0," + type + "]");
  413. }
  414. }).appendTo("#bot-equips-" + type);
  415. }
  416.  
  417. function StartBot() {
  418. player = new Player();
  419. init();
  420. Log("AutoHeal loaded");
  421. WebSocket.prototype.oldSend = WebSocket.prototype.send;
  422. WebSocket.prototype.send = function (m) {
  423. if (!ws) {
  424. ws = this;
  425. socketFound(this);
  426. }
  427. var parsed = parseWSMsg(m);
  428.  
  429. if (parsed[0] == "5") {
  430. var id = parsed[1];
  431. var isWeapon = parsed[2] || false;
  432. if (!isWeapon) {
  433. if (id == 0 || id == 1) {
  434. player.itemInHand = player.items[ITEM_TYPE.FOOD];
  435. }
  436. }
  437. }
  438.  
  439. if (parsed[0] == "6") {
  440. var item = getItemBySid(parsed[1]);
  441. if (item) {
  442. player.items[item.type] = item;
  443. if (item.type == player.itemInHand.type) {
  444. player.itemInHand = item;
  445. }
  446. }
  447. }
  448.  
  449. this.oldSend(m);
  450. };
  451.  
  452. function socketFound(socket) {
  453. window.gameSocket = socket;
  454. socket.addEventListener("message", function (e) {
  455. var m = e.data;
  456. var parsed = parseWSMsg(m);
  457.  
  458. switch (parsed[0]) {
  459. case "1":
  460. player.id = parsed[1];
  461. break;
  462.  
  463. case "us":
  464. var itemId = parsed[2];
  465. var pacType = parsed[1];
  466. var itemType = parsed[3];
  467. switch (pacType) {
  468. case 0:
  469. addEquip(itemType, itemId);
  470. break;
  471.  
  472. case 1:
  473. if (itemType == 1) player.accessory = itemId;else if (itemType === 0) player.hat = itemId;
  474. equipCancleSelect(itemType, "all");
  475. equipSelect(itemType, itemId);
  476. break;
  477. }
  478. break;
  479.  
  480. case "9":
  481. player.resources[parsed[1]] = parsed[2];
  482. break;
  483.  
  484. case "10":
  485. if (parsed[1] == player.id) {
  486. player.hp = parsed[2];
  487. if (player.hp <= 0) {
  488. dead();
  489. }
  490. }
  491. break;
  492. }
  493. });
  494. }
  495.  
  496. var healTimer = setInterval(function () {
  497. if (autoHealStarted) heal();
  498. }, 0);
  499.  
  500. function parseWSMsg(s) {
  501. if (s.indexOf("42") === -1) return -1;
  502. var o = s.substring(s.indexOf("["));
  503. return JSON.parse(o);
  504. }
  505.  
  506. function heal() {
  507. if (player.hp >= 100) return;
  508. if (hasApple()) {
  509. if (player.itemInHand.type == ITEM_TYPE.FOOD) {
  510. ws.send("42[\"4\",1,null]");
  511. player.itemInHand = player.items[ITEM_TYPE.WEAPON];
  512. } else {
  513. ws.send("42[\"5\"," + player.items[ITEM_TYPE.FOOD].id + ",null]");
  514. heal();
  515. }
  516. }
  517. }
  518.  
  519. function hasApple() {
  520. if (player.items[ITEM_TYPE.FOOD].id === 0) return player.resources.food >= 10;else return player.resources.food >= 15;
  521. }
  522. }
  523. })();
  524.  
  525. (function() {
  526. var můjVar;
  527. var můjVar2;
  528. var můjVar3;
  529. var můjVar4;
  530. var můjVar5;
  531. var můjVar6;
  532. var můjVar7;
  533. var můjVar8;
  534. var můjVar9;
  535. var můjVar10;
  536. var můjVar11;
  537. var změna = true;
  538. var ID_FAZE = 45;
  539. var ID_Moo_Head = 28;
  540. var ID_Pig_Head = 29;
  541. var ID_Fluff_Head = 30;
  542. var ID_Pandou_Head = 36;
  543. var ID_Bear_Head = 37;
  544. var ID_Monkey_Head = 38;
  545. var ID_Polar_Head = 44;
  546. var ID_Fez_Hat = 35;
  547. var ID_Enigma_Hat = 42;
  548. var ID_Blitz_Hat = 43;
  549. var ID_Bob_XIII_Hat = 49;
  550.  
  551. document.addEventListener('keydown', function (e) {
  552. if (e.keyCode == 36) {
  553. e.preventDefault();
  554. if (změna) {
  555. storeEquip(ID_Moo_Head);
  556. můjVar = setTimeout(function(){ h1(); }, 180);
  557. } else {
  558. clearTimeout(můjVar);
  559. clearTimeout(můjVar2);
  560. clearTimeout(můjVar3);
  561. clearTimeout(můjVar4);
  562. clearTimeout(můjVar5);
  563. clearTimeout(můjVar6);
  564. clearTimeout(můjVar7);
  565. clearTimeout(můjVar8);
  566. clearTimeout(můjVar9);
  567. clearTimeout(můjVar10);
  568. clearTimeout(můjVar11);
  569. storeEquip(ID_FAZE);
  570. }
  571. změna = !změna;
  572. }
  573. });
  574.  
  575. function h1() {
  576. storeEquip(ID_Moo_Head);
  577. clearTimeout(můjVar);
  578. můjVar2 = setTimeout(function(){ h2(); }, 180);
  579. }
  580. function h2() {
  581. storeEquip(ID_Pig_Head);
  582. clearTimeout(můjVar2);
  583. můjVar3 = setTimeout(function(){ h3(); }, 180);
  584. }
  585. function h3() {
  586. storeEquip(ID_Fluff_Head);
  587. clearTimeout(můjVar3);
  588. můjVar4 = setTimeout(function(){ h4(); }, 180);
  589. }
  590. function h4() {
  591. storeEquip(ID_Pandou_Head);
  592. clearTimeout(můjVar4);
  593. můjVar5 = setTimeout(function(){ h5(); }, 180);
  594. }
  595. function h5() {
  596. storeEquip(ID_Bear_Head);
  597. clearTimeout(můjVar5);
  598. můjVar6 = setTimeout(function(){ h6(); }, 180);
  599. }
  600. function h6() {
  601. storeEquip(ID_Monkey_Head);
  602. clearTimeout(můjVar6);
  603. můjVar7 = setTimeout(function(){ h7(); }, 180);
  604. }
  605. function h7() {
  606. storeEquip(ID_Polar_Head);
  607. clearTimeout(můjVar7);
  608. můjVar8 = setTimeout(function(){ h8(); }, 180);
  609. }
  610. function h8() {
  611. storeEquip(ID_Fez_Hat);
  612. clearTimeout(můjVar8);
  613. můjVar9 = setTimeout(function(){ h9(); }, 180);
  614. }
  615. function h9() {
  616. storeEquip(ID_Enigma_Hat);
  617. clearTimeout(můjVar9);
  618. můjVar10 = setTimeout(function(){ h10(); }, 180);
  619. }
  620. function h10() {
  621. storeEquip(ID_Blitz_Hat);
  622. clearTimeout(můjVar10);
  623. můjVar11 = setTimeout(function(){ h11(); }, 180);
  624. }
  625. function h11() {
  626. storeEquip(ID_Bob_XIII_Hat);
  627. clearTimeout(můjVar11);
  628. můjVar = setTimeout(function(){ h1(); }, 180);
  629. }
  630. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement