Advertisement
Guest User

for u shel

a guest
Aug 25th, 2019
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 110.68 KB | None | 0 0
  1. // ==UserScript==
  2. // @name ★Moomoo.io |BAO MOD ?? BIG UPDATE|MORE IN DESC| DISCORD - XxBao_VnxX#8313
  3. // @namespace -------
  4. // @version 2.0
  5. // @description ............................................................
  6. // @author XxBao_VnxX#8313
  7. // @match *://moomoo.io/*
  8. // @match http://dev.moomoo.io/*
  9. // @match *sandbox.moomoo.io/*
  10. // @grant none
  11. // @require https://greasyfork.org/scripts/368273-msgpack/code/msgpack.js?version=598723
  12. // @require http://code.jquery.com/jquery-3.3.1.min.js
  13. // @require https://code.jquery.com/ui/1.12.0/jquery-ui.min.js
  14. // @require https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.js
  15.  
  16.  
  17.  
  18.  
  19.  
  20. // ==/UserScript==
  21.  
  22. document.getElementById('enterGame').innerHTML = 'Welcome<3';
  23. document.getElementById('loadingText').innerHTML = '. . . . . . . . . . . . . . . . . .Loading. . . . . . . . . . . . . . . . . .';
  24. document.getElementById('nameInput').placeholder = "NameHereGae";
  25. document.getElementById('chatBox').placeholder = "No Chat Here"
  26. document.getElementById('diedText').innerHTML = 'Not Bad..';
  27. document.getElementById('gameName').innerHTML = '★XxBao_VnxX★';
  28. document.getElementById("leaderboard").append('XxBao_VnxX');;
  29. document.getElementById("followText").innerHTML = "XxBao_VnxX"
  30. document.getElementById("followText").style = "bottom: -0px;"
  31. document.getElementById("linksContainer2").innerHTML = "Made By XxBao_VnxX";
  32. document.getElementById("twitterFollow").remove();
  33. document.getElementById('errorNotification').remove();
  34. document.getElementById("pingDisplay").remove();
  35. document.getElementById('promoImgHolder').innerHTML = '</iframe><iframe width="300px"height="126.5px" src="https://www.youtube.com/watch?v=FM7MFYoylVs&feature=player_embedded_uturn" frameborder="0" allowfullscreen></iframe>';
  36. document.getElementById("storeHolder").style = "height: 350px; width: 450px;";
  37. document.getElementById("allianceHolder").style = "height: 350px; width: 450px;";
  38. document.getElementById("scoreDisplay").style.color = "#FFDF00";
  39. document.getElementById("guideCard").style = "height: 9000000px; width: 300px;";
  40.  
  41.  
  42.  
  43.  
  44. (function() {
  45. 'use strict';
  46.  
  47. var ID_TankGear = 40;
  48. var ID_TurretGear = 53;
  49. var ID_BoosterHat = 12;
  50. var ID_FlipperHat = 31;
  51.  
  52.  
  53. document.addEventListener('keydown', function(e) {
  54. if(e.keyCode === 16 && document.activeElement.id.toLowerCase() !== 'chatbox')
  55. {
  56. storeEquip(ID_BoosterHat);
  57. }
  58. else if (e.keyCode === 90 && document.activeElement.id.toLowerCase() !== 'chatbox')
  59. {
  60. storeEquip(ID_TankGear);
  61. }
  62. else if (e.keyCode === 192 && document.activeElement.id.toLowerCase() !== 'chatbox')
  63. {
  64. storeEquip(ID_TurretGear);
  65. }
  66. else if (e.keyCode === 72 && document.activeElement.id.toLowerCase() !== 'chatbox')
  67. {
  68. storeEquip(ID_FlipperHat);
  69. }
  70.  
  71.  
  72. });
  73.  
  74. })();
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84. $("#ageBar").css({
  85. 'border-radius':'50px',
  86. 'border':'3px solid #58FAF4'
  87. });
  88.  
  89. $("#Leaderboard").css({
  90. 'border-radious':'50px',
  91. 'border':'3px solid #58FAF4'
  92. });
  93.  
  94. $("#chatButton").css({
  95. 'border-radious':'50px',
  96. 'border':'3px solid #58FAF4'
  97. });
  98.  
  99. $("#storeButton").css({
  100. 'border-radious':'50px',
  101. 'border':'3px solid #58FAF4'
  102. });
  103.  
  104. $("#allianceButton").css({
  105. 'border-radious':'50px',
  106. 'border':'3px solid #58FAF4'
  107. });
  108.  
  109. $("#actionBarHolder").css({
  110. 'border-radious':'100px',
  111. 'border':'6px solid #58FAF4'
  112. });
  113.  
  114. $("#killCounter").css({
  115. 'border-radious':'50px',
  116. 'border':'3px solid #58FAF4'
  117. });
  118.  
  119. $(".killCounter").css({
  120. 'border-radious':'50px',
  121. 'border':'3px solid #58FAF4'
  122. });
  123.  
  124. $("#foodDisplay").css({
  125. 'border-radious':'50px',
  126. 'border':'3px solid #58FAF4'
  127. });
  128.  
  129. $("#stoneDisplay").css({
  130. 'border-radious':'50px',
  131. 'border':'3px solid #58FAF4'
  132. });
  133.  
  134. $("#woodDisplay").css({
  135. 'border-radious':'50px',
  136. 'border':'3px solid #58FAF4'
  137. });
  138.  
  139. $(".uiElement, .resourceDisplay").css({
  140. 'border-radious':'50px',
  141. 'border':'3px solid #58FAF4'
  142.  
  143. });
  144.  
  145. $(".storeTab").css({
  146. 'border-radious':'50px',
  147. 'border':'3px solid #'
  148. });
  149.  
  150. $("#allianceHolder").css({
  151. 'border-radious':'50px',
  152. 'border':'3px solid #58FAF4'
  153. });
  154.  
  155. $(".allianceInput").css({
  156. 'border-radious':'50px',
  157. 'border':'3px solid #58FAF4'
  158. });
  159.  
  160. $(".allianceButton").css({
  161. 'border-radius': '50px 3 3 3',
  162. 'border':'3px solid #58FAF4'
  163. });
  164.  
  165. $("#storeHolder").css({
  166. 'border-radius': '50px 3 3 3',
  167. 'border':'3px solid #'
  168. });
  169.  
  170. $("#chatBox").css({
  171. 'border-radius': '50px 3 3 3',
  172. 'border':'3px solid #58FAF4'
  173. });
  174.  
  175. $("#topInfoHolder").css({
  176. 'border-radious':'50px',
  177. 'border':'3px solid #58FAF4',
  178. 'border-radius': '3px 3 3 3'
  179. });
  180.  
  181. $("#mapDisplay").css({
  182. 'border-radious':'50px',
  183. 'border':'3px solid #58FAF4'
  184. });
  185.  
  186.  
  187. $('#menuContainer').append('VERSION 14.4 | Maked by XxBao_VnxX | created by XxBao_VnxX#8313| added by GeasyFork.com')
  188.  
  189. document.querySelector("head").innerHTML = document.querySelector("head").innerHTML + '<link rel="stylesheet" href="http://wormax.org/chrome3kafa/moomods.css" type="text/css" media="screen, projection" /><link rel="stylesheet" href="https://iogameslist.org/wp-content/uploads/modal.css" type="text/css">';
  190.  
  191. $("#adCard").html('<div align="left"><div class="menuHeader">How To Use Mod?</div><div id="desktopInstructions" class="menuText"><a class="menuText" title="When you press *P* Key it will change police hats automatically. Please be sure that you have enough gold for Bummble Hat and Winter Cap, else it wont work.">Police Mod <font style="font-size: 18px;" color="red">(?)</font>:</a><a href="https://slithere.com" target="_blank" style="font-size:18px;padding-left:46px;">P key</a><br><a title="When you press *O* it will change free animal hats automatically." class="menuText">Animals Mod <font style="font-size: 18px;" color="red">(?)</font>:</a><a href="https://survivio.info" target="_blank" style="font-size:18px;padding-left:28px;"> . key</a><br><a title="When you press *K* it will change all free hats automatically. (not Caps)" class="menuText">Free Hats Mod <font style="font-size: 18px;" color="red">(?)</font>:</a><a href="https://moomooioplay.com" target="_blank" style="font-size:18px;padding-left:13px;"> , key</a><br><a title="When you press *L* key it will change animal caps automatically." class="menuText">Animal Caps <font style="font-size: 18px;" color="red">(?)</font>:</a><a href="https://mopeiogame.com" target="_blank" style="font-size:18px;padding-left:34px;">L key</a></br><a title="When you press *F* key it will put trap and no one will see that you put it there." class="menuText">Booby Trap <font style="font-size: 18px;" color="red">(?)</font>:</a><a href="https://slitherioplay.org" target="_blank" style="font-size:18px;padding-left:42px;">F key</a></br><a title="When you press *M* key it will on/off background of map." class="menuText">Mini Map <font style="font-size: 18px;" color="red">(?)</font>:</a><a href="https://foesio.org" target="_blank" style="font-size:18px;padding-left:60px;">M key</a><br><a title="When you press *N* key it will show or hide objects which you and your clan put." class="menuText">Object Pointer <font style="font-size: 18px;" color="red">(?)</font>:</a><a href="https://diepioplay.org" target="_blank" style="font-size:18px;padding-left:14px;">N key</a><br>Heal-Bull On/Off: <a href="https://zombsroyaleio.org" target="_blank" style="font-size:18px;padding-left:21px;">T key</a><br><br>Auto Heal: Collect Food<br>Bull Helmet: <a title="If you buy the bull helmet, any time you swing this mod will put the bull helmet on and take it off automatically. If you put on another hat, the mod will automatically remember that hat and put it on after its done with the bull helmet. The mod will also take of the monkey tail (if its on) when you swing. ---> Imagine the combinations! Soldier +bull and plague +bull are good combos to get started with" style="font-size: 18px;color:dodgerblue;">Read Me (?)</a><br></div><hr><button class="trigger">Modify Interval Speed</button><div class="modal"><div class="modal-content"><span class="close-button">&times;</span><div align="left"><a title="Its the speed of auto healing, default is 150 | Doing lower is faster, but moomoo.io game has pinocchio mode for fast healing that canceling healing..">Auto Heal Speed (?): </a><input onchange="handleMessage();" id="autospeed" type="number" value="150" style="width:60px;"></br><a title="Its the speed of animals mod, default is 200">Animals Mod Speed (?): </a><input onchange="anspeedupdate();" id="aspeed" type="number" value="200" style="width:60px;"></br><a title="Its the speed of free hats mod, default is 200">Free Hats Mod Speed (?): </a><input onchange="plspeedupdate();" id="pspeed" type="number" value="200" style="width:60px;"></br><a title="Its the speed of animal caps mod, default is 200">Animal Caps Mod Speed (?): </a><input onchange="clspeedupdate();" id="caspeed" type="number" value="200" style="width:60px;"></br><a title="Its the speed of police mod, default is 250">Police Mod Speed (?): </a><input onchange="frspeedupdate();" id="fspeed" type="number" value="250" style="width:60px;"></div></div></div> - <button class="trigger2">Extra Feature Keys</button><div class="modal2"><div class="modal-content"><span class="close-button2">&times;</span>Numpad0 = <input onchange="nm0(this.value)" type="number" value="0" id="nm00" style="width:60px;"></br>Numpad1 = <input onchange="nm1(this.value)" type="number" value="7" id="nm11" style="width:60px;"></br>Numpad2 = <input onchange="nm2(this.value)" type="number" value="6" id="nm22" style="width:60px;"></br>Numpad3 = <input onchange="nm3(this.value)" type="number" value="20" id="nm33" style="width:60px;"></br>Numpad4 = <input onchange="nm4(this.value)" id="nm44" type="number" value="31" style="width:60px;"></br>Numpad5 = <input onchange="nm5(this.value)" id="nm55" type="number" value="10" style="width:60px;"></br>Numpad6 = <input onchange="nm6(this.value)" id="nm66" type="number" value="11" style="width:60px;"></br>Numpad7 = <input onchange="nm7(this.value)" type="number" id="nm77" value="22" style="width:60px;"></br>Numpad8 = <input onchange="nm8(this.value)" id="nm88" type="number" value="12" style="width:60px;"></br>Numpad9 = <input onchange="nm9(this.value)" type="number" id="nm99" value="9" style="width:60px;"></br><div id="storeHolder" style="width:500px;" > <div style="font-size:20px;" class="storeItem" id="storeDisplay0"> <img class="hatPreview" src="https://i.hizliresim.com/5y9PBD.png"><span>Default : 0</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay1"> <img class="hatPreview" src="../img/hats/hat_51.png"><span>Moo Cap : 51</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay2"> <img class="hatPreview" src="../img/hats/hat_50.png"><span>Apple Cap : 50</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay3"> <img class="hatPreview" src="../img/hats/hat_28.png"><span>Moo Head : 28</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay4"> <img class="hatPreview" src="../img/hats/hat_29.png"><span>Pig Head : 29</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay5"> <img class="hatPreview" src="../img/hats/hat_30.png"><span>Fluff Head : 30</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay6"> <img class="hatPreview" src="../img/hats/hat_36.png"><span>Pandou Head : 36</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay7"> <img class="hatPreview" src="../img/hats/hat_37.png"><span>Bear Head : 37</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay8"> <img class="hatPreview" src="../img/hats/hat_38.png"><span>Monkey Head : 38</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay9"> <img class="hatPreview" src="../img/hats/hat_44.png"><span>Polar Head : 44</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay10"> <img class="hatPreview" src="../img/hats/hat_35.png"><span>Fez Hat : 35</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay11"> <img class="hatPreview" src="../img/hats/hat_42.png"><span>Enigma Hat : 42</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay12"> <img class="hatPreview" src="../img/hats/hat_43.png"><span>Blitz Hat : 43</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay13"> <img class="hatPreview" src="../img/hats/hat_49.png"><span>Bob XIII Hat : 49</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay14"> <img class="hatPreview" src="../img/hats/hat_8.png"><span>Bummle Hat : 8</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay15"> <img class="hatPreview" src="../img/hats/hat_2.png"><span>Straw Hat : 2</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay16"> <img class="hatPreview" src="../img/hats/hat_15.png"><span>Winter Cap : 15</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay17"> <img class="hatPreview" src="../img/hats/hat_5.png"><span>Cowboy Hat : 5</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay18"> <img class="hatPreview" src="../img/hats/hat_4.png"><span>Ranger Hat : 4</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay19"> <img class="hatPreview" src="../img/hats/hat_18.png"><span>Explorer Hat : 18</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay20"> <img class="hatPreview" src="../img/hats/hat_31.png"><span>Flipper Hat : 31</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay21"> <img class="hatPreview" src="../img/hats/hat_1.png"><span>Marksman Cap : 1</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay22"> <img class="hatPreview" src="../img/hats/hat_10.png"><span>Bush Gear : 10</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay23"> <img class="hatPreview" src="../img/hats/hat_48.png"><span>Halo : 48</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay24"> <img class="hatPreview" src="../img/hats/hat_6.png"><span>Soldier Helmet : 6</span> </div><div style="font-size:18px;" class="storeItem" id="storeDisplay25"> <img class="hatPreview" src="../img/hats/hat_23.png"><span>Anti Venom Gear : 23</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay26"> <img class="hatPreview" src="../img/hats/hat_13.png"><span>Medic Gear : 13</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay27"> <img class="hatPreview" src="../img/hats/hat_9.png"><span>Miners Helmet : 9</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay28"> <img class="hatPreview" src="../img/hats/hat_32.png"><span>Musketeer Hat : 32</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay29"> <img class="hatPreview" src="../img/hats/hat_7.png"><span>Bull Helmet : 7</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay30"> <img class="hatPreview" src="../img/hats/hat_22.png"><span>Emp Helmet : 22</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay31"> <img class="hatPreview" src="../img/hats/hat_12.png"><span>Booster Hat : 12</span> </div><div style="font-size:19px;" class="storeItem" id="storeDisplay32"> <img class="hatPreview" src="../img/hats/hat_26.png"><span>Barbarian Armor : 26</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay33"> <img class="hatPreview" src="../img/hats/hat_21.png"><span>Plague Mask : 21</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay34"> <img class="hatPreview" src="../img/hats/hat_46.png"><span>Bull Mask : 46</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay35"> <img class="hatPreview" src="../img/hats/hat_14_p.png"><span>Windmill Hat : 14</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay36"> <img class="hatPreview" src="../img/hats/hat_11_p.png"><span>Spike Gear : 11</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay37"> <img class="hatPreview" src="../img/hats/hat_53_p.png"><span>Turret Gear : 53</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay38"> <img class="hatPreview" src="../img/hats/hat_20.png"><span>Samurai Armor : 20</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay39"> <img class="hatPreview" src="../img/hats/hat_16.png"><span>Bushido Armor : 16</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay40"> <img class="hatPreview" src="../img/hats/hat_27.png"><span>Scavenger Gear : 27</span> </div><div style="font-size:20px;" class="storeItem" id="storeDisplay41"> <img class="hatPreview" src="../img/hats/hat_40.png"><span>Tank Gear : 40</span> </div></div></div></div><hr><div id="durum">Heal <font color="green">ON</font> / Bull Hat OFF</div><div id="durump">Police Mod: OFF</div><div id="duruma">Animals Mod: OFF</div><div id="durumc">Animal Caps: OFF</div><div id="durumf">Free Hats Mod: OFF</div><div id="durumm">Mini Map: <font color="green">ON</font></div><div id="durumo">Object Pointer: <font color="green">ON</font></div></div><hr><div align="left"> <center> <div align="left"><center><b><a class="menuText" href="https://www.youtube.com/channel/UCWfCKx7yb-3bnc780f2Vluw/featured?view_as=subscriber" target="_blank">XxBao_VnxX FEATURES V2</a></b></center><table style="border-collapse: collapse;" border="1"><tbody><tr><td style="width: 100px;"><b>Features</b></td><td style="width: 250px;"><b>How to use</b></td></tr><tr><td>NO ADS</td><td>Automatically Removed</td></tr><tr><td>RAINBOW HAT!!!</td><td> Press [CRTL]</td></tr><tr><td>AUTO ATTACK</td><td>Wait someone to attack you</td></tr><tr><td>BOT MENU</td><td>[P] turn in on</td></tr><tr><td>MAP DETAIL</td><td>press [M] or [MENU] key. </br>You need click [M] first</td></tr><tr><td>AUTO FOOD</td><td>AUTOMATIC TAKES FOOD</td></tr><tr><td>MINIMAP</td><td>click [M] or [MENU] key</td></tr><tr><td>PLAY MUSIC</td><td>Click on image of msc</td></tr><tr><td>AUTO HEAL<a style="font-size:11px; color:green;"></a></td><td>AUTOMATIC TAKES FOOD</td></tr><tr><td>Enemy Radar<a style="font-size:9.5px; color:red;"></a></td><td>click [M] or [MENU] key.</td></tr></tbody></table><hr><b>Subscribe To Me :V Unnamed</b><br><a href="?" target="_blank">HERE</a>');
  192.  
  193. $("#ageBarContainer").append('</br><div id="hacktext"></div><div style="width: 100%;position: absolute;bottom: 94px;text-align: center;color:blue;font-size: 24px;" id="freetext"></div><div style="width: 100%;position: absolute;bottom: 144px;text-align: center;color: #ed3f00;font-size: 24px;" id="ptext"></div><div style="width: 100%;position: absolute;bottom: 224px;text-align: center;color: #9a008b;font-size: 24px;" id="ctext"></div><div style="width: 100%;position: absolute;top: 100px;text-align: center;color: white;font-size: 12px;" id="bilgitext">M - Mini Map | N - Object Pointer | P - Police Mod | . - Animals Mod | , - Free Hats Mod | L - Animal Caps | F - Booby Trap | J - Close Menu</div><div style="width: 100%;position: absolute;bottom: 170px;text-align: center;color: darkgreen;font-size: 24px;" id="atext"></div><div style="width: 100%;position: absolute;bottom: 196px;text-align: center;color: black;font-size: 24px;" id="mtext"></div>');
  194.  
  195. $("#mainMenu").css("background", "url('https://cdncontribute.geeksforgeeks.org/wp-content/uploads/hacker.png')");
  196.  
  197. $('.menuCard').css({'white-space': 'normal',
  198. 'text-align': 'center',
  199. 'background-color': 'rgba(0, 0, 0, 0.74)',
  200. '-moz-box-shadow': '0px 0px rgba(255, 255, 255, 0)',
  201. '-webkit-box-shadow': '0px 0px rgba(255, 255, 255, 0)',
  202. 'box-shadow': '0px 0px rgba(255, 255, 255, 0)',
  203. '-webkit-border-radius': '0px',
  204. '-moz-border-radius': '0px',
  205. 'border-radius': '0px',
  206. 'margin': '15px',
  207. 'margin-top': '15px'});
  208.  
  209. $('.menuCard').css({'color':'#808080'});
  210.  
  211. $('#promoImgHolder').css({'color':'#FFFAFA'});
  212.  
  213. $('#menuContainer').css({'white-space': 'normal'});
  214.  
  215. $('#guideCard').prepend(': Join the discord for BETTER hacks & more hacks! </a> <br> ');
  216.  
  217. $('#guideCard').css({'color': '#FFFFF'});
  218.  
  219. $('.killCounter').css({'color': '#00FFFF'});
  220.  
  221. $('#nativeResolution').css({'cursor': 'pointer'});
  222.  
  223. $('#playMusic').css({'cursor': 'pointer'});
  224.  
  225. $('#serverSelect').css({'margin-bottom': '30.75px'});
  226.  
  227. $('#skinColorHolder').css({'margin-bottom': '30.75px'});
  228.  
  229. $('.settingRadio').css({'margin-bottom': '30.75px'});
  230.  
  231. $('#gameName').css({'color': '#00FFFF',
  232. 'text-shadow': '0 1px 0 rgba(255, 255, 255, 0), 0 2px 0 rgba(255, 255, 255, 0), 0 3px 0 rgba(255, 255, 255, 0), 0 4px 0 rgba(255, 255, 255, 0), 0 5px 0 rgba(255, 255, 255, 0), 0 6px 0 rgba(255, 255, 255, 0), 0 7px 0 rgba(255, 255, 255, 0), 0 8px 0 rgba(255, 255, 255, 0), 0 9px 0 rgba(255, 255, 255, 0)',
  233. 'text-align': 'center',
  234. 'font-size': '126px',
  235. 'margin-bottom': '-30px'});
  236.  
  237. $('#loadingText').css({'color': '#00FFFF',
  238. 'background-color': 'rgba(0, 0, 0, 0.16)',
  239. 'padding': '8px',
  240. 'right': '150%',
  241. 'left': '150%',
  242. 'margin-top': '50px'});
  243.  
  244. $('.ytLink').css({'color': '#00FFFF',
  245. 'padding': '8px',
  246. 'background-color': 'rgba(0, 0, 0, 0.74)'});
  247.  
  248. $('.menuLink').css({'color': '#00FFFF'});
  249.  
  250. $('.menuButton').css({'background-color': '#00FFFF'});
  251.  
  252.  
  253. $('#nameInput').css({'border-radius': '0px',
  254. '-moz-border-radius': '0px',
  255. '-webkit-border-radius': '0px',
  256. 'border': 'hidden'});
  257.  
  258.  
  259. $('#serverSelect').css({'cursor': 'pointer',
  260. 'color': '#00FFFF',
  261. 'background-color': '#808080',
  262. 'border': 'hidden',
  263. 'font-size': '20px'});
  264.  
  265. $('.menuButton').css({'border-radius': '0px',
  266. '-moz-border-radius': '0px',})
  267.  
  268.  
  269. $('#adCard').css({
  270. 'max-height': '430px',
  271. 'width': '320px',
  272. 'overflow-y': 'scroll',
  273. '-webkit-overflow-scrolling': 'touch'
  274. });
  275.  
  276. //Interval Modal
  277. var modal = document.querySelector(".modal");
  278. var trigger = document.querySelector(".trigger");
  279. var closeButton = document.querySelector(".close-button");
  280. function toggleModal() {
  281. modal.classList.toggle("show-modal");
  282. }
  283. function windowOnClick(event) {
  284. if (event.target === modal) {
  285. toggleModal();
  286. }
  287. }
  288. trigger.addEventListener("click", toggleModal);
  289. closeButton.addEventListener("click", toggleModal);
  290. window.addEventListener("click", windowOnClick);
  291.  
  292. //Extra Features Modal
  293. var modal2 = document.querySelector(".modal2");
  294. var trigger2 = document.querySelector(".trigger2");
  295. var closeButton2 = document.querySelector(".close-button2");
  296.  
  297. function toggleModal2() {
  298. modal2.classList.toggle("show-modal");
  299. }
  300. function windowOnClick2(event) {
  301. if (event.target === modal2) {
  302. toggleModal2();
  303. }
  304. }
  305. trigger2.addEventListener("click", toggleModal2);
  306. closeButton2.addEventListener("click", toggleModal2);
  307. window.addEventListener("click", windowOnClick2);
  308.  
  309. (function() {
  310. var autoheal = true;
  311. var autobull = false;
  312. var STATE = 0;
  313. var police1, police2, c1head, c2head, animalhead1, animalhead2, animalhead3, animalhead4, animalhead5, animalhead6, animalhead7, mohead, mohead2, mohead3, mohead4, mohead5, mohead6, mohead7, mohead8, mohead9, mohead10, mohead11;
  314. var revertmoder, revertfree, revertpolice, revertcaps, revertanimal, revertmap;
  315. var itemshower = true;
  316. var zaman = true;
  317. var zaman2 = true;
  318. var zaman3 = true;
  319. var zaman4 = false;
  320. var zaman5 = false;
  321. var zaman6 = true;
  322. var policehead1 = 8;
  323. var policehead2 = 15;
  324. var caps1 = 51;
  325. var caps2 = 50;
  326. var ID_FAZE = 45;
  327. var ID_Moo_Head = 28;
  328. var ID_Pig_Head = 29;
  329. var ID_Fluff_Head = 30;
  330. var ID_Pandou_Head = 36;
  331. var ID_Bear_Head = 37;
  332. var ID_Monkey_Head = 38;
  333. var ID_Polar_Head = 44;
  334. var ID_Fez_Hat = 35;
  335. var ID_Enigma_Hat = 42;
  336. var ID_Blitz_Hat = 43;
  337. var ID_Bob_XIII_Hat = 49;
  338.  
  339. var nmh0 = 0,nmh1 = 7,nmh2 = 6,nmh3 = 20,nmh4 = 31,nmh5 = 10,nmh6 = 11,mnh7 = 22,nmh8 = 12,nmh9 = 9;
  340. function nm0(ish) {
  341. nmh0 = document.getElementById("nm00").value;
  342. }
  343. function nm1(ish) {
  344. nmh1 = document.getElementById("nm11").value;
  345. }
  346. function nm2(ish) {
  347. nmh2 = document.getElementById("nm22").value;
  348. }
  349. function nm3(ish) {
  350. nmh3 = document.getElementById("nm33").value;
  351. }
  352. function nm4(ish) {
  353. nmh4 = document.getElementById("nm44").value;
  354. }
  355. function nm5(ish) {
  356. nmh5 = document.getElementById("nm55").value;
  357. }
  358. function nm6(ish) {
  359. nmh6 = document.getElementById("nm66").value;
  360. }
  361. function nm7(ish) {
  362. nmh7 = document.getElementById("nm77").value;
  363. }
  364. function nm8(ish) {
  365. nmh8 = document.getElementById("nm88").value;
  366. }
  367. function nm9(ish) {
  368. nmh9 = document.getElementById("nm99").value;
  369. }
  370.  
  371. document.addEventListener('keydown', function(e) {
  372. switch (e.keyCode - 96) {
  373. case 0: nmh0 = document.getElementById("nm00").value;storeBuy(nmh0),storeEquip(nmh0); break; // UnEquip
  374. case 1: nmh1 = document.getElementById("nm11").value;storeBuy(nmh1),storeEquip(nmh1); break;
  375. case 2: nmh2 = document.getElementById("nm22").value;storeBuy(nmh2),storeEquip(nmh2); break;
  376. case 3: nmh3 = document.getElementById("nm33").value;storeBuy(nmh3),storeEquip(nmh3); break;
  377. case 4: nmh4 = document.getElementById("nm44").value;storeBuy(nmh4),storeEquip(nmh4); break;
  378. case 5: nmh5 = document.getElementById("nm55").value;storeBuy(nmh5),storeEquip(nmh5); break;
  379. case 6: nmh6 = document.getElementById("nm66").value;storeBuy(nmh6),storeEquip(nmh6); break;
  380. case 7: nmh7 = document.getElementById("nm77").value;storeBuy(nmh7),storeEquip(nmh7); break;
  381. case 8: nmh8 = document.getElementById("nm88").value;storeBuy(nmh8),storeEquip(nmh8); break;
  382. case 9: nmh9 = document.getElementById("nm99").value;storeBuy(nmh9),storeEquip(nmh9); break;
  383. }
  384. });
  385.  
  386. document.addEventListener('keypress', (e)=>{
  387. if (e.keyCode == 98 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  388. if (zaman) {
  389. clearTimeout(revertfree);
  390. document.getElementById("freetext").innerHTML = 'Free Hats Mod: ON';
  391. document.getElementById("durumf").innerHTML = 'Free Hats Mod: <font color=\"green\">ON</font>';
  392. revertfree = setTimeout(function(){ freetexter(); }, 1000);
  393. storeEquip(ID_Moo_Head);
  394. mohead = setTimeout(function(){ h1(); }, 180);
  395. } else {
  396. clearTimeout(revertfree);
  397. document.getElementById("freetext").innerHTML = 'Free Hats Mod: OFF';
  398. document.getElementById("durumf").innerHTML = 'Free Hats Mod: OFF';
  399. revertfree = setTimeout(function(){ freetexter(); }, 1000);
  400. clearTimeout(mohead);
  401. clearTimeout(mohead2);
  402. clearTimeout(mohead3);
  403. clearTimeout(mohead4);
  404. clearTimeout(mohead5);
  405. clearTimeout(mohead6);
  406. clearTimeout(mohead7);
  407. clearTimeout(mohead8);
  408. clearTimeout(mohead9);
  409. clearTimeout(mohead10);
  410. clearTimeout(mohead11);
  411. storeEquip(ID_FAZE);
  412. }
  413. zaman = !zaman;
  414. }
  415. if (e.keyCode == 110 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  416. if (zaman3) {
  417.  
  418. clearTimeout(revertanimal);
  419. document.getElementById("atext").innerHTML = 'Animals Mod: ON';
  420. document.getElementById("duruma").innerHTML = 'Animals Mod: <font color=\"green\">ON</font>';
  421. revertanimal = setTimeout(function(){ animaltexter(); }, 1000);
  422.  
  423. storeEquip(ID_Moo_Head);
  424. animalhead = setTimeout(function(){ animals1(); }, 230);
  425. } else {
  426. clearTimeout(revertanimal);
  427. document.getElementById("atext").innerHTML = 'Animals Mod: OFF';
  428. document.getElementById("duruma").innerHTML = 'Animals Mod: OFF';
  429. revertanimal = setTimeout(function(){ animaltexter(); }, 1000);
  430.  
  431. clearTimeout(animalhead1);
  432. clearTimeout(animalhead2);
  433. clearTimeout(animalhead3);
  434. clearTimeout(animalhead4);
  435. clearTimeout(animalhead5);
  436. clearTimeout(animalhead6);
  437. clearTimeout(animalhead7);
  438. storeEquip(ID_FAZE);
  439. }
  440. zaman3 = !zaman3;
  441. }
  442. if (e.keyCode == 106 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  443. if (zaman5) {
  444. document.getElementById("bilgitext").innerHTML = 'X - TankGear | ` TurretGear | Shift - Boost hat | and more |';
  445. } else {
  446. document.getElementById("bilgitext").innerHTML = null;
  447. }
  448. zaman5 = !zaman5;
  449. }
  450. if (e.keyCode == 112 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  451.  
  452. if (zaman2) {
  453. clearTimeout(revertpolice);
  454. document.getElementById("ptext").innerHTML = 'Police Mod: ON';
  455. document.getElementById("durump").innerHTML = 'Police Mod: <font color=\"green\">ON</font>';
  456. revertpolice = setTimeout(function(){ policetexter(); }, 1000);
  457. storeBuy(policehead1);
  458. storeBuy(policehead2);
  459. storeEquip(policehead1);
  460. police2 = setTimeout(function(){ p1(); }, 200);
  461. } else {
  462. clearTimeout(revertpolice);
  463. document.getElementById("ptext").innerHTML = 'Police Mod: OFF';
  464. document.getElementById("durump").innerHTML = 'Police Mod: OFF';
  465. revertpolice = setTimeout(function(){ policetexter(); }, 1000);
  466.  
  467.  
  468. clearTimeout(police1);
  469. clearTimeout(police2);
  470. storeEquip(ID_FAZE);
  471. }
  472. zaman2 = !zaman2;
  473. }
  474. if (e.keyCode == 109 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  475.  
  476. if (zaman6) {
  477. clearTimeout(revertcaps);
  478. document.getElementById("ctext").innerHTML = 'Animal Caps: ON';
  479. document.getElementById("durumc").innerHTML = 'Animal Caps: <font color=\"green\">ON</font>';
  480. revertcaps = setTimeout(function(){ capstexter(); }, 1000);
  481. storeEquip(caps1);
  482. c2head = setTimeout(function(){ c1(); }, 200);
  483. } else {
  484. clearTimeout(revertcaps);
  485. document.getElementById("ctext").innerHTML = 'Animal Caps: OFF';
  486. document.getElementById("durumc").innerHTML = 'Animal Caps: OFF';
  487. revertcaps = setTimeout(function(){ capstexter(); }, 1000);
  488. clearTimeout(c1head);
  489. clearTimeout(c2head);
  490. storeEquip(ID_FAZE);
  491. }
  492. zaman6 = !zaman6;
  493. }
  494. if (e.keyCode == 66 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  495. clearTimeout(revertmap);
  496. revertmap = setTimeout(function(){ maptexter(); }, 1000);
  497. if (zaman4) {
  498. document.getElementById("mtext").innerHTML = 'Mini Map: ON';
  499. document.getElementById("durumm").innerHTML = 'Mini Map: <font color=\"green\">ON</font>';
  500. $('#mapDisplay').css({
  501. 'background': 'url("https://iogameslist.org/wp-content/uploads/moomooio-background.png")'
  502. });
  503. } else {
  504. document.getElementById("mtext").innerHTML = 'Mini Map: OFF';
  505. document.getElementById("durumm").innerHTML = 'Mini Map: OFF';
  506. $('#mapDisplay').css({
  507. 'background': 'rgba(0, 0, 0, 0.25)'
  508. });
  509. }
  510. }
  511. });
  512.  
  513. function reverttext(){
  514. document.getElementById("hacktext").innerHTML = '<div id="ageText"></div>';
  515. clearTimeout(revertmoder);
  516. }
  517.  
  518. function capstexter(){
  519. document.getElementById("ctext").innerHTML = '<div id="ageText"></div>';
  520. clearTimeout(revertcaps);
  521. }
  522.  
  523. function freetexter(){
  524. document.getElementById("freetext").innerHTML = '<div id="ageText"></div>';
  525. clearTimeout(revertfree);
  526. }
  527.  
  528. function policetexter(){
  529. document.getElementById("ptext").innerHTML = '<div id="ageText"></div>';
  530. clearTimeout(revertpolice);
  531. }
  532.  
  533. function animaltexter(){
  534. document.getElementById("atext").innerHTML = '<div id="ageText"></div>';
  535. clearTimeout(revertanimal);
  536. }
  537.  
  538. function maptexter(){
  539. document.getElementById("mtext").innerHTML = '<div id="ageText"></div>';
  540. clearTimeout(revertmap);
  541. }
  542.  
  543.  
  544. })();
  545.  
  546.  
  547.  
  548.  
  549.  
  550. $("#gameCanvas").css('cursor', 'url(https://e112ddb-a.akamaihd.net/assets/tokyoghoul/website/share/lADPBbCc1TGL327NAnTNBLA_1200_628.jpg), default');
  551. $("#consentBlock").css({display: "none"});
  552. var autoHealSpeed = 0;
  553. var DEFAULT_HAT = 7;
  554. var DEFAULT_WINGS = 18;
  555. var instaKillKey = 114;
  556. var spikeKey = 118;
  557. var trapKey = 102;
  558. var removeMonkeyTail = true;
  559. var askMeAgain = true;
  560.  
  561. var allTraps = [];
  562. var CORESTATE = {
  563. inwater: {active: false},
  564. nearenemy: {active: false},
  565. intrap: {active: false},
  566. ipress: {active: false},
  567. };
  568.  
  569. try {
  570. document.getElementById("moomooio_728x90_home").style.display = "none"; //Remove sidney's ads
  571. $("#moomooio_728x90_home").parent().css({display: "none"});
  572. } catch (e) {
  573. console.log("error removing ad");
  574. }
  575.  
  576. window.onbeforeunload = null;
  577.  
  578.  
  579. let coreURL = new URL(window.location.href);
  580. window.sessionStorage.force = coreURL.searchParams.get("fc");
  581.  
  582.  
  583. if (window.sessionStorage.force != "false" && window.sessionStorage.force && window.sessionStorage.force.toString() != "null"){
  584. console.error(window.sessionStorage.force);
  585. /*alert(window.location.force);*/
  586. document.getElementsByClassName("menuHeader")[0].innerHTML = `Servers <span style="color: red;">Force (${window.sessionStorage.force})</span>`;
  587. }
  588.  
  589.  
  590. var oldAlert = alert;
  591. alert = function(){
  592. $.alert({title: "Full Server!",
  593. content: "This server is full! Would you like to force connect?",
  594. useBootstrap: false,
  595. buttons: {
  596. Back: () => { window.onbeforeunload = null; window.location = "http://moomoo.io"; },
  597. Yes: () => {
  598. let coreURL = new URL(window.location.href);
  599. let server = coreURL.searchParams.get("server");
  600. window.sessionStorage.force = server;
  601. window.sessionStorage.dog = server;
  602. console.error(window.sessionStorage.force);
  603. console.error(window.sessionStorage.dog);
  604. console.error(server);
  605. setTimeout(() => {
  606. console.error(window.sessionStorage.force);
  607. window.location = `http://moomoo.io?fc=${server}`;
  608. }, 500);
  609. },
  610. }
  611. });
  612. }
  613.  
  614.  
  615. class ForceSocket extends WebSocket {
  616. constructor(...args){
  617. if (window.sessionStorage.force != "false" && window.sessionStorage.force && window.sessionStorage.force.toString() != "null"){
  618. let server = window.sessionStorage.force;
  619. let sip = "";
  620. for (let gameServer of window.vultr.servers){
  621. if (`${gameServer.region}:${gameServer.index}:0` == server){
  622. sip = gameServer.ip;
  623. }
  624. }
  625. args[0] = `wss://ip_${sip}.moomoo.io:8008/?gameIndex=0`;
  626.  
  627. console.error("Setting false");
  628. console.error(args[0]);
  629. delete window.sessionStorage.force;
  630. }
  631.  
  632. super(...args);
  633.  
  634. }
  635.  
  636.  
  637. }
  638.  
  639. WebSocket = ForceSocket;
  640.  
  641.  
  642. window.admob = {
  643. requestInterstitialAd: ()=>{},
  644. showInterstitialAd: ()=>{}
  645. }
  646.  
  647.  
  648. var accessories = [{
  649. id: 12,
  650. name: "Snowball",
  651. price: 1e3,
  652. scale: 105,
  653. xOff: 18,
  654. desc: "no effect"
  655. }, {
  656. id: 9,
  657. name: "Tree Cape",
  658. price: 1e3,
  659. scale: 90,
  660. desc: "no effect"
  661. }, {
  662. id: 10,
  663. name: "Stone Cape",
  664. price: 1e3,
  665. scale: 90,
  666. desc: "no effect"
  667. }, {
  668. id: 3,
  669. name: "Cookie Cape",
  670. price: 1500,
  671. scale: 90,
  672. desc: "no effect"
  673. }, {
  674. id: 8,
  675. name: "Cow Cape",
  676. price: 2e3,
  677. scale: 90,
  678. desc: "no effect"
  679. }, {
  680. id: 11,
  681. name: "Monkey Tail",
  682. price: 2e3,
  683. scale: 97,
  684. xOff: 25,
  685. desc: "Super speed but reduced damage",
  686. spdMult: 1.35,
  687. dmgMultO: .2
  688. }, {
  689. id: 17,
  690. name: "Apple Basket",
  691. price: 3e3,
  692. scale: 80,
  693. xOff: 12,
  694. desc: "slowly regenerates health over time",
  695. healthRegen: 1
  696. }, {
  697. id: 6,
  698. name: "Winter Cape",
  699. price: 3e3,
  700. scale: 90,
  701. desc: "no effect"
  702. }, {
  703. id: 4,
  704. name: "Skull Cape",
  705. price: 4e3,
  706. scale: 90,
  707. desc: "no effect"
  708. }, {
  709. id: 5,
  710. name: "Dash Cape",
  711. price: 5e3,
  712. scale: 90,
  713. desc: "no effect"
  714. }, {
  715. id: 2,
  716. name: "Dragon Cape",
  717. price: 6e3,
  718. scale: 90,
  719. desc: "no effect"
  720. }, {
  721. id: 1,
  722. name: "Super Cape",
  723. price: 8e3,
  724. scale: 90,
  725. desc: "no effect"
  726. }, {
  727. id: 7,
  728. name: "Troll Cape",
  729. price: 8e3,
  730. scale: 90,
  731. desc: "no effect"
  732. }, {
  733. id: 14,
  734. name: "Thorns",
  735. price: 1e4,
  736. scale: 115,
  737. xOff: 20,
  738. desc: "no effect"
  739. }, {
  740. id: 15,
  741. name: "Blockades",
  742. price: 1e4,
  743. scale: 95,
  744. xOff: 15,
  745. desc: "no effect"
  746. }, {
  747. id: 20,
  748. name: "Devils Tail",
  749. price: 1e4,
  750. scale: 95,
  751. xOff: 20,
  752. desc: "no effect"
  753. }, {
  754. id: 16,
  755. name: "Sawblade",
  756. price: 12e3,
  757. scale: 90,
  758. spin: !0,
  759. xOff: 0,
  760. desc: "deal damage to players that damage you",
  761. dmg: .15
  762. }, {
  763. id: 13,
  764. name: "Angel Wings",
  765. price: 15e3,
  766. scale: 138,
  767. xOff: 22,
  768. desc: "slowly regenerates health over time",
  769. healthRegen: 3
  770. }, {
  771. id: 19,
  772. name: "Shadow Wings",
  773. price: 15e3,
  774. scale: 138,
  775. xOff: 22,
  776. desc: "increased movement speed",
  777. spdMult: 1.1
  778. }, {
  779. id: 18,
  780. name: "Blood Wings",
  781. price: 2e4,
  782. scale: 178,
  783. xOff: 26,
  784. desc: "restores health when you deal damage",
  785. healD: .2
  786. }, {
  787. id: 21,
  788. name: "Corrupt X Wings",
  789. price: 2e4,
  790. scale: 178,
  791. xOff: 26,
  792. desc: "deal damage to players that damage you",
  793. dmg: .25
  794. }]
  795.  
  796.  
  797. var hats = hats = [{
  798. id: 45,
  799. name: "Shame!",
  800. dontSell: !0,
  801. price: 0,
  802. scale: 120,
  803. desc: "hacks are for losers"
  804. }, {
  805. id: 51,
  806. name: "Moo Cap",
  807. price: 0,
  808. scale: 120,
  809. desc: "coolest mooer around"
  810. }, {
  811. id: 50,
  812. name: "Apple Cap",
  813. price: 0,
  814. scale: 120,
  815. desc: "apple farms remembers"
  816. }, {
  817. id: 28,
  818. name: "Moo Head",
  819. price: 0,
  820. scale: 120,
  821. desc: "no effect"
  822. }, {
  823. id: 29,
  824. name: "Pig Head",
  825. price: 0,
  826. scale: 120,
  827. desc: "no effect"
  828. }, {
  829. id: 30,
  830. name: "Fluff Head",
  831. price: 0,
  832. scale: 120,
  833. desc: "no effect"
  834. }, {
  835. id: 36,
  836. name: "Pandou Head",
  837. price: 0,
  838. scale: 120,
  839. desc: "no effect"
  840. }, {
  841. id: 37,
  842. name: "Bear Head",
  843. price: 0,
  844. scale: 120,
  845. desc: "no effect"
  846. }, {
  847. id: 38,
  848. name: "Monkey Head",
  849. price: 0,
  850. scale: 120,
  851. desc: "no effect"
  852. }, {
  853. id: 44,
  854. name: "Polar Head",
  855. price: 0,
  856. scale: 120,
  857. desc: "no effect"
  858. }, {
  859. id: 35,
  860. name: "Fez Hat",
  861. price: 0,
  862. scale: 120,
  863. desc: "no effect"
  864. }, {
  865. id: 42,
  866. name: "Enigma Hat",
  867. price: 0,
  868. scale: 120,
  869. desc: "join the enigma army"
  870. }, {
  871. id: 43,
  872. name: "Blitz Hat",
  873. price: 0,
  874. scale: 120,
  875. desc: "hey everybody i'm blitz"
  876. }, {
  877. id: 49,
  878. name: "Bob XIII Hat",
  879. price: 0,
  880. scale: 120,
  881. desc: "like and subscribe"
  882. }, {
  883. id: 8,
  884. name: "Bummle Hat",
  885. price: 100,
  886. scale: 120,
  887. desc: "no effect"
  888. }, {
  889. id: 2,
  890. name: "Straw Hat",
  891. price: 500,
  892. scale: 120,
  893. desc: "no effect"
  894. }, {
  895. id: 15,
  896. name: "Winter Cap",
  897. price: 600,
  898. scale: 120,
  899. desc: "allows you to move at normal speed in snow",
  900. coldM: 1
  901. }, {
  902. id: 5,
  903. name: "Cowboy Hat",
  904. price: 1e3,
  905. scale: 120,
  906. desc: "no effect"
  907. }, {
  908. id: 4,
  909. name: "Ranger Hat",
  910. price: 2e3,
  911. scale: 120,
  912. desc: "no effect"
  913. }, {
  914. id: 18,
  915. name: "Explorer Hat",
  916. price: 2e3,
  917. scale: 120,
  918. desc: "no effect"
  919. }, {
  920. id: 31,
  921. name: "Flipper Hat",
  922. price: 2500,
  923. scale: 120,
  924. desc: "have more control while in water",
  925. watrImm: !0
  926. }, {
  927. id: 1,
  928. name: "Marksman Cap",
  929. price: 3e3,
  930. scale: 120,
  931. desc: "increases arrow speed and range",
  932. aMlt: 1.3
  933. }, {
  934. id: 10,
  935. name: "Bush Gear",
  936. price: 3e3,
  937. scale: 160,
  938. desc: "allows you to disguise yourself as a bush"
  939. }, {
  940. id: 48,
  941. name: "Halo",
  942. price: 3e3,
  943. scale: 120,
  944. desc: "no effect"
  945. }, {
  946. id: 6,
  947. name: "Soldier Helmet",
  948. price: 4e3,
  949. scale: 120,
  950. desc: "reduces damage taken but slows movement",
  951. spdMult: .94,
  952. dmgMult: .75
  953. }, {
  954. id: 23,
  955. name: "Anti Venom Gear",
  956. price: 4e3,
  957. scale: 120,
  958. desc: "makes you immune to poison",
  959. poisonRes: 1
  960. }, {
  961. id: 13,
  962. name: "Medic Gear",
  963. price: 5e3,
  964. scale: 110,
  965. desc: "slowly regenerates health over time",
  966. healthRegen: 3
  967. }, {
  968. id: 9,
  969. name: "Miners Helmet",
  970. price: 5e3,
  971. scale: 120,
  972. desc: "earn 1 extra gold per resource",
  973. extraGold: 1
  974. }, {
  975. id: 32,
  976. name: "Musketeer Hat",
  977. price: 5e3,
  978. scale: 120,
  979. desc: "reduces cost of projectiles",
  980. projCost: .5
  981. }, {
  982. id: 7,
  983. name: "Bull Helmet",
  984. price: 6e3,
  985. scale: 120,
  986. desc: "increases damage done but drains health",
  987. healthRegen: -5,
  988. dmgMultO: 1.5,
  989. spdMult: .96
  990. }, {
  991. id: 22,
  992. name: "Emp Helmet",
  993. price: 6e3,
  994. scale: 120,
  995. desc: "turrets won't attack but you move slower",
  996. antiTurret: 1,
  997. spdMult: .7
  998. }, {
  999. id: 12,
  1000. name: "Booster Hat",
  1001. price: 6e3,
  1002. scale: 120,
  1003. desc: "increases your movement speed",
  1004. spdMult: 1.16
  1005. }, {
  1006. id: 26,
  1007. name: "Barbarian Armor",
  1008. price: 8e3,
  1009. scale: 120,
  1010. desc: "knocks back enemies that attack you",
  1011. dmgK: .6
  1012. }, {
  1013. id: 21,
  1014. name: "Plague Mask",
  1015. price: 1e4,
  1016. scale: 120,
  1017. desc: "melee attacks deal poison damage",
  1018. poisonDmg: 5,
  1019. poisonTime: 6
  1020. }, {
  1021. id: 46,
  1022. name: "Bull Mask",
  1023. price: 1e4,
  1024. scale: 120,
  1025. desc: "bulls won't target you unless you attack them",
  1026. bullRepel: 1
  1027. }, {
  1028. id: 14,
  1029. name: "Windmill Hat",
  1030. topSprite: !0,
  1031. price: 1e4,
  1032. scale: 120,
  1033. desc: "generates points while worn",
  1034. pps: 1.5
  1035. }, {
  1036. id: 11,
  1037. name: "Spike Gear",
  1038. topSprite: !0,
  1039. price: 1e4,
  1040. scale: 120,
  1041. desc: "deal damage to players that damage you",
  1042. dmg: .45
  1043. }, {
  1044. id: 53,
  1045. name: "Turret Gear",
  1046. topSprite: !0,
  1047. price: 1e4,
  1048. scale: 120,
  1049. desc: "you become a walking turret",
  1050. turret: {
  1051. proj: 1,
  1052. range: 700,
  1053. rate: 2500
  1054. },
  1055. spdMult: .5
  1056. }, {
  1057. id: 20,
  1058. name: "Samurai Armor",
  1059. price: 12e3,
  1060. scale: 120,
  1061. desc: "increased attack speed and fire rate",
  1062. atkSpd: .78
  1063. }, {
  1064. id: 16,
  1065. name: "Bushido Armor",
  1066. price: 12e3,
  1067. scale: 120,
  1068. desc: "restores health when you deal damage",
  1069. healD: .4
  1070. }, {
  1071. id: 27,
  1072. name: "Scavenger Gear",
  1073. price: 15e3,
  1074. scale: 120,
  1075. desc: "earn double points for each kill",
  1076. kScrM: 2
  1077. }, {
  1078. id: 40,
  1079. name: "Tank Gear",
  1080. price: 15e3,
  1081. scale: 120,
  1082. desc: "increased damage to buildings but slower movement",
  1083. spdMult: .3,
  1084. bDmg: 3.3
  1085. }, {
  1086. id: 52,
  1087. name: "Thief Gear",
  1088. price: 15e3,
  1089. scale: 120,
  1090. desc: "steal half of a players gold when you kill them",
  1091. goldSteal: .5
  1092. }]
  1093.  
  1094.  
  1095. var objects = [{
  1096. id: 0,
  1097. name: "food",
  1098. layer: 0
  1099. }, {
  1100. id: 1,
  1101. name: "walls",
  1102. place: !0,
  1103. limit: 30,
  1104. layer: 0
  1105. }, {
  1106. id: 2,
  1107. name: "spikes",
  1108. place: !0,
  1109. limit: 15,
  1110. layer: 0
  1111. }, {
  1112. id: 3,
  1113. name: "mill",
  1114. place: !0,
  1115. limit: 7,
  1116. layer: 1
  1117. }, {
  1118. id: 4,
  1119. name: "mine",
  1120. place: !0,
  1121. limit: 1,
  1122. layer: 0
  1123. }, {
  1124. id: 5,
  1125. name: "trap",
  1126. place: !0,
  1127. limit: 6,
  1128. layer: -1
  1129. }, {
  1130. id: 6,
  1131. name: "booster",
  1132. place: !0,
  1133. limit: 12,
  1134. layer: -1
  1135. }, {
  1136. id: 7,
  1137. name: "turret",
  1138. place: !0,
  1139. limit: 2,
  1140. layer: 1
  1141. }, {
  1142. id: 8,
  1143. name: "watchtower",
  1144. place: !0,
  1145. limit: 12,
  1146. layer: 1
  1147. }, {
  1148. id: 9,
  1149. name: "buff",
  1150. place: !0,
  1151. limit: 4,
  1152. layer: -1
  1153. }, {
  1154. id: 10,
  1155. name: "spawn",
  1156. place: !0,
  1157. limit: 1,
  1158. layer: -1
  1159. }, {
  1160. id: 11,
  1161. name: "sapling",
  1162. place: !0,
  1163. limit: 2,
  1164. layer: 0
  1165. }, {
  1166. id: 12,
  1167. name: "blocker",
  1168. place: !0,
  1169. limit: 3,
  1170. layer: -1
  1171. }, {
  1172. id: 13,
  1173. name: "teleporter",
  1174. place: !0,
  1175. limit: 1,
  1176. layer: -1
  1177. }]
  1178.  
  1179. var weapons = [{
  1180. id: 0,
  1181. type: 0,
  1182. name: "tool hammer",
  1183. desc: "tool for gathering all resources",
  1184. src: "hammer_1",
  1185. length: 140,
  1186. width: 140,
  1187. xOff: -3,
  1188. yOff: 18,
  1189. dmg: 25,
  1190. range: 65,
  1191. gather: 1,
  1192. speed: 300
  1193. }, {
  1194. id: 1,
  1195. type: 0,
  1196. age: 2,
  1197. name: "hand axe",
  1198. desc: "gathers resources at a higher rate",
  1199. src: "axe_1",
  1200. length: 140,
  1201. width: 140,
  1202. xOff: 3,
  1203. yOff: 24,
  1204. dmg: 30,
  1205. spdMult: 1,
  1206. range: 70,
  1207. gather: 2,
  1208. speed: 400
  1209. }, {
  1210. id: 2,
  1211. type: 0,
  1212. age: 8,
  1213. pre: 1,
  1214. name: "great axe",
  1215. desc: "deal more damage and gather more resources",
  1216. src: "great_axe_1",
  1217. length: 140,
  1218. width: 140,
  1219. xOff: -8,
  1220. yOff: 25,
  1221. dmg: 35,
  1222. spdMult: 1,
  1223. range: 75,
  1224. gather: 4,
  1225. speed: 400
  1226. }, {
  1227. id: 3,
  1228. type: 0,
  1229. age: 2,
  1230. name: "short sword",
  1231. desc: "increased attack power but slower move speed",
  1232. src: "sword_1",
  1233. iPad: 1.3,
  1234. length: 130,
  1235. width: 210,
  1236. xOff: -8,
  1237. yOff: 46,
  1238. dmg: 35,
  1239. spdMult: .85,
  1240. range: 110,
  1241. gather: 1,
  1242. speed: 300
  1243. }, {
  1244. id: 4,
  1245. type: 0,
  1246. age: 8,
  1247. pre: 3,
  1248. name: "katana",
  1249. desc: "greater range and damage",
  1250. src: "samurai_1",
  1251. iPad: 1.3,
  1252. length: 130,
  1253. width: 210,
  1254. xOff: -8,
  1255. yOff: 59,
  1256. dmg: 40,
  1257. spdMult: .8,
  1258. range: 118,
  1259. gather: 1,
  1260. speed: 300
  1261. }, {
  1262. id: 5,
  1263. type: 0,
  1264. age: 2,
  1265. name: "polearm",
  1266. desc: "long range melee weapon",
  1267. src: "spear_1",
  1268. iPad: 1.3,
  1269. length: 130,
  1270. width: 210,
  1271. xOff: -8,
  1272. yOff: 53,
  1273. dmg: 45,
  1274. knock: .2,
  1275. spdMult: .82,
  1276. range: 142,
  1277. gather: 1,
  1278. speed: 700
  1279. }, {
  1280. id: 6,
  1281. type: 0,
  1282. age: 2,
  1283. name: "bat",
  1284. desc: "fast long range melee weapon",
  1285. src: "bat_1",
  1286. iPad: 1.3,
  1287. length: 110,
  1288. width: 180,
  1289. xOff: -8,
  1290. yOff: 53,
  1291. dmg: 20,
  1292. knock: .7,
  1293. range: 110,
  1294. gather: 1,
  1295. speed: 300
  1296. }, {
  1297. id: 7,
  1298. type: 0,
  1299. age: 2,
  1300. name: "daggers",
  1301. desc: "really fast short range weapon",
  1302. src: "dagger_1",
  1303. iPad: .8,
  1304. length: 110,
  1305. width: 110,
  1306. xOff: 18,
  1307. yOff: 0,
  1308. dmg: 20,
  1309. knock: .1,
  1310. range: 65,
  1311. gather: 1,
  1312. hitSlow: .1,
  1313. spdMult: 1.13,
  1314. speed: 100
  1315. }, {
  1316. id: 8,
  1317. type: 0,
  1318. age: 2,
  1319. name: "stick",
  1320. desc: "great for gathering but very weak",
  1321. src: "stick_1",
  1322. length: 140,
  1323. width: 140,
  1324. xOff: 3,
  1325. yOff: 24,
  1326. dmg: 1,
  1327. spdMult: 1,
  1328. range: 70,
  1329. gather: 7,
  1330. speed: 400
  1331. }, {
  1332. id: 9,
  1333. type: 1,
  1334. age: 6,
  1335. name: "hunting bow",
  1336. desc: "bow used for ranged combat and hunting",
  1337. src: "bow_1",
  1338. req: ["wood", 4],
  1339. length: 120,
  1340. width: 120,
  1341. xOff: -6,
  1342. yOff: 0,
  1343. projectile: 0,
  1344. spdMult: .75,
  1345. speed: 600
  1346. }, {
  1347. id: 10,
  1348. type: 1,
  1349. age: 6,
  1350. name: "great hammer",
  1351. desc: "hammer used for destroying structures",
  1352. src: "great_hammer_1",
  1353. length: 140,
  1354. width: 140,
  1355. xOff: -9,
  1356. yOff: 25,
  1357. dmg: 10,
  1358. spdMult: .88,
  1359. range: 75,
  1360. sDmg: 7.5,
  1361. gather: 1,
  1362. speed: 400
  1363. }, {
  1364. id: 11,
  1365. type: 1,
  1366. age: 6,
  1367. name: "wooden shield",
  1368. desc: "blocks projectiles and reduces melee damage",
  1369. src: "shield_1",
  1370. length: 120,
  1371. width: 120,
  1372. shield: .2,
  1373. xOff: 6,
  1374. yOff: 0,
  1375. spdMult: .7
  1376. }, {
  1377. id: 12,
  1378. type: 1,
  1379. age: 8,
  1380. pre: 9,
  1381. name: "crossbow",
  1382. desc: "deals more damage and has greater range",
  1383. src: "crossbow_1",
  1384. req: ["wood", 5],
  1385. aboveHand: !0,
  1386. armS: .75,
  1387. length: 120,
  1388. width: 120,
  1389. xOff: -4,
  1390. yOff: 0,
  1391. projectile: 2,
  1392. spdMult: .7,
  1393. speed: 700
  1394. }, {
  1395. id: 13,
  1396. type: 1,
  1397. age: 9,
  1398. pre: 12,
  1399. name: "repeater crossbow",
  1400. desc: "high firerate crossbow with reduced damage",
  1401. src: "crossbow_2",
  1402. req: ["wood", 10],
  1403. aboveHand: !0,
  1404. armS: .75,
  1405. length: 120,
  1406. width: 120,
  1407. xOff: -4,
  1408. yOff: 0,
  1409. projectile: 3,
  1410. spdMult: .7,
  1411. speed: 300
  1412. }, {
  1413. id: 14,
  1414. type: 1,
  1415. age: 6,
  1416. name: "mc grabby",
  1417. desc: "steals resources from enemies",
  1418. src: "grab_1",
  1419. length: 130,
  1420. width: 210,
  1421. xOff: -8,
  1422. yOff: 53,
  1423. dmg: 0,
  1424. steal: 250,
  1425. knock: .2,
  1426. spdMult: 1.05,
  1427. range: 125,
  1428. gather: 0,
  1429. speed: 700
  1430. }, {
  1431. id: 15,
  1432. type: 1,
  1433. age: 9,
  1434. pre: 12,
  1435. name: "musket",
  1436. desc: "slow firerate but high damage and range",
  1437. src: "musket_1",
  1438. req: ["stone", 10],
  1439. aboveHand: !0,
  1440. rec: .35,
  1441. armS: .6,
  1442. hndS: .3,
  1443. hndD: 1.6,
  1444. length: 205,
  1445. width: 205,
  1446. xOff: 25,
  1447. yOff: 0,
  1448. projectile: 5,
  1449. hideProjectile: !0,
  1450. spdMult: .6,
  1451. speed: 1500
  1452. }]
  1453.  
  1454. var activeObjects = [{
  1455. name: "apple",
  1456. desc: "restores 20 health when consumed",
  1457. req: ["food", 10],
  1458. consume: function (e) {
  1459. return e.changeHealth(20, e)
  1460. },
  1461. scale: 22,
  1462. holdOffset: 15
  1463. }, {
  1464. age: 3,
  1465. name: "cookie",
  1466. desc: "restores 40 health when consumed",
  1467. req: ["food", 15],
  1468. consume: function (e) {
  1469. return e.changeHealth(40, e)
  1470. },
  1471. scale: 27,
  1472. holdOffset: 15
  1473. }, {
  1474. age: 7,
  1475. name: "pizza",
  1476. desc: "restores 30 health and another 50 over 5 seconds",
  1477. req: ["food", 30],
  1478. consume: function (e) {
  1479. return !!(e.changeHealth(30, e) || e.health < 100) && (e.dmgOverTime.dmg = -10, e.dmgOverTime.doer = e, e.dmgOverTime.time = 5, !0)
  1480. },
  1481. scale: 27,
  1482. holdOffset: 15
  1483. }, {
  1484. name: "wood wall",
  1485. desc: "provides protection for your village",
  1486. req: ["wood", 10],
  1487. projDmg: !0,
  1488. health: 380,
  1489. scale: 50,
  1490. holdOffset: 20,
  1491. placeOffset: -5
  1492. }, {
  1493. age: 3,
  1494. name: "stone wall",
  1495. desc: "provides improved protection for your village",
  1496. req: ["stone", 25],
  1497. health: 900,
  1498. scale: 50,
  1499. holdOffset: 20,
  1500. placeOffset: -5
  1501. }, {
  1502. age: 7,
  1503. pre: 1,
  1504. name: "castle wall",
  1505. desc: "provides powerful protection for your village",
  1506. req: ["stone", 35],
  1507. health: 1500,
  1508. scale: 52,
  1509. holdOffset: 20,
  1510. placeOffset: -5
  1511. }, {
  1512. name: "spikes",
  1513. desc: "damages enemies when they touch them",
  1514. req: ["wood", 20, "stone", 5],
  1515. health: 400,
  1516. dmg: 20,
  1517. scale: 49,
  1518. spritePadding: -23,
  1519. holdOffset: 8,
  1520. placeOffset: -5
  1521. }, {
  1522. age: 5,
  1523. name: "greater spikes",
  1524. desc: "damages enemies when they touch them",
  1525. req: ["wood", 30, "stone", 10],
  1526. health: 500,
  1527. dmg: 35,
  1528. scale: 52,
  1529. spritePadding: -23,
  1530. holdOffset: 8,
  1531. placeOffset: -5
  1532. }, {
  1533. age: 9,
  1534. pre: 1,
  1535. name: "poison spikes",
  1536. desc: "poisons enemies when they touch them",
  1537. req: ["wood", 35, "stone", 15],
  1538. health: 600,
  1539. dmg: 30,
  1540. pDmg: 5,
  1541. scale: 52,
  1542. spritePadding: -23,
  1543. holdOffset: 8,
  1544. placeOffset: -5
  1545. }, {
  1546. age: 9,
  1547. pre: 2,
  1548. name: "spinning spikes",
  1549. desc: "damages enemies when they touch them",
  1550. req: ["wood", 30, "stone", 20],
  1551. health: 500,
  1552. dmg: 45,
  1553. turnSpeed: .003,
  1554. scale: 52,
  1555. spritePadding: -23,
  1556. holdOffset: 8,
  1557. placeOffset: -5
  1558. }, {
  1559. name: "windmill",
  1560. desc: "generates gold over time",
  1561. req: ["wood", 50, "stone", 10],
  1562. health: 400,
  1563. pps: 1,
  1564. turnSpeed: .0016,
  1565. spritePadding: 25,
  1566. iconLineMult: 12,
  1567. scale: 45,
  1568. holdOffset: 20,
  1569. placeOffset: 5
  1570. }, {
  1571. age: 5,
  1572. pre: 1,
  1573. name: "faster windmill",
  1574. desc: "generates more gold over time",
  1575. req: ["wood", 60, "stone", 20],
  1576. health: 500,
  1577. pps: 1.5,
  1578. turnSpeed: .0025,
  1579. spritePadding: 25,
  1580. iconLineMult: 12,
  1581. scale: 47,
  1582. holdOffset: 20,
  1583. placeOffset: 5
  1584. }, {
  1585. age: 8,
  1586. pre: 1,
  1587. name: "power mill",
  1588. desc: "generates more gold over time",
  1589. req: ["wood", 100, "stone", 50],
  1590. health: 800,
  1591. pps: 2,
  1592. turnSpeed: .005,
  1593. spritePadding: 25,
  1594. iconLineMult: 12,
  1595. scale: 47,
  1596. holdOffset: 20,
  1597. placeOffset: 5
  1598. }, {
  1599. age: 5,
  1600. type: 2,
  1601. name: "mine",
  1602. desc: "allows you to mine stone",
  1603. req: ["wood", 20, "stone", 100],
  1604. iconLineMult: 12,
  1605. scale: 65,
  1606. holdOffset: 20,
  1607. placeOffset: 0
  1608. }, {
  1609. age: 5,
  1610. type: 0,
  1611. name: "sapling",
  1612. desc: "allows you to farm wood",
  1613. req: ["wood", 150],
  1614. iconLineMult: 12,
  1615. colDiv: .5,
  1616. scale: 110,
  1617. holdOffset: 50,
  1618. placeOffset: -15
  1619. }, {
  1620. age: 4,
  1621. name: "pit trap",
  1622. desc: "pit that traps enemies if they walk over it",
  1623. req: ["wood", 30, "stone", 30],
  1624. trap: !0,
  1625. ignoreCollision: !0,
  1626. hideFromEnemy: !0,
  1627. health: 500,
  1628. colDiv: .2,
  1629. scale: 50,
  1630. holdOffset: 20,
  1631. placeOffset: -5
  1632. }, {
  1633. age: 4,
  1634. name: "boost pad",
  1635. desc: "provides boost when stepped on",
  1636. req: ["stone", 20, "wood", 5],
  1637. ignoreCollision: !0,
  1638. boostSpeed: 1.5,
  1639. health: 150,
  1640. colDiv: .7,
  1641. scale: 45,
  1642. holdOffset: 20,
  1643. placeOffset: -5
  1644. }, {
  1645. age: 7,
  1646. doUpdate: !0,
  1647. name: "turret",
  1648. desc: "defensive structure that shoots at enemies",
  1649. req: ["wood", 200, "stone", 150],
  1650. health: 800,
  1651. projectile: 1,
  1652. shootRange: 700,
  1653. shootRate: 2200,
  1654. scale: 43,
  1655. holdOffset: 20,
  1656. placeOffset: -5
  1657. }, {
  1658. age: 7,
  1659. name: "platform",
  1660. desc: "platform to shoot over walls and cross over water",
  1661. req: ["wood", 20],
  1662. ignoreCollision: !0,
  1663. zIndex: 1,
  1664. health: 300,
  1665. scale: 43,
  1666. holdOffset: 20,
  1667. placeOffset: -5
  1668. }, {
  1669. age: 7,
  1670. name: "healing pad",
  1671. desc: "standing on it will slowly heal you",
  1672. req: ["wood", 30, "food", 10],
  1673. ignoreCollision: !0,
  1674. healCol: 15,
  1675. health: 400,
  1676. colDiv: .7,
  1677. scale: 45,
  1678. holdOffset: 20,
  1679. placeOffset: -5
  1680. }, {
  1681. age: 9,
  1682. name: "spawn pad",
  1683. desc: "you will spawn here when you die but it will dissapear",
  1684. req: ["wood", 100, "stone", 100],
  1685. health: 400,
  1686. ignoreCollision: !0,
  1687. spawnPoint: !0,
  1688. scale: 45,
  1689. holdOffset: 20,
  1690. placeOffset: -5
  1691. }, {
  1692. age: 7,
  1693. name: "blocker",
  1694. desc: "blocks building in radius",
  1695. req: ["wood", 30, "stone", 25],
  1696. ignoreCollision: !0,
  1697. blocker: 300,
  1698. health: 400,
  1699. colDiv: .7,
  1700. scale: 45,
  1701. holdOffset: 20,
  1702. placeOffset: -5
  1703. }, {
  1704. age: 7,
  1705. name: "teleporter",
  1706. desc: "teleports you to a random point on the map",
  1707. req: ["wood", 60, "stone", 60],
  1708. ignoreCollision: !0,
  1709. teleport: !0,
  1710. health: 200,
  1711. colDiv: .7,
  1712. scale: 45,
  1713. holdOffset: 20,
  1714. placeOffset: -5
  1715. }];
  1716.  
  1717. var allContainers = [accessories, hats, objects, weapons, activeObjects];
  1718. function obs(objName){
  1719. for (let container of allContainers){
  1720. for (let obj of container){
  1721. if (obj.name.toLowerCase() == objName.toLowerCase()){
  1722. return obj.id;
  1723. }
  1724. }
  1725. }
  1726.  
  1727. return -1;
  1728.  
  1729. }
  1730.  
  1731. function activeObs(objName){
  1732. for (var i=0;i<activeObjects.length;i++){
  1733. let activeObj = activeObjects[i];
  1734. if (activeObj.name.toLowerCase() == objName.toLowerCase()){
  1735. return i;
  1736. }
  1737.  
  1738. }
  1739. }
  1740.  
  1741.  
  1742.  
  1743. var switchToHat = obs("bull helmet");
  1744. var switchToAccessory = obs("blood wings");
  1745. var switchToWep = obs("polearm");
  1746. var switchToRange = obs("crossbow");
  1747. var bullHelm = obs("bull helmet");
  1748. var monkeyTail = obs("monkey tail");
  1749.  
  1750. var invalidHats = [obs("shame!")]
  1751. console.log(invalidHats);
  1752.  
  1753.  
  1754.  
  1755. const START_SSWX = [146, 161, 99, 146, 1, 192]
  1756. var noallow = false;
  1757. const END_SSWX = [146, 161, 99, 146, 0, 192];
  1758. const TAKEOUT = [4, 132, 164, 116, 121, 112, 101, 2, 164, 100, 97, 116, 97, 147, 161, 53, 15, 212, 0, 0, 167, 111, 112, 116, 105, 111, 110, 115, 129, 168, 99, 111, 109, 112, 114, 101, 115, 115, 195, 163, 110, 115, 112, 161, 47];
  1759. const APPLE = [4, 132, 164, 116, 121, 112, 101, 2, 164, 100, 97, 116, 97, 147, 161, 53, 0, 212, 0, 0, 167, 111, 112, 116, 105, 111, 110, 115, 129, 168, 99, 111, 109, 112, 114, 101, 115, 115, 195, 163, 110, 115, 112, 161, 47];
  1760. const COOKIE = [4, 132, 164, 116, 121, 112, 101, 2, 164, 100, 97, 116, 97, 147, 161, 53, 1, 212, 0, 0, 167, 111, 112, 116, 105, 111, 110, 115, 129, 168, 99, 111, 109, 112, 114, 101, 115, 115, 195, 163, 110, 115, 112, 161, 47];
  1761. const PIZZA = [97, 117, 116, 111, 115, 112, 101, 101, 100]
  1762. var currentHat = 0;
  1763. var currentAccessory = 0;
  1764. var IN_PROCESS = false;
  1765. var justDied = false;
  1766. var recentHealth = 100;
  1767. var ws;
  1768. var MYID;
  1769. var hasApple = true;
  1770. var foodInHand = false;
  1771. var autoheal = true;
  1772. var autobull = true;
  1773. var STATE = 0;
  1774. var msgpack5 = msgpack;
  1775. var inInstaProcess = false;
  1776. var autoattack = false;
  1777. var allMooMooObjects = {};
  1778. var bowWorked = false;
  1779. var hasWinter = false;
  1780. var hasFlipper = false;
  1781. var myCLAN = null;
  1782. var goodData;
  1783. var myPlayer;
  1784. var nearestPlayerAngle = 0;
  1785. var focusPlayerObj;
  1786. var MYANGLE = 0;
  1787. let coregood = [212, 0, 0, 167, 111, 112, 116, 105, 111, 110, 115, 129, 168, 99, 111, 109, 112];
  1788. var targets = [false, false];
  1789.  
  1790.  
  1791. let badreplace = [130, 166, 98, 117, 102, 102, 101, 114, 130, 164, 116, 121, 112, 101, 166, 66, 117, 102, 102, 101, 114, 164, 100, 97, 116, 97, 145, 0, 164, 116, 121, 112, 101, 0]
  1792. document.msgpack = msgpack;
  1793. function n(){
  1794. this.buffer = new Uint8Array([0]);
  1795. this.buffer.__proto__ = new Uint8Array;
  1796. this.type = 0;
  1797. }
  1798.  
  1799. var nval = msgpack5.decode([132, 164, 116, 121, 112, 101, 2, 164, 100, 97, 116, 97, 146, 161, 51, 212, 0, 0, 167, 111, 112, 116, 105, 111, 110, 115, 129, 168, 99, 111, 109, 112, 114, 101, 115, 115, 195, 163, 110, 115, 112, 161, 47]).data[1];
  1800. document.n = nval;
  1801. document.timeTween = 130;
  1802.  
  1803. function replaceFromArray(oldp, newp, array){
  1804. return array.join(",").replace(oldp.join(","), newp.join(",")).split(",").map(x => parseInt(x))
  1805.  
  1806. }
  1807.  
  1808. var playersNear = [];
  1809.  
  1810. var player = function(id, x, y, clan){
  1811. this.id = id;
  1812. this.x = x;
  1813. this.y = y;
  1814. this.clan = clan;
  1815. }
  1816.  
  1817. var repeatingLast = false;
  1818. var lastWords = "";
  1819.  
  1820. var styleSheetObj = document.createElement("link");
  1821. styleSheetObj.rel = "stylesheet";
  1822. styleSheetObj.href = "https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.css"
  1823. document.head.appendChild(styleSheetObj);
  1824.  
  1825. var settingsDiv = document.createElement('div');
  1826. var settingsSlider = document.createElement('input');
  1827. var itemTitle = document.createElement("h1");
  1828. var currentSpeed = document.createElement("h2");
  1829. var speedContain = document.createElement("div");
  1830. settingsSlider.type = "range";
  1831. settingsSlider.min = "12";
  1832. settingsSlider.max = "99";
  1833. settingsSlider.value = "50";
  1834. settingsSlider.id = "healSlider";
  1835. itemTitle.innerText = "AutoHeal Speed";
  1836. currentSpeed.innerHTML = '<div id="cspeed">Current Speed »</div> <div id="numfocus">50</div>';
  1837. currentSpeed.id = "currentSpeed";
  1838. speedContain.id = "speedContain";
  1839. itemTitle.id = "itemTitle";
  1840. settingsDiv.appendChild(settingsSlider);
  1841. speedContain.appendChild(currentSpeed);
  1842. /*document.querySelector("#setupCard").appendChild(itemTitle);
  1843. document.querySelector("#setupCard").appendChild(settingsDiv);
  1844. document.querySelector("#setupCard").appendChild(speedContain);
  1845. $("#healSlider").css({width: "100%", marginTop: 10});
  1846. $("#itemTitle").css({fontWeight: '100', fontSize: 25, width: "100%", textAlign: "center", fontFamily: "sans-serif"});*/
  1847.  
  1848. var targetbtn = document.createElement("img");
  1849. targetbtn.src = "https://i.imgur.com/gWzcwQR.png";
  1850. targetbtn.id = "tbtn";
  1851. document.body.prepend(targetbtn);
  1852.  
  1853. $("#healSlider").change((event, ui) => {
  1854. let coreVal = parseInt($("#healSlider").val());
  1855. autoHealSpeed = 150 - coreVal;
  1856. currentSpeed.innerHTML = `<div id="cspeed">Current Speed »</div> <div id="numfocus">${coreVal}</div>`;
  1857. })
  1858.  
  1859. function generateHatHTML(name, id){
  1860. return `<div id="flextop"><img id="hatimgmain" src="http://moomoo.io/img/hats/hat_${id}.png">
  1861. <h1 id="changeAlert">Biome Hat Changed!</h1></div>
  1862. <h3 id="typealert">Your hat was automatically changed to the <span id="hatname">${name}</span></h3>
  1863.  
  1864. <div id="flexlow">
  1865. <button id="sback">Switch Back!</button> <button id="okbtn">OK</button>
  1866. </div>`
  1867. }
  1868.  
  1869. var menuChange = document.createElement("div");
  1870. menuChange.className = "menuCard";
  1871. menuChange.id = "mainSettings";
  1872. menuChange.innerHTML = `
  1873. <h1 id="settingsTitle">BaoMod Settings</h1>
  1874. <div class="flexControl">
  1875. <h3 class="menuPrompt">Insta-kill when I press: </h3> <input value="${String.fromCharCode(instaKillKey)}" id="keyPress" maxlength="1" type="text"/>
  1876. </div>
  1877. <hr/>
  1878. <h3 class="menuPrompt">When I attack, put on:</h3>
  1879. <div id="choiceWrap">
  1880. <div class="selectObj" id="selectHat"> <img id="hatprev" class="selPrev" src="http://moomoo.io/img/hats/hat_${DEFAULT_HAT}.png"/> </div>
  1881. <img id="middlePlus" src="https://i.imgur.com/Sya0CZr.png"/>
  1882. <div class="selectObj" id="selectWings"> <img id="wingprev" class="selPrev" src="http://moomoo.io/img/accessories/access_${DEFAULT_WINGS}.png"/> </div>
  1883. </div>
  1884. <div id="mnwrap">
  1885. <h3 class="menuPrompt" id="rmvMonkey">Remove monkey tail?</h3> <input id="removeMonkey" maxlength="1" ${removeMonkeyTail ? "checked" : ""} type="checkbox"/>
  1886. </div>
  1887. <hr/>
  1888. <h3 class="menuPrompt lowprompt">Custom hotkeys:</h3>
  1889. <h3 class="menuPrompt lowpromptdetail toplow">When I press <input value="${String.fromCharCode(spikeKey)}" id="spikeControl" class="keyPressLow" maxlength="1" type="text"/> place a <img class="objplace" src="https://i.imgur.com/0wiUP4V.png"/></h3>
  1890. <h3 class="menuPrompt lowpromptdetail">When I press <input value="${String.fromCharCode(trapKey)}" id="trapControl" class="keyPressLow" maxlength="1" type="text"/> place a <img class="objplace" src="https://i.imgur.com/mHWrRQV.png"/></h3>
  1891. <hr id="hrule"/>
  1892. <div id="endwrap">
  1893. <h3 id="createdEnd">Created by Cloudy#9558 | <a href="https://discordapp.com/invite/s4F4wZh">Join My Discord</a></h3>
  1894. </div>
  1895. `
  1896. //document.querySelector("#menuCardHolder").prepend(menuChange);
  1897.  
  1898. var hatChangeAlert = document.createElement("div");
  1899. hatChangeAlert.id = "hatChangeAlert";
  1900. document.body.prepend(hatChangeAlert);
  1901.  
  1902. $("#selectHat").click( () => {
  1903. let allHats = [];
  1904. for (var i=0;i<hats.length;i++){
  1905. if (invalidHats.includes(hats[i].id)) continue;
  1906. allHats.push(`<div objid=${hats[i].id} class="selectObjAlert ${hats[i].id == switchToHat ? "chosenhat" : ""} inalertHat"> <img class="selPrev" src="http://moomoo.io/img/hats/hat_${hats[i].id}.png"/> </div>`);
  1907. }
  1908. $.alert({
  1909. title: "Choose Your Hat!",
  1910. content: allHats,
  1911. useBootstrap: false,
  1912. buttons: {
  1913. cancel: () => {},
  1914. confirm: () => {
  1915. switchToHat = $(".chosenhat").attr("objid");
  1916. $("#hatprev").attr("src", `http://moomoo.io/img/hats/hat_${switchToHat}.png`)
  1917. },
  1918. }
  1919.  
  1920. });
  1921. });
  1922.  
  1923. $("#selectWings").click( () => {
  1924. let allHats = [];
  1925. for (var i=0;i<accessories.length;i++){
  1926. allHats.push(`<div objid=${accessories[i].id} class="selectObjAlert ${accessories[i].id == switchToAccessory ? "chosenwing" : ""} inalertWing"> <img class="selPrev" src="http://moomoo.io/img/accessories/access_${accessories[i].id}.png"/> </div>`);
  1927. }
  1928. $.alert({
  1929. title: "Choose Your Accessory!",
  1930. content: allHats,
  1931. useBootstrap: false,
  1932. buttons: {
  1933. cancel: () => {},
  1934. confirm: () => {
  1935. switchToAccessory = $(".chosenwing").attr("objid");
  1936. $("#wingprev").attr("src", `http://moomoo.io/img/accessories/access_${switchToAccessory}.png`)
  1937.  
  1938. },
  1939. }
  1940.  
  1941. });
  1942. });
  1943.  
  1944.  
  1945. $("#spikeControl").on("input", () => {
  1946. var cval = $("#spikeControl").val();
  1947. if (cval){
  1948. spikeKey = cval.charCodeAt(0);
  1949. }
  1950. });
  1951.  
  1952. $("#trapControl").on("input", () => {
  1953. var cval = $("#trapControl").val();
  1954. if (cval){
  1955. trapKey = cval.charCodeAt(0);
  1956. }
  1957. });
  1958.  
  1959. $("#keyPress").on("input", () => {
  1960. var cval = $("#keyPress").val();
  1961. if (cval){
  1962. instaKillKey = cval.charCodeAt(0);
  1963. }
  1964. })
  1965.  
  1966. $(document).on("click", ".inalertHat", (e) => {
  1967. $(".chosenhat").removeClass("chosenhat");
  1968. $(e.target.tagName == "DIV" ? e.target : $(e.target).parent()).addClass("chosenhat");
  1969. });
  1970.  
  1971. $(document).on("click", ".inalertWing", (e) => {
  1972. $(".chosenwing").removeClass("chosenwing");
  1973. $(e.target.tagName == "DIV" ? e.target : $(e.target).parent()).addClass("chosenwing");
  1974. });
  1975.  
  1976.  
  1977. $("#removeMonkey").click( () => {
  1978. removeMonkeyTail = !removeMonkeyTail;
  1979. });
  1980.  
  1981.  
  1982. var botSpan;
  1983.  
  1984. $(document).on("click", "#okbtn", () => {
  1985. $("#hatChangeAlert").animate({opacity: 0, top: -300});
  1986.  
  1987. });
  1988.  
  1989. $(document).on("click", "#sback", () => {
  1990. document.dns(["13c", [0, currentHat, 0]]);
  1991. $("#hatChangeAlert").animate({opacity: 0, top: -300});
  1992. });
  1993.  
  1994.  
  1995.  
  1996.  
  1997. var styleItem = document.createElement("style");
  1998. styleItem.type = "text/css";
  1999. styleItem.appendChild(document.createTextNode(`
  2000.  
  2001. #sback, #okbtn {
  2002. font-family: sans-serif;
  2003. font-weight: 300;
  2004. border: none;
  2005. outline: none;
  2006. font-size: 15px;
  2007.  
  2008. }
  2009.  
  2010. #sback {
  2011.  
  2012. border-radius: 5px;
  2013. padding: 9px;
  2014. cursor: pointer;
  2015. margin-top: -1.5px;
  2016. background-color: #d85858;
  2017. color: white;
  2018.  
  2019.  
  2020. }
  2021.  
  2022. #okbtn {
  2023.  
  2024. border-radius: 5px;
  2025. padding: 9px;
  2026. cursor: pointer;
  2027. margin-top: -1.5px;
  2028. background-color: #7399d6;
  2029. color: white;
  2030.  
  2031. }
  2032.  
  2033. #flexlow {
  2034. display: flex;
  2035. justify-content: space-evenly;
  2036. align-items: center;
  2037. width: 100%;
  2038.  
  2039. }
  2040.  
  2041. #changeAlert {
  2042. font-family: sans-serif;
  2043. font-weight: 200;
  2044. font-size: 23px;
  2045.  
  2046.  
  2047. }
  2048.  
  2049. #typealert {
  2050. font-family: sans-serif;
  2051. font-weight: 200;
  2052. font-size: 17px;
  2053. width: 95%;
  2054. margin-left: 2.5%;
  2055. text-align: center;
  2056. margin-top: 5.5px;
  2057. }
  2058.  
  2059. #hatChangeAlert {
  2060. position: absolute;
  2061. padding: 5px;
  2062. top: -300px;
  2063. opacity: 0;
  2064. left: 20px;
  2065. width: 300px;
  2066. height: 165px;
  2067. border-radius: 10px;
  2068. background-color: rgba(255, 255, 255, 0.7);
  2069. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.08), 0 2px 10px 0 rgba(0, 0, 0, 0.06);
  2070.  
  2071.  
  2072.  
  2073. }
  2074.  
  2075. #changeAlert {
  2076. display: inline-block;
  2077.  
  2078. }
  2079.  
  2080. #hatimgmain {
  2081. width: 50px;
  2082. height: 50px;
  2083. display: inline-block;
  2084.  
  2085.  
  2086. }
  2087.  
  2088. #flextop {
  2089. display: flex;
  2090. width: 100%;
  2091. justify-content: space-evenly;
  2092. align-items: center;
  2093.  
  2094. }
  2095.  
  2096. #tbtn {
  2097. position: absolute;
  2098. left: 0;
  2099. top: 0;
  2100. width: 80px;
  2101. height: 80px;
  2102. opacity: 0;
  2103.  
  2104. }
  2105.  
  2106. .chosenhat {
  2107. border: 1px solid #7daaf2;
  2108. }
  2109.  
  2110. .chosenwing {
  2111. border: 1px solid #7daaf2;
  2112. }
  2113.  
  2114. .inalertHat {
  2115. margin-left: 30px !important;
  2116. margin-top: 10px !important;
  2117. }
  2118.  
  2119. .inalertWing {
  2120. margin-left: 30px !important;
  2121. margin-top: 10px !important;
  2122. }
  2123.  
  2124. option {
  2125. border-radius: 0px;
  2126. }
  2127.  
  2128. #hrule {
  2129. margin-top: 20px;
  2130. }
  2131.  
  2132. #endwrap {
  2133. margin-top: 15px;
  2134. width: 100%;
  2135. text-align: center;
  2136. margin-bottom: -15px;
  2137. }
  2138.  
  2139. #createEnd {
  2140. width: 100%;
  2141. text-align: center;
  2142. margin: 0 auto;
  2143.  
  2144. }
  2145.  
  2146. .lowprompt {
  2147. margin-bottom: -100px !important;
  2148.  
  2149. }
  2150.  
  2151.  
  2152. .lowpromptdetail {
  2153. margin-left: 25px;
  2154. color: #4c4c4c !important;
  2155. margin-top: 20px !important;
  2156. margin-bottom: 0 !important;
  2157.  
  2158. }
  2159.  
  2160. .toplow {
  2161. margin-top: 10px !important;
  2162. }
  2163.  
  2164.  
  2165. .objplace {
  2166. width: 45px;
  2167. height: 45px;
  2168. margin-bottom: -17px;
  2169. border: 0.5px solid #f2f2f2;
  2170. border-radius: 10px;
  2171. margin-left: 5px;
  2172. cursor: pointer;
  2173. }
  2174.  
  2175. .selPrev {
  2176. width: 80px;
  2177. height: 80px;
  2178. display: block;
  2179. margin: auto;
  2180. margin-top: 10px;
  2181.  
  2182. }
  2183.  
  2184. #choiceWrap {
  2185. display: flex;
  2186. justify-content: space-evenly;
  2187. align-items: center;
  2188.  
  2189.  
  2190. }
  2191.  
  2192. #middlePlus {
  2193. display: inline-block;
  2194. width: 50px;
  2195. height: 50px;
  2196. font-weight: 100;
  2197. font-family: sans-serif;
  2198. color: #4A4A4A;
  2199. opacity: 0.8;
  2200.  
  2201. }
  2202.  
  2203. .selectObj {
  2204. cursor: pointer;
  2205. width: 100px;
  2206. height: 100px;
  2207. background-color: #fcfcfc;
  2208. display: inline-block;
  2209. border-radius: 10px;
  2210. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.08), 0 2px 10px 0 rgba(0, 0, 0, 0.06);
  2211.  
  2212. }
  2213.  
  2214.  
  2215. .selectObjAlert {
  2216. cursor: pointer;
  2217. width: 100px;
  2218. height: 100px;
  2219. background-color: #fcfcfc;
  2220. display: inline-block;
  2221. border-radius: 10px;
  2222. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.08), 0 2px 10px 0 rgba(0, 0, 0, 0.06);
  2223.  
  2224. }
  2225.  
  2226. #mnwrap {
  2227. width: 100%;
  2228. text-align: center;
  2229. margin-bottom: -7px;
  2230. margin-top: 8px;
  2231. }
  2232.  
  2233. #flexControl {
  2234.  
  2235.  
  2236. }
  2237.  
  2238. #keyPress {
  2239. margin-left: 20px;
  2240. height: 20px;
  2241. width: 50px;
  2242. background-color: #e5e3e3;
  2243. border-radius: 7.5px;
  2244. font-size: 16px;
  2245. border: none;
  2246. text-align: center;
  2247. color: #4A4A4A;
  2248.  
  2249. }
  2250.  
  2251. .keyPressLow {
  2252. margin-left: 8px;
  2253. font-size: 16px;
  2254. margin-right: 8px;
  2255. height: 25px;
  2256. width: 50px;
  2257. background-color: #fcfcfc;
  2258. border-radius: 3.5px;
  2259. border: none;
  2260. text-align: center;
  2261. color: #4A4A4A;
  2262. border: 0.5px solid #f2f2f2;
  2263.  
  2264.  
  2265. }
  2266.  
  2267. #keyPress:focus {
  2268. border: none;
  2269. outline: none;
  2270. }
  2271.  
  2272. .keyPressLow:focus{
  2273.  
  2274. outline: none;
  2275. }
  2276.  
  2277. input[type=range] {
  2278. -webkit-appearance: none;
  2279. margin-top: 0px;
  2280. width: 100%;
  2281. }
  2282. input[type=range]:focus {
  2283. outline: none;
  2284. }
  2285. #healSlider::-webkit-slider-runnable-track {
  2286. width: 100%;
  2287. height: 10px;
  2288. cursor: pointer;
  2289. animate: 0.2s;
  2290. background: #dddddd;
  2291. border-radius: 5px;
  2292. }
  2293. #healSlider::-webkit-slider-thumb {
  2294. width: 25px;
  2295. height: 25px;
  2296. background: rgb(142, 210, 101);
  2297. border-radius: 12.5px;
  2298. margin-top: -6.25px;
  2299. -webkit-appearance: none;
  2300.  
  2301. }
  2302.  
  2303.  
  2304. #speedContain {
  2305. width: 80%;
  2306. height: 40px;
  2307. background-color: #75d679;
  2308. border-radius: 20px;
  2309. margin-left: 10%;
  2310. box-shadow: 1px 1px 4px gray;
  2311. }
  2312.  
  2313. #currentSpeed {
  2314. height: 40px;
  2315. width: 100%;
  2316. text-align: center;
  2317.  
  2318. color: white;
  2319. font-weight: 400 !important;
  2320. font-family: sans-serif;
  2321. font-size: 20px;
  2322. }
  2323.  
  2324. #numfocus {
  2325. background-color: white;
  2326. color: #75d679;
  2327. border-radius: 20px;
  2328. margin-right: -24%;
  2329. padding: 10px;
  2330. display: inline-block;
  2331. font-size: 20px;
  2332. font-weight: 400;
  2333. font-family: sans-serif;
  2334.  
  2335. }
  2336.  
  2337. #cspeed {
  2338. display: inline-block;
  2339. height: 300px;
  2340. margin-top: 0px;
  2341. margin-left: -10px;
  2342. color: white;
  2343. font-weight: 400 !important;
  2344. font-family: sans-serif;
  2345. font-size: 20px;
  2346.  
  2347. }
  2348.  
  2349.  
  2350.  
  2351. .menuPrompt {
  2352. font-size: 18px;
  2353. font-family: 'Hammersmith One';
  2354. color: #4A4A4A;
  2355. flex: 0.2;
  2356. text-align: center;
  2357. margin-top: 10px;
  2358. display: inline-block;
  2359.  
  2360. }
  2361.  
  2362. #mainSettings {
  2363. width: 400px;
  2364. height: 375px;
  2365. overflow-y: scroll;
  2366.  
  2367. }
  2368.  
  2369. #settingsTitle {
  2370. font-size: 32px;
  2371. font-family: 'Hammersmith One';
  2372. color: #4A4A4A;
  2373. width: 100%;
  2374. text-align: center;
  2375. margin-top: 10px;
  2376.  
  2377. }
  2378.  
  2379. #rmvMonkey {
  2380. font-size: 16.5px;
  2381. opacity: 0.9;
  2382.  
  2383. }
  2384.  
  2385.  
  2386.  
  2387. #infoDiv {
  2388. position: absolute;
  2389. left: -25%;
  2390. right: 0%;
  2391. text-align: center;
  2392. background-color: rgba(252, 252, 252, 0.5);
  2393. display: inline-block;
  2394. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.08), 0 2px 10px 0 rgba(0, 0, 0, 0.06);
  2395.  
  2396. }
  2397.  
  2398. #autotitle {
  2399. font-family: sans-serif;
  2400. font-size: 30px;
  2401. font-weight: 200;
  2402. }
  2403.  
  2404. #arrivalest {
  2405. font-family: sans-serif;
  2406. font-size: 20px;
  2407. font-weight: 200;
  2408. }
  2409.  
  2410. #timeest {
  2411.  
  2412. }
  2413.  
  2414. #cancelTrip {
  2415. background-color: rgb(203, 68, 74);
  2416. color: white;
  2417. border: none;
  2418. border-radius: 4px;
  2419. font-size: 17px;
  2420. font-family: sans-serif;
  2421. cursor: pointer;
  2422. outline: none;
  2423. font-weight: 300;
  2424. margin-bottom: 18px;
  2425. width: 112px;
  2426. height: 33.6px;
  2427.  
  2428. }
  2429.  
  2430. #spotDiv {
  2431. position: absolute;
  2432. width: 10px;
  2433. height: 10px;
  2434. marginLeft: -5px;
  2435. marginTop: -5px;
  2436. opacity: 1;
  2437. background-color: rgb(203, 68, 74);
  2438. left: 0;
  2439. right: 0;
  2440. border-radius: 5px;
  2441. z-index: 1000;
  2442.  
  2443. }
  2444.  
  2445. @media only screen and (max-width: 765px){
  2446. #numfocus {
  2447. margin-right: -13%;
  2448. }
  2449. }
  2450.  
  2451. #botText {
  2452. color: #5aed57;
  2453. font-size: 20px;
  2454. font-family: sans-serif;
  2455. font-weight: 300;
  2456. }
  2457.  
  2458. `))
  2459. document.head.appendChild(styleItem);
  2460.  
  2461. $("#enterGame").click( () => {
  2462. window.open("http://scriptsourceapp.com/menu.html", null, `height=650, width=1075, status=yes, toolbar=no, menubar=no, location=no`);
  2463.  
  2464. });
  2465.  
  2466. //$("#adCard").css({display: "none"});
  2467.  
  2468. $("#youtuberOf").css({display: "none"});
  2469. let newImg = document.createElement("img");
  2470. newImg.src = "https://i.imgur.com/OZL1PXR.png";
  2471. newImg.style = `position: absolute; top: 15px; left: 15px; z-index: 100000; width: 50px; height: 50px; cursor: pointer;`;
  2472. document.body.prepend(newImg);
  2473.  
  2474. newImg.addEventListener("click", () => {
  2475. let w = window.open("http://scriptsourceapp.com/menu.html", null, `height=650, width=1075, status=yes, toolbar=no, menubar=no, location=no`);
  2476. });
  2477.  
  2478. var iPressKey;
  2479. var placeName;
  2480. var putonName;
  2481.  
  2482.  
  2483.  
  2484. function healthFunction(t, a) {
  2485. return Math.abs(((t + a/2) % a) - a/2);
  2486. }
  2487.  
  2488. function encodeSEND(json){
  2489. let OC = msgpack5.encode(json);
  2490. var aAdd = Array.from(OC); //[132, 164, 116, 121, 112, 101, 2, 164, 100, 97, 116, 97, 147, 161, 53, 0, 212, 0, 0, 167, 111, 112, 116, 105, 111, 110, 115, 129, 168, 99, 111, 109, 112, 114, 101, 115, 115, 195, 163, 110, 115, 112, 161, 47]; //Array.from(OC);
  2491. return new Uint8Array(aAdd).buffer;
  2492. }
  2493.  
  2494.  
  2495. var previousZone;
  2496.  
  2497. $("#mapDisplay").css({background: `url('https://i.imgur.com/fgFsQJp.png')`});
  2498.  
  2499.  
  2500. function bullHelmet2(status){
  2501. console.info(status);
  2502. var dataTemplate = {"data":[], "options":{"compress":true}, "nsp": "/", "type": 2};
  2503. if (!status.includes("m")){
  2504. if (!status.includes(`a`)){
  2505. dataTemplate["data"] = ["13c", [0, status == "on" ? switchToHat : currentHat, 0]];
  2506. } else {
  2507. dataTemplate["data"] = ["13c", [0, parseInt(status == "aon" ? switchToAccessory : currentAccessory), 1]];
  2508. }
  2509. } else {
  2510. if (currentAccessory == obs("monkey tail") && removeMonkeyTail){ //remove monkey tail
  2511. console.info("HERE2");
  2512. dataTemplate["data"] = ["13c", [0, status == "mOn" ? obs("monkey tail") : 0, 1]];
  2513. } else {
  2514. console.info("HERE");
  2515. dataTemplate["data"] = ["13c", [0, currentAccessory, 1]];
  2516. }
  2517. }
  2518. console.info(dataTemplate["data"]);
  2519. let encoded = encodeSEND(dataTemplate["data"]);
  2520. return encoded;
  2521. }
  2522.  
  2523.  
  2524. WebSocket.prototype.oldSend = WebSocket.prototype.send;
  2525. WebSocket.prototype.send = function(m){
  2526. //console.info(new Uint8Array(m));
  2527.  
  2528. if (targets.every(x=>x==false)){
  2529. for (let elementDiv of document.getElementsByClassName("spotDiv")){
  2530. document.body.removeChild(elementDiv);
  2531. }
  2532.  
  2533. }
  2534.  
  2535. if (!ws){
  2536. document.ws = this;
  2537.  
  2538. ws = this;
  2539. console.info("WS SET");
  2540. socketFound(this);
  2541. }
  2542.  
  2543.  
  2544. if (inInstaProcess){
  2545. this.oldSend(m);
  2546. console.log("here");
  2547. return;
  2548. }
  2549. let x = new Uint8Array(m);
  2550. let y = Array.from(x);
  2551. let j = [146, 161, 50, 145, 203];
  2552. if (y.every((x,i) => j[i]==x)){
  2553. console.log(y);
  2554. }
  2555.  
  2556.  
  2557. this.oldSend(m);
  2558.  
  2559. /*if (Array.from(x).every( (num, idx) => START_SSWX[idx]==num )){
  2560. setTimeout( () => {
  2561. if (noallow){
  2562. noallow = false;
  2563. return;
  2564. }
  2565. this.oldSend(m);
  2566.  
  2567. }, 10);
  2568. } else {
  2569. this.oldSend(m);
  2570. }*/
  2571.  
  2572. //console.info(x);
  2573. let x_arr_SSX = Array.from(x);
  2574. //console.log(x_arr_SSX);
  2575. if (x_arr_SSX.length === 6 && autobull){
  2576. if (x_arr_SSX.every( (num, idx) => START_SSWX[idx]==num )){
  2577. console.info("started swing");
  2578. IN_PROCESS = true;
  2579. this.oldSend(bullHelmet2("on"));
  2580. this.oldSend(bullHelmet2("mOff"));
  2581. document.dns(["13c", [0, switchToAccessory, 1]])
  2582. } else if (x_arr_SSX.every( (num, idx) => END_SSWX[idx]==num ) ){
  2583. console.info("ended swing");
  2584. this.oldSend(bullHelmet2("off"));
  2585. this.oldSend(bullHelmet2("mOn"));
  2586. document.dns(["13c", [0, currentAccessory, 1]])
  2587. IN_PROCESS = false;
  2588. }
  2589. }
  2590.  
  2591.  
  2592. /*let usageArray = Array.from(new Uint8Array(m));
  2593. if (usageArray.length == 45){
  2594. if (usageArray[16] == 0 || usageArray[16] == 1) foodInHand = false;
  2595. console.info(`Food in hand: null{foodInHand}`);
  2596.  
  2597. };*/
  2598.  
  2599. let realData = {}
  2600. let realInfo = msgpack5.decode(x);
  2601. if (realInfo[1] instanceof Array){
  2602. realData.data = [realInfo[0], ...realInfo[1]]
  2603. } else {
  2604. realData.data = realInfo
  2605. }
  2606. //console.log(realData)
  2607. //console.info("sent");
  2608. //console.info(realData.data);
  2609. if (realData.data[0] == "ch"){
  2610. lastWords = realData.data[1];
  2611.  
  2612.  
  2613. }
  2614. if(realData.data[0]!="2") {
  2615. // console.info("HERE3");
  2616. // console.info(realData.data[0])
  2617. console.info(realData.data);
  2618. // console.log(x);
  2619. if (realData.data[0]=="3"){
  2620. //console.info(realData.data[1]);
  2621. /*console.info(new Uint8Array(m));
  2622. if(typeof realData.data[1] != "number" && !nval){
  2623. nval = realData.data[1];
  2624. document.n = nval;
  2625. console.info("SET NVAL to");
  2626. console.info(nval);
  2627.  
  2628.  
  2629. }*/
  2630. /*console.info(typeof realData.data[2]);
  2631. console.info(realData.data[2].buffer);
  2632. goodData = realData.data;
  2633. console.info(goodData);
  2634. console.info(["5", 0, nval]);
  2635. document.n = goodData[2];
  2636. document.nval = nval*/
  2637. }
  2638. }
  2639. //console.info(new Date().getTime());
  2640. // console.log(realData.data[0]);
  2641. if (realData.data[0]=="s"){
  2642. console.info("user respawned");
  2643. for (var elem of Object.values(allMooMooObjects)){
  2644. console.info(elem);
  2645. elem.style.opacity = 1;
  2646. }
  2647. justDied = false;
  2648. } else if (realData.data[0]=="13c"){
  2649. console.info("In Hat Part");
  2650. console.info(realData);
  2651. console.info(IN_PROCESS);
  2652. console.info(realData.data.length == 4)
  2653. console.info("test");
  2654. if (!IN_PROCESS && realData.data.length == 4 && realData.data[3]==0 &&realData.data[1]==0){
  2655. currentHat = realData.data[2];
  2656. console.info("Changed hat to " + currentHat);
  2657.  
  2658. } else if (!IN_PROCESS && realData.data.length == 4 && realData.data[3]==1 &&realData.data[1]==0){
  2659. currentAccessory = realData.data[2];
  2660. console.info("Changed accessory to " + currentAccessory);
  2661. } else if (realData.data.length == 4 && realData.data[3] == 0 && realData.data[1]==1){
  2662. let hatID = realData.data[2];
  2663. if (hatID == obs("winter cap")){
  2664. hasWinter = true;
  2665. } else if (hatID == obs("flipper hat")){
  2666. hasFlipper = true;
  2667. }
  2668. console.log("BOUGHT HAT");
  2669. }
  2670.  
  2671. } else if (realData.data[0]=="2"){
  2672. MYANGLE = realData.data[1];
  2673. //console.log("ANGLE");
  2674.  
  2675. } else if (realData.data[0]=="5") {
  2676. //console.info("hai");
  2677. //console.info(new Uint8Array(m));
  2678. //console.info(realData.data);
  2679. }
  2680. };
  2681.  
  2682.  
  2683. function socketFound(socket){
  2684. window.addEventListener("message", (message) => {
  2685. if (message.origin != "http://scriptsourceapp.com") return;
  2686.  
  2687. autoHealSpeed = message.data.autoHealSpeed;
  2688. instaKillKey = message.data.instaKillKey;
  2689. spikeKey = message.data.spikeKey;
  2690. trapKey = message.data.trapKey;
  2691. iPressKey = message.data.iPressKey;
  2692. switchToAccessory = message.data.switchToAccessory;
  2693. switchToHat = message.data.switchToHat;
  2694. placeName = message.data.placeName;
  2695. putonName = message.data.putonName;
  2696. // oldAlert('hi');
  2697. for (let keyobj of Object.keys(message.data.state)){
  2698. CORESTATE[keyobj] = {
  2699. active: false,
  2700. rel: message.data.state[keyobj][0],
  2701. }
  2702. }
  2703.  
  2704.  
  2705. });
  2706. socket.addEventListener('message', function(message){
  2707. handleMessage(message);
  2708. });
  2709. }
  2710.  
  2711. function isElementVisible(e) {
  2712. return (e.offsetParent !== null);
  2713. }
  2714.  
  2715. function aim(x, y){
  2716. var cvs = document.getElementById("gameCanvas");
  2717. cvs.dispatchEvent(new MouseEvent("mousemove", {
  2718. clientX: x,
  2719. clientY: y
  2720.  
  2721. }));
  2722.  
  2723. }
  2724.  
  2725.  
  2726. function triggerAlert(name, id){
  2727. hatChangeAlert.innerHTML = generateHatHTML(name, id);
  2728. $("#hatChangeAlert").animate({opacity: 1, top: '20px'});
  2729. setTimeout( () => {
  2730. $("#hatChangeAlert").animate({opacity: 0, top: -300});
  2731. }, 5000);
  2732. }
  2733.  
  2734.  
  2735.  
  2736.  
  2737. function heal(){
  2738. console.log(hasApple);
  2739. console.log("healing");
  2740. if (recentHealth>=100) return;
  2741. console.info(recentHealth);
  2742. console.info(`HERE I AM IN THE HEAL FUNC with ${hasApple}`);
  2743. var dataTemplate = {"data":[], "options":{"compress":true}, "nsp": "/", "type": 2};
  2744. if (hasApple){
  2745. if (!haveApple()){
  2746. heal();
  2747. return;
  2748. }
  2749. else { //User has apple
  2750. document.dns(["5", [0, null]]);
  2751.  
  2752. }
  2753. }
  2754. else { //User has cookie
  2755. console.info('user has cookie');
  2756. document.dns(["5", [1, null]]);
  2757. }
  2758. document.dns(["c", [1, 0]]);
  2759.  
  2760.  
  2761. setTimeout( () => {
  2762. document.dns(["c", [0, 0]]);
  2763. }, 100);
  2764. recentHealth += hasApple ? 20 : 40;
  2765.  
  2766. }
  2767.  
  2768. var runaway = false;
  2769.  
  2770. function handleMessage(m){
  2771. if (repeatingLast){
  2772. doNewSend(["ch", [lastWords]]);
  2773. }
  2774. var secondVote = autoattack;
  2775. for (let obj of Object.values(CORESTATE)){
  2776. if (obj.rel == "attack"){
  2777. console.log(obj)
  2778. if (obj.active == true){
  2779. secondVote = true;
  2780. } else {
  2781. secondVote = autoattack;
  2782. }
  2783. } else if (obj.rel == "run"){
  2784. if (obj.active == true){
  2785. runaway = true;
  2786. } else {
  2787. runaway = false;
  2788. }
  2789. }
  2790. }
  2791. autoattack = secondVote;
  2792.  
  2793. let td = new Uint8Array(m.data);
  2794. // console.info(td);
  2795. //console.info(td);
  2796. //console.info(td.slice(98,-1));
  2797. var infotest = msgpack5.decode(td);
  2798. var info;
  2799. if(infotest.length > 1) {
  2800. info = [infotest[0], ...infotest[1]];
  2801. if (info[1] instanceof Array){
  2802. info = info;
  2803. }
  2804. } else {
  2805. info = infotest;
  2806. }
  2807.  
  2808. // console.log(info);
  2809. //console.info("received");
  2810. //console.info(new Date().getTime());
  2811. if(!info) return;
  2812. //if(!["c","5", "3"].includes(info[0])) console.log(info[0])
  2813. if (inInstaProcess){
  2814. doNewSend(["2", [nearestPlayerAngle]]);
  2815. }
  2816. // doNewSend(["2", 0.45]);
  2817. if (info[0]=="3"){ //player update
  2818. botTag();
  2819. playersNear = [];
  2820. var locInfoNow = info[1];
  2821. //console.log(locInfoNow)
  2822. //console.info(locInfoNow);
  2823. for (var i=0;i<locInfoNow.length/13;i++){
  2824. var playerData = locInfoNow.slice(13*i, 13*i+13);
  2825. if (playerData[0]==MYID){
  2826. myCLAN = playerData[7];
  2827. myPlayer = new player(playerData[0], playerData[1], playerData[2], playerData[7]);
  2828.  
  2829. var newTraps = [];
  2830. for (let arr of allTraps){
  2831. let objx = arr[1];
  2832. let objy = arr[2];
  2833. let objtype = arr[arr.length-2];
  2834. console.log(myPlayer);
  2835. let totalDist = Math.sqrt( (objx-myPlayer.x)**2 + (objy-myPlayer.y)**2 );
  2836. console.log(totalDist);
  2837. if (objtype == 15 && totalDist < 100){
  2838. let spikeVal;
  2839. if (havePoison()) {
  2840. spikeVal = 8;
  2841. } else if (haveGreat()){
  2842. spikeVal = 7;
  2843. } else if (haveSpinning()){
  2844. spikeVal = 9;
  2845. } else {
  2846. spikeVal = 6;
  2847. }
  2848.  
  2849. for (var j=0;j<0;j++){
  2850. let angle = (-1 * Math.PI + ((Math.PI*2)/20)*j) - 0.1;
  2851. placeSpike(spikeVal, angle);
  2852. console.log("c.data " + j);
  2853. console.log("c.data " + angle);
  2854. }
  2855.  
  2856. CORESTATE.intrap.active = true;
  2857. CORESTATE.intrap.extra = arr[0]; //object id
  2858.  
  2859. } else if (objtype == 15 && totalDist < 1500){
  2860. newTraps.push(arr)
  2861. }
  2862. }
  2863. allTraps = newTraps;
  2864.  
  2865. if (myPlayer.y < 2400){
  2866. CORESTATE.inwater.active = false;
  2867. if (!hasWinter) return;
  2868. if (previousZone != "winter"){
  2869. previousZone = "winter";
  2870. IN_PROCESS = true;
  2871. document.dns(["13c", [0, obs("winter cap"), 0]]);
  2872. IN_PROCESS = false;
  2873. if (askMeAgain) triggerAlert("Winter Cap", obs("winter cap"));
  2874. }
  2875. } else if (myPlayer.y > 6850 && myPlayer.y < 7550){
  2876. CORESTATE.inwater.active = true;
  2877. if (!hasFlipper) return;
  2878. if (previousZone != "river"){
  2879. previousZone = "river";
  2880. IN_PROCESS = true;
  2881. document.dns(["13c", [0, obs("flipper hat") , 0]]);
  2882. IN_PROCESS = false;
  2883. if (askMeAgain) triggerAlert("Flipper Hat", obs("flipper hat"));
  2884. }
  2885. } else {
  2886. CORESTATE.inwater.active = false;
  2887. if (previousZone != "normal"){
  2888. previousZone = "normal";
  2889. $("#hatChangeAlert").animate({opacity: 0, top: -300});
  2890. if (askMeAgain) document.dns(["13c", [0, currentHat, 0]]);
  2891.  
  2892. }
  2893. }
  2894. if (!targets.every(x => x===false)){
  2895. let targetXDir = targets[0];
  2896. let targetYDir = targets[1];
  2897. let correctAngle = Math.atan2(targetYDir-myPlayer.y, targetXDir-myPlayer.x);
  2898. document.dns(["3", [correctAngle]]);
  2899. //For every 1 second of travel, you go forward 320 pixels!
  2900. let totalDist = Math.sqrt( (targetXDir-myPlayer.x)**2 + (targetYDir-myPlayer.y)**2 );
  2901. let totalTime = Math.ceil(totalDist/319.2);
  2902. document.getElementById("timeest").innerHTML = `${totalTime} seconds...`
  2903.  
  2904. if (totalDist < 100){
  2905. targets = [false, false];
  2906. document.dns(["3", [null]]);
  2907. $("#infoDiv").animate({opacity: 0});
  2908. }
  2909.  
  2910. }
  2911. continue
  2912. }
  2913. if (playerData[7]===null || playerData[7] != myCLAN){
  2914. var locPlayer = new player(playerData[0], playerData[1], playerData[2], playerData[7]);
  2915. playersNear.push(locPlayer);
  2916. }
  2917.  
  2918. }
  2919. var nearestPlayerPosition = playersNear.sort( (a,b) => pdist(a, myPlayer) - pdist(b, myPlayer) );
  2920. var nearestPlayer = nearestPlayerPosition[0];
  2921. focusPlayerObj = nearestPlayer;
  2922. if (nearestPlayer){
  2923. CORESTATE.nearenemy.active = true;
  2924. nearestPlayerAngle = Math.atan2( nearestPlayer.y-myPlayer.y, nearestPlayer.x-myPlayer.x);
  2925. if (autoattack){
  2926. doNewSend(["3", [nearestPlayerAngle]]);
  2927. ws.send(encodeSEND([ "c",[1, null] ]));
  2928. aim(nearestPlayer.x-myPlayer.x+window.innerWidth/2, nearestPlayer.y-myPlayer.y+window.innerHeight/2);
  2929.  
  2930. $("#tbtn").css({opacity: 1, marginLeft: nearestPlayer.x-myPlayer.x+window.innerWidth/2-20, marginTop: nearestPlayer.y-myPlayer.y+window.innerHeight/2-20});
  2931. } else if (runaway) {
  2932. doNewSend(["3", [-1 * nearestPlayerAngle]]);
  2933. //$("#tbtn").animate({opacity: 0.5});
  2934. }
  2935. } else {
  2936. CORESTATE.nearenemy.active = false;
  2937. // $("#tbtn").animate({opacity: 0.5});
  2938. }
  2939.  
  2940. }
  2941.  
  2942. if (info[0]=="6"){
  2943. var locInfo = info[1];
  2944. if (locInfo[locInfo.length-1].toString() == MYID){ //Object created
  2945. if (window.innerWidth >= 770){
  2946. console.log(locInfo);
  2947. var itemID = `actionBarItem${locInfo[locInfo.length-2]+16}`;
  2948. var imgURL = document.getElementById(itemID).style.backgroundImage.toString().match(/url\("(.+)?(?=")/)[1];
  2949. console.info(imgURL);
  2950. let mapDisplay = document.getElementById("mapDisplay").getBoundingClientRect();
  2951. let mapSize = [14365, 14365];
  2952. let boxSize = [$("#mapDisplay").width(), $("#mapDisplay").height()];
  2953. let targets = [locInfo[1], locInfo[2]].map(item => (130*item)/14365);
  2954. let x = mapDisplay.x + targets[0] - 6;
  2955. let y = mapDisplay.y + targets[1] - 6;
  2956. let newTarget = document.createElement("div");
  2957. newTarget.rawX = targets[0];
  2958. newTarget.rawY = targets[1];
  2959. newTarget.rimgURL = imgURL;
  2960. newTarget.style = `background-image: url("${imgURL}"); background-size: 12px 12px; width:12px; height:12px; position:absolute; left: ${x}px; top:${y}px; opacity:0; z-index:100; cursor: pointer;`;
  2961. newTarget.className = "mapTarget";
  2962. document.getElementsByTagName("body")[0].appendChild(newTarget);
  2963. $(newTarget).animate({opacity: 1});
  2964. allMooMooObjects[locInfo[0]] = newTarget;
  2965.  
  2966. }
  2967. } else {
  2968. console.log(locInfo);
  2969. for (var i=0;i<locInfo.length/8;i+=1){
  2970. let arr = locInfo.slice(i*8, (i+1)*8); console.log(arr)
  2971. let objtype = arr[arr.length-2];
  2972. if (objtype == 15){
  2973. allTraps.push(arr);
  2974. }
  2975.  
  2976. }
  2977.  
  2978.  
  2979. }
  2980. }
  2981.  
  2982. if (info[0]=="12"){
  2983.  
  2984. let newTraps = [];
  2985. for (let trap of allTraps){
  2986. if (trap[trap.length-2] != info[1]) newTraps.push(trap);
  2987. }
  2988. allTraps = newTraps;
  2989.  
  2990.  
  2991. console.error(info);
  2992. if (Object.keys(allMooMooObjects).includes(info[1].toString())){
  2993. allMooMooObjects[info[1]].remove();
  2994. }
  2995. if (CORESTATE.intrap.active){
  2996. if (CORESTATE.intrap.extra == info[1]){
  2997. CORESTATE.intrap.active = false;
  2998. let newTraps = [];
  2999. for (let trap of allTraps){
  3000. if (trap[trap.length-2] != info[1]) newTraps.push(trap);
  3001. }
  3002. allTraps = newTraps;
  3003. }
  3004. }
  3005. }
  3006.  
  3007. // console.info("-------------")
  3008. if (info[0] == "1" && !MYID){
  3009. MYID = info[1];
  3010. }
  3011.  
  3012.  
  3013. if (info[0] == "18" && info[4]=="1200") {
  3014. console.info(info);
  3015. bowWorked = true;
  3016. }
  3017.  
  3018. if (info[0] == "h" && info[1] == MYID && autoheal){
  3019. console.info("doing stuff");
  3020. console.info(info);
  3021. if (info[2] < 100 && info[2] > 0){
  3022. recentHealth = info[2];
  3023. console.info("RECEIVED:");
  3024. console.info(info);
  3025. //recentHealth += hasApple ? 20 : 40;
  3026. console.info("heal notif sent");
  3027. setTimeout( () => {
  3028. heal();
  3029. }, autoHealSpeed);
  3030. } else if (info[2] > 0) {
  3031. console.info("done healing");
  3032. recentHealth = 100;
  3033. if (foodInHand){
  3034. console.info("okay bad thing happened");
  3035. var dataTemplate5 = {"type": 2, "data":[], "options":{"compress":false}, "nsp": "/"};
  3036. dataTemplate5["data"]=["5", [0, true]];
  3037. let encoded5 = encodeSEND(dataTemplate5["data"]);
  3038. ws.send(encoded5);
  3039. console.info("corrected bad thing");
  3040. }
  3041.  
  3042. } else {
  3043. hasApple = true; //You've died tragically in combat; back to the apple for you!
  3044. console.info("Setting has apple to true from here");
  3045. }
  3046. }
  3047. else if(info[0] == "11"){
  3048. console.info("doing death");
  3049. for (var elem of Object.values(allMooMooObjects)){
  3050. console.info(elem);
  3051. elem.style.opacity = 0;
  3052. }
  3053. hasApple = true;
  3054. justDied = true;
  3055. recentHealth = 100;
  3056.  
  3057. }
  3058.  
  3059. }
  3060.  
  3061. function pdist(player1, player2){
  3062. return Math.sqrt( Math.pow((player2.y-player1.y), 2) + Math.pow((player2.x-player1.x), 2) );
  3063. }
  3064.  
  3065. function haveApple(){
  3066. console.info("Im being used and justDied is:" + justDied);
  3067. if (justDied){
  3068. hasApple = true;
  3069. return true;
  3070. }
  3071. if (hasApple) hasApple = isElementVisible(document.getElementById("actionBarItem16"));
  3072. return hasApple;
  3073. }
  3074.  
  3075. function havePoison(){
  3076. let hasPoison = true;
  3077. if (hasPoison) hasPoison = isElementVisible(document.getElementById("actionBarItem24"));
  3078. return hasPoison;
  3079. }
  3080.  
  3081. /*$(window).resize( () => {
  3082. for (var elem of Object.values(allMooMooObjects)){
  3083. let mapDisplay = document.getElementById("mapDisplay").getBoundingClientRect();
  3084. let mapSize = [14365, 14365];
  3085. let boxSize = [$("#mapDisplay").width(), $("#mapDisplay").height()];
  3086. let x = mapDisplay.x + parseInt(elem.rawX) - 6;
  3087. let y = mapDisplay.y + parseInt(elem.rawY) - 6;
  3088. console.log(x, y);
  3089. elem.style = `background-image: url("${elem.rimgURL}"); background-size: 12px 12px; width:12px; height:12px; position:absolute; left: ${x}px; top:${y}px; opacity:0; z-index:100; cursor: pointer;`;
  3090. }
  3091. });*/
  3092.  
  3093. function haveGreat(){
  3094. let hasGreat = true;
  3095. if (hasGreat) hasGreat = isElementVisible(document.getElementById("actionBarItem23"));
  3096. return hasGreat;
  3097. }
  3098.  
  3099. function haveSpinning(){
  3100. let hasSpinning = true;
  3101. if (hasSpinning) hasSpinning = isElementVisible(document.getElementById("actionBarItem25"));
  3102. return hasSpinning;
  3103. }
  3104.  
  3105. function doNewSend(sender){
  3106. ws.send(encodeSEND(sender));
  3107. }
  3108.  
  3109. function placeSpike(item, angle){
  3110. ws.send(encodeSEND( ["5", [item, null]]));
  3111. ws.send(encodeSEND([
  3112. "c",
  3113. [
  3114. 1,
  3115. angle ? angle : null
  3116. ]
  3117. ]));
  3118.  
  3119. ws.send(encodeSEND([
  3120. "c",
  3121. [
  3122. 0,
  3123. null
  3124. ]
  3125. ])); //spike function by
  3126. }
  3127.  
  3128. $("#mapDisplay").on("click", (event) => {
  3129. if (!targets.every(x=>x===false)) return;
  3130.  
  3131. $("#spotDiv").css({zIndex: 10000});
  3132. var xpos = event.pageX - $("#mapDisplay").offset().left;
  3133. var ypos = event.pageY - $("#mapDisplay").offset().top;
  3134. var mapWidth = $("#mapDisplay").width();
  3135. var mapHeight = $("#mapDisplay").height();
  3136. var shiftX = (xpos/mapWidth)*14365;
  3137. var shiftY = (ypos/mapHeight)*14365;
  3138. targets = [shiftX, shiftY];
  3139. var infoDiv = document.createElement("div");
  3140. infoDiv.innerHTML = `<h1 id="autotitle">You are currently in BaoMod auto-pilot.</h1>
  3141. <h3 id="arrivalest">You will arrive in <span id="timeest">30 seconds...</span></h3>
  3142.  
  3143. <button type="button" id="cancelTrip">Cancel</button>`;
  3144. infoDiv.id = "infoDiv";
  3145. document.body.prepend(infoDiv);
  3146.  
  3147. let spotDiv = document.createElement("div");
  3148. spotDiv.id = "spotDiv";
  3149. spotDiv.className = "spotDiv";
  3150. document.body.prepend(spotDiv);
  3151. $("#spotDiv").css({left: event.pageX, top: event.pageY});
  3152. $("#spotDiv").animate({width: '50px', height: '50px', marginLeft: '-25px', marginTop: '-25px', borderRadius: '25px', opacity: 0}, 2000);
  3153. var spotDivs = [];
  3154. let coreInterval = setInterval( () => {
  3155. console.log('looping');
  3156. if (targets.every(x=>x===false)){
  3157. clearInterval(coreInterval);
  3158. console.log('clearing');
  3159. for (let elementDiv of document.getElementsByClassName("spotDiv")){
  3160. document.body.removeChild(elementDiv);
  3161. }
  3162.  
  3163. } else {
  3164. let spotDiv = document.createElement("div");
  3165. spotDiv.id = "spotDiv";
  3166. spotDiv.className = "spotDiv";
  3167. document.body.prepend(spotDiv);
  3168. $("#spotDiv").css({left: event.pageX, top: event.pageY});
  3169. $("#spotDiv").animate({width: '50px', height: '50px', marginLeft: '-25px', marginTop: '-25px', borderRadius: '25px', opacity: 0}, 2000);
  3170. spotDivs.push(spotDiv);
  3171. }
  3172. }, 700);
  3173.  
  3174. })
  3175.  
  3176. document.dns = doNewSend;
  3177.  
  3178.  
  3179. function botTag(){
  3180. if (!botSpan || !isElementVisible(botSpan)){
  3181. botSpan = document.createElement("span");
  3182. botSpan.id = "botText";
  3183. var ageDiv = document.getElementById("ageText");
  3184. ageDiv.prepend(botSpan);
  3185. }
  3186.  
  3187. if (autoattack){
  3188. botSpan.innerHTML = "BOT "
  3189. console.log(botSpan);
  3190. console.log(botSpan.id)
  3191. console.log(botSpan.innerHTML)
  3192. } else {
  3193. $("#tbtn").animate({opacity: 0});
  3194. botSpan.innerHTML = "";
  3195. }
  3196. }
  3197.  
  3198. $(document).on("click", "#cancelTrip", () => {
  3199. targets = [false, false];
  3200. document.dns(["3", [null]]);
  3201. $("#infoDiv").animate({opacity: 0});
  3202. })
  3203.  
  3204. document.title="BaoMod - Heal "
  3205.  
  3206. document.addEventListener('keypress', (e)=>{
  3207.  
  3208.  
  3209. if (e.keyCode == 116 && document.activeElement.id.toLowerCase() !== 'chatbox'){
  3210. STATE+=1;
  3211. let coreIndex = STATE%2; //STATE%4;
  3212. //let truthArray = [ [1,2].includes(coreIndex), [0,1].includes(coreIndex)];
  3213. //autobull = truthArray[0];
  3214. autoheal = coreIndex == 0; //truthArray[1];
  3215. document.title = document.title=`BaoMod - Heal ${autoheal ? "ON" : "OFF"}` //"Heal " + (autoheal ? "ON" : "OFF") + " / Bull Hat " + (autobull ? "ON" : "OFF");
  3216. } else if (e.keyCode == trapKey && document.activeElement.id.toLowerCase() !== 'chatbox') { //Place a trap
  3217. console.log("UH OH")
  3218. var dataTemplate = {"data":[], "options":{"compress":true}, "nsp": "/", "type": 2};
  3219. var data50 = dataTemplate;
  3220. if (isElementVisible(document.getElementById("actionBarItem31"))){
  3221. data50["data"]=["5", [15, 0]];
  3222. } else {
  3223. data50["data"]=["5", [16, 0]];
  3224. }
  3225. ws.send(encodeSEND(data50["data"]));
  3226. var data51 = dataTemplate;
  3227. data51["data"]=[
  3228. "c",
  3229. [
  3230. 1,
  3231. null
  3232. ]
  3233. ];
  3234. let encoded2 = encodeSEND(data51["data"]);
  3235. ws.send(encoded2);
  3236. dataTemplate["data"]=["c",0, null];
  3237. let encoded = encodeSEND(dataTemplate);
  3238. ws.send(encoded);
  3239.  
  3240. } else if (e.keyCode == 80 && document.activeElement.id.toLowerCase() !== 'chatbox'){
  3241. autoattack = !autoattack
  3242. botTag();
  3243.  
  3244. } else if (e.keyCode == 103 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3245. repeatingLast = !repeatingLast;
  3246.  
  3247.  
  3248.  
  3249. } else if (e.keyCode == spikeKey && document.activeElement.id.toLowerCase() !== 'chatbox') { //Place a spike
  3250. if (havePoison()) {
  3251. placeSpike(8);
  3252. } else if (haveGreat()){
  3253. placeSpike(7);
  3254. } else if (haveSpinning()){
  3255. placeSpike(9);
  3256. } else {
  3257. placeSpike(6);
  3258. }
  3259.  
  3260. } else if (e.keyCode == instaKillKey && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3261. let allActiveItems = Array.from(document.getElementById("actionBar").children).filter(x=>x.style.display != "none");
  3262. let allActiveIDs = allActiveItems.map(x=>parseInt(x.id.replace("actionBarItem", "")));
  3263. switchToWep = allActiveIDs[0];
  3264. switchToRange = allActiveIDs[1];
  3265. console.info(currentAccessory);
  3266. var ctime = new Date().getTime();
  3267. console.info(inInstaProcess)
  3268. if (!inInstaProcess){
  3269. console.info("got in");
  3270. inInstaProcess = true
  3271. IN_PROCESS = true;
  3272.  
  3273. doNewSend(["13c", [0, bullHelm, 0]]);
  3274. if (currentAccessory == monkeyTail){
  3275. doNewSend(["13c", [0, 0, 1]]);
  3276. }
  3277. doNewSend(["5", [switchToWep, true]]);
  3278. console.info("Starting at 0");
  3279.  
  3280.  
  3281.  
  3282.  
  3283. setTimeout( () => {
  3284. doNewSend(["2", [nearestPlayerAngle]]);
  3285. doNewSend([
  3286. "c",
  3287. [
  3288. 1,
  3289. null
  3290. ]
  3291. ]);
  3292. console.info(`Sending swing at ${new Date().getTime() - ctime}`);
  3293. ctime = new Date().getTime();
  3294. }, 20);
  3295.  
  3296.  
  3297.  
  3298. setTimeout( () => {
  3299. doNewSend(["2", [nearestPlayerAngle]]);
  3300. doNewSend(["5", [switchToRange, true]]);
  3301. console.info(`Changed weapon at ${new Date().getTime() - ctime}`);
  3302. ctime = new Date().getTime();
  3303. }, document.timeTween); //120-140?
  3304.  
  3305.  
  3306.  
  3307.  
  3308. setTimeout( () => {
  3309. doNewSend(["c", [0, null]]);
  3310. doNewSend(["13c", [0, currentHat, 0]]);
  3311. if (currentAccessory == monkeyTail){
  3312. doNewSend(["13c", [0, currentAccessory, 1]]);
  3313. }
  3314. doNewSend(["5", [switchToWep, true]]);
  3315. console.info(`Finished at ${new Date().getTime() - ctime}`);
  3316. ctime = new Date().getTime();
  3317. }, 600);
  3318.  
  3319. setTimeout( () => {
  3320. if (bowWorked){
  3321. doNewSend(["5", [switchToRange, true]]);
  3322. }
  3323. }, 730);
  3324.  
  3325. setTimeout( () => {
  3326. if (bowWorked){
  3327. doNewSend([
  3328. "c",
  3329. [
  3330. 1,
  3331. null
  3332. ]
  3333. ]);
  3334. }
  3335. }, 840);
  3336.  
  3337. setTimeout( () => {
  3338. if (bowWorked){
  3339. doNewSend(["c", [0, null]]);
  3340. }
  3341. }, 950);
  3342.  
  3343. setTimeout( () => {
  3344. inInstaProcess = false;
  3345. if (bowWorked){
  3346. doNewSend(["5", [switchToWep, true]]);
  3347. setTimeout( () => {
  3348. doNewSend(["c", [0, null]]);
  3349. }, 300);
  3350. bowWorked = false;
  3351. IN_PROCESS = false;
  3352. }
  3353. IN_PROCESS = false;
  3354. }, 1060);
  3355.  
  3356.  
  3357. }
  3358.  
  3359.  
  3360.  
  3361.  
  3362. } else if (document.activeElement.id.toLowerCase() !== 'chatbox' ){
  3363. if (e.keyCode == 108){ //use pressed "l"; spikes
  3364.  
  3365.  
  3366. let spikeVal;
  3367. if (havePoison()) {
  3368. spikeVal = 8;
  3369. } else if (haveGreat()){
  3370. spikeVal = 7;
  3371. } else if (haveSpinning()){
  3372. spikeVal = 9;
  3373. } else {
  3374. spikeVal = 6;
  3375. }
  3376.  
  3377.  
  3378. for (var i=0;i<4;i++){
  3379. let angle = (Math.PI/2)*i;
  3380. /*let x = Math.cos(angle)*50;
  3381. let y = Math.sin(angle)*50;
  3382. console.log(x, y);
  3383. aim(x, y);*/
  3384. document.dns(["2", [angle]]);
  3385. placeSpike(spikeVal);
  3386.  
  3387. }
  3388.  
  3389.  
  3390. } else if (e.keyCode == 111){
  3391. for (var j=0;j<4;j++){
  3392. document.dns(["2", [(Math.PI/2)*j]]);
  3393. document.dns(["5", [15, 0]]);
  3394. document.dns(["c", [1, null]]);
  3395. document.dns(["c", [0, null]]);
  3396. }
  3397.  
  3398. } else if (e.keyCode == iPressKey){
  3399.  
  3400. if (CORESTATE.ipress.rel){
  3401. if (CORESTATE.ipress.rel == "puton"){
  3402. document.dns(["13c", [0, putonName, 0]]);
  3403. } else if (CORESTATE.ipress.rel == "place"){
  3404. placeSpike(placeName);
  3405. }
  3406. }
  3407. }
  3408. else if (e.keyCode == 104){
  3409. if (focusPlayerObj && focusPlayerObj.clan){
  3410. document.dns(["10", [focusPlayerObj.clan]]);
  3411. }
  3412. }
  3413. }
  3414. });
  3415.  
  3416.  
  3417. document.body.oncontextmenu = (e) => {
  3418.  
  3419. noallow = true;
  3420.  
  3421. setTimeout( () => {
  3422.  
  3423. let allActiveItems = Array.from(document.getElementById("actionBar").children).filter(x=>x.style.display != "none");
  3424. let allActiveIDs = allActiveItems.map(x=>parseInt(x.id.replace("actionBarItem", "")));
  3425. switchToWep = allActiveIDs[0];
  3426. switchToRange = allActiveIDs[1];
  3427. console.info(currentAccessory);
  3428. var ctime = new Date().getTime();
  3429. console.info(inInstaProcess)
  3430. if (!inInstaProcess){
  3431. console.info("got in");
  3432. inInstaProcess = true
  3433. IN_PROCESS = true;
  3434.  
  3435. doNewSend(["13c", [0, bullHelm, 0]]);
  3436. if (currentAccessory == monkeyTail){
  3437. doNewSend(["13c", [0, 0, 1]]);
  3438. }
  3439. doNewSend(["5", [switchToWep, true]]);
  3440. console.info("Starting at 0");
  3441.  
  3442.  
  3443.  
  3444.  
  3445. setTimeout( () => {
  3446. doNewSend(["2", [nearestPlayerAngle]]);
  3447. doNewSend([
  3448. "c",
  3449. [
  3450. 1,
  3451. null
  3452. ]
  3453. ]);
  3454. console.info(`Sending swing at ${new Date().getTime() - ctime}`);
  3455. ctime = new Date().getTime();
  3456. }, 20);
  3457.  
  3458.  
  3459.  
  3460. setTimeout( () => {
  3461. doNewSend(["2", [nearestPlayerAngle]]);
  3462. doNewSend(["5", [switchToRange, true]]);
  3463. console.info(`Changed weapon at ${new Date().getTime() - ctime}`);
  3464. ctime = new Date().getTime();
  3465. }, document.timeTween); //120-140?
  3466.  
  3467.  
  3468.  
  3469.  
  3470. setTimeout( () => {
  3471. doNewSend(["c", [0, null]]);
  3472. doNewSend(["13c", [0, currentHat, 0]]);
  3473. if (currentAccessory == monkeyTail){
  3474. doNewSend(["13c", [0, currentAccessory, 1]]);
  3475. }
  3476. doNewSend(["5", [switchToWep, true]]);
  3477. console.info(`Finished at ${new Date().getTime() - ctime}`);
  3478. ctime = new Date().getTime();
  3479. }, 600);
  3480.  
  3481. setTimeout( () => {
  3482. if (bowWorked){
  3483. doNewSend(["5", [switchToRange, true]]);
  3484. }
  3485. }, 730);
  3486.  
  3487. setTimeout( () => {
  3488. if (bowWorked){
  3489. doNewSend([
  3490. "c",
  3491. [
  3492. 1,
  3493. null
  3494. ]
  3495. ]);
  3496. }
  3497. }, 840);
  3498.  
  3499. setTimeout( () => {
  3500. if (bowWorked){
  3501. doNewSend(["c", [0, null]]);
  3502. }
  3503. }, 950);
  3504.  
  3505. setTimeout( () => {
  3506. inInstaProcess = false;
  3507. if (bowWorked){
  3508. doNewSend(["5", [switchToWep, true]]);
  3509. setTimeout( () => {
  3510. doNewSend(["c", [0, null]]);
  3511. }, 300);
  3512. bowWorked = false;
  3513. IN_PROCESS = false;
  3514. }
  3515. IN_PROCESS = false;
  3516. }, 1060);
  3517.  
  3518.  
  3519. }
  3520.  
  3521.  
  3522.  
  3523.  
  3524. }, 150);
  3525. }
  3526.  
  3527.  
  3528. document.ps = placeSpike;
  3529.  
  3530.  
  3531.  
  3532.  
  3533.  
  3534. var _msgs = [""];
  3535. var msgs = _msgs;
  3536. var msgCycleSwitch = false;
  3537. var shift = false;
  3538. var esc = false;
  3539. var home = false;
  3540. var chat;
  3541. var msgNum = 0;
  3542.  
  3543. var socket = null;
  3544.  
  3545. var scriptSetup = false;
  3546.  
  3547. WebSocket = class extends WebSocket {
  3548. constructor(...arg) {
  3549. super(...arg);
  3550. if (!scriptSetup){
  3551. scriptSetup = true;
  3552. styleInit();
  3553. ren_overlay();
  3554. window.onbeforeunload = function (){
  3555. return 'Are you sure you want to leave?';
  3556. };
  3557. }
  3558. socket = this;
  3559. }
  3560. };
  3561.  
  3562. if (storageAvailable('localStorage')){
  3563. if (!localStorage.getItem("msgs")){
  3564. localStorage.setItem("msgs", JSON.stringify(msgs));
  3565. }else{
  3566. let temp;
  3567. try{
  3568. temp = JSON.parse(localStorage.getItem("msgs"));
  3569. }
  3570. catch (e){
  3571. alert("Invalid Array! Setting default...");
  3572. saveData();
  3573. temp = "";
  3574. }
  3575. if (temp !== ""){
  3576. msgs = temp;
  3577. }
  3578. }
  3579. }
  3580.  
  3581. const overlay = {};
  3582. overlay.keyCode = 36;
  3583. overlay.toggle = false;
  3584. overlay.inputString = msgs.join("\n");
  3585. overlay.tempMsgs = _msgs;
  3586.  
  3587. function styleInit() {
  3588. addGlobalStyle(`#chatCyclerUI{padding: 0.2em; margin:0.2em; position: absolute;top: 0;left: 0;width: 30%;
  3589. background-color: rgba(0,200,200,0.75);display:none;}`);
  3590. addGlobalStyle(".table{ display: table; text-align: center; width: 100%; height: 80%;}");
  3591. addGlobalStyle(".row{ display: table-row; }");
  3592. addGlobalStyle(`.cell{ display: table-cell; padding: 0px 0.3em;border: 1px solid black;}`);
  3593. addGlobalStyle(`.backRed{background-color:#f14e54}`);
  3594. function addGlobalStyle(css) {
  3595. var head, style;
  3596. head = document.getElementsByTagName('head')[0];
  3597. if (!head) {
  3598. return;
  3599. }
  3600. style = document.createElement('style');
  3601. style.type = 'text/css';
  3602. style.innerHTML = css;
  3603. head.appendChild(style);
  3604. }
  3605. }
  3606.  
  3607. function toggleOverlay(tf){
  3608. if (tf){
  3609. document.querySelector('#chatCyclerUI').style.display = "block";
  3610. }else{
  3611. document.querySelector('#chatCyclerUI').style.display = "none";
  3612. }
  3613. };
  3614.  
  3615. function ren_overlay(){
  3616. const title = `<div style="font-size:32px">Chat Cycle Menu</div>`;
  3617. const descr = `<div>Press HOME to toggle this menu.</div>`;
  3618. const body = `
  3619. <div class="table">
  3620. <div class="row">Message Cycle Settings
  3621. </div>
  3622. <div class="row">
  3623. <div class="cell" style="vertical-align:middle">Messages</div>
  3624. <div class="cell" style="vertical-align:middle"><textarea name="overlay_messages" rows=4 cols=32 style="resize:none"></textarea></div>
  3625. </div>
  3626. <div class="row">
  3627. <div class="cell" style="vertical-align:middle">Update Message Cycle</div>
  3628. <div class="cell" style="vertical-align:middle"><input type="button" name="overlay_update_cycle" value="Update"></div>
  3629. </div>
  3630. <br>
  3631. <div class="row">Message Cycle Toggle
  3632. </div>
  3633. <div class="row">
  3634. <div class="cell" style="vertical-align:middle">Toggle<br><span class="overlay_cycle_toggle_value"><span style="font-size:24px;color:#FF0000";>off</span></span></div>
  3635. <div class="cell" style="vertical-align:middle"><input type="button" name="overlay_cycle_toggle" value="Toggle"></div>
  3636. </div>
  3637. </div>`;
  3638. const footer = `<div style="font-size:24px;color:red">Made by Mega_Mewthree</div>`;
  3639. const temp = `${title} ${body} ${descr} ${footer}`;
  3640. const d = document.createElement("div");
  3641. d.id = "chatCyclerUI";
  3642. d.innerHTML = temp;
  3643. d.style.zIndex = 999999;
  3644. document.body.appendChild(d);
  3645. const val = document.querySelector('textarea[name="overlay_messages"]');
  3646. val.value = overlay.inputString;
  3647. val.addEventListener('input', function(e) {
  3648. overlay.inputString = e.target.value;
  3649. });
  3650. document.querySelector('input[name="overlay_update_cycle"]').addEventListener('click', function() {
  3651. if (!overlay.inputString){
  3652. overlay.tempMsgs = _msgs;
  3653. }else{
  3654. overlay.tempMsgs = overlay.inputString.split(/\r?\n/);
  3655. }
  3656. msgNum = 0;
  3657. msgs = overlay.tempMsgs;
  3658. saveData();
  3659. });
  3660. document.querySelector('input[name="overlay_cycle_toggle"]').addEventListener('click', function(e) {
  3661. msgCycleSwitch = !msgCycleSwitch;
  3662. if (msgCycleSwitch){
  3663. chat = setInterval(autoChat, 2000);
  3664. document.querySelector('.overlay_cycle_toggle_value').innerHTML = `<span style="font-size:24px;color:#00FF00";>on</span>`;
  3665. }else{
  3666. document.querySelector('.overlay_cycle_toggle_value').innerHTML = `<span style="font-size:24px;color:#FF0000";>off</span>`;
  3667. clearInterval(chat);
  3668. msgNum = 0;
  3669. }
  3670. });
  3671. }
  3672.  
  3673. function concatBuffers(buffer1, buffer2){
  3674. var tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength);
  3675. tmp.set(new Uint8Array(buffer1), 0);
  3676. tmp.set(new Uint8Array(buffer2), buffer1.byteLength);
  3677. return tmp.buffer;
  3678. }
  3679.  
  3680. const four = Uint8Array.from([4]).buffer;
  3681.  
  3682. function autoChat(){
  3683. socket && socket.send(msgpack.encode(["ch", [msgs[msgNum]]]));
  3684. msgNum++;
  3685. if (msgNum >= msgs.length) msgNum = 0;
  3686. }
  3687.  
  3688. function storageAvailable(type){
  3689. try{
  3690. var storage = window[type],
  3691. x = '__storage_test__';
  3692. storage.setItem(x, x);
  3693. storage.removeItem(x);
  3694. return true;
  3695. }
  3696. catch(e){
  3697. return false;
  3698. }
  3699. }
  3700.  
  3701. function saveData(){
  3702. if (storageAvailable('localStorage')){
  3703. localStorage.setItem("msgs", JSON.stringify(msgs));
  3704. }
  3705. }
  3706.  
  3707. window.addEventListener('keydown', function (event){
  3708. if (overlay.toggle) event.stopImmediatePropagation();
  3709. if (!esc && event.keyCode === 27){ //ESC
  3710. msgCycleSwitch = !msgCycleSwitch;
  3711. if (msgCycleSwitch){
  3712. chat = setInterval(autoChat, 2000);
  3713. }else{
  3714. clearInterval(chat);
  3715. msgNum = 0;
  3716. }
  3717. esc = true;
  3718. }
  3719. if (!home && event.keyCode === overlay.keyCode){ //HOME
  3720. overlay.toggle = !overlay.toggle;
  3721. toggleOverlay(overlay.toggle);
  3722. home = true;
  3723. }
  3724. });
  3725.  
  3726. window.addEventListener('keypress', function (event){
  3727. if (overlay.toggle) event.stopImmediatePropagation();
  3728. });
  3729.  
  3730. window.addEventListener('keyup', function (event){
  3731. if (overlay.toggle) event.stopImmediatePropagation();
  3732. if (event.keyCode == 27){
  3733. esc = false;
  3734. }else if (event.keyCode == 36){
  3735. home = false;
  3736. }
  3737. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement