Advertisement
Guest User

Untitled

a guest
Jan 17th, 2020
2,265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.99 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Moomoo.io autoheal hack, modified by iZioid
  3. // @namespace -
  4. // @version 1.2
  5. // @description *Auto monkey tail remover *Auto-tankgear (Q) For fastheal (G) For Spike + BoostPad, (N) For 1 Windmills, (O) For 5 Windmills, (H) For Turrets (F) For BoostPad, (V) For Spike (P) For 4 Walls, (M) for Active/Unactive Auto Hat and (M) For 4 Spikes, (T) for Active/Unactive AutoHeal [Apple/Cookie/Cheese]
  6. // @author Leviathan#7744
  7. // @match *://moomoo.io/*
  8. // @match *://sandbox.moomoo.io/*
  9. // @grant GM_addStyle
  10. // @require https://greasyfork.org/scripts/368273-msgpack/code/msgpack.js?version=598723
  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. // ==/UserScript==
  15.  
  16. document.getElementById("twitterFollow").remove();
  17. document.getElementById("youtubeFollow").remove();
  18. document.getElementById("followText").style = "bottom: -0px;"
  19. document.getElementById('errorNotification').remove();
  20. document.getElementById("pingDisplay").remove();
  21. $("#consentBlock").css({display: "none"});
  22. $("#youtuberOf").css({display: "none"});
  23. $("#mapDisplay").css({background: `url('https://i.imgur.com/fgFsQJp.png')`});
  24.  
  25. document.getElementById("moomooio_728x90_home").style.display = "none";
  26. $("#moomooio_728x90_home").parent().css({display: "none"});
  27.  
  28. window.onbeforeunload = null;
  29.  
  30. let mouseX;
  31. let mouseY;
  32.  
  33. let width;
  34. let height;
  35.  
  36. setInterval(() => {
  37. if(clanToggle == 1) {
  38. doNewSend(["9", [null]]);
  39. doNewSend(["8", [animate(false, 5)]])
  40. }
  41. doNewSend(["testing", [6]]);
  42. }, 200);
  43.  
  44. setInterval(() => {
  45. if(messageToggle == 1) {
  46. doNewSend(["ch", [animate(true, 5)]])
  47. }
  48. }, 200);
  49.  
  50. setInterval(() => {
  51. if(autoaim == true) {
  52. doNewSend(["2", [nearestEnemyAngle]]);
  53. }
  54. }, 0);
  55.  
  56. setInterval(() => {
  57. if(hatToggle == 1) {
  58. if(oldHat != normalHat) {
  59. hat(normalHat);
  60. console.log("Tried. - Hat")
  61. }
  62. if(oldAcc != normalAcc) {
  63. acc(normalAcc);
  64. console.log("Tried. - Acc")
  65. }
  66. oldHat = normalHat;
  67. oldAcc = normalAcc
  68. }
  69. }, 25);
  70.  
  71. function normal() {
  72. hat(normalHat);
  73. acc(normalAcc);
  74. }
  75.  
  76. function aim(x, y){
  77. var cvs = document.getElementById("gameCanvas");
  78. cvs.dispatchEvent(new MouseEvent("mousemove", {
  79. clientX: x,
  80. clientY: y
  81.  
  82. }));
  83. }
  84.  
  85. let coreURL = new URL(window.location.href);
  86. window.sessionStorage.force = coreURL.searchParams.get("fc");
  87.  
  88. var nearestEnemy;
  89. var nearestEnemyAngle;
  90. var isEnemyNear;
  91. var instaSpeed = 230;
  92. var primary;
  93. var secondary;
  94. var foodType;
  95. var wallType;
  96. var spikeType;
  97. var millType;
  98. var mineType;
  99. var boostType;
  100. var turretType;
  101. var spawnpadType;
  102. var autoaim = false;
  103. var tick = 1;
  104. var oldHat;
  105. var oldAcc;
  106. var enemiesNear;
  107. var normalHat;
  108. var normalAcc;
  109. var ws;
  110. var msgpack5 = msgpack;
  111. var boostDir;
  112. let myPlayer = {
  113. id: null,
  114. x: null,
  115. y: null,
  116. dir: null,
  117. object: null,
  118. weapon: null,
  119. clan: null,
  120. isLeader: null,
  121. hat: null,
  122. accessory: null,
  123. isSkull: null
  124. };
  125.  
  126. let healSpeed = 70;
  127. var messageToggle = 0;
  128. var clanToggle = 0;
  129. let healToggle = 1;
  130. let hatToggle = 1;
  131.  
  132. document.msgpack = msgpack;
  133. function n(){
  134. this.buffer = new Uint8Array([0]);
  135. this.buffer.__proto__ = new Uint8Array;
  136. this.type = 0;
  137. }
  138.  
  139. WebSocket.prototype.oldSend = WebSocket.prototype.send;
  140. WebSocket.prototype.send = function(m){
  141. if (!ws){
  142. document.ws = this;
  143.  
  144. ws = this;
  145. socketFound(this);
  146. }
  147. this.oldSend(m);
  148. };
  149.  
  150.  
  151. function socketFound(socket){
  152. socket.addEventListener('message', function(message){
  153. handleMessage(message);
  154. });
  155. }
  156.  
  157. function handleMessage(m){
  158. let temp = msgpack5.decode(new Uint8Array(m.data));
  159. let data;
  160. if(temp.length > 1) {
  161. data = [temp[0], ...temp[1]];
  162. if (data[1] instanceof Array){
  163. data = data;
  164. }
  165. } else {
  166. data = temp;
  167. }
  168. let item = data[0];
  169. if(!data) {return};
  170.  
  171. if(item === "io-init") {
  172. let cvs = document.getElementById("gameCanvas");
  173. width = cvs.clientWidth;
  174. height = cvs.clientHeight;
  175. $(window).resize(function() {
  176. width = cvs.clientWidth;
  177. height = cvs.clientHeight;
  178. });
  179. cvs.addEventListener("mousemove", e => {
  180. mouseX = e.clientX;
  181. mouseY = e.clientY;
  182. });
  183. }
  184.  
  185. if (item == "1" && myPlayer.id == null){
  186. myPlayer.id = data[1];
  187. }
  188.  
  189. if (item == "33") {
  190. enemiesNear = [];
  191. for(let i = 0; i < data[1].length / 13; i++) {
  192. let playerInfo = data[1].slice(13*i, 13*i+13);
  193. if(playerInfo[0] == myPlayer.id) {
  194. myPlayer.x = playerInfo[1];
  195. myPlayer.y = playerInfo[2];
  196. myPlayer.dir = playerInfo[3];
  197. myPlayer.object = playerInfo[4];
  198. myPlayer.weapon = playerInfo[5];
  199. myPlayer.clan = playerInfo[7];
  200. myPlayer.isLeader = playerInfo[8];
  201. myPlayer.hat = playerInfo[9];
  202. myPlayer.accessory = playerInfo[10];
  203. myPlayer.isSkull = playerInfo[11];
  204. } else if(playerInfo[7] != myPlayer.clan || playerInfo[7] === null) {
  205. enemiesNear.push(playerInfo);
  206. }
  207. }
  208. }
  209.  
  210. isEnemyNear = false;
  211. if(enemiesNear) {
  212. nearestEnemy = enemiesNear.sort((a,b) => dist(a, myPlayer) - dist(b, myPlayer))[0];
  213. }
  214.  
  215. if(nearestEnemy) {
  216. nearestEnemyAngle = Math.atan2(nearestEnemy[2]-myPlayer.y, nearestEnemy[1]-myPlayer.x);
  217. if(Math.sqrt(Math.pow((myPlayer.y-nearestEnemy[2]), 2) + Math.pow((myPlayer.x-nearestEnemy[1]), 2)) < 300) {
  218. isEnemyNear = true;
  219. if(autoaim == false && myPlayer.hat != 7 && myPlayer.hat != 53) {
  220. normalHat = 6;
  221. if(primary != 8) {
  222. normalAcc = 19
  223. }
  224. };
  225. }
  226. }
  227. if(isEnemyNear == false && autoaim == false) {
  228. normalAcc = 11;
  229. if (myPlayer.y < 2400){
  230. normalHat = 15;
  231. } else if (myPlayer.y > 6850 && myPlayer.y < 7550){
  232. normalHat = 31;
  233. } else {
  234. normalHat = 12;
  235. }
  236. }
  237. if (!nearestEnemy) {
  238. nearestEnemyAngle = myPlayer.dir;
  239. }
  240. if(item == "h" && data[1] == myPlayer.id) {
  241. if(data[2] < 100 && data[2] > 0 && healToggle == 1) {
  242. setTimeout( () => {
  243. place(foodType, null);
  244. }, healSpeed);
  245.  
  246. }
  247. }
  248. update();
  249. }
  250.  
  251.  
  252. function doNewSend(sender){
  253. ws.send(new Uint8Array(Array.from(msgpack5.encode(sender))));
  254. }
  255.  
  256. function acc(id) {
  257. doNewSend(["13c", [0, 0, 1]]);
  258. doNewSend(["13c", [0, id, 1]]);
  259. }
  260.  
  261. function hat(id) {
  262. doNewSend(["13c", [0, id, 0]]);
  263. }
  264.  
  265.  
  266. function place(id, angle = Math.atan2(mouseY - height / 2, mouseX - width / 2)) {
  267. doNewSend(["5", [id, null]]);
  268. doNewSend(["c", [1, angle]]);
  269. doNewSend(["c", [0, angle]]);
  270. doNewSend(["5", [myPlayer.weapon, true]]);
  271. }
  272.  
  273. function boostSpike() {
  274. if(boostDir == null) {
  275. boostDir = nearestEnemyAngle;
  276. }
  277. place(spikeType, boostDir + toRad(90));
  278. place(spikeType, boostDir - toRad(90));
  279. place(boostType, boostDir);
  280. doNewSend(["33", [boostDir]]);
  281. }
  282.  
  283.  
  284. var repeater = function(key, action, interval) {
  285. let _isKeyDown = false;
  286. let _intervalId = undefined;
  287.  
  288. return {
  289. start(keycode) {
  290. if(keycode == key && document.activeElement.id.toLowerCase() !== 'chatbox') {
  291. _isKeyDown = true;
  292. if(_intervalId === undefined) {
  293. _intervalId = setInterval(() => {
  294. action();
  295. if(!_isKeyDown){
  296. clearInterval(_intervalId);
  297. _intervalId = undefined;
  298. console.log("claered");
  299. }
  300. }, interval);
  301. }
  302. }
  303. },
  304.  
  305. stop(keycode) {
  306. if(keycode == key && document.activeElement.id.toLowerCase() !== 'chatbox') {
  307. _isKeyDown = false;
  308. }
  309. }
  310. };
  311.  
  312.  
  313. }
  314.  
  315. const healer = repeater(81, () => {place(foodType)}, 0);
  316. const boostPlacer = repeater(70, () => {place(boostType)}, 0);
  317. const spikePlacer = repeater(86, () => {place(spikeType)}, 0);
  318. const millPlacer = repeater(78, () => {place(millType)}, 0);
  319. const turretPlacer = repeater(72, () => {place(turretType)}, 0);
  320. const boostSpiker = repeater(71, boostSpike, 0);
  321.  
  322. document.addEventListener('keydown', (e)=>{
  323. spikePlacer.start(e.keyCode);
  324. healer.start(e.keyCode);
  325. boostPlacer.start(e.keyCode);
  326. boostSpiker.start(e.keyCode);
  327. millPlacer.start(e.keyCode);
  328. turretPlacer.start(e.keyCode);
  329.  
  330. if (e.keyCode == 79 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  331. for (let i=0;i<5;i++){
  332. let angle = myPlayer.dir + toRad(i * 72);
  333. place(millType, angle)
  334. }
  335. }
  336. if (e.keyCode == 80 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  337. for (let i=0;i<4;i++){
  338. let angle = myPlayer.dir + toRad(i * 90);
  339. place(wallType, angle)
  340. }
  341. }
  342. if (e.keyCode == 73 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  343. for (let i=0;i<4;i++){
  344. let angle = myPlayer.dir + toRad(i * 90);
  345. place(boostType, angle)
  346. }
  347. }
  348. if (e.keyCode == 186 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  349. for (let i=0;i<4;i++){
  350. let angle = myPlayer.dir + toRad(i * 90);
  351. place(spikeType, angle)
  352. }
  353. }
  354. if (e.keyCode == 72 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  355. place(turretType, myPlayer.dir + toRad(45));
  356. place(turretType, myPlayer.dir - toRad(45));
  357. }
  358.  
  359. if (e.keyCode == 77 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  360. if (myPlayer.y < 2400){
  361. hat(15);
  362. } else if (myPlayer.y > 6850 && myPlayer.y < 7550){
  363. hat(31);
  364. } else {
  365. hat(12);
  366. }
  367. acc(11);
  368. }
  369.  
  370. if(e.keyCode == 82 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  371. autoaim = true;
  372. doNewSend(["5", [primary, true]]);
  373. doNewSend(["13c", [0, 7, 0]]);
  374. doNewSend(["13c", [0, 0, 1]]);
  375. doNewSend(["13c", [0, 19, 1]]);
  376. doNewSend(["c", [1]]);
  377. setTimeout( () => {
  378. doNewSend(["13c", [0, 53, 0]]);
  379. doNewSend(["5", [secondary, true]]);
  380. }, instaSpeed - 130);
  381.  
  382. setTimeout( () => {
  383. doNewSend(["5", [primary, true]]);
  384. doNewSend(["c", [0, null]]);
  385. doNewSend(["13c", [0, 6, 0]]);
  386. autoaim = false;
  387. }, instaSpeed);
  388. }
  389.  
  390.  
  391. if(e.keyCode == 38 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  392. messageToggle = (messageToggle + 1) % 2;
  393. }
  394.  
  395. if(e.keyCode == 40 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  396. clanToggle = (clanToggle + 1) % 2;
  397. }
  398.  
  399. if(e.keyCode == 84 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  400. healToggle = (healToggle + 1) % 2;
  401. if(healToggle == 0) {
  402. if(hatToggle == 0) {
  403. document.title = "Heal: OFF | Hat: OFF"
  404. } else {
  405. document.title = "Heal: OFF | Hat: ON"
  406. }
  407. } else {
  408. if(hatToggle == 0) {
  409. document.title = "Heal: ON | Hat: OFF"
  410. } else {
  411. document.title = "Heal: ON | Hat: ON"
  412. }
  413. }
  414. }
  415. if(e.keyCode == 76 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  416. autoaim = true;
  417. doNewSend(["5", [secondary, true]]);
  418. doNewSend(["13c", [0, 53, 0]]);
  419. doNewSend(["c", [1]]);
  420.  
  421. setTimeout( () => {
  422. doNewSend(["6", [12]]);
  423. }, 300);
  424.  
  425. setTimeout( () => {
  426. doNewSend(["6", [15]]);
  427. }, 300);
  428.  
  429. setTimeout( () => {
  430. doNewSend(["c", [0]]);
  431. doNewSend(["13c", [0, 6, 0]]);
  432. doNewSend(["5", [primary, true]]);
  433. autoaim = false;
  434. }, 300);
  435. }
  436.  
  437. if(e.keyCode == 97 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  438. doNewSend(["6", [4]]);
  439. }
  440.  
  441. if(e.keyCode == 98 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  442. doNewSend(["6", [15]]);
  443. }
  444. if(e.keyCode == 99 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  445. doNewSend(["6", [28]]);
  446. }
  447. if(e.keyCode == 105 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  448. doNewSend(["6", [28]]);
  449. doNewSend(["6", [25]]);
  450. }
  451. if(e.keyCode == 66 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  452. hatToggle = (hatToggle + 1) % 2;
  453. if(healToggle == 0) {
  454. if(hatToggle == 0) {
  455. document.title = "Heal: OFF | Hat: OFF"
  456. } else {
  457. document.title = "Heal: OFF | Hat: ON"
  458. }
  459. } else {
  460. if(hatToggle == 0) {
  461. document.title = "Heal: ON | Hat: OFF"
  462. } else {
  463. document.title = "Heal: ON | Hat: ON"
  464. }
  465. }
  466. }
  467. })
  468.  
  469. document.addEventListener('keyup', (e)=>{
  470. spikePlacer.stop(e.keyCode);
  471. boostPlacer.stop(e.keyCode);
  472. boostSpiker.stop(e.keyCode);
  473. millPlacer.stop(e.keyCode);
  474. turretPlacer.stop(e.keyCode);
  475. healer.stop(e.keyCode);
  476. if(e.keyCode == 71 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  477. setTimeout( () => {
  478. doNewSend(["33", [null]]);
  479. boostDir = null;
  480. }, 10);
  481. }
  482. })
  483.  
  484.  
  485. function isElementVisible(e) {
  486. return (e.offsetParent !== null);
  487. }
  488.  
  489.  
  490. function toRad(angle) {
  491. return angle * 0.01745329251;
  492. }
  493.  
  494. function dist(a, b){
  495. return Math.sqrt( Math.pow((b.y-a[2]), 2) + Math.pow((b.x-a[1]), 2) );
  496. }
  497.  
  498.  
  499. document.title = "Heal: ON | Hat: ON"
  500.  
  501. function update() {
  502. for (let i=0;i<9;i++){
  503. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  504. primary = i;
  505. }
  506. }
  507.  
  508. for (let i=9;i<16;i++){
  509. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  510. secondary = i;
  511. }
  512. }
  513.  
  514. for (let i=16;i<19;i++){
  515. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  516. foodType = i - 16;
  517. }
  518. }
  519.  
  520. for (let i=19;i<22;i++){
  521. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  522. wallType = i - 16;
  523. }
  524. }
  525.  
  526. for (let i=22;i<26;i++){
  527. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  528. spikeType = i - 16;
  529. }
  530. }
  531.  
  532. for (let i=26;i<29;i++){
  533. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  534. millType = i - 16;
  535. }
  536. }
  537.  
  538. for (let i=29;i<31;i++){
  539. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  540. mineType = i - 16;
  541. }
  542. }
  543.  
  544. for (let i=31;i<33;i++){
  545. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  546. boostType = i - 16;
  547. }
  548. }
  549.  
  550. for (let i=33;i<39;i++){
  551. if (isElementVisible(document.getElementById("actionBarItem" + i.toString())) && i != 36){
  552. turretType = i - 16;
  553. }
  554. }
  555.  
  556. spawnpadType = 36;
  557. }
  558. function sElementVisible(e) {
  559. return (e.offsetParent !== null);
  560. }
  561.  
  562.  
  563. function oRad(angle) {
  564. return angle * 0.01745329251;
  565. }
  566.  
  567. function ist(a, b){
  568. return Math.sqrt( Math.pow((b.y-a[2]), 2) + Math.pow((b.x-a[1]), 2) );
  569. }
  570.  
  571. function animate(space, chance) {
  572. let result = '';
  573. let characters;
  574. if(space) {
  575. characters = 'hi oi fodinha';
  576. } else {
  577. characters = 'picaso!'
  578. }
  579. if(space) {
  580. characters = characters.padStart((30 - characters.length) / 2 + characters.length)
  581. characters = characters.padEnd(30);
  582. }
  583. let count = 0;
  584. for (let i = 0; i < characters.length; i++ ) {
  585. if(Math.floor(Math.random() * chance) == 1 && characters.charAt(i) != "-" && count < 2 && characters.charAt(i) != " ") {
  586. result += "_";
  587. count++
  588. } else {
  589. result += characters.charAt(i);
  590. }
  591. }
  592. return result;
  593. }
  594. // ==UserScript==
  595. // @name MooMoo.IO Hat Hotkeys
  596. // @namespace :D
  597. // @version 0.13
  598. // @description Press ESC to open menu to hat hotkeys!
  599. // @author Brendan
  600. // @match *://moomoo.io/*
  601. // @match *://dev.moomoo.io/
  602. // @match *://sandbox.moomoo.io/*
  603. // @grant none
  604. // ==/UserScript==
  605.  
  606. // Lets start by specifying the ids for each hat in the game - the important ones.
  607.  
  608.  
  609. var ID_WinterCap = 15;
  610. var ID_FlipperHat = 31;
  611. var ID_MarksmanCap = 1;
  612. var ID_BushGear = 10;
  613. var ID_SoldierHelmet = 6;
  614. var ID_AntiVenomGear = 23;
  615. var ID_MusketeerHat = 32;
  616. var ID_MedicGear = 13;
  617. var ID_BullHelmet = 7;
  618. var ID_EmpHelmet = 22;
  619. var ID_BoosterHat = 12;
  620. var ID_BarbarianArmor = 26;
  621. var ID_BullMask = 46;
  622. var ID_WindmillHat = 14;
  623. var ID_SpikeGear = 11;
  624. var ID_BushidoArmor = 16;
  625. var ID_SamuraiArmor = 20;
  626. var ID_ScavengerGear = 27;
  627. var ID_TankGear = 40;
  628. //Turret Gear. "Use if you want to"
  629. var ID_TurretGear = 53;
  630.  
  631. // Keys
  632.  
  633. var TankGearKey = 90;
  634. var BullHelmetKey = 74;
  635. var SoldierHelmetKey = 71;
  636. var TurretKey = 72;
  637. var BoosterHatKey = 66;
  638. var uneqiup = 16;
  639. var SpikeGearKey = 89;
  640. var BarabarianKey = 84;
  641. var SpikeKey = 86
  642.  
  643. // Remove all of the ads on the page.
  644.  
  645. try {
  646. document.getElementById("moomooio_728x90_home").style.display = "none";
  647. $("moomooio728x90_home").parent().css({display: "none"});
  648. } catch (e) {
  649. console.log("There was an error removing the ads.");
  650. }
  651.  
  652.  
  653. var menuChange = document.createElement("div");
  654. menuChange.className = "menuCard";
  655. menuChange.id = "mainSettings";
  656. menuChange.innerHTML = `
  657. <div id="simpleModal" class="modal">
  658. <div class="modal-content">
  659. <div class="modal-header">
  660. <span class="closeBtn">&times;</span>
  661. <h2 style="font-size: 17px;">Hat Macro Settings</h2>
  662. </div>
  663. <div class="modal-body" style="font-size: 17px;">
  664. <div class="flexControl">
  665. <h3 style="color: red; font-size: 17px;">To unquip a hat press: LEFT SHIFT</h3>
  666. <h3 class="menuPrompt">Tank Gear: </h3> <input value="${String.fromCharCode(TankGearKey)}" id="tankGear" class="keyPressLow" onkeyup="this.value = this.value.toUpperCase();" maxlength="1" type="text"/>
  667. <h3 class="menuPrompt">Bull Helmet: </h3> <input value="${String.fromCharCode(BullHelmetKey)}" id="bullHelm" class="keyPressLow" onkeyup="this.value = this.value.toUpperCase();" maxlength="1" type="text"/>
  668. <h3 class="menuPrompt">Soldier Helmet: </h3> <input value="${String.fromCharCode(SoldierHelmetKey)}" id="soldier" class="keyPressLow"onkeyup="this.value = this.value.toUpperCase();" maxlength="1" type="text"/>
  669. <h3 class="menuPrompt">Turret Gear: </h3> <input value="${String.fromCharCode(TurretKey)}" id="turret" class="keyPressLow" maxlength="1" onkeyup="this.value = this.value.toUpperCase();" type="text"/>
  670. <h3 class="menuPrompt">Booster Hat: </h3> <input value="${String.fromCharCode(BoosterHatKey)}" id="booster" class="keyPressLow" maxlength="1" onkeyup="this.value = this.value.toUpperCase();" type="text"/>
  671. <h3 class="menuPrompt">Spike Gear: </h3> <input value="${String.fromCharCode(SpikeGearKey)}" id="spikeg" class="keyPressLow" maxlength="1" onkeyup="this.value = this.value.toUpperCase();" type="text"/>
  672. <h3 class="menuPrompt">Barbarian Armor: </h3> <input value="${String.fromCharCode(BarabarianKey)}" id="barb" class="keyPressLow" onkeyup="this.value = this.value.toUpperCase();" maxlength="1" type="text"/>
  673. <hr>
  674. <h3 style="font-size: 17px;"> Map Settings </h3>
  675.  
  676. <label class="container">Show biomes on the map
  677. <input type="checkbox" id="myCheck">
  678. <span class="checkmark"></span>
  679. </label>
  680. </div>
  681. </div>
  682. <div class="modal-footer">
  683. <h3 style="font-size: 17px;">Edit and live save your changes!</h3>
  684. <p>This hack is free and will always be free!</p>
  685. </div>
  686. </div>
  687. </div>
  688. `
  689. document.body.appendChild(menuChange)
  690.  
  691.  
  692. $("#tankGear").on("input", () => {
  693. var cval = $("#tankGear").val();
  694. if (cval){
  695. TankGearKey = cval.toUpperCase();
  696. TankGearKey = TankGearKey.charCodeAt(0);
  697. console.log(TankGearKey);
  698. }
  699. });
  700.  
  701. $("#bullHelm").on("input", () => {
  702. var cval = $("#bullHelm").val();
  703. if (cval){
  704. BullHelmetKey = cval.toUpperCase();
  705. BullHelmetKey = BullHelmetKey.charCodeAt(0);
  706. console.log(BullHelmetKey);
  707. }
  708. });
  709.  
  710. $("#soldier").on("input", () => {
  711. var cval = $("#soldier").val();
  712. if (cval){
  713. SoldierHelmetKey = cval.toUpperCase();
  714. SoldierHelmetKey = SoldierHelmetKey.charCodeAt(0);
  715. console.log(SoldierHelmetKey);
  716. }
  717. });
  718.  
  719. $("#turret").on("input", () => {
  720. var cval = $("#turret").val();
  721. if (cval){
  722. TurretKey = cval.toUpperCase();
  723. TurretKey = TurretKey.charCodeAt(0);
  724. console.log(TurretKey);
  725. }
  726. });
  727.  
  728.  
  729.  
  730. $("#barb").on("input", () => {
  731. var cval = $("#barb").val();
  732. if (cval){
  733. BarabarianKey = cval.toUpperCase();
  734. BarabarianKey = BarabarianKey.charCodeAt(0);
  735. console.log(BarabarianKey);
  736. }
  737. });
  738.  
  739. $("#booster").on("input", () => {
  740. var cval = $("#booster").val();
  741. if (cval){
  742. BoosterHatKey = cval.toUpperCase();
  743. BoosterHatKey = BoosterHatKey.charCodeAt(0);
  744. console.log(BoosterHatKey);
  745. }
  746. });
  747.  
  748. $("#spikeg").on("input", () => {
  749. var cval = $("#spikeg").val();
  750. if (cval){
  751. SpikeGearKey = cval.toUpperCase();
  752. SpikeGearKey = SpikeGearKey.charCodeAt(0);
  753. console.log(SpikeGearKey);
  754. }
  755. });
  756.  
  757. $("#trap").on("input", () => {
  758. var cval = $("#trap").val();
  759. if (cval){
  760. TrapKey = cval.toUpperCase();
  761. TrapKey = TrapKey.charCodeAt(0);
  762. console.log(TrapKey);
  763. }
  764. });
  765.  
  766. var styleItem = document.createElement("style");
  767. styleItem.type = "text/css";
  768. styleItem.appendChild(document.createTextNode(`
  769. .keyPressLow {
  770. margin-left: 8px;
  771. font-size: 16px;
  772. margin-right: 8px;
  773. height: 25px;
  774. width: 50px;
  775. background-color: #fcfcfc;
  776. border-radius: 3.5px;
  777. border: none;
  778. text-align: center;
  779. color: #4A4A4A;
  780. border: 0.5px solid #f2f2f2;
  781. }
  782.  
  783. .menuPrompt {
  784. font-size: 17px;
  785. font-family: 'Hammersmith One';
  786. color: #4A4A4A;
  787. flex: 0.2;
  788. text-align: center;
  789. margin-top: 10px;
  790. display: inline-block;
  791. }
  792.  
  793. .modal {
  794. display: none;
  795. position: fixed;
  796. z-index: 1;
  797. left: 0;
  798. top: 0;
  799. overflow: auto;
  800. height: 100%;
  801. width: 100%;
  802. }
  803.  
  804. .modal-content {
  805. margin: 10% auto;
  806. width: 40%;
  807. box-shadow: 0 5px 8px 0 rgba(0, 0, 0, 0.2), 0 7px 20px 0 rgba(0, 0, 0, 0.17);
  808. font-size: 14px;
  809. line-height: 1.6;
  810. }
  811.  
  812. .modal-header h2,
  813. .modal-footer h3 {
  814. margin: 0;
  815. }
  816.  
  817. .modal-header {
  818. background: #428bca;
  819. padding: 15px;
  820. color: #fff;
  821. border-top-left-radius: 5px;
  822. border-top-right-radius: 5px;
  823. }
  824.  
  825. .modal-body {
  826. padding: 10px 20px;
  827. background: #fff;
  828. }
  829.  
  830. .modal-footer {
  831. background: #428bca;
  832. padding: 10px;
  833. color: #fff;
  834. text-align: center;
  835. border-bottom-left-radius: 5px;
  836. border-bottom-right-radius: 5px;
  837. }
  838.  
  839. .closeBtn {
  840. color: #ccc;
  841. float: right;
  842. font-size: 30px;
  843. color: #fff;
  844. }
  845.  
  846. .closeBtn:hover,
  847. .closeBtn:focus {
  848. color: #000;
  849. text-decoration: none;
  850. cursor: pointer;
  851. }
  852.  
  853. /* Customize the label (the container) */
  854. .container {
  855. display: block;
  856. position: relative;
  857. padding-left: 35px;
  858. margin-bottom: 12px;
  859. cursor: pointer;
  860. font-size: 16px;
  861. -webkit-user-select: none;
  862. -moz-user-select: none;
  863. -ms-user-select: none;
  864. user-select: none;
  865. }
  866.  
  867. /* Hide the browser's default checkbox */
  868. .container input {
  869. position: absolute;
  870. opacity: 0;
  871. cursor: pointer;
  872. height: 0;
  873. width: 0;
  874. }
  875.  
  876. /* Create a custom checkbox */
  877. .checkmark {
  878. position: absolute;
  879. top: 0;
  880. left: 0;
  881. height: 25px;
  882. width: 25px;
  883. background-color: #eee;
  884. }
  885.  
  886. /* On mouse-over, add a grey background color */
  887. .container:hover input ~ .checkmark {
  888. background-color: #ccc;
  889. }
  890.  
  891. /* When the checkbox is checked, add a blue background */
  892. .container input:checked ~ .checkmark {
  893. background-color: #2196F3;
  894. }
  895.  
  896. /* Create the checkmark/indicator (hidden when not checked) */
  897. .checkmark:after {
  898. content: "";
  899. position: absolute;
  900. display: none;
  901. }
  902.  
  903. /* Show the checkmark when checked */
  904. .container input:checked ~ .checkmark:after {
  905. display: block;
  906. }
  907.  
  908. /* Style the checkmark/indicator */
  909. .container .checkmark:after {
  910. left: 9px;
  911. top: 5px;
  912. width: 5px;
  913. height: 10px;
  914. border: solid white;
  915. border-width: 0 3px 3px 0;
  916. -webkit-transform: rotate(45deg);
  917. -ms-transform: rotate(45deg);
  918. transform: rotate(45deg);
  919. }
  920.  
  921. `))
  922. document.head.appendChild(styleItem);
  923.  
  924.  
  925. $("#adCard").css({display: "none"});
  926.  
  927.  
  928. document.addEventListener('keydown', function(e) {
  929. if (e.keyCode == uneqiup && document.activeElement.id.toLowerCase() !== 'chatbox'){
  930. console.log("done")
  931. storeEquip(0);
  932. } else if (e.keyCode == 27){
  933. if (modal.style.display = "none") {
  934. modal.style.display = "block";
  935. } else {
  936. modal.style.display = "none";
  937. }
  938. } else if (e.keyCode == TankGearKey && document.activeElement.id.toLowerCase() !== 'chatbox'){
  939. storeEquip(ID_TankGear);
  940. } else if (e.keyCode == SoldierHelmetKey && document.activeElement.id.toLowerCase() !== 'chatbox'){
  941. storeEquip(ID_SoldierHelmet);
  942. } else if (e.keyCode == BullHelmetKey && document.activeElement.id.toLowerCase() !== 'chatbox'){
  943. storeEquip(ID_BullHelmet);
  944. } else if (e.keyCode == BoosterHatKey && document.activeElement.id.toLowerCase() !== 'chatbox'){
  945. storeEquip(ID_BoosterHat);
  946. } else if (e.keyCode == BarabarianKey && document.activeElement.id.toLowerCase() !== 'chatbox'){
  947. storeEquip(ID_BarbarianArmor);
  948. } else if (e.keyCode == SpikeGearKey && document.activeElement.id.toLowerCase() !== 'chatbox'){
  949. storeEquip(ID_SpikeGear);
  950. } else if (e.keyCode == TurretKey && document.activeElement.id.toLowerCase() !== 'chatbox'){
  951. storeEquip(ID_TurretGear);
  952. }
  953. })
  954.  
  955. // Get modal element
  956. var modal = document.getElementById("simpleModal");
  957. // Get close button
  958. var closeBtn = document.getElementsByClassName('closeBtn')[0];
  959.  
  960. // Events
  961. closeBtn.addEventListener('click', closeModal);
  962. window.addEventListener('click', outsideClick);
  963.  
  964. // Close
  965. function closeModal() {
  966. modal.style.display = 'none';
  967. }
  968.  
  969. // Close If Outside Click
  970. function outsideClick(e) {
  971. if (e.target == modal) {
  972. modal.style.display = 'none';
  973. }
  974. }
  975.  
  976. var checkbox = document.querySelector("#myCheck")
  977.  
  978. checkbox.addEventListener('change', function() {
  979. if (this.checked) {
  980. $("#mapDisplay").css({background: `url('https://i.imgur.com/fgFsQJp.png')`});
  981. console.log('checked')
  982. } else {
  983. $("#mapDisplay").css({background: `rgba(0, 0, 0, 0.25)`})
  984. console.log('unchecked')
  985. }
  986. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement