Facebook
From SunnyCakes YT, 3 Years ago, written in PHP.
Embed
Download Paste or View Raw
Hits: 236
  1. // ==UserScript==
  2. // @name        ?CookieMod?
  3. // @namespace    -
  4. // @version     2.0
  5. // @description  'BEST HACK TO MOOMOO IO' Mod tools - 【HatMacro & settings - ESC】【Better Map】 【More FPS & CPS】【AutoChat - 8 Numpad / ▲】【ServerCrash - 2 Numpad / ▼】【KillCheat?】【LabyWebsite - top left】【Windmill - N】【CircleTrap/boostpad - I】【CircleWindmill - O】【CX Insta [double spike] - spacebar】【Boost&spike - G】【AutoHeal】【Insta - R】【Age1 Insta - U】 【WeaponRadius [Katana, Sword, Poleram]】【More FPS * Choose 0-25】【More CPS * 30】【-50% ClownHat chance】【Aimcursor】【Map outlined in blue】【auto instakill bot need 50+ food】【working on regular bot mode】
  6. // @author      Sunnycakes
  7. // @match        *://moomoo.io/*
  8. // @match        *://sandbox.moomoo.io/*
  9. // @grant        none
  10. // @require https://greasyfork.org/scripts/368273-msgpack/code/msgpack.js?version=598723
  11. // @require http://code.jquery.com/jquery-3.3.1.min.js
  12. // @require https://code.jquery.com/ui/1.12.0/jquery-ui.min.js
  13. // @require https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.js
  14. // ==/UserScript==
  15.  
  16. $('#mapDisplay').css({
  17.     'background': 'url("http://i.imgur.com/Qllo1mA.png")'
  18. });
  19.  
  20.  
  21. $("#mapDisplay").css({background: `url('https://imgur.com/z699FUE')`});
  22. $("#mapDisplay").css({
  23.     'border-radious':'300px',
  24.     'border':'3px solid #5196ab'
  25. });
  26. $("#consentBlock").css({display: "none"});
  27. //$("#youtuberOf").css({display: "none"});
  28. $("#mapDisplay").css({background: `url('https://imgur.com/z699FUE')`});document.getElementById('enterGame').innerHTML = 'Go Boom!';
  29. document.getElementById("gameName").style.color = "Red";
  30. document.getElementById('loadingText').innerHTML = 'Loadin Get a Cookie';
  31. document.getElementById('nameInput').placeholder = "Name";
  32. document.getElementById('chatBox').placeholder = "Chat";
  33. document.getElementById("pingDisplay").style.color = "red";
  34. document.getElementById('diedText').innerHTML = 'You Die';
  35. document.getElementById('diedText').style.color = "Red";
  36.  
  37. document.getElementById("storeHolder").style = "height: 1500px; width: 450px;"
  38.  
  39. document.getElementById('adCard').remove();
  40. document.getElementById('errorNotification').remove();
  41.  
  42. document.getElementById("leaderboard").style.color = "red";
  43. document.getElementById("gameName").style.color = "Red";
  44. document.getElementById("setupCard").style.color = "Red";
  45. document.getElementById('gameName').innerHTML = '?CookieMod?';
  46. document.getElementById("promoImg").remove();
  47. document.getElementById("scoreDisplay").style.color = "Red";
  48. document.getElementById("woodDisplay").style.color = "Red";
  49. document.getElementById("stoneDisplay").style.color = "Red";
  50. document.getElementById("killCounter").style.color = "Red";
  51. document.getElementById("foodDisplay").style.color = "Red";
  52. document.getElementById("ageText").style.color = "red";
  53. document.getElementById("allianceButton").style.color = "black";
  54. document.getElementById("chatButton").style.color = "black";
  55. document.getElementById("storeButton").style.color = "black";
  56.     $("#mapDisplay").css({background: `url('https://imgur.com/z699FUE')`});
  57. $("#mapDisplay").css({
  58.   'border-radious':'350px',
  59.   'border':'3px solid #ff0202'
  60. });
  61.  
  62. $('.menuCard').css({'white-space': 'normal',
  63.                     'text-align': 'center',
  64.                     'background-color': 'rgba(0, 0, 0, 0)',
  65.                     '-moz-box-shadow': '0px 0px rgba(255, 255, 255, 0)',
  66.                     '-webkit-box-shadow': '0px 0px rgba(255, 255, 255, 0)',
  67.                     'box-shadow': '0px 0px rgba(255, 255, 255, 0)',
  68.                     '-webkit-border-radius': '0px',
  69.                     '-moz-border-radius': '0px',
  70.                     'border-radius': '0px',
  71.                     'margin': '15px',
  72.                     'margin-top': '15px'});
  73.  
  74. $('#menuContainer').css({'white-space': 'normal'});
  75.  
  76. $('#nativeResolution').css({'cursor': 'pointer'});
  77.  
  78. $('#playMusic').css({'cursor': 'pointer'});
  79.  
  80. $('#guideCard').css({'overflow-y': 'hidden',
  81.                      'margin-top': 'auto',
  82.                      'margin-bottom': '30px'});
  83.  
  84. $('#gameName').css({'color': '#000000',
  85.                     'text-shadow': '0 1px 0 rgba(231, 76, 60), 0 2px 0 rgba(231, 76, 60), 0 3px 0 rgba(231, 76, 60), 0 4px 0 rgba(231, 76, 60), 0 5px 0 rgba(231, 76, 60), 0 6px 0 rgba(231, 76, 60), 0 7px 0 rgba(231, 76, 60), 0 8px 0 rgba(231, 76, 60), 0 9px 0 rgba(255, 0, 0)',
  86.                     'text-align': 'center',
  87.                     'font-size': '156px',
  88.                     'margin-bottom': '-30px'});
  89.  
  90. aa
  91. $('#skinColorHolder').css({'margin-bottom': '30.75px'});
  92.  
  93. $('.settingRadio').css({'margin-bottom': '30.75px'});
  94.  
  95.  
  96.  
  97. $('#linksContainer2').css({'-webkit-border-radius': '0px 0 0 0',
  98.                            '-moz-border-radius': '0px 0 0 0',
  99.                            'border-radius': '0px 0 0 0',
  100.                            'right': '44%',
  101.                            'left': '44%',
  102.                            'background-color': 'rgba(0, 0, 0, 0)',
  103.                            'text-align': 'center',
  104.                            'bottom': '12px'});
  105.  
  106. $('#gameName').css({'color': '#000000',
  107.                     'text-shadow': '0 1px 0 rgba(231, 76, 60), 0 2px 0 rgba(231, 76, 60), 0 3px 0 rgba(231, 76, 60), 0 4px 0 rgba(231, 76, 60), 0 5px 0 rgba(231, 76, 60), 0 6px 0 rgba(231, 76, 60), 0 7px 0 rgba(231, 76, 60), 0 8px 0 rgba(231, 76, 60), 0 9px 0 rgba(255, 0, 0)',
  108.                     'text-align': 'center',
  109.                     'font-size': '156px',
  110.                     'margin-bottom': '-30px'});
  111.  
  112. $('pingDisplay').css({'color': '#ffcf23',
  113.                     '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)',
  114.                     'text-align': 'center',
  115.                     'font-size': '156px',
  116.                     'margin-bottom': '-30px'});
  117.  
  118. $('#loadingText').css({'color': '#000000',
  119.                        'background-color': 'rgba(0, 0, 0, 0)',
  120.                        'padding': '8px',
  121.                        'right': '150%',
  122.                        'left': '150%',
  123.                        'margin-top': '40px'});
  124.  
  125. $('.ytLink').css({'color': '#144db4',
  126.                   'padding': '8px',
  127.                   'background-color': 'rgba(255, 0, 0, 0)'});
  128.  
  129. $('.menuLink').css({'color': '#144db4'});
  130.  
  131. $('#nameInput').css({'border-radius': '0px',
  132.                      '-moz-border-radius': '0px',
  133.                      '-webkit-border-radius': '0px',
  134.                      'border': 'hidden'});
  135.  
  136. $('#serverSelect').css({'cursor': 'pointer',
  137.                         'color': '#000000',
  138.                         'background-color': '#808080',
  139.                         'border': 'hidden',
  140.                         'font-size': '20px'});
  141.  
  142. $('.menuButton').css({'border-radius': '0px',
  143.                       '-moz-border-radius': '0px',
  144.                       '-webkit-border-radius': '0px'});
  145.  
  146. $('#promoImgHolder').css({'position': 'absolute',
  147.                           'bottom': '-7%',
  148.                           'left': '20px',
  149.                           'width': '420px',
  150.                           'height': '236.25px',
  151.                           'padding-bottom': '18px',
  152.                           'margin-top': '0px'});
  153.  
  154. $('#adCard').css({'position': 'absolute',
  155.                   'bottom': '-7%',
  156.                   'right': '20px',
  157.                   'width': '420px',
  158.                   'height': '236.25px',
  159.                   'padding-bottom': '18px'});
  160.  
  161.  
  162. $('.menuHeader').css({'color': 'rgba(255, 255, 255, 1)'});
  163.  
  164. $('#killCounter').css({'color': '#ededed'});
  165.  
  166. $('#diedText').css({'background-color': 'rgba(0, 0, 0, 0)'});
  167.  
  168. $('#gameCanvas').css({'background-color': '#f4f4f4'});
  169.  
  170. $('#allianceButton').css({'color': 'rgba(241, 241, 241, 1)'});
  171.  
  172. $('#storeButton').css({'color': 'rgba(241, 241, 241, 1)'});
  173.  
  174. $('#chatButton').css({'color': 'rgba(241, 241, 241, 1)'});
  175.  
  176. $('.gameButton').css({'-webkit-border-radius': '0px 0 0 0',
  177.                       '-moz-border-radius': '0px 0 0 0',
  178.                       'border-radius': '0px 0 0 0',
  179.                       'background-color': 'rgba(0, 0, 0, 0.4)'});
  180.  
  181.     $('#partyButton').css({'color': '#000000',
  182. 'text-shadow': '0 3px 0 rgba(231, 76, 60), 0 3px 0 rgba(231, 76, 60), 0 3px 0 rgba(231, 76, 60), 0 3px 0 rgba(231, 76, 60), 0 3px 0 rgba(231, 76, 60), 0 3px 0 rgba(231, 76, 60), 0 3px 0 rgba(231, 76, 60), 0 3px 0 rgba(231, 76, 60), 0 3px 0 rgba(255, 0, 0)',
  183. 'text-align': 'center',
  184. 'font-size': '30px',
  185. 'margin-bottom': '30px'});
  186.  
  187.         $('#joinPartyButton').css({'color': '#000000',
  188. 'text-shadow': '0 3px 0 rgba(231, 76, 60), 0 3px 0 rgba(231, 76, 60), 0 3px 0 rgba(231, 76, 60), 0 3px 0 rgba(231, 76, 60), 0 3px 0 rgba(231, 76, 60), 0 3px 0 rgba(231, 76, 60), 0 3px 0 rgba(231, 76, 60), 0 3px 0 rgba(231, 76, 60), 0 3px 0 rgba(255, 0, 0)',
  189. 'text-align': 'center',
  190. 'font-size': '30px',
  191. 'margin-bottom': '30px'});
  192.  
  193. $('.uiElement, .resourceDisplay').css({'-webkit-border-radius': '0px',
  194.                                        '-moz-border-radius': '0px',
  195.                                        'border-radius': '0px',
  196.                                        'background-color': 'rgba(0, 0, 0, 0.25);'});
  197.  
  198. $('#chatBox').css({'-webkit-border-radius': '0px',
  199.                    '-moz-border-radius': '0px',
  200.                    'border-radius': '700px',
  201.                    'background-color': 'rgba(0, 0, 0, 0.18)',
  202.                    'text-align': 'center'});
  203.  
  204. $('#foodDisplay').css({'color': '#F40D0D'});
  205. $('#killCounter').css({'color': '#F40D0D'});
  206. $('#woodDisplay').css({'color': '#49FF00'});
  207. $('#stoneDisplay').css({'color': '#555252'});
  208. $('#scoreDisplay').css({'color': '#ffd700'});
  209.  
  210. $('#ageBar').css({'-webkit-border-radius': '0px',
  211.                   '-moz-border-radius': '0px',
  212.                   'border-radius': '0px',
  213.                   'background-color': 'rgba(0, 0, 0, 0.4)'});
  214. $('#ageBarBody').css({'-webkit-border-radius': '0px',
  215.                       '-moz-border-radius': '0px',
  216.                       'border-radius': '0px',
  217.                       'background-color': '#FF0000'});
  218.  
  219. $('.storeTab').css({'-webkit-border-radius': '0px',
  220.                     '-moz-border-radius': '0px',
  221.                     'border-radius': '0px',
  222.                     'background-color': 'rgba(0, 0, 0, 0.4)'});
  223.  
  224. $('#storeHolder').css({'-webkit-border-radius': '0px',
  225.                        '-moz-border-radius': '0px',
  226.                        'border-radius': '0px',
  227.                        'background-color': 'rgba(0, 0, 0, 0.4)'});
  228.  
  229. $('#allianceHolder').css({'-webkit-border-radius': '0px',
  230.                           '-moz-border-radius': '0px',
  231.                           'border-radius': '0px',
  232.                           'background-color': 'rgba(0, 0, 0, 0.4)'});
  233.  
  234. $('.actionBarItem').css({'-webkit-border-radius': '0px',
  235.                          'border-radius': '0px',
  236.                          'background-color': 'rgba(0, 0, 0, 0.4)'});
  237.  
  238.  
  239. $("#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">"Z"Tank Gear | "C" Turret Gear | "K" Bull Helmet | "J" Samurai Armor | "B" Soldier Helmet | "Shift" Fish Hat | "/" Winter Cap | "," Booster Helmet</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>');
  240. (function() {var css = [
  241.  
  242.         "div#adCard, ",
  243.         "  #twitterFollow, ",
  244.         "  #youtubeFollow, ",
  245.         "  #downloadButtonContainer, ",
  246.         "  #promoImg {",
  247.         "    display: none;",
  248.         "  }",
  249.         "",
  250.         "  #featuredYoutube > a.ytLink, ",
  251.         "  a {",
  252.         "    font-size: 15px;",
  253.         "    color: #ff0000      !important;",
  254.         "    font-family: mv boli;",
  255.         "  }",
  256.         "",
  257.         "  .uiElement, ",
  258.         "  .resourceDisplay, ",
  259.         "  .actionBarItem {",
  260.         "    border: 3px solid rgb(255, 2, 2);",
  261.         "    border-radius: 50px !important;",
  262.         "    transition: 0.5s;",
  263.         "  }",
  264.         "",
  265.         "  .uiElement:hover, ",
  266.         "  .resourceDisplay:hover, ",
  267.         "  .actionBarItem:hover {",
  268.         "    background-color: rgba(0,0,0) !important;",
  269.         "    border: 3px solid rgba(70, 130, 180, 0.5);",
  270.         "    border-radius: 100px !important;",
  271.         "  }",
  272.         "",
  273.         "  .actionBarItem {",
  274.         "    width: 56px;",
  275.         "    height: 56px;",
  276.         "    background-position: center; ",
  277.         "    background-size: 55px 55px;",
  278.         "  }",
  279.         "",
  280.         "  .menuHeader {",
  281.         "    color: #ff0000",
  282.         "    font-family: mv boli;",
  283.         "  }",
  284.         "",
  285.         "  #moddedMenu:hover > .titleMM {",
  286.         "    transform: rotate(0deg) translate(0,-1580%)",
  287.         "  }",
  288.         "",
  289.         "  .storeItem, ",
  290.         "  .storeTab, ",
  291.         "  .allianceButtonM, ",
  292.         "  #allianceInput::placeholder, ",
  293.         "  .allianceItem, ",
  294.         "  .joinAlBtn {",
  295.         "    color: #ff0000 !important;",
  296.         "    font-family: mv boli;",
  297.         "  }",
  298.         "",
  299.         "  .menuText {",
  300.         "    font-size: 18px;",
  301.         "    font-family: mv boli;",
  302.         "    color: #ff0000",
  303.         "    margin-bottom: 10px;",
  304.         "  }",
  305.         "",
  306.         "  .settingRadio  {",
  307.         "    font-family: mv boli;",
  308.         "    color: #ff0000",
  309.         "  }",
  310.         "",
  311.         "  .switch {",
  312.         "    margin-top: 5px;",
  313.         "    margin-left: 10px;",
  314.         "    position: absolute;",
  315.         "    width: 60px;",
  316.         "    height: 34px;",
  317.         "    transition: opacity 1s;",
  318.         "    opacity: 0;",
  319.         "  }",
  320.         "",
  321.         "  .text {",
  322.         "    bottom: 76%;",
  323.         "    position: absolute;",
  324.         "    color: #ff0000;",
  325.         "    font-size: 20px;",
  326.         "    left: 0%;",
  327.         "    display: none;",
  328.         "    transition: 1s;",
  329.         "  }",
  330.         "",
  331.         "  .text > b { ",
  332.         "    font-size: 20px;",
  333.         "    color: #ff0000;",
  334.         "  }",
  335.         "",
  336.         "  b:hover { ",
  337.         "    color: #ff0000;",
  338.         "  }",
  339.         "",
  340.         "  .one > .text {",
  341.         "    top: 5.5%;",
  342.         "  }",
  343.         "",
  344.         "  .two > .text {",
  345.         "    top: 10.7%;",
  346.         "  }",
  347.         "",
  348.         "  .three > .text {",
  349.         "    top: 37.5%;",
  350.         "  }",
  351.         "",
  352.         "  .four > .text {",
  353.         "    top: 47.5%;",
  354.         "  }",
  355.         "",
  356.         "  .five > .text {",
  357.         "    top: 57.5%;",
  358.         "  }",
  359.         "",
  360.         "  .six > .text {",
  361.         "    top: 67.5%;",
  362.         "  }",
  363.         "",
  364.         "  .seven > .text {",
  365.         "    top: 77.5%;",
  366.         "  }",
  367.         "",
  368.         "  .eight > .text {",
  369.         "    top: 87.5%;",
  370.         "  }",
  371.         "",
  372.         "  #moddedMenu:hover .switch {",
  373.         "    opacity: 1;",
  374.         "  }",
  375.         "",
  376.         "  #moddedMenu:hover .text {",
  377.         "    display: block;",
  378.         "  }",
  379.         "",
  380.         "  .one > .switch {",
  381.         "    top: 15%;",
  382.         "  }",
  383.         "",
  384.         "  .two > .switch {",
  385.         "    top: 25%;",
  386.         "  }",
  387.         "",
  388.         "  .three > .switch {",
  389.         "    top: 35%;",
  390.         "  }",
  391.         "",
  392.         "  .four > .switch {",
  393.         "    top: 45%;",
  394.         "  }",
  395.         "",
  396.         "  .five > .switch {",
  397.         "    top: 55%;",
  398.         "  }",
  399.         "",
  400.         "  .six > .switch {",
  401.         "    top: 65%;",
  402.         "  }",
  403.         "",
  404.         "  .seven > .switch {",
  405.         "    top: 75%;",
  406.         "  }",
  407.         "",
  408.         "  .eight > .switch {",
  409.         "    top: 85%;",
  410.         "  }",
  411.         "",
  412.         "  .switch input {",
  413.         "    display:none;",
  414.         "  }",
  415.         "",
  416.         "  ::-webkit-scrollbar {",
  417.         "    width: 10px;",
  418.         "    border-right: 2px solid #ff0000;",
  419.         "  }",
  420.         "",
  421.         "  ::-webkit-scrollbar-thumb {",
  422.         "    border: 2px solid #ff0000;",
  423.         "  }",
  424.         "",
  425.         "  ::-webkit-scrollbar-thumb:hover {",
  426.         "    background: #ff0000;",
  427.         "  }",
  428.         "",
  429.         "  ::-webkit-scrollbar-thumb:active {",
  430.         "    background: SteelBlue;",
  431.         "    border: 2px solid #ff0000;",
  432.         "  }",
  433.         "",
  434.         "  .slider {",
  435.         "    position: absolute;",
  436.         "    cursor: pointer;",
  437.         "    top: 0;",
  438.         "    left: 0;",
  439.         "    right: 0;",
  440.         "    bottom: 0;",
  441.         "    background-color: #ff0000;",
  442.         "    -webkit-transition: .4s;",
  443.         "    transition: .4s;",
  444.         "  }",
  445.         "",
  446.         "  .slider:before {",
  447.         "    position: absolute;",
  448.         "    content: "";",
  449.         "    height: 26px;",
  450.         "    width: 26px;",
  451.         "    left: 4px;",
  452.         "    bottom: 4px;",
  453.         "    background-color: black;",
  454.         "    -webkit-transition: .4s;",
  455.         "    transition: .4s;",
  456.         "  }",
  457.         "",
  458.         "  input:checked + .slider {",
  459.         "    background-color: #ff0000;",
  460.         "  }",
  461.         "  ",
  462.         "  input:focus + .slider {",
  463.         "    box-shadow: 0 0 1px #ff0000;",
  464.         "  }",
  465.         "",
  466.         "  input:checked + .slider:before {",
  467.         "    -webkit-transform: translateX(26px);",
  468.         "    -ms-transform: translateX(26px);",
  469.         "    transform: translateX(26px);",
  470.         "  }",
  471.         "",
  472.         "  .slider.round {",
  473.         "    border-radius: 34px;",
  474.         "  }",
  475.         "",
  476.         "  .slider.round:before {",
  477.         "    border-radius: 50%;",
  478.         "  }"
  479.  
  480. ].join("n");
  481. if (typeof GM_addStyle != "undefined") {
  482.         GM_addStyle(css);
  483. } else if (typeof PRO_addStyle != "undefined") {
  484.         PRO_addStyle(css);
  485. } else if (typeof addStyle != "undefined") {
  486.         addStyle(css);
  487. } else {
  488.         var node = document.createElement("style");
  489.         node.type = "text/css";
  490.         node.appendChild(document.createTextNode(css));
  491.         var heads = document.getElementsByTagName("head");
  492.         if (heads.length > 0) {
  493.                 heads[0].appendChild(node);
  494.         } else {
  495.                 // no head yet, stick it whereever
  496.                 document.documentElement.appendChild(node);
  497.         }
  498. }
  499. })();
  500.  
  501. // document.addEventListener("keydown", function(a) {if (a.keyCode == 8,9,13,16,17,18,19,20,27,33,34,35,36,37,38,39,40,45,46,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,96,97,98,100,101,102,103,104,105,106,107,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,144,145,186,187,188,189,190,191,192,219,220,221,222) {document.getElementById("nameInput").value="FERANYZERIR BOT";}}, false);
  502.  
  503. var myElement = document.querySelector('#nameInput');
  504. myElement.style.backgroundColor = "#fffdfd";
  505. myElement.style.color = "#000000";
  506.  
  507. var getElement = document.querySelector('#enterGame');
  508. getElement.style.backgroundColor = "#d61818";
  509. getElement.style.color = "#000000";
  510.  
  511. $('#leaderboard').append('COOKIE&MILK BEST');
  512.  
  513.  
  514.  
  515.  
  516.  
  517. var countr = 0;
  518. var delay = 0;
  519. var rand = Math.round(Math.random()*1000);
  520.  
  521.  
  522.  
  523. var sANC = 1;
  524. var aNC = [255,255,0];
  525. var rANC = [0,255];
  526.  
  527. var mk = document.getElementById("gameCanvas").getContext("2d");
  528. var Laa = 0;
  529. var Lab = 0;
  530. var aVZ = 0;
  531. var fBX = "Whats up";
  532. var resForRANC = 1;
  533.  
  534. // 1920-1080
  535.  
  536. function rainbowColor(){
  537.     if(resForRANC === 1){
  538.         aNC = [124,224,61,1];
  539.         resForRANC = 0;
  540.     }
  541.     if(aNC[0] === 255 && aNC[1] !== 255 && aNC[2] === 0){aNC[1] += 255/rANC[1];}
  542.     if(aNC[0] !== 0 && aNC[1] === 255 && aNC[2] === 0){aNC[0] += 255/rANC[1]*-1;}
  543.     if(aNC[0] === 0 && aNC[1] === 255 && aNC[2] !== 255){aNC[2] += 255/rANC[1];}
  544.     if(aNC[0] === 0 && aNC[1] !== 0 && aNC[2] === 255){aNC[1] += 255/rANC[1]*-1;}
  545.     if(aNC[0] !== 255 && aNC[1] === 0 && aNC[2] === 255){aNC[0] += 255/rANC[1];}
  546.     if(aNC[0] === 255 && aNC[1] === 0 && aNC[2] !== 0){aNC[2] += 255/rANC[1]*-1;}
  547.     if(aNC[0] < 0){aNC[0] = 0;} if(255 < aNC[0]){aNC[0] = 255;}
  548.     if(aNC[1] < 0){aNC[1] = 0;} if(255 < aNC[1]){aNC[1] = 255;}
  549.     if(aNC[2] < 0){aNC[2] = 0;} if(255 < aNC[2]){aNC[2] = 255;}
  550. }
  551. function mess(space, chance) {
  552.    let result = '';
  553.    let characters;
  554.    if(space) {
  555.        characters = 'GOEatACookienub';
  556.    }
  557.    if(space) {
  558.        characters = characters.padStart((30 - characters.length) / 2 + characters.length)
  559.        characters = characters.padEnd(30);
  560.    }
  561.    let count = 0;
  562.    for (let i = 0; i < characters.length; i++ ) {
  563.       if(Math.floor(Math.random() * chance) == 0 && characters.charAt(i) != "-" && count < 0 && characters.charAt(i) != " ") {
  564.           result += "";
  565.           count++
  566.       } else {
  567.           result += characters.charAt(i);
  568.       }
  569.    }
  570.    return result;
  571. }
  572.  
  573. function katie(){
  574.     if(document.getElementById("actionBarItem0")){
  575.         if(document.getElementById("actionBarItem3").style.display === "inline-block"){
  576.             if(fBX !== 3){
  577.                 aVZ = [[0,480],[0,360],[0,255]];
  578.                 if(sANC === 1){aNC = [255,0,0];}
  579.                 fBX = 3;
  580.             }
  581.  
  582.             aVZ[0][0] += 1;
  583.             if(aVZ[0][1] <= aVZ[0][0]){
  584.                 aVZ[0][0] = 0;
  585.             }
  586.             aVZ[1][0] += 1;
  587.             if(aVZ[1][1] <= aVZ[1][0]){
  588.                 aVZ[1][0] = 0;
  589.             }
  590.             aVZ[2][0] += 1;
  591.             if(aVZ[2][1] <= aVZ[2][0]){
  592.                 aVZ[2][0] = 0;
  593.             }
  594.  
  595.             mk.beginPath();
  596.             mk.lineWidth = 24;
  597.             mk.strokeStyle = "rgb("+Math.round(aNC[0])+","+Math.round(aNC[1])+","+Math.round(aNC[2])+",0.625)";
  598.             mk.arc(960,540,212,0+Math.PI/(aVZ[0][1]/2)*aVZ[0][0],7/8*Math.PI+Math.PI/(aVZ[0][1]/2)*aVZ[0][0]);
  599.             mk.stroke();
  600.             mk.beginPath();
  601.             mk.lineWidth = 30;
  602.             mk.strokeStyle = "rgb("+Math.round(aNC[0]/255*220)+","+Math.round(aNC[1]/255*220)+","+Math.round(aNC[2]/255*220)+",0.625)";
  603.             mk.arc(960,540,185,0+Math.PI/(aVZ[1][1]/2)*aVZ[1][0],2/3*Math.PI+Math.PI/(aVZ[1][1]/2)*aVZ[1][0]);
  604.             mk.stroke();
  605.             mk.beginPath();
  606.             mk.lineWidth = 45;
  607.             mk.strokeStyle = "rgb("+Math.round(aNC[0])+","+Math.round(aNC[1])+","+Math.round(aNC[2])+",0.5)";
  608.             mk.arc(960,540,85,0+Math.PI/(aVZ[2][1]/2)*aVZ[2][0],1/3*Math.PI+Math.PI/(aVZ[2][1]/2)*aVZ[2][0]);
  609.             mk.stroke();
  610.         }
  611.         if(document.getElementById("actionBarItem4").style.display === "inline-block"){
  612.             if(fBX !== 4){
  613.                 aVZ = [[0,360],[0,250],[0,225],[0,250]];
  614.                 if(sANC === 1){aNC = [255,0,0];}
  615.                 fBX = 4;
  616.             }
  617.  
  618.             aVZ[0][0] += -1;
  619.             if(aVZ[0][1] <= aVZ[0][0]){
  620.                 aVZ[0][0] = 0;
  621.             }
  622.             aVZ[1][0] += 1;
  623.             if(aVZ[1][1] <= aVZ[1][0]){
  624.                 aVZ[1][0] = 0;
  625.             }
  626.             aVZ[2][0] += -1;
  627.             if(aVZ[2][1] <= aVZ[2][0]){
  628.                 aVZ[2][0] = 0;
  629.             }
  630.             aVZ[3][0] += 1;
  631.             if(aVZ[3][1] <= aVZ[3][0]){
  632.                 aVZ[3][0] = 0;
  633.             }
  634.  
  635.             mk.beginPath();
  636.             mk.lineWidth = 36;
  637.             mk.strokeStyle = "rgb("+Math.round(aNC[0])+","+Math.round(aNC[1])+","+Math.round(aNC[2])+",0.45)";
  638.             mk.arc(960,540,251,0+Math.PI/(aVZ[0][1]/2)*aVZ[0][0],15/16*Math.PI+Math.PI/(aVZ[0][1]/2)*aVZ[0][0]);
  639.             mk.stroke();
  640.             mk.beginPath();
  641.             mk.lineWidth = 46;
  642.             mk.strokeStyle = "rgb("+Math.round(aNC[0]/255*220)+","+Math.round(aNC[1]/255*220)+","+Math.round(aNC[2]/255*220)+",0.45)";
  643.             mk.arc(960,540,210,0+Math.PI/(aVZ[1][1]/2)*aVZ[1][0],7/9*Math.PI+Math.PI/(aVZ[1][1]/2)*aVZ[1][0]);
  644.             mk.stroke();
  645.             mk.beginPath();
  646.             mk.lineWidth = 32;
  647.             mk.strokeStyle = "rgb("+Math.round(aNC[0])+","+Math.round(aNC[1])+","+Math.round(aNC[2])+",0.383)";
  648.             mk.arc(960,540,109,0+Math.PI/(aVZ[2][1]/2)*aVZ[2][0],2/3*Math.PI+Math.PI/(aVZ[2][1]/2)*aVZ[2][0]);
  649.             mk.stroke();
  650.             mk.beginPath();
  651.             mk.lineWidth = 26;
  652.             mk.strokeStyle = "rgb("+Math.round(aNC[0]/255*235)+","+Math.round(aNC[1]/255*235)+","+Math.round(aNC[2]/255*235)+",0.383)";
  653.             mk.arc(960,540,80,0+Math.PI/(aVZ[3][1]/2)*aVZ[3][0],7/8*Math.PI+Math.PI/(aVZ[3][1]/2)*aVZ[3][0]);
  654.             mk.stroke();
  655.         }
  656.         if(document.getElementById("actionBarItem5").style.display === "inline-block"){
  657.             if(fBX !== 5){
  658.                 aVZ = [[0,250,2.5,10,1.2]];
  659.                 if(sANC === 1){aNC = [255,0,255];}
  660.                 fBX = 5;
  661.             }
  662.  
  663.             aVZ[0][0] += 1;
  664.             if(aVZ[0][1] <= aVZ[0][0]){
  665.                 aVZ[0][0] = 0;
  666.             }
  667.  
  668.             for(Laa = 0; Laa < Math.round(aVZ[0][1]/5*2); Laa++){
  669.                 mk.beginPath();
  670.                 mk.lineWidth = 26;
  671.                 mk.strokeStyle = "rgb("+Math.round(aNC[0]/255*235)+","+Math.round(aNC[1]/255*235)+","+Math.round(aNC[2]/255*235)+",0.5)";
  672.                 mk.arc(960,540,200+Math.sin(aVZ[0][3]*Math.PI/(aVZ[0][1]/aVZ[0][2])*(Laa-aVZ[0][0]))*aVZ[0][3]*aVZ[0][4],0-2*Math.PI/aVZ[0][1]*Laa+2*Math.PI/aVZ[0][1]*aVZ[0][0],2*Math.PI/aVZ[0][1]-2*Math.PI/aVZ[0][1]*Laa+2*Math.PI/aVZ[0][1]*aVZ[0][0]);
  673.                 mk.stroke();
  674.             }
  675.         }
  676.     }
  677. }
  678.  
  679. function letThereBeLight(){
  680.     if(rANC[0] === 1){
  681.         rainbowColor();
  682.     }
  683.     katie();
  684.     window.requestAnimationFrame(letThereBeLight);
  685. }
  686.  
  687. window.requestAnimationFrame(letThereBeLight);
  688.  
  689. var settingsDiv = document.createElement('div');
  690. var settingsSlider = document.createElement('input');
  691. var itemTitle = document.createElement("h1");
  692. var currentSpeed = document.createElement("h2");
  693. var speedContain = document.createElement("div");
  694. settingsSlider.type = "range";
  695. settingsSlider.min = "0";
  696. settingsSlider.max = "100";
  697. settingsSlider.value = "0";
  698. settingsSlider.id = "healSlider";
  699. itemTitle.innerText = "speed Hat settings";
  700. currentSpeed.innerHTML = '<div id="cspeed">Speed Hat »</div> <div id="numfocus">?</div>';
  701. currentSpeed.id = "FPS";
  702. speedContain.id = "speedContain";
  703. itemTitle.id = "itemTitle";
  704. settingsDiv.appendChild(settingsSlider);
  705. speedContain.appendChild(currentSpeed);
  706. document.querySelector("#setupCard").appendChild(itemTitle);
  707. document.querySelector("#setupCard").appendChild(settingsDiv);
  708. document.querySelector("#setupCard").appendChild(speedContain);
  709. $("#healSlider").css({width: "100%", marginTop: 10});
  710. $("#itemTitle").css({fontWeight: '100', fontSize: 25, width: "100%", textAlign: "center", fontFamily: "sans-serif"});
  711. $("#healSlider").change((event, ui) => {
  712.     let coreVal = parseInt($("#healSlider").val());
  713.     InstaSpeed = 25 - coreVal;
  714.     currentSpeed.innerHTML = `<div id="cspeed">add FPS »</div> <div id="numfocus">${coreVal}</div>`;
  715. })
  716. var FPSspeed
  717.  
  718. var styleItem = document.createElement("style");
  719. styleItem.type = "text/css";
  720. styleItem.appendChild(document.createTextNode(`
  721. #sback, #okbtn {
  722. font-family: sans-serif;
  723. font-weight: 300;
  724. border: none;
  725. outline: none;
  726. font-size: 15px;
  727.  
  728. }
  729.  
  730. #sback {
  731.  
  732. border-radius: 5px;
  733. padding: 9px;
  734. cursor: pointer;
  735. margin-top: -1.5px;
  736. background-color: #d85858;
  737. color: white;
  738.  
  739.  
  740. }
  741.  
  742. #okbtn {
  743.  
  744. border-radius: 5px;
  745. padding: 9px;
  746. cursor: pointer;
  747. margin-top: -1.5px;
  748. background-color: #7399d6;
  749. color: white;
  750.  
  751. }
  752.  
  753. #flexlow {
  754. display: flex;
  755. justify-content: space-evenly;
  756. align-items: center;
  757. width: 100%;
  758.  
  759. }
  760.  
  761. #changeAlert {
  762. font-family: sans-serif;
  763. font-weight: 200;
  764. font-size: 23px;
  765.  
  766.  
  767. }
  768.  
  769. #typealert {
  770. font-family: sans-serif;
  771. font-weight: 200;
  772. font-size: 17px;
  773. width: 95%;
  774. margin-left: 2.5%;
  775. text-align: center;
  776. margin-top: 5.5px;
  777. }
  778.  
  779. #hatChangeAlert {
  780. position: absolute;
  781. padding: 5px;
  782. top: -300px;
  783. opacity: 0;
  784. left: 20px;
  785. width: 300px;
  786. height: 165px;
  787. border-radius: 10px;
  788. background-color: rgba(255, 255, 255, 0.7);
  789. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.08), 0 2px 10px 0 rgba(0, 0, 0, 0.06);
  790.  
  791.  
  792.  
  793. }
  794.  
  795. #changeAlert {
  796. display: inline-block;
  797.  
  798. }
  799.  
  800. #hatimgmain {
  801. width: 50px;
  802. height: 50px;
  803. display: inline-block;
  804.  
  805.  
  806. }
  807.  
  808. #flextop {
  809. display: flex;
  810. width: 100%;
  811. justify-content: space-evenly;
  812. align-items: center;
  813.  
  814. }
  815.  
  816. #tbtn {
  817. position: absolute;
  818. left: 0;
  819. top: 0;
  820. width: 80px;
  821. height: 80px;
  822. opacity: 0;
  823.  
  824. }
  825.  
  826. .chosenhat {
  827. border: 1px solid #7daaf2;
  828. }
  829.  
  830. .chosenwing {
  831. border: 1px solid #7daaf2;
  832. }
  833.  
  834. .inalertHat {
  835. margin-left: 30px !important;
  836. margin-top: 10px !important;
  837. }
  838.  
  839. .inalertWing {
  840. margin-left: 30px !important;
  841. margin-top: 10px !important;
  842. }
  843.  
  844. option {
  845. border-radius: 0px;
  846. }
  847.  
  848. #hrule {
  849. margin-top: 20px;
  850. }
  851.  
  852. #endwrap {
  853. margin-top: 15px;
  854. width: 100%;
  855. text-align: center;
  856. margin-bottom: -15px;
  857. }
  858.  
  859. #createEnd {
  860. width: 100%;
  861. text-align: center;
  862. margin: 0 auto;
  863.  
  864. }
  865.  
  866. .lowprompt {
  867. margin-bottom: -100px !important;
  868.  
  869. }
  870.  
  871.  
  872. .lowpromptdetail {
  873. margin-left: 25px;
  874. color: #4c4c4c !important;
  875. margin-top: 20px !important;
  876. margin-bottom: 0 !important;
  877.  
  878. }
  879.  
  880. .toplow {
  881. margin-top: 10px !important;
  882. }
  883.  
  884.  
  885. .objplace {
  886. width: 45px;
  887. height: 45px;
  888. margin-bottom: -17px;
  889. border: 0.5px solid #f2f2f2;
  890. border-radius: 10px;
  891. margin-left: 5px;
  892. cursor: pointer;
  893. }
  894.  
  895. .selPrev {
  896. width: 80px;
  897. height: 80px;
  898. display: block;
  899. margin: auto;
  900. margin-top: 10px;
  901.  
  902. }
  903.  
  904. #choiceWrap {
  905. display: flex;
  906. justify-content: space-evenly;
  907. align-items: center;
  908.  
  909.  
  910. }
  911.  
  912. #middlePlus {
  913. display: inline-block;
  914. width: 50px;
  915. height: 50px;
  916. font-weight: 100;
  917. font-family: sans-serif;
  918. color: #4A4A4A;
  919. opacity: 0.8;
  920.  
  921. }
  922.  
  923. .selectObj {
  924. cursor: pointer;
  925. width: 100px;
  926. height: 100px;
  927. background-color: #fcfcfc;
  928. display: inline-block;
  929. border-radius: 10px;
  930. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.08), 0 2px 10px 0 rgba(0, 0, 0, 0.06);
  931.  
  932. }
  933.  
  934.  
  935. .selectObjAlert {
  936. cursor: pointer;
  937. width: 100px;
  938. height: 100px;
  939. background-color: #fcfcfc;
  940. display: inline-block;
  941. border-radius: 10px;
  942. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.08), 0 2px 10px 0 rgba(0, 0, 0, 0.06);
  943.  
  944. }
  945.  
  946. #mnwrap {
  947. width: 100%;
  948. text-align: center;
  949. margin-bottom: -7px;
  950. margin-top: 8px;
  951. }
  952.  
  953. #flexControl {
  954.  
  955.  
  956. }
  957.  
  958. #keyPress {
  959. margin-left: 20px;
  960. height: 20px;
  961. width: 50px;
  962. background-color: #e5e3e3;
  963. border-radius: 7.5px;
  964. font-size: 16px;
  965. border: none;
  966. text-align: center;
  967. color: #4A4A4A;
  968.  
  969. }
  970.  
  971. .keyPressLow {
  972. margin-left: 8px;
  973. font-size: 16px;
  974. margin-right: 8px;
  975. height: 25px;
  976. width: 50px;
  977. background-color: #fcfcfc;
  978. border-radius: 3.5px;
  979. border: none;
  980. text-align: center;
  981. color: #4A4A4A;
  982. border: 0.5px solid #f2f2f2;
  983.  
  984.  
  985. }
  986.  
  987. #keyPress:focus {
  988. border: none;
  989. outline: none;
  990. }
  991.  
  992. .keyPressLow:focus{
  993.  
  994. outline: none;
  995. }
  996.  
  997. input[type=range] {
  998. -webkit-appearance: none;
  999. margin-top: 0px;
  1000. width: 100%;
  1001. }
  1002. input[type=range]:focus {
  1003. outline: none;
  1004. }
  1005. #healSlider::-webkit-slider-runnable-track {
  1006. width: 100%;
  1007. height: 10px;
  1008. cursor: pointer;
  1009. animate: 0.2s;
  1010. background: #dddddd;
  1011. border-radius: 5px;
  1012. }
  1013. #healSlider::-webkit-slider-thumb {
  1014. width: 25px;
  1015. height: 25px;
  1016. background: rgb(42, 131, 232, 1);
  1017. border-radius: 12.5px;
  1018. margin-top: -6.25px;
  1019. -webkit-appearance: none;
  1020.  
  1021. }
  1022.  
  1023.  
  1024. #speedContain {
  1025. width: 80%;
  1026. height: 40px;
  1027. background-color: #ca2525;
  1028. border-radius: 20px;
  1029. margin-left: 10%;
  1030. box-shadow: 1px 1px 4px gray;
  1031. }
  1032.  
  1033. #currentSpeed {
  1034. height: 40px;
  1035. width: 100%;
  1036. text-align: center;
  1037.  
  1038. color: white;
  1039. font-weight: 400 !important;
  1040. font-family: sans-serif;
  1041. font-size: 20px;
  1042. }
  1043.  
  1044. #numfocus {
  1045. background-color: white;
  1046. color: #f71717;
  1047. border-radius: 20px;
  1048. margin-right: -24%;
  1049. padding: 10px;
  1050. display: inline-block;
  1051. font-size: 20px;
  1052. font-weight: 400;
  1053. font-family: sans-serif;
  1054.  
  1055. }
  1056.  
  1057. #cspeed {
  1058. display: inline-block;
  1059. height: 300px;
  1060. margin-top: 0px;
  1061. margin-left: -10px;
  1062. color: white;
  1063. font-weight: 400 !important;
  1064. font-family: sans-serif;
  1065. font-size: 20px;
  1066.  
  1067. }
  1068.  
  1069. `))
  1070. document.head.appendChild(styleItem);
  1071.  
  1072. $("#youtuberOf").css({display: "none"});
  1073. let newImg = document.createElement("img");
  1074. newImg.src = "https://i.ya-webdesign.com/images/sub-button-png-5.png";
  1075. newImg.style = `position: absolute; top: 15px; left: 15px; z-index: 100000; width: 120px; height: 50px; cursor: pointer;`;
  1076. document.body.prepend(newImg);
  1077.  
  1078. newImg.addEventListener("click", () => {
  1079.     let w = window.open("https://www.youtube.com/channel/UCs5G5ZM8RkXwv9stEAGagSg", null, `height=650, width=1199, status=yes, toolbar=no, menubar=no, location=no`);
  1080. });
  1081.  
  1082. function isElementVisible(e) {
  1083.     return (e.offsetParent !== null);
  1084. }
  1085.  
  1086.  
  1087. function toRad(angle) {
  1088.     return angle * 0.01745329251;
  1089. }
  1090.  
  1091. function dist(a, b){
  1092.     return Math.sqrt( Math.pow((b.y-a[2]), 2) + Math.pow((b.x-a[1]), 2) );
  1093. }
  1094.  
  1095. function spam(space, chance) {
  1096.     let result = '';
  1097.     let characters;
  1098.     if(space) {
  1099.         characters = 'GG Want Cookie?';
  1100.     }
  1101.     if(space) {
  1102.         characters = characters.padStart((30 - characters.length) / 2 + characters.length)
  1103.         characters = characters.padEnd(30);
  1104.     }
  1105.     let count = 0;
  1106.     for (let i = 0; i < characters.length; i++ ) {
  1107.         if(Math.floor(Math.random() * chance) == 0 && characters.charAt(i) != "-" && count < 0 && characters.charAt(i) != " ") {
  1108.             result += "";
  1109.             count++
  1110.         } else {
  1111.             result += characters.charAt(i);
  1112.         }
  1113.     }
  1114.     return result;
  1115. }
  1116.  
  1117. ({'position':'absolute','bottom':'72px','left':'20px','width':'420px','height':'236.25px','padding-bottom':'18px','margin-top':'0px'});
  1118.  
  1119. $("#gameCanvas").css('cursor', 'url(http://cur.cursors-4u.net/games/gam-15/gam1422.gif), default');
  1120.  
  1121. $('.menuCard').css({'white-space': 'normal',
  1122.                     'text-align': 'center',
  1123.                     'background-color': 'rgba(0, 0, 0, 0.74)',
  1124.                     '-moz-box-shadow': '0px 0px rgba(255, 255, 255, 0)',
  1125.                     '-webkit-box-shadow': '0px 0px rgba(255, 255, 255, 0)',
  1126.                     'box-shadow': '0px 0px rgba(255, 255, 255, 0)',
  1127.                     '-webkit-border-radius': '0px',
  1128.                     '-moz-border-radius': '0px',
  1129.                     'border-radius': '0px',
  1130.                     'margin': '15px',
  1131.                     'margin-top': '15px'});
  1132.  
  1133. $('.menuCard').css({'color':'#808080'});
  1134.  
  1135.  
  1136. $('#menuContainer').css({'white-space': 'normal'});
  1137.  
  1138.  
  1139. $('#guideCard').css({'color': '#FFFFF'});
  1140.  
  1141. $('.killCounter').css({'color': '#000000'});
  1142.  
  1143. $('#nativeResolution').css({'cursor': 'pointer'});
  1144.  
  1145. $('#playMusic').css({'cursor': 'pointer'});
  1146.  
  1147. $('#skinColorHolder').css({'margin-bottom': '30.75px'});
  1148.  
  1149. $('.settingRadio').css({'margin-bottom': '30.75px'});
  1150.  
  1151. $('#gameName').css({'color': '#000000',
  1152.                     '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)',
  1153.                     'text-align': 'center',
  1154.                     'font-size': '126px',
  1155.                     'margin-bottom': '-30px'});
  1156.  
  1157. $('#loadingText').css({'color': '#000000',
  1158.                        'background-color': 'rgba(0, 0, 0, 0.74)',
  1159.                        'padding': '8px',
  1160.                        'right': '150%',
  1161.                        'left': '150%',
  1162.                        'margin-top': '40px'});
  1163.  
  1164. $('.ytLink').css({'color': '#000000',
  1165.                   'padding': '8px',
  1166.                   'background-color': 'rgba(0, 0, 0, 0.74)'});
  1167.  
  1168. $('.menuLink').css({'color': '#000000'});
  1169.  
  1170. $('.menuButton').css({'background-color': '#000000'});
  1171.  
  1172.  
  1173. $('#nameInput').css({'border-radius': '0px',
  1174.                      '-moz-border-radius': '0px',
  1175.                      '-webkit-border-radius': '0px',
  1176.                      'border': 'hidden'});
  1177.  
  1178.  
  1179. $('#serverSelect').css({'cursor': 'pointer',
  1180.                         'color': '#000000',
  1181.                         'background-color': '#808080',
  1182.                         'border': 'hidden',
  1183.                         'font-size': '20px'});
  1184.  
  1185. $('.menuButton').css({'border-radius': '0px',
  1186.                       '-moz-border-radius': '0px',})
  1187.  
  1188. var moomooVer = $('#linksContainer2 .menuLink').html(),
  1189.     hideSelectors = ['#mobileDownloadButtonContainer',
  1190.                      '#followText',
  1191.                      '#smallLinks',
  1192.                      '#linksContainer1',
  1193.                      '#twitterFollow',
  1194.                      '#youtubeFollow',
  1195.                      '#cdm-zone-02',
  1196.                      '#youtuberOf',
  1197.                      '#promoImg',
  1198.                      '#downloadButtonContainer',
  1199.                      '.menuHeader',
  1200.                      '.menuLink',
  1201.                      '.menuHeader:nth-child(5)',
  1202.                      '.menuHeader:nth-child(6)',
  1203.                      '.menuText'
  1204.                     ],
  1205.     css = '#rightCardHolder {display: block!important}',
  1206.     head = document.head || document.getElementsByTagName('head')[0],
  1207.     style = document.createElement('style');
  1208.  
  1209. style.type = 'text/css';
  1210. if (style.styleSheet){
  1211.     style.styleSheet.cssText = css;
  1212. } else {
  1213.     style.appendChild(document.createTextNode(css));
  1214. }
  1215.  
  1216. for ( let i = 0; i < hideSelectors.length; i++ ) {
  1217.     $(hideSelectors[i]).hide();
  1218. }
  1219.  
  1220. $('.menuCard').css({'white-space': 'normal',
  1221.                     'text-align': 'center',
  1222.                     'background-color': 'rgba(0, 0, 0, 0)',
  1223.                     '-moz-box-shadow': '0px 0px rgba(255, 255, 255, 0)',
  1224.                     '-webkit-box-shadow': '0px 0px rgba(255, 255, 255, 0)',
  1225.                     'box-shadow': '0px 0px rgba(255, 255, 255, 0)',
  1226.                     '-webkit-border-radius': '0px',
  1227.                     '-moz-border-radius': '0px',
  1228.                     'border-radius': '0px',
  1229.                     'margin': '15px',
  1230.                     'margin-top': '15px'});
  1231.  
  1232. $('#menuContainer').css({'white-space': 'normal'});
  1233.  
  1234. $('#nativeResolution').css({'cursor': 'pointer'});
  1235.  
  1236. $('#playMusic').css({'cursor': 'pointer'});
  1237.  
  1238. $('#guideCard').css({'overflow-y': 'hidden',
  1239.                      'margin-top': 'auto',
  1240.                      'margin-bottom': '30px'});
  1241.  
  1242.  
  1243. $('#skinColorHolder').css({'margin-bottom': '30.75px'});
  1244.  
  1245. $('.settingRadio').css({'margin-bottom': '30.75px'});
  1246.  
  1247.  
  1248.  
  1249. $('#linksContainer2').css({'-webkit-border-radius': '0px 0 0 0',
  1250.                            '-moz-border-radius': '0px 0 0 0',
  1251.                            'border-radius': '0px 0 0 0',
  1252.                            'right': '44%',
  1253.                            'left': '44%',
  1254.                            'background-color': 'rgba(0, 0, 0, 0)',
  1255.                            'text-align': 'center',
  1256.                            'bottom': '12px'});
  1257.  
  1258. $('#gameName').css({'color': '#84563c',
  1259.                     '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)',
  1260.                     'text-align': 'center',
  1261.                     'font-size': '156px',
  1262.                     'margin-bottom': '-30px'});
  1263.  
  1264. $('#loadingText').css({'color': '#84563c',
  1265.                        'background-color': 'rgba(0, 0, 0, 0)',
  1266.                        'padding': '8px',
  1267.                        'right': '150%',
  1268.                        'left': '150%',
  1269.                        'margin-top': '40px'});
  1270.  
  1271. $('.ytLink').css({'color': '#144db4',
  1272.                   'padding': '8px',
  1273.                   'background-color': 'rgba(0, 0, 0, 0)'});
  1274.  
  1275. $('.menuLink').css({'color': '#144db4'});
  1276.  
  1277. $('#nameInput').css({'border-radius': '0px',
  1278.                      '-moz-border-radius': '0px',
  1279.                      '-webkit-border-radius': '0px',
  1280.                      'border': 'hidden'});
  1281.  
  1282. $('#serverSelect').css({'cursor': 'pointer',
  1283.                         'color': '#ff0000',
  1284.                         'background-color': '#808080',
  1285.                         'border': 'hidden',
  1286.                         'font-size': '20px'});
  1287.  
  1288. $('.menuButton').css({'border-radius': '0px',
  1289.                       '-moz-border-radius': '0px',
  1290.                       '-webkit-border-radius': '0px'});
  1291.  
  1292. $('#promoImgHolder').css({'position': 'absolute',
  1293.                           'bottom': '-7%',
  1294.                           'left': '20px',
  1295.                           'width': '420px',
  1296.                           'height': '236.25px',
  1297.                           'padding-bottom': '18px',
  1298.                           'margin-top': '0px'});
  1299.  
  1300. $('#adCard').css({'position': 'absolute',
  1301.                   'bottom': '-7%',
  1302.                   'right': '20px',
  1303.                   'width': '420px',
  1304.                   'height': '236.25px',
  1305.                   'padding-bottom': '18px'});
  1306.  
  1307.  
  1308. $('.menuHeader').css({'color': 'rgba(255, 255, 255, 1)'});
  1309.  
  1310. $('#killCounter').css({'color': '#ededed'});
  1311.  
  1312. $('#diedText').css({'background-color': 'rgba(0, 0, 0, 0)'});
  1313.  
  1314. $('#gameCanvas').css({'background-color': '#f4f4f4'});
  1315.  
  1316. $('#allianceButton').css({'color': 'rgba(241, 241, 241, 1)'});
  1317.  
  1318. $('#storeButton').css({'color': 'rgba(241, 241, 241, 1)'});
  1319.  
  1320. $('#chatButton').css({'color': 'rgba(241, 241, 241, 1)'});
  1321.  
  1322. $('.gameButton').css({'-webkit-border-radius': '0px 0 0 0',
  1323.                       '-moz-border-radius': '0px 0 0 0',
  1324.                       'border-radius': '0px 0 0 0',
  1325.                       'background-color': 'rgba(0, 0, 0, 0.4)'});
  1326.  
  1327. $('.uiElement, .resourceDisplay').css({'-webkit-border-radius': '0px',
  1328.                                        '-moz-border-radius': '0px',
  1329.                                        'border-radius': '0px',
  1330.                                        'background-color': 'rgba(0, 0, 0, 0.4)'});
  1331.  
  1332. $('#chatBox').css({'-webkit-border-radius': '0px',
  1333.                    '-moz-border-radius': '0px',
  1334.                    'border-radius': '0px',
  1335.                    'background-color': 'rgba(0, 0, 0, 0.4)',
  1336.                    'text-align': 'center'});
  1337.  
  1338. $('#foodDisplay').css({'color': '#270D0B'});
  1339.  
  1340. $('#woodDisplay').css({'color': '#d2faa5'});
  1341.  
  1342. $('#stoneDisplay').css({'color': '#c5c5d1'});
  1343.  
  1344. $('#scoreDisplay').css({'color': '#c2b17a'});
  1345.  
  1346. $('#leaderboard').css({'-webkit-border-radius': '0px',
  1347.                        '-moz-border-radius': '0px',
  1348.                        'border-radius': '0px',
  1349.                        'background-color': 'rgba(0, 0, 0, 0.4)',
  1350.                        'text-align': 'center'});
  1351.  
  1352. $('#ageText').css({'color': '#ffdfd'});
  1353.  
  1354. $('#ageBar').css({'-webkit-border-radius': '0px',
  1355.                   '-moz-border-radius': '0px',
  1356.                   'border-radius': '0px',
  1357.                   'background-color': 'rgba(0, 0, 0, 0.4)'});
  1358.  
  1359. $('#ageBarBody').css({'-webkit-border-radius': '0px',
  1360.                       '-moz-border-radius': '0px',
  1361.                       'border-radius': '0px',
  1362.                       'background-color': '#f00'});
  1363.  
  1364. $('.storeTab').css({'-webkit-border-radius': '0px',
  1365.                     '-moz-border-radius': '0px',
  1366.                     'border-radius': '0px',
  1367.                     'background-color': 'rgba(0, 0, 0, 0.4)'});
  1368.  
  1369. $('#storeHolder').css({'-webkit-border-radius': '0px',
  1370.                        '-moz-border-radius': '0px',
  1371.                        'border-radius': '0px',
  1372.                        'background-color': 'rgba(0, 0, 0, 0.4)'});
  1373.  
  1374. $('#allianceHolder').css({'-webkit-border-radius': '0px',
  1375.                           '-moz-border-radius': '0px',
  1376.                           'border-radius': '0px',
  1377.                           'background-color': 'rgba(0, 0, 0, 0.4)'});
  1378.  
  1379. $('.actionBarItem').css({'-webkit-border-radius': '0px',
  1380.                          'border-radius': '0px',
  1381.                          'background-color': 'rgba(0, 0, 0, 0.4)'});
  1382.  
  1383. $('#itemInfoHolder').css({'text-align': 'center',
  1384.                           'top': '125px',
  1385.                           'left': '350px',
  1386.                           'right': '350px',
  1387.                           'max-width': '666px'});
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396. var ID_WinterCap = 15;
  1397. var ID_FlipperHat = 31;
  1398. var ID_MarksmanCap = 1;
  1399. var ID_BushGear = 10;
  1400. var ID_SoldierHelmet = 6;
  1401. var ID_AntiVenomGear = 23;
  1402. var ID_MusketeerHat = 32;
  1403. var ID_MedicGear = 13;
  1404. var ID_BullHelmet = 7;
  1405. var ID_EmpHelmet = 22;
  1406. var ID_BoosterHat = 12;
  1407. var ID_BarbarianArmor = 26;
  1408. var ID_BullMask = 46;
  1409. var ID_WindmillHat = 14;
  1410. var ID_SpikeGear = 11;
  1411. var ID_BushidoArmor = 16;
  1412. var ID_SamuraiArmor = 20;
  1413. var ID_ScavengerGear = 27;
  1414. var ID_TankGear = 40;
  1415. var ID_TurretGear = 53;
  1416.  
  1417. // Keys
  1418. var TankGearKey = 90;
  1419. var TurretKey = 80;
  1420. var BullHelmetKey = 74;
  1421. var SoldierHelmetKey = 71;
  1422. var BoosterHatKey = 66;
  1423. var uneqiup = 16;
  1424. var SpikeGearKey = 89;
  1425. var EmpKey = 84;
  1426. var SamuKey = 80;
  1427. var SpikeKey = 86
  1428.  
  1429. try {
  1430.     document.getElementById("moomooio_728x90_home").style.display = "none";
  1431.     $("moomooio728x90_home").parent().css({display: "none"});
  1432. } catch (e) {
  1433.     console.log("There was an error removing the ads.");
  1434. }
  1435.  
  1436.  
  1437. var menuChange = document.createElement("div");
  1438. menuChange.className = "menuCard";
  1439. menuChange.id = "mainSettings";
  1440. menuChange.innerHTML = `
  1441. <div id="simpleModal" class="modal">
  1442. <div class="modal-content">
  1443. <div class="modal-header">
  1444. <span class="closeBtn">×</span>
  1445. <h2 style="font-size: 17px;">Mod - Settings</h2>
  1446. </div>
  1447. <div class="modal-body" style="font-size: 17px;">
  1448. <div class="flexControl">
  1449. <h3 style="color: #5692dc; font-size: 17px;">Made by Sunnycakes & Cookie_or_die</h3>
  1450.  <div align="left"><div class="menuHeader">Auto Heal Speed:<input onchange="plspeedupdate();" id="pspeed" type="number" value="200" style="width:60px;"></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.">4 Walls <font style="font-size: 18px;" color="red">(?)</font>:</a><a href="https://www.youtube.com/channel/UCb5P-Vs-Eg7bpQW04dPbbdQ?view_as=subscriber" 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"Windmill Circle <font style="font-size: 18px;" color="red">Windmill Circle</font>:</a><a href="" target="_blank" style="font-size:18px;padding-left:28px;">O key</a><br><a title="When you press *K* it will change all free hats automatically. (not Caps)" class="menuText">CPS     : <font style="font-size: 18px;" color="red">(?)</font>:</a>.........<input onchange="plspeedupdate();" id="pspeed" type="number" value="200" style="width:60px;"></a><br><a title="When you press *L* key it will change animal caps automatically." class="menuText">Insta Bow<font style="font-size: 18px;" color="red">(?)</font>:</a><a href="" 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">Trap<font style="font-size: 18px;" color="red"></font>:</a>F key</a></br><a title="When you press *M* key it will on/off background of map." class="menuText">2 Spikes insta<font style="font-size: 18px;" color="red">(?)</font>:</a><a>Space</a><br><a title="When you press *N* key it will show or hide objects which you and your clan put." class="menuText">Windmill<font style="font-size: 18px;" color="red">(?)</font>:</a><a href="" target="_blank" style="font-size:18px;padding-left:14px;">N key</a><br>anti clown hat 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>HAT SETTINGS<div class="modal"><div class="modal-content"><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> -
  1451.  
  1452. <h3 class="menuPrompt">Tank Gear: </h3> <input value="${String.fromCharCode(TankGearKey)}" id="tankGear" class="keyPressLow" onkeyup="this.value = this.value.toUpperCase();" maxlength="1" type="text"/>
  1453. <h3 class="menuPrompt">Bull Helmet: </h3> <input value="${String.fromCharCode(BullHelmetKey)}" id="bullHelm" class="keyPressLow" onkeyup="this.value = this.value.toUpperCase();" maxlength="1" type="text"/>
  1454. <h3 class="menuPrompt">Soldier Helmet: </h3> <input value="${String.fromCharCode(SoldierHelmetKey)}" id="soldier" class="keyPressLow"onkeyup="this.value = this.value.toUpperCase();"  maxlength="1" type="text"/>
  1455. <h3 class="menuPrompt">Turret Gear: </h3> <input value="${String.fromCharCode(TurretKey)}" id="turret" class="keyPressLow" maxlength="1" onkeyup="this.value = this.value.toUpperCase();" type="text"/>
  1456. <h3 class="menuPrompt">Booster Hat: </h3> <input value="${String.fromCharCode(BoosterHatKey)}" id="booster" class="keyPressLow" maxlength="1" onkeyup="this.value = this.value.toUpperCase();" type="text"/>
  1457. <h3 class="menuPrompt">Spike Gear: </h3> <input value="${String.fromCharCode(SpikeGearKey)}" id="spikeg" class="keyPressLow" maxlength="1" onkeyup="this.value = this.value.toUpperCase();" type="text"/>
  1458. <h3 class="menuPrompt">Emp Helmet: </h3> <input value="${String.fromCharCode(EmpKey)}" id="emp" class="keyPressLow" onkeyup="this.value = this.value.toUpperCase();" maxlength="1" type="text"/>
  1459. <h3 class="menuPrompt">Samurai Armor: </h3> <input value="${String.fromCharCode(SamuKey)}" id="samu" class="keyPressLow" onkeyup="this.value = this.value.toUpperCase();" maxlength="1" type="text"/>
  1460. <hr>
  1461. <h3 style="font-size: 17px;"> Settings </h3>
  1462. <div class="modal-body" style="font-size: 17px;">
  1463. <div class="flexControl">
  1464. <label class="container">activate: Better map?
  1465. <input type="checkbox" id="myCheck">
  1466. <span class="checkmark"></span>
  1467. </label>
  1468. </div>
  1469. </div>
  1470. <div class="modal-body" style="font-size: 17px;">
  1471. <div class="flexControl">
  1472. <label class="container">activate: more fps?
  1473. <input type="checkbox" id="getCheck">
  1474. <span class="checkmark"></span>
  1475. </label>
  1476. </div>
  1477. </div>
  1478. <div class="modal-body" style="font-size: 17px;">
  1479. <div class="flexControl">
  1480. <label class="container">activate: more cps?
  1481. <input type="checkbox" id="letCheck">
  1482. <span class="checkmark"></span>
  1483. </label>
  1484. </div>
  1485. </div>
  1486. <div class="modal-body" style="font-size: 17px;">
  1487. <div class="flexControl">
  1488. <label class="container">-50% ClownHat chance
  1489. <input type="checkbox" id="getCheck">
  1490. <span class="checkmark"></span>
  1491.                       <div class="modal-body" style="font-size: 17px;">
  1492.             <div class="flexControl">
  1493. <label class="container">Hat Macro speed - 100%
  1494.                     <input type="checkbox" id="myCheck">
  1495.                     <span class="checkmark"></span>
  1496.                 </label>
  1497.             </div>
  1498.         </div>
  1499.                 <div class="modal-body" style="font-size: 17px;">
  1500.             <div class="flexControl">
  1501. <label class="container">Hat Macro speed - 70% 〖recommended〗
  1502.                     <input type="checkbox" id="myCheck">
  1503.                     <span class="checkmark"></span>
  1504.                 </label>
  1505.             </div>
  1506.         </div>
  1507.                         <div class="modal-body" style="font-size: 17px;">
  1508.             <div class="flexControl">
  1509. <label class="container">Hat Macro speed - 130%
  1510.                     <input type="checkbox" id="myCheck">
  1511.                     <span class="checkmark"></span>
  1512.                 </label>
  1513.             </div>
  1514.         </div>
  1515.         <div class="modal-footer">
  1516.             <p>If you activate hat macro speeds, this is added together</p>
  1517.         </div>
  1518.     </div>
  1519. </div>
  1520. </label>
  1521. </div>
  1522. </div>
  1523. <div class="modal-footer">
  1524. <h3 style="font-size: 14px;">Whats FPS? - FPS means "Frames per second" * The FPS value indicates how many frames per second appear on your screen and therefore how smoothly the picture runs. <br> <br> Whats CPS? - CPS is an abbreviation for "characters per second" * It is a unit for speed in data transmission</h3>
  1525. <p>If something doesn't work properly, write it down in the rating</p>
  1526. </div>
  1527. </div>
  1528. </div>
  1529. `
  1530. document.body.appendChild(menuChange)
  1531.  
  1532.  
  1533. $("#tankGear").on("input", () => {
  1534.    var cval = $("#tankGear").val();
  1535.    if (cval){
  1536.        TankGearKey = cval.toUpperCase();
  1537.        TankGearKey = TankGearKey.charCodeAt(0);
  1538.        console.log(TankGearKey);
  1539.    }
  1540. });
  1541.  
  1542. $("#bullHelm").on("input", () => {
  1543.    var cval = $("#bullHelm").val();
  1544.    if (cval){
  1545.        BullHelmetKey = cval.toUpperCase();
  1546.        BullHelmetKey = BullHelmetKey.charCodeAt(0);
  1547.        console.log(BullHelmetKey);
  1548.    }
  1549. });
  1550.  
  1551. $("#soldier").on("input", () => {
  1552.    var cval = $("#soldier").val();
  1553.    if (cval){
  1554.        SoldierHelmetKey = cval.toUpperCase();
  1555.        SoldierHelmetKey = SoldierHelmetKey.charCodeAt(0);
  1556.        console.log(SoldierHelmetKey);
  1557.    }
  1558. });
  1559.  
  1560. $("#turret").on("input", () => {
  1561.    var cval = $("#turret").val();
  1562.    if (cval){
  1563.        TurretKey = cval.toUpperCase();
  1564.        TurretKey = TurretKey.charCodeAt(0);
  1565.        console.log(TurretKey);
  1566.    }
  1567. });
  1568.  
  1569.  
  1570.  
  1571. $("#emp").on("input", () => {
  1572.    var cval = $("#emp").val();
  1573.    if (cval){
  1574.        EmpKey = cval.toUpperCase();
  1575.        EmpKey = EmpKey.charCodeAt(0);
  1576.        console.log(EmpKey);
  1577.    }
  1578. });
  1579.  
  1580. $("#samu").on("input", () => {
  1581.    var cval = $("#samu").val();
  1582.    if (cval){
  1583.        SamuKey = cval.toUpperCase();
  1584.        SamuKey = SamuKey.charCodeAt(0);
  1585.        console.log(SamuKey);
  1586.    }
  1587. });
  1588.  
  1589. $("#booster").on("input", () => {
  1590.    var cval = $("#booster").val();
  1591.    if (cval){
  1592.        BoosterHatKey = cval.toUpperCase();
  1593.        BoosterHatKey = BoosterHatKey.charCodeAt(0);
  1594.        console.log(BoosterHatKey);
  1595.    }
  1596. });
  1597.  
  1598. $("#spikeg").on("input", () => {
  1599.    var cval = $("#spikeg").val();
  1600.    if (cval){
  1601.        SpikeGearKey = cval.toUpperCase();
  1602.        SpikeGearKey = SpikeGearKey.charCodeAt(0);
  1603.        console.log(SpikeGearKey);
  1604.    }
  1605. });
  1606.  
  1607. $("#trap").on("input", () => {
  1608.    var cval = $("#trap").val();
  1609.    if (cval){
  1610.        TrapKey = cval.toUpperCase();
  1611.        TrapKey = TrapKey.charCodeAt(0);
  1612.        console.log(TrapKey);
  1613.    }
  1614. });
  1615.  
  1616. var styleItem = document.createElement("style");
  1617. styleItem.type = "text/css";
  1618. styleItem.appendChild(document.createTextNode(`
  1619. .keyPressLow {
  1620. margin-left: 8px;
  1621. font-size: 16px;
  1622. margin-right: 8px;
  1623. height: 25px;
  1624. width: 50px;
  1625. background-color: #fcfcfc;
  1626. border-radius: 3.5px;
  1627. border: none;
  1628. text-align: center;
  1629. color: #4A4A4A;
  1630. border: 0.5px solid #f2f2f2;
  1631. }
  1632.  
  1633. .menuPrompt {
  1634. font-size: 17px;
  1635. font-family: 'Hammersmith One';
  1636. color: #4A4A4A;
  1637. flex: 0.2;
  1638. text-align: center;
  1639. margin-top: 10px;
  1640. display: inline-block;
  1641. }
  1642.  
  1643. .modal {
  1644. display: none;
  1645. position: fixed;
  1646. z-index: 1;
  1647. left: 0;
  1648. top: 0;
  1649. overflow: auto;
  1650. height: 100%;
  1651. width: 100%;
  1652. }
  1653.  
  1654. .modal-content {
  1655. margin: 10% auto;
  1656. width: 40%;
  1657. box-shadow: 0 5px 8px 0 rgba(0, 0, 0, 0.2), 0 7px 20px 0 rgba(0, 0, 0, 0.17);
  1658. font-size: 14px;
  1659. line-height: 1.6;
  1660. }
  1661.  
  1662. .modal-header h2,
  1663. .modal-footer h3 {
  1664. margin: 0;
  1665. }
  1666.  
  1667. .modal-header {
  1668. background: #42a739;
  1669. padding: 15px;
  1670. color: #fff;
  1671. border-top-left-radius: 5px;
  1672. border-top-right-radius: 5px;
  1673. }
  1674.  
  1675. .modal-body {
  1676. padding: 10px 20px;
  1677. background: #fff;
  1678. }
  1679.  
  1680. .modal-footer {
  1681. background: #2b9ae2;
  1682. padding: 10px;
  1683. color: #fff;
  1684. text-align: center;
  1685. border-bottom-left-radius: 5px;
  1686. border-bottom-right-radius: 5px;
  1687. }
  1688.  
  1689. .closeBtn {
  1690. color: #ccc;
  1691. float: right;
  1692. font-size: 30px;
  1693. color: #fff;
  1694. }
  1695.  
  1696. .closeBtn:hover,
  1697. .closeBtn:focus {
  1698. color: #2652e2;
  1699. text-decoration: none;
  1700. cursor: pointer;
  1701. }
  1702.  
  1703. /* Customize the label (the container) */
  1704. .container {
  1705. display: block;
  1706. position: relative;
  1707. padding-left: 35px;
  1708. margin-bottom: 12px;
  1709. cursor: pointer;
  1710. font-size: 16px;
  1711. -webkit-user-select: none;
  1712. -moz-user-select: none;
  1713. -ms-user-select: none;
  1714. user-select: none;
  1715. }
  1716.  
  1717. /* Hide the browser's default checkbox */
  1718. .container input {
  1719. position: absolute;
  1720. opacity: 0;
  1721. cursor: pointer;
  1722. height: 0;
  1723. width: 0;
  1724. }
  1725.  
  1726. /* Create a custom checkbox */
  1727. .checkmark {
  1728. position: absolute;
  1729. top: 0;
  1730. left: 0;
  1731. height: 25px;
  1732. width: 25px;
  1733. background-color: #eee;
  1734. }
  1735.  
  1736. /* On mouse-over, add a grey background color */
  1737. .container:hover input ~ .checkmark {
  1738. background-color: #ccc;
  1739. }
  1740.  
  1741. /* When the checkbox is checked, add a green background */
  1742. .container input:checked ~ .checkmark {
  1743. background-color: #27cf29;
  1744. }
  1745.  
  1746. /* Create the checkmark/indicator (hidden when not checked) */
  1747. .checkmark:after {
  1748. content: "";
  1749. position: absolute;
  1750. display: none;
  1751. }
  1752.  
  1753. /* Show the checkmark when checked */
  1754. .container input:checked ~ .checkmark:after {
  1755. display: block;
  1756. }
  1757.  
  1758. /* Style the checkmark/indicator */
  1759. .container .checkmark:after {
  1760. left: 9px;
  1761. top: 5px;
  1762. width: 5px;
  1763. height: 10px;
  1764. border: solid white;
  1765. border-width: 0 3px 3px 0;
  1766. -webkit-transform: rotate(45deg);
  1767. -ms-transform: rotate(45deg);
  1768. transform: rotate(45deg);
  1769. }
  1770.  
  1771. `))
  1772. document.head.appendChild(styleItem);
  1773.  
  1774.  
  1775. $("#adCard").css({display: "none"});
  1776.  
  1777.  
  1778. document.addEventListener('keydown', function(e) {
  1779.     if (e.keyCode == uneqiup && document.activeElement.id.toLowerCase() !== 'chatbox'){
  1780.         console.log("done")
  1781.         storeEquip(0);
  1782.     } else if (e.keyCode == 27){
  1783.         if (modal.style.display = "none") {
  1784.             modal.style.display = "block";
  1785.         } else {
  1786.             modal.style.display = "none";
  1787.         }
  1788.     } else if (e.keyCode == TankGearKey && document.activeElement.id.toLowerCase() !== 'chatbox'){
  1789.         storeEquip(ID_TankGear);
  1790.     } else if (e.keyCode == SoldierHelmetKey && document.activeElement.id.toLowerCase() !== 'chatbox'){
  1791.         storeEquip(ID_SoldierHelmet);
  1792.     } else if (e.keyCode == BullHelmetKey && document.activeElement.id.toLowerCase() !== 'chatbox'){
  1793.         storeEquip(ID_BullHelmet);
  1794.     } else if (e.keyCode == BoosterHatKey && document.activeElement.id.toLowerCase() !== 'chatbox'){
  1795.         storeEquip(ID_BoosterHat);
  1796.     } else if (e.keyCode == EmpKey && document.activeElement.id.toLowerCase() !== 'chatbox'){
  1797.         storeEquip(ID_EmpHelmet);
  1798.     } else if (e.keyCode == SamuKey && document.activeElement.id.toLowerCase() !== 'chatbox'){
  1799.         storeEquip(ID_SamuraiArmor);
  1800.     } else if (e.keyCode == SpikeGearKey && document.activeElement.id.toLowerCase() !== 'chatbox'){
  1801.         storeEquip(ID_SpikeGear);
  1802.     } else if (e.keyCode == TurretKey && document.activeElement.id.toLowerCase() !== 'chatbox'){
  1803.         storeEquip(ID_TurretGear);
  1804.     }
  1805. })
  1806.  
  1807. // Get modal element
  1808. var modal = document.getElementById("simpleModal");
  1809. // Get close button
  1810. var closeBtn = document.getElementsByClassName('closeBtn')[0];
  1811.  
  1812. // Events
  1813. closeBtn.addEventListener('click', closeModal);
  1814. window.addEventListener('click', outsideClick);
  1815.  
  1816. // Close
  1817. function closeModal() {
  1818.     modal.style.display = 'none';
  1819. }
  1820.  
  1821. // Close If Outside Click
  1822. function outsideClick(e) {
  1823.     if (e.target == modal) {
  1824.         modal.style.display = 'none';
  1825.     }
  1826. }
  1827.  
  1828. var checkbox = document.querySelector("#myCheck")
  1829.  
  1830. checkbox.addEventListener('change', function() {
  1831.     if (this.checked) {
  1832.         $("#mapDisplay").css({background: `url('https://imgur.com/lFHNnV4')`});
  1833.         console.log('checked')
  1834.     } else {
  1835.         $("#mapDisplay").css({background: `rgba(0, 0, 0, 0.25)`})
  1836.         console.log('unchecked')
  1837.     }
  1838. })
  1839.  
  1840.  
  1841.  
  1842. var myElement = document.querySelector('#nameInput');
  1843. myElement.style.backgroundColor = "#fffdfd";
  1844. myElement.style.color = "#000000";
  1845.  
  1846. var getElement = document.querySelector('#enterGame');
  1847. getElement.style.backgroundColor = "#d81e1e";
  1848. getElement.style.color = "#000000";
  1849.  
  1850. window.history.replaceState = () => {};
  1851. window.history.pushState = () => {};
  1852.  
  1853. const force = getParam("force-connect", window.location.search);
  1854. const party = getParam("server", window.location.search);
  1855. const ip = /d+:d+:d+/.exec(party);
  1856. var canplace=true;
  1857. var run=true;
  1858.  
  1859.  
  1860. WebSocket = class extends WebSocket {
  1861.     constructor(...args){
  1862.         if (force !== null && /d+:d+:d+/.test(force)){
  1863.             const allServers = [];
  1864.             const servers = window.vultr.servers;
  1865.             let len = servers.length;
  1866.             let server;
  1867.             let games;
  1868.             let gameLen;
  1869.             while (len--) {
  1870.                 server = servers[len];
  1871.                 games = server.games;
  1872.                 gameLen = games.length;
  1873.                 while (gameLen--) {
  1874.                     allServers.push({id: `${server.region}:${server.index}:${gameLen}`, ip: server.ip, gameIndex: gameLen});
  1875.                 }
  1876.             }
  1877.             const s = (function (id) {
  1878.                 let len = allServers.length;
  1879.                 while (len--) {
  1880.                     if (allServers[len].id === id) return allServers[len];
  1881.                 }
  1882.                 return false;
  1883.             })(force);
  1884.             args[0] = args[0].replace(/ip_[a-z0-9]+/, `ip_${s.ip}`).replace(/?gameIndex=d+/, `?gameIndex=${s.gameIndex}`);
  1885.         }
  1886.         super(...args);
  1887.     }
  1888. };
  1889.  
  1890. function getParam(name, url) {
  1891.     if (!url) url = window.location.href;
  1892.     name = name.replace(/[[]]/g, "$&");
  1893.     var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
  1894.         results = regex.exec(url);
  1895.     if (!results) return null;
  1896.     if (!results[2]) return '';
  1897.     return decodeURIComponent(results[2].replace(/+/g, " "));
  1898. }
  1899. console.log("MooMoo.io modded UI");
  1900.  
  1901. (function(){
  1902.  
  1903.     addEventListener("click", function(e) { // changes the 'reload' button
  1904.         if (e.target.tagName == "A" && e.target.href == "javascript:window.location.href=window.location.href") {
  1905.             e.preventDefault();
  1906.             location.replace(location.origin);
  1907.         }
  1908.     });
  1909.  
  1910.     var sI = -1,
  1911.         hideAct = false;
  1912.  
  1913.     function $(e){
  1914.         var a = document.querySelectorAll(e);
  1915.         if(a.length == 1){
  1916.             return a[0];
  1917.         } else if(a.length == 0){
  1918.             return null;
  1919.         } else {
  1920.             return a;
  1921.         }
  1922.         return a;
  1923.     }
  1924.  
  1925.     function getCookie(e){
  1926.         var c = document.cookie, g;
  1927.         c=c.split('; ');
  1928.         c.forEach(function(ob){
  1929.             var f=ob.split('=');
  1930.             if(f[0]==e){
  1931.                 g=f[1];
  1932.                 return;
  1933.             }
  1934.             return;
  1935.         }
  1936.                  );
  1937.         if(g!==undefined){
  1938.             return g;
  1939.         }else{
  1940.             return null;
  1941.         }
  1942.     }
  1943.  
  1944.     function resetInterval() {
  1945.         clearInterval(sI);
  1946.  
  1947.         if(hideAct){
  1948.             $("#mainMenu").classList.remove("hide");
  1949.             hideAct = false;
  1950.         }
  1951.         sI = setInterval(function(){
  1952.             hideActionMenu();
  1953.         }, 10e3);
  1954.     }
  1955.  
  1956.     function hideActionMenu() {
  1957.         hideAct = true;
  1958.         $("#mainMenu").classList.add("hide");
  1959.     }
  1960.  
  1961.     addEventListener("mousemove", function(){
  1962.         resetInterval();
  1963.     });
  1964.     addEventListener("keydown", function() {
  1965.         resetInterval();
  1966.     });
  1967.     document.body.addEventListener("focus", function() {
  1968.         resetInterval();
  1969.     });
  1970.     addEventListener("blur", function() {
  1971.         hideActionMenu();
  1972.     });
  1973.  
  1974.     Array.prototype.remove = function(){
  1975.         for(let i of this){
  1976.             i.remove();
  1977.         }
  1978.     };
  1979.  
  1980.     Element.prototype.remove = function(){
  1981.         this.parentElement.removeChild(this);
  1982.     };
  1983.  
  1984.     window.Worker = null;
  1985.  
  1986.     addEventListener("load", function(){
  1987.         [$("#youtuberOf"), $("#adCard"), $("#followText"), $("#youtubeFollow"), $("#twitterFollow"), $(".menuCard[style='width:728px;display:inline-block;margin-top:10px;padding:10px;']")].remove();
  1988.         $("#promoImgHolder").innerHTML = "";
  1989.         {
  1990.             let a = [$("#serverBrowser"), $("#altServer")];
  1991.             for (var i = 0; i < a.length; i++) {
  1992.                 $("#promoImgHolder").appendChild(a[i]);
  1993.             }
  1994.         }
  1995.         {
  1996.             let settings = $(".settingRadio"),
  1997.                 parent = document.createElement("div");
  1998.  
  1999.             parent.classList.add("settings", "menuCard");
  2000.             parent.addEventListener("click", function(e) {
  2001.                 if (e.target == this) { // prevent closing if user clicked settings
  2002.                     this.classList.toggle("show");
  2003.                 }
  2004.             });
  2005.  
  2006.             for (let i of settings) {
  2007.                 parent.appendChild(i);
  2008.             }
  2009.  
  2010.             $("#menuCardHolder").children[0].appendChild(parent);
  2011.         }
  2012.         {
  2013.             let b = $("#skinColorHolder");
  2014.             $("#promoImgHolder").appendChild(b);
  2015.             $("#rightCardHolder").remove();
  2016.         }
  2017.         {
  2018.             if(localStorage.tampermonkeyMoomooChangelogSave){
  2019.                 if(localStorage.tampermonkeyMoomooChangelogSave == a.innerText){
  2020.                     a.parentElement.style.opacity = .5;
  2021.                 } else {
  2022.                     a.style.fontSize = "5em";
  2023.                     a.addEventListener("click", function(){
  2024.                         localStorage.tampermonkeyMoomooChangelogSave = a.innerText;
  2025.                         a.style.fontSize = "1em";
  2026.                         a.parentElement.style.opacity = .5;
  2027.                     });
  2028.                 }
  2029.             } else {
  2030.                 localStorage.tampermonkeyMoomooChangelogSave = a.innerText;
  2031.             }
  2032.         }
  2033.         {
  2034.             // custom css!
  2035.             let e = document.createElement("style");
  2036.             e.innerHTML = `
  2037.  
  2038. `;
  2039.             document.head.appendChild(e);
  2040.         }
  2041.     });
  2042.  
  2043. }());
  2044.  
  2045. try {
  2046.     window.admob = {
  2047.         requestInterstitialAd: ()=>{},
  2048.         showInterstitialAd: ()=>{}
  2049.     }
  2050. } catch (e) {
  2051.     console.warn(e)
  2052. }
  2053.  
  2054.  
  2055.  
  2056.  
  2057. $('#subConfirmationElement').click( () => {
  2058.     window.follmoo();
  2059.     localStorage["Subbed"] = true;
  2060. });
  2061.  
  2062. $("#youtuberOf").remove();
  2063. $("#followText").remove();
  2064. $("#twitterFollow").remove();
  2065. $("#youtubeFollow").remove();
  2066. $("#adCard").remove();
  2067. $("#mobileInstructions").remove();
  2068. $("#downloadButtonContainer").remove();
  2069. $("#mobileDownloadButtonContainer").remove();
  2070. $(".downloadBadge").remove();
  2071.  
  2072. var autoreloadloop;
  2073. var autoreloadenough = 0;
  2074.  
  2075. autoreloadloop = setInterval(function () {
  2076.     if (autoreloadenough < 200) {
  2077.         if (document.getElementById("loadingText").innerHTML == `disconnected<a href="javascript:window.location.href=window.location.href" class="ytLink">reload</a>`) {
  2078.             document.title = "AutoReload:Working";
  2079.             clearInterval(autoreloadloop);
  2080.             setTimeout(function () {document.title = "Moo Moo";}, 1000)
  2081.             location.reload();
  2082.         }
  2083.         autoreloadenough++;
  2084.     }
  2085.     else if (autoreloadenough >= 300) {
  2086.         clearInterval(autoreloadloop);
  2087.         document.title = "AutoReloader Done";
  2088.         setTimeout(function () {document.title = "Moo Moo";}, 1000)
  2089.     }
  2090. }, 50);
  2091.  
  2092. $("#consentBlock").css({display: "none"});
  2093. //$("#youtuberOf").css({display: "none"});
  2094.  
  2095. document.getElementById("moomooio_728x90_home").style.display = "none";
  2096. $("#moomooio_728x90_home").parent().css({display: "none"});
  2097.  
  2098. window.onbeforeunload = null;
  2099.  
  2100. let mouseX;
  2101. let mouseY;
  2102.  
  2103. let width;
  2104. let height;
  2105.  
  2106. setInterval(() => {
  2107.    if(clanToggle == 1) {
  2108.         doNewSend(["9", [null]]);
  2109.         doNewSend(["8", [animate(false, 5)]])
  2110.     }
  2111.     doNewSend(["testing", [6]]);
  2112. }, 200);
  2113.  
  2114. setInterval(() => {
  2115.     if(messageToggle == 1) {
  2116.         doNewSend(["ch", [animate(true, 5)]])
  2117.     }
  2118. }, 200);
  2119.  
  2120. setInterval(() => {
  2121.     if(autoaim == true) {
  2122.         doNewSend(["2", [nearestEnemyAngle]]);
  2123.     }
  2124. }, 0);
  2125.  
  2126. setInterval(() => {
  2127.     if(hatToggle == 1) {
  2128.         if(oldHat != normalHat) {
  2129.             hat(normalHat);
  2130.             console.log("Tried. - Hat")
  2131.         }
  2132.         if(oldAcc != normalAcc) {
  2133.             acc(normalAcc);
  2134.             console.log("Tried. - Acc")
  2135.         }
  2136.         oldHat = normalHat;
  2137.         oldAcc = normalAcc
  2138.     }
  2139. }, 25);
  2140.  
  2141. function normal() {
  2142.     hat(normalHat);
  2143.     acc(normalAcc);
  2144. }
  2145.  
  2146. function aim(x, y){
  2147.      var cvs = document.getElementById("gameCanvas");
  2148.      cvs.dispatchEvent(new MouseEvent("mousemove", {
  2149.          clientX: x,
  2150.          clientY: y
  2151.  
  2152.      }));
  2153. }
  2154. let coreURL = new URL(window.location.href);
  2155. window.sessionStorage.force = coreURL.searchParams.get("fc");
  2156.  
  2157. var nearestEnemy;
  2158. var nearestEnemyAngle;
  2159. var isEnemyNear;
  2160. var instaSpeed = 230;
  2161. var primary;
  2162. var secondary;
  2163. var foodType;
  2164. var wallType;
  2165. var spikeType;
  2166. var millType;
  2167. var mineType;
  2168. var boostType;
  2169. var turretType;
  2170. var spawnpadType;
  2171. var autoaim = true;
  2172. var tick = 0;
  2173. var oldHat;
  2174. var oldAcc;
  2175. var enemiesNear;
  2176. var normalHat;
  2177. var normalAcc;
  2178. var ws;
  2179. var canplace=true;
  2180. var run=true;
  2181. var msgpack5 = msgpack;
  2182. var boostDir;
  2183. let myPlayer = {
  2184.     id: null,
  2185.     x: null,
  2186.     y: null,
  2187.     dir: null,
  2188.     object: null,
  2189.     weapon: null,
  2190.     clan: null,
  2191.     isLeader: null,
  2192.     hat: null,
  2193.     accessory: null,
  2194.     isSkull: null
  2195. };
  2196.  
  2197. let healSpeed = 150;
  2198. var messageToggle = 0;
  2199. var clanToggle = 0;
  2200. let healToggle = 1;
  2201. let hatToggle = 0;
  2202. var stuff={};
  2203. var bot;
  2204. var atk;
  2205. var matk;
  2206. var accessories = [
  2207.     {
  2208.         id: 12,
  2209.         name: "Snowball",
  2210.         price: 1e3,
  2211.         scale: 105,
  2212.         xOff: 18,
  2213.         desc: "no effect"
  2214.     }, {
  2215.         id: 9,
  2216.         name: "Tree Cape",
  2217.         price: 1e3,
  2218.         scale: 90,
  2219.         desc: "no effect"
  2220.     }, {
  2221.         id: 10,
  2222.         name: "Stone Cape",
  2223.         price: 1e3,
  2224.         scale: 90,
  2225.         desc: "no effect"
  2226.     }, {
  2227.         id: 3,
  2228.         name: "Cookie Cape",
  2229.         price: 1500,
  2230.         scale: 90,
  2231.         desc: "no effect"
  2232.     }, {
  2233.         id: 8,
  2234.         name: "Cow Cape",
  2235.         price: 2e3,
  2236.         scale: 90,
  2237.         desc: "no effect"
  2238.     }, {
  2239.         id: 11,
  2240.         name: "Monkey Tail",
  2241.         price: 2e3,
  2242.         scale: 97,
  2243.         xOff: 25,
  2244.         desc: "Super speed but reduced damage",
  2245.         spdMult: 1.35,
  2246.         dmgMultO: .2
  2247.     }, {
  2248.         id: 17,
  2249.         name: "Apple Basket",
  2250.         price: 3e3,
  2251.         scale: 80,
  2252.         xOff: 12,
  2253.         desc: "slowly regenerates health over time",
  2254.         healthRegen: 1
  2255.     }, {
  2256.         id: 6,
  2257.         name: "Winter Cape",
  2258.         price: 3e3,
  2259.         scale: 90,
  2260.         desc: "no effect"
  2261.     }, {
  2262.         id: 4,
  2263.         name: "Skull Cape",
  2264.         price: 4e3,
  2265.         scale: 90,
  2266.         desc: "no effect"
  2267.     }, {
  2268.         id: 5,
  2269.         name: "Dash Cape",
  2270.         price: 5e3,
  2271.         scale: 90,
  2272.         desc: "no effect"
  2273.     }, {
  2274.         id: 2,
  2275.         name: "Dragon Cape",
  2276.         price: 6e3,
  2277.         scale: 90,
  2278.         desc: "no effect"
  2279.     }, {
  2280.         id: 1,
  2281.         name: "Super Cape",
  2282.         price: 8e3,
  2283.         scale: 90,
  2284.         desc: "no effect"
  2285.     }, {
  2286.         id: 7,
  2287.         name: "Troll Cape",
  2288.         price: 8e3,
  2289.         scale: 90,
  2290.         desc: "no effect"
  2291.     }, {
  2292.         id: 14,
  2293.         name: "Thorns",
  2294.         price: 1e4,
  2295.         scale: 115,
  2296.         xOff: 20,
  2297.         desc: "no effect"
  2298.     }, {
  2299.         id: 15,
  2300.         name: "Blockades",
  2301.         price: 1e4,
  2302.         scale: 95,
  2303.         xOff: 15,
  2304.         desc: "no effect"
  2305.     }, {
  2306.         id: 20,
  2307.         name: "Devils Tail",
  2308.         price: 1e4,
  2309.         scale: 95,
  2310.         xOff: 20,
  2311.         desc: "no effect"
  2312.     }, {
  2313.         id: 16,
  2314.         name: "Sawblade",
  2315.         price: 12e3,
  2316.         scale: 90,
  2317.         spin: !0,
  2318.         xOff: 0,
  2319.         desc: "deal damage to players that damage you",
  2320.         dmg: .15
  2321.     }, {
  2322.         id: 13,
  2323.         name: "Angel Wings",
  2324.         price: 15e3,
  2325.         scale: 138,
  2326.         xOff: 22,
  2327.         desc: "slowly regenerates health over time",
  2328.         healthRegen: 3
  2329.     }, {
  2330.         id: 19,
  2331.         name: "Shadow Wings",
  2332.         price: 15e3,
  2333.         scale: 138,
  2334.         xOff: 22,
  2335.         desc: "increased movement speed",
  2336.         spdMult: 1.1
  2337.     }, {
  2338.         id: 18,
  2339.         name: "Blood Wings",
  2340.         price: 2e4,
  2341.         scale: 178,
  2342.         xOff: 26,
  2343.         desc: "restores health when you deal damage",
  2344.         healD: .2
  2345.     }, {
  2346.         id: 21,
  2347.         name: "Corrupt X Wings",
  2348.         price: 2e4,
  2349.         scale: 178,
  2350.         xOff: 26,
  2351.         desc: "deal damage to players that damage you",
  2352.         dmg: .25
  2353.     }];
  2354.  
  2355. var hats = hats = [
  2356.     {
  2357.         id: 45,
  2358.         name: "Shame!",
  2359.         dontSell: !0,
  2360.         price: 0,
  2361.         scale: 120,
  2362.         desc: "hacks are for losers"
  2363.     }, {
  2364.         id: 51,
  2365.         name: "Moo Cap",
  2366.         price: 0,
  2367.         scale: 120,
  2368.         desc: "coolest mooer around"
  2369.     }, {
  2370.         id: 50,
  2371.         name: "Apple Cap",
  2372.         price: 0,
  2373.         scale: 120,
  2374.         desc: "apple farms remembers"
  2375.     }, {
  2376.         id: 28,
  2377.         name: "Moo Head",
  2378.         price: 0,
  2379.         scale: 120,
  2380.         desc: "no effect"
  2381.     }, {
  2382.         id: 29,
  2383.         name: "Pig Head",
  2384.         price: 0,
  2385.         scale: 120,
  2386.         desc: "no effect"
  2387.     }, {
  2388.         id: 30,
  2389.         name: "Fluff Head",
  2390.         price: 0,
  2391.         scale: 120,
  2392.         desc: "no effect"
  2393.     }, {
  2394.         id: 36,
  2395.         name: "Pandou Head",
  2396.         price: 0,
  2397.         scale: 120,
  2398.         desc: "no effect"
  2399.     }, {
  2400.         id: 37,
  2401.         name: "Bear Head",
  2402.         price: 0,
  2403.         scale: 120,
  2404.         desc: "no effect"
  2405.     }, {
  2406.         id: 38,
  2407.         name: "Monkey Head",
  2408.         price: 0,
  2409.         scale: 120,
  2410.         desc: "no effect"
  2411.     }, {
  2412.         id: 44,
  2413.         name: "Polar Head",
  2414.         price: 0,
  2415.         scale: 120,
  2416.         desc: "no effect"
  2417.     }, {
  2418.         id: 35,
  2419.         name: "Fez Hat",
  2420.         price: 0,
  2421.         scale: 120,
  2422.         desc: "no effect"
  2423.     }, {
  2424.         id: 42,
  2425.         name: "Enigma Hat",
  2426.         price: 0,
  2427.         scale: 120,
  2428.         desc: "join the enigma army"
  2429.     }, {
  2430.         id: 43,
  2431.         name: "Blitz Hat",
  2432.         price: 0,
  2433.         scale: 120,
  2434.         desc: "hey everybody i'm blitz"
  2435.     }, {
  2436.         id: 49,
  2437.         name: "Bob XIII Hat",
  2438.         price: 0,
  2439.         scale: 120,
  2440.         desc: "like and subscribe"
  2441.     }, {
  2442.         id: 8,
  2443.         name: "Bummle Hat",
  2444.         price: 100,
  2445.         scale: 120,
  2446.         desc: "no effect"
  2447.     }, {
  2448.         id: 2,
  2449.         name: "Straw Hat",
  2450.         price: 500,
  2451.         scale: 120,
  2452.         desc: "no effect"
  2453.     }, {
  2454.         id: 15,
  2455.         name: "Winter Cap",
  2456.         price: 600,
  2457.         scale: 120,
  2458.         desc: "allows you to move at normal speed in snow",
  2459.         coldM: 1
  2460.     }, {
  2461.         id: 5,
  2462.         name: "Cowboy Hat",
  2463.         price: 1e3,
  2464.         scale: 120,
  2465.         desc: "no effect"
  2466.     }, {
  2467.         id: 4,
  2468.         name: "Ranger Hat",
  2469.         price: 2e3,
  2470.         scale: 120,
  2471.         desc: "no effect"
  2472.     }, {
  2473.         id: 18,
  2474.         name: "Explorer Hat",
  2475.         price: 2e3,
  2476.         scale: 120,
  2477.         desc: "no effect"
  2478.     }, {
  2479.         id: 31,
  2480.         name: "Flipper Hat",
  2481.         price: 2500,
  2482.         scale: 120,
  2483.         desc: "have more control while in water",
  2484.         watrImm: !0
  2485.     }, {
  2486.         id: 1,
  2487.         name: "Marksman Cap",
  2488.         price: 3e3,
  2489.         scale: 120,
  2490.         desc: "increases arrow speed and range",
  2491.         aMlt: 1.3
  2492.     }, {
  2493.         id: 10,
  2494.         name: "Bush Gear",
  2495.         price: 3e3,
  2496.         scale: 160,
  2497.         desc: "allows you to disguise yourself as a bush"
  2498.     }, {
  2499.         id: 48,
  2500.         name: "Halo",
  2501.         price: 3e3,
  2502.         scale: 120,
  2503.         desc: "no effect"
  2504.     }, {
  2505.         id: 6,
  2506.         name: "Soldier Helmet",
  2507.         price: 4e3,
  2508.         scale: 120,
  2509.         desc: "reduces damage taken but slows movement",
  2510.         spdMult: .94,
  2511.         dmgMult: .75
  2512.     }, {
  2513.         id: 23,
  2514.         name: "Anti Venom Gear",
  2515.         price: 4e3,
  2516.         scale: 120,
  2517.         desc: "makes you immune to poison",
  2518.         poisonRes: 1
  2519.     }, {
  2520.         id: 13,
  2521.         name: "Medic Gear",
  2522.         price: 5e3,
  2523.         scale: 110,
  2524.         desc: "slowly regenerates health over time",
  2525.         healthRegen: 3
  2526.     }, {
  2527.         id: 9,
  2528.         name: "Miners Helmet",
  2529.         price: 5e3,
  2530.         scale: 120,
  2531.         desc: "earn 1 extra gold per resource",
  2532.         extraGold: 1
  2533.     }, {
  2534.         id: 32,
  2535.         name: "Musketeer Hat",
  2536.         price: 5e3,
  2537.         scale: 120,
  2538.         desc: "reduces cost of projectiles",
  2539.         projCost: .5
  2540.     }, {
  2541.         id: 7,
  2542.         name: "Bull Helmet",
  2543.         price: 6e3,
  2544.         scale: 120,
  2545.         desc: "increases damage done but drains health",
  2546.         healthRegen: -5,
  2547.         dmgMultO: 1.5,
  2548.         spdMult: .96
  2549.     }, {
  2550.         id: 22,
  2551.         name: "Emp Helmet",
  2552.         price: 6e3,
  2553.         scale: 120,
  2554.         desc: "turrets won't attack but you move slower",
  2555.         antiTurret: 1,
  2556.         spdMult: .7
  2557.     }, {
  2558.         id: 12,
  2559.         name: "Booster Hat",
  2560.         price: 6e3,
  2561.         scale: 120,
  2562.         desc: "increases your movement speed",
  2563.         spdMult: 1.16
  2564.     }, {
  2565.         id: 26,
  2566.         name: "Barbarian Armor",
  2567.         price: 8e3,
  2568.         scale: 120,
  2569.         desc: "knocks back enemies that attack you",
  2570.         dmgK: .6
  2571.     }, {
  2572.         id: 21,
  2573.         name: "Plague Mask",
  2574.         price: 1e4,
  2575.         scale: 120,
  2576.         desc: "melee attacks deal poison damage",
  2577.         poisonDmg: 5,
  2578.         poisonTime: 6
  2579.     }, {
  2580.         id: 46,
  2581.         name: "Bull Mask",
  2582.         price: 1e4,
  2583.         scale: 120,
  2584.         desc: "bulls won't target you unless you attack them",
  2585.         bullRepel: 1
  2586.     }, {
  2587.         id: 14,
  2588.         name: "Windmill Hat",
  2589.         topSprite: !0,
  2590.         price: 1e4,
  2591.         scale: 120,
  2592.         desc: "generates points while worn",
  2593.         pps: 1.5
  2594.     }, {
  2595.         id: 11,
  2596.         name: "Spike Gear",
  2597.         topSprite: !0,
  2598.         price: 1e4,
  2599.         scale: 120,
  2600.         desc: "deal damage to players that damage you",
  2601.         dmg: .45
  2602.     }, {
  2603.         id: 53,
  2604.         name: "Turret Gear",
  2605.         topSprite: !0,
  2606.         price: 1e4,
  2607.         scale: 120,
  2608.         desc: "you become a walking turret",
  2609.         turret: {
  2610.             proj: 1,
  2611.             range: 700,
  2612.             rate: 2500
  2613.         },
  2614.         spdMult: .5
  2615.     }, {
  2616.         id: 20,
  2617.         name: "Samurai Armor",
  2618.         price: 12e3,
  2619.         scale: 120,
  2620.         desc: "increased attack speed and fire rate",
  2621.         atkSpd: .78
  2622.     }, {
  2623.         id: 16,
  2624.         name: "Bushido Armor",
  2625.         price: 12e3,
  2626.         scale: 120,
  2627.         desc: "restores health when you deal damage",
  2628.         healD: .4
  2629.     }, {
  2630.         id: 27,
  2631.         name: "Scavenger Gear",
  2632.         price: 15e3,
  2633.         scale: 120,
  2634.         desc: "earn double points for each kill",
  2635.         kScrM: 2
  2636.     }, {
  2637.         id: 40,
  2638.         name: "Tank Gear",
  2639.         price: 15e3,
  2640.         scale: 120,
  2641.         desc: "increased damage to buildings but slower movement",
  2642.         spdMult: .3,
  2643.         bDmg: 3.3
  2644.     }, {
  2645.         id: 52,
  2646.         name: "Thief Gear",
  2647.         price: 15e3,
  2648.         scale: 120,
  2649.         desc: "steal half of a players gold when you kill them",
  2650.         goldSteal: .5
  2651.     }];
  2652.  
  2653. var objects = [
  2654.     {
  2655.         id: 0,
  2656.         name: "food",
  2657.         layer: 0
  2658.     }, {
  2659.         id: 1,
  2660.         name: "walls",
  2661.         place: !0,
  2662.         limit: 30,
  2663.         layer: 0
  2664.     }, {
  2665.         id: 2,
  2666.         name: "spikes",
  2667.         place: !0,
  2668.         limit: 15,
  2669.         layer: 0
  2670.     }, {
  2671.         id: 3,
  2672.         name: "mill",
  2673.         place: !0,
  2674.         limit: 7,
  2675.         layer: 1
  2676.     }, {
  2677.         id: 4,
  2678.         name: "mine",
  2679.         place: !0,
  2680.         limit: 1,
  2681.         layer: 0
  2682.     }, {
  2683.         id: 5,
  2684.         name: "trap",
  2685.         place: !0,
  2686.         limit: 6,
  2687.         layer: -1
  2688.     }, {
  2689.         id: 6,
  2690.         name: "booster",
  2691.         place: !0,
  2692.         limit: 12,
  2693.         layer: -1
  2694.     }, {
  2695.         id: 7,
  2696.         name: "turret",
  2697.         place: !0,
  2698.         limit: 2,
  2699.         layer: 1
  2700.     }, {
  2701.         id: 8,
  2702.         name: "watchtower",
  2703.         place: !0,
  2704.         limit: 12,
  2705.         layer: 1
  2706.     }, {
  2707.         id: 9,
  2708.         name: "buff",
  2709.         place: !0,
  2710.         limit: 4,
  2711.         layer: -1
  2712.     }, {
  2713.         id: 10,
  2714.         name: "spawn",
  2715.         place: !0,
  2716.         limit: 1,
  2717.         layer: -1
  2718.     }, {
  2719.         id: 11,
  2720.         name: "sapling",
  2721.         place: !0,
  2722.         limit: 2,
  2723.         layer: 0
  2724.     }, {
  2725.         id: 12,
  2726.         name: "blocker",
  2727.         place: !0,
  2728.         limit: 3,
  2729.         layer: -1
  2730.     }, {
  2731.         id: 13,
  2732.         name: "teleporter",
  2733.         place: !0,
  2734.         limit: 1,
  2735.         layer: -1
  2736.     }];
  2737.  
  2738. var weapons = [
  2739.     {
  2740.         id: 0,
  2741.         type: 0,
  2742.         name: "tool hammer",
  2743.         desc: "tool for gathering all resources",
  2744.         src: "hammer_1",
  2745.         length: 140,
  2746.         width: 140,
  2747.         xOff: -3,
  2748.         yOff: 18,
  2749.         dmg: 25,
  2750.         range: 65,
  2751.         gather: 1,
  2752.         speed: 300
  2753.     }, {
  2754.         id: 1,
  2755.         type: 0,
  2756.         age: 2,
  2757.         name: "hand axe",
  2758.         desc: "gathers resources at a higher rate",
  2759.         src: "axe_1",
  2760.         length: 140,
  2761.         width: 140,
  2762.         xOff: 3,
  2763.         yOff: 24,
  2764.         dmg: 30,
  2765.         spdMult: 1,
  2766.         range: 70,
  2767.         gather: 2,
  2768.         speed: 400
  2769.     }, {
  2770.         id: 2,
  2771.         type: 0,
  2772.         age: 8,
  2773.         pre: 1,
  2774.         name: "great axe",
  2775.         desc: "deal more damage and gather more resources",
  2776.         src: "great_axe_1",
  2777.         length: 140,
  2778.         width: 140,
  2779.         xOff: -8,
  2780.         yOff: 25,
  2781.         dmg: 35,
  2782.         spdMult: 1,
  2783.         range: 75,
  2784.         gather: 4,
  2785.         speed: 400
  2786.     }, {
  2787.         id: 3,
  2788.         type: 0,
  2789.         age: 2,
  2790.         name: "short sword",
  2791.         desc: "increased attack power but slower move speed",
  2792.         src: "sword_1",
  2793.         iPad: 1.3,
  2794.         length: 130,
  2795.         width: 210,
  2796.         xOff: -8,
  2797.         yOff: 46,
  2798.         dmg: 35,
  2799.         spdMult: .85,
  2800.         range: 110,
  2801.         gather: 1,
  2802.         speed: 300
  2803.     }, {
  2804.         id: 4,
  2805.         type: 0,
  2806.         age: 8,
  2807.         pre: 3,
  2808.         name: "katana",
  2809.         desc: "greater range and damage",
  2810.         src: "samurai_1",
  2811.         iPad: 1.3,
  2812.         length: 130,
  2813.         width: 210,
  2814.         xOff: -8,
  2815.         yOff: 59,
  2816.         dmg: 40,
  2817.         spdMult: .8,
  2818.         range: 118,
  2819.         gather: 1,
  2820.         speed: 300
  2821.     }, {
  2822.         id: 5,
  2823.         type: 0,
  2824.         age: 2,
  2825.         name: "polearm",
  2826.         desc: "long range melee weapon",
  2827.         src: "spear_1",
  2828.         iPad: 1.3,
  2829.         length: 130,
  2830.         width: 210,
  2831.         xOff: -8,
  2832.         yOff: 53,
  2833.         dmg: 45,
  2834.         knock: .2,
  2835.         spdMult: .82,
  2836.         range: 142,
  2837.         gather: 1,
  2838.         speed: 700
  2839.     }, {
  2840.         id: 6,
  2841.         type: 0,
  2842.         age: 2,
  2843.         name: "bat",
  2844.         desc: "fast long range melee weapon",
  2845.         src: "bat_1",
  2846.         iPad: 1.3,
  2847.         length: 110,
  2848.         width: 180,
  2849.         xOff: -8,
  2850.         yOff: 53,
  2851.         dmg: 20,
  2852.         knock: .7,
  2853.         range: 110,
  2854.         gather: 1,
  2855.         speed: 300
  2856.     }, {
  2857.         id: 7,
  2858.         type: 0,
  2859.         age: 2,
  2860.         name: "daggers",
  2861.         desc: "really fast short range weapon",
  2862.         src: "dagger_1",
  2863.         iPad: .8,
  2864.         length: 110,
  2865.         width: 110,
  2866.         xOff: 18,
  2867.         yOff: 0,
  2868.         dmg: 20,
  2869.         knock: .1,
  2870.         range: 65,
  2871.         gather: 1,
  2872.         hitSlow: .1,
  2873.         spdMult: 1.13,
  2874.         speed: 100
  2875.     }, {
  2876.         id: 8,
  2877.         type: 0,
  2878.         age: 2,
  2879.         name: "stick",
  2880.         desc: "great for gathering but very weak",
  2881.         src: "stick_1",
  2882.         length: 140,
  2883.         width: 140,
  2884.         xOff: 3,
  2885.         yOff: 24,
  2886.         dmg: 1,
  2887.         spdMult: 1,
  2888.         range: 70,
  2889.         gather: 7,
  2890.         speed: 400
  2891.     }, {
  2892.         id: 9,
  2893.         type: 1,
  2894.         age: 6,
  2895.         name: "hunting bow",
  2896.         desc: "bow used for ranged combat and hunting",
  2897.         src: "bow_1",
  2898.         req: ["wood", 4],
  2899.         length: 120,
  2900.         width: 120,
  2901.         xOff: -6,
  2902.         yOff: 0,
  2903.         projectile: 0,
  2904.         spdMult: .75,
  2905.         speed: 600
  2906.     }, {
  2907.         id: 10,
  2908.         type: 1,
  2909.         age: 6,
  2910.         name: "great hammer",
  2911.         desc: "hammer used for destroying structures",
  2912.         src: "great_hammer_1",
  2913.         length: 140,
  2914.         width: 140,
  2915.         xOff: -9,
  2916.         yOff: 25,
  2917.         dmg: 10,
  2918.         spdMult: .88,
  2919.         range: 75,
  2920.         sDmg: 7.5,
  2921.         gather: 1,
  2922.         speed: 400
  2923.     }, {
  2924.         id: 11,
  2925.         type: 1,
  2926.         age: 6,
  2927.         name: "wooden shield",
  2928.         desc: "blocks projectiles and reduces melee damage",
  2929.         src: "shield_1",
  2930.         length: 120,
  2931.         width: 120,
  2932.         shield: .2,
  2933.         xOff: 6,
  2934.         yOff: 0,
  2935.         spdMult: .7
  2936.     }, {
  2937.         id: 12,
  2938.         type: 1,
  2939.         age: 8,
  2940.         pre: 9,
  2941.         name: "crossbow",
  2942.         desc: "deals more damage and has greater range",
  2943.         src: "crossbow_1",
  2944.         req: ["wood", 5],
  2945.         aboveHand: !0,
  2946.         armS: .75,
  2947.         length: 120,
  2948.         width: 120,
  2949.         xOff: -4,
  2950.         yOff: 0,
  2951.         projectile: 2,
  2952.         spdMult: .7,
  2953.         speed: 700
  2954.     }, {
  2955.         id: 13,
  2956.         type: 1,
  2957.         age: 9,
  2958.         pre: 12,
  2959.         name: "repeater crossbow",
  2960.         desc: "high firerate crossbow with reduced damage",
  2961.         src: "crossbow_2",
  2962.         req: ["wood", 10],
  2963.         aboveHand: !0,
  2964.         armS: .75,
  2965.         length: 120,
  2966.         width: 120,
  2967.         xOff: -4,
  2968.         yOff: 0,
  2969.         projectile: 3,
  2970.         spdMult: .7,
  2971.         speed: 300
  2972.     }, {
  2973.         id: 14,
  2974.         type: 1,
  2975.         age: 6,
  2976.         name: "mc grabby",
  2977.         desc: "steals resources from enemies",
  2978.         src: "grab_1",
  2979.         length: 130,
  2980.         width: 210,
  2981.         xOff: -8,
  2982.         yOff: 53,
  2983.         dmg: 0,
  2984.         steal: 250,
  2985.         knock: .2,
  2986.         spdMult: 1.05,
  2987.         range: 125,
  2988.         gather: 0,
  2989.         speed: 700
  2990.     }, {
  2991.         id: 15,
  2992.         type: 1,
  2993.         age: 9,
  2994.         pre: 12,
  2995.         name: "musket",
  2996.         desc: "slow firerate but high damage and range",
  2997.         src: "musket_1",
  2998.         req: ["stone", 10],
  2999.         aboveHand: !0,
  3000.         rec: .35,
  3001.         armS: .6,
  3002.         hndS: .3,
  3003.         hndD: 1.6,
  3004.         length: 205,
  3005.         width: 205,
  3006.         xOff: 25,
  3007.         yOff: 0,
  3008.         projectile: 5,
  3009.         hideProjectile: !0,
  3010.         spdMult: .6,
  3011.         speed: 1500
  3012.     }];
  3013.  
  3014. var activeObjects = [
  3015.     {
  3016.         name: "apple",
  3017.         desc: "restores 20 health when consumed",
  3018.         req: ["food", 10],
  3019.         consume: function (e) {
  3020.             return e.changeHealth(20, e)
  3021.         },
  3022.         scale: 22,
  3023.         holdOffset: 15
  3024.     }, {
  3025.         age: 3,
  3026.         name: "cookie",
  3027.         desc: "restores 40 health when consumed",
  3028.         req: ["food", 15],
  3029.         consume: function (e) {
  3030.             return e.changeHealth(40, e)
  3031.         },
  3032.         scale: 27,
  3033.         holdOffset: 15
  3034.     }, {
  3035.         age: 7,
  3036.         name: "pizza",
  3037.         desc: "restores 30 health and another 50 over 5 seconds",
  3038.         req: ["food", 30],
  3039.         consume: function (e) {
  3040.             return !!(e.changeHealth(30, e) || e.health < 100) && (e.dmgOverTime.dmg = -10, e.dmgOverTime.doer = e, e.dmgOverTime.time = 5, !0)
  3041.         },
  3042.         scale: 27,
  3043.         holdOffset: 15
  3044.     }, {
  3045.         name: "wood wall",
  3046.         desc: "provides protection for your village",
  3047.         req: ["wood", 10],
  3048.         projDmg: !0,
  3049.         health: 380,
  3050.         scale: 50,
  3051.         holdOffset: 20,
  3052.         placeOffset: -5
  3053.     }, {
  3054.         age: 3,
  3055.         name: "stone wall",
  3056.         desc: "provides improved protection for your village",
  3057.         req: ["stone", 25],
  3058.         health: 900,
  3059.         scale: 50,
  3060.         holdOffset: 20,
  3061.         placeOffset: -5
  3062.     }, {
  3063.         age: 7,
  3064.         pre: 1,
  3065.         name: "castle wall",
  3066.         desc: "provides powerful protection for your village",
  3067.         req: ["stone", 35],
  3068.         health: 1500,
  3069.         scale: 52,
  3070.         holdOffset: 20,
  3071.         placeOffset: -5
  3072.     }, {
  3073.         name: "spikes",
  3074.         desc: "damages enemies when they touch them",
  3075.         req: ["wood", 20, "stone", 5],
  3076.         health: 400,
  3077.         dmg: 20,
  3078.         scale: 49,
  3079.         spritePadding: -23,
  3080.         holdOffset: 8,
  3081.         placeOffset: -5
  3082.     }, {
  3083.         age: 5,
  3084.         name: "greater spikes",
  3085.         desc: "damages enemies when they touch them",
  3086.         req: ["wood", 30, "stone", 10],
  3087.         health: 500,
  3088.         dmg: 35,
  3089.         scale: 52,
  3090.         spritePadding: -23,
  3091.         holdOffset: 8,
  3092.         placeOffset: -5
  3093.     }, {
  3094.         age: 9,
  3095.         pre: 1,
  3096.         name: "poison spikes",
  3097.         desc: "poisons enemies when they touch them",
  3098.         req: ["wood", 35, "stone", 15],
  3099.         health: 600,
  3100.         dmg: 30,
  3101.         pDmg: 5,
  3102.         scale: 52,
  3103.         spritePadding: -23,
  3104.         holdOffset: 8,
  3105.         placeOffset: -5
  3106.     }, {
  3107.         age: 9,
  3108.         pre: 2,
  3109.         name: "spinning spikes",
  3110.         desc: "damages enemies when they touch them",
  3111.         req: ["wood", 30, "stone", 20],
  3112.         health: 500,
  3113.         dmg: 45,
  3114.         turnSpeed: .003,
  3115.         scale: 52,
  3116.         spritePadding: -23,
  3117.         holdOffset: 8,
  3118.         placeOffset: -5
  3119.     }, {
  3120.         name: "windmill",
  3121.         desc: "generates gold over time",
  3122.         req: ["wood", 50, "stone", 10],
  3123.         health: 400,
  3124.         pps: 1,
  3125.         turnSpeed: .0016,
  3126.         spritePadding: 25,
  3127.         iconLineMult: 12,
  3128.         scale: 45,
  3129.         holdOffset: 20,
  3130.         placeOffset: 5
  3131.     }, {
  3132.         age: 5,
  3133.         pre: 1,
  3134.         name: "faster windmill",
  3135.         desc: "generates more gold over time",
  3136.         req: ["wood", 60, "stone", 20],
  3137.         health: 500,
  3138.         pps: 1.5,
  3139.         turnSpeed: .0025,
  3140.         spritePadding: 25,
  3141.         iconLineMult: 12,
  3142.         scale: 47,
  3143.         holdOffset: 20,
  3144.         placeOffset: 5
  3145.     }, {
  3146.         age: 8,
  3147.         pre: 1,
  3148.         name: "power mill",
  3149.         desc: "generates more gold over time",
  3150.         req: ["wood", 100, "stone", 50],
  3151.         health: 800,
  3152.         pps: 2,
  3153.         turnSpeed: .005,
  3154.         spritePadding: 25,
  3155.         iconLineMult: 12,
  3156.         scale: 47,
  3157.         holdOffset: 20,
  3158.         placeOffset: 5
  3159.     }, {
  3160.         age: 5,
  3161.         type: 2,
  3162.         name: "mine",
  3163.         desc: "allows you to mine stone",
  3164.         req: ["wood", 20, "stone", 100],
  3165.         iconLineMult: 12,
  3166.         scale: 65,
  3167.         holdOffset: 20,
  3168.         placeOffset: 0
  3169.     }, {
  3170.         age: 5,
  3171.         type: 0,
  3172.         name: "sapling",
  3173.         desc: "allows you to farm wood",
  3174.         req: ["wood", 150],
  3175.         iconLineMult: 12,
  3176.         colDiv: .5,
  3177.         scale: 110,
  3178.         holdOffset: 50,
  3179.         placeOffset: -15
  3180.     }, {
  3181.         age: 4,
  3182.         name: "pit trap",
  3183.         desc: "pit that traps enemies if they walk over it",
  3184.         req: ["wood", 30, "stone", 30],
  3185.         trap: !0,
  3186.         ignoreCollision: !0,
  3187.         hideFromEnemy: !0,
  3188.         health: 500,
  3189.         colDiv: .2,
  3190.         scale: 50,
  3191.         holdOffset: 20,
  3192.         placeOffset: -5
  3193.     }, {
  3194.         age: 4,
  3195.         name: "boost pad",
  3196.         desc: "provides boost when stepped on",
  3197.         req: ["stone", 20, "wood", 5],
  3198.         ignoreCollision: !0,
  3199.         boostSpeed: 1.5,
  3200.         health: 150,
  3201.         colDiv: .7,
  3202.         scale: 45,
  3203.         holdOffset: 20,
  3204.         placeOffset: -5
  3205.     }, {
  3206.         age: 7,
  3207.         doUpdate: !0,
  3208.         name: "turret",
  3209.         desc: "defensive structure that shoots at enemies",
  3210.         req: ["wood", 200, "stone", 150],
  3211.         health: 800,
  3212.         projectile: 1,
  3213.         shootRange: 700,
  3214.         shootRate: 2200,
  3215.         scale: 43,
  3216.         holdOffset: 20,
  3217.         placeOffset: -5
  3218.     }, {
  3219.         age: 7,
  3220.         name: "platform",
  3221.         desc: "platform to shoot over walls and cross over water",
  3222.         req: ["wood", 20],
  3223.         ignoreCollision: !0,
  3224.         zIndex: 1,
  3225.         health: 300,
  3226.         scale: 43,
  3227.         holdOffset: 20,
  3228.         placeOffset: -5
  3229.     }, {
  3230.         age: 7,
  3231.         name: "healing pad",
  3232.         desc: "standing on it will slowly heal you",
  3233.         req: ["wood", 30, "food", 10],
  3234.         ignoreCollision: !0,
  3235.         healCol: 15,
  3236.         health: 400,
  3237.         colDiv: .7,
  3238.         scale: 45,
  3239.         holdOffset: 20,
  3240.         placeOffset: -5
  3241.     }, {
  3242.         age: 9,
  3243.         name: "spawn pad",
  3244.         desc: "you will spawn here when you die but it will dissapear",
  3245.         req: ["wood", 100, "stone", 100],
  3246.         health: 400,
  3247.         ignoreCollision: !0,
  3248.         spawnPoint: !0,
  3249.         scale: 45,
  3250.         holdOffset: 20,
  3251.         placeOffset: -5
  3252.     }, {
  3253.         age: 7,
  3254.         name: "blocker",
  3255.         desc: "blocks building in radius",
  3256.         req: ["wood", 30, "stone", 25],
  3257.         ignoreCollision: !0,
  3258.         blocker: 300,
  3259.         health: 400,
  3260.         colDiv: .7,
  3261.         scale: 45,
  3262.         holdOffset: 20,
  3263.         placeOffset: -5
  3264.     }, {
  3265.         age: 7,
  3266.         name: "teleporter",
  3267.         desc: "teleports you to a random point on the map",
  3268.         req: ["wood", 60, "stone", 60],
  3269.         ignoreCollision: !0,
  3270.         teleport: !0,
  3271.         health: 200,
  3272.         colDiv: .7,
  3273.         scale: 45,
  3274.         holdOffset: 20,
  3275.         placeOffset: -5
  3276.     }];
  3277.  
  3278. var allContainers = [accessories, hats, objects, weapons, activeObjects];
  3279.  
  3280. document.msgpack = msgpack;
  3281. function n(){
  3282.     this.buffer = new Uint8Array([0]);
  3283.     this.buffer.__proto__ = new Uint8Array;
  3284.     this.type = 0;
  3285. }
  3286.  
  3287. WebSocket.prototype.oldSend = WebSocket.prototype.send;
  3288. WebSocket.prototype.send = function(m){
  3289.     if (!ws){
  3290.         document.ws = this;
  3291.  
  3292.         ws = this;
  3293.         socketFound(this);
  3294.     }
  3295.     this.oldSend(m);
  3296. };
  3297. var run,food;
  3298.  
  3299. function socketFound(socket){
  3300.     socket.addEventListener('message', function(message){
  3301.         handleMessage(message);
  3302.     });
  3303. }
  3304. var yes;
  3305. function handleMessage(m){
  3306.     let temp = msgpack5.decode(new Uint8Array(m.data));
  3307.     let data;
  3308.     if(temp.length > 1) {
  3309.         data = [temp[0], ...temp[1]];
  3310.         if (data[1] instanceof Array){
  3311.             data = data;
  3312.         }
  3313.     } else {
  3314.         data = temp;
  3315.     }
  3316.     let item = data[0];
  3317.     if(!data) {return};
  3318.  
  3319.     if(item === "io-init") {
  3320.         let cvs = document.getElementById("gameCanvas");
  3321.         width = cvs.clientWidth;
  3322.         height = cvs.clientHeight;
  3323.         $(window).resize(function() {
  3324.             width = cvs.clientWidth;
  3325.             height = cvs.clientHeight;
  3326.         });
  3327.         cvs.addEventListener("mousemove", e => {
  3328.             mouseX = e.clientX;
  3329.             mouseY = e.clientY;
  3330.         });
  3331.     }
  3332.  
  3333.     if (item == "1" && myPlayer.id == null){
  3334.         myPlayer.id = data[1];
  3335.     }
  3336.  
  3337.     if (item == "33") {
  3338.         enemiesNear = [];
  3339.         for(let i = 0; i < data[1].length / 13; i++) {
  3340.             let playerInfo = data[1].slice(13*i, 13*i+13);
  3341.             if(playerInfo[0] == myPlayer.id) {
  3342.                 myPlayer.x = playerInfo[1];
  3343.                 myPlayer.y = playerInfo[2];
  3344.                 myPlayer.dir = playerInfo[3];
  3345.                 myPlayer.object = playerInfo[4];
  3346.                 myPlayer.weapon = playerInfo[5];
  3347.                 myPlayer.clan = playerInfo[7];
  3348.                 myPlayer.isLeader = playerInfo[8];
  3349.                 myPlayer.hat = playerInfo[9];
  3350.                 myPlayer.accessory = playerInfo[10];
  3351.                 myPlayer.isSkull = playerInfo[11];
  3352.             } else if(playerInfo[7] != myPlayer.clan || playerInfo[7] === null) {
  3353.                 enemiesNear.push(playerInfo);
  3354.             }
  3355.         }
  3356.     }
  3357.  
  3358.     isEnemyNear = false;
  3359.     if(enemiesNear) {
  3360.         nearestEnemy = enemiesNear.sort((a,b) => dist(a, myPlayer) - dist(b, myPlayer))[0];
  3361.     }
  3362.  
  3363.  
  3364.     if(nearestEnemy) {
  3365.         nearestEnemyAngle = Math.atan2(nearestEnemy[2]-myPlayer.y, nearestEnemy[1]-myPlayer.x);
  3366.         if(!bot&&!autokill){
  3367.             if(Math.sqrt(Math.pow((myPlayer.y-nearestEnemy[2]), 2) + Math.pow((myPlayer.x-nearestEnemy[1]), 2)) < 300) {
  3368.                 isEnemyNear = true;
  3369.                 if(autoaim == false && myPlayer.hat != 7 && myPlayer.hat != 53) {
  3370.                     normalHat = 6;
  3371.                     if(primary != 8) {
  3372.                         normalAcc = 21
  3373.                     }
  3374.                 };
  3375.             }
  3376.         }else{
  3377.             if(!atk){
  3378.                 isEnemyNear = true;
  3379.                 autoaim=false;
  3380.                 if(autoaim == false && myPlayer.hat != 7 && myPlayer.hat != 53) {
  3381.                     normalHat = 6;
  3382.                     if(primary != 8) {
  3383.                         normalAcc = 19
  3384.                     }
  3385.                 };
  3386.             }}
  3387.         if(Math.sqrt(Math.pow((myPlayer.y-nearestEnemy[2]), 2) + Math.pow((myPlayer.x-nearestEnemy[1]), 2)) < 30000){yes=true;}else{yes=false}
  3388.         if(Math.sqrt(Math.pow((myPlayer.y-nearestEnemy[2]), 2) + Math.pow((myPlayer.x-nearestEnemy[1]), 2)) > stuff.PR+95){atk=true}else{atk=false}
  3389.         if(Math.sqrt(Math.pow((myPlayer.y-nearestEnemy[2]), 2) + Math.pow((myPlayer.x-nearestEnemy[1]), 2)) >stuff.PR+200){boost=true}else{boost=false}
  3390.     }
  3391.  
  3392.  
  3393.  
  3394.     if(isEnemyNear == false && autoaim == false) {
  3395.         normalAcc = 11;
  3396.         if (myPlayer.y < 2400){
  3397.             normalHat = 15;
  3398.         } else if (myPlayer.y > 6850 && myPlayer.y < 7550){
  3399.             normalHat = 31;
  3400.         } else {
  3401.             normalHat = 12;
  3402.         }
  3403.     }
  3404.     if (!nearestEnemy) {
  3405.         nearestEnemyAngle = myPlayer.dir;
  3406.     }
  3407.     if(item == "h" && data[1] == myPlayer.id) {
  3408.         if(data[2] < 100 && data[2] > 0 && healToggle == 1) {
  3409.             setTimeout( () => {
  3410.                 place(foodType, null);
  3411.             }, healSpeed);
  3412.  
  3413.         }
  3414.     }
  3415.     update();
  3416. }
  3417.  
  3418. function id(n){return document.getElementById(n);};
  3419. function doNewSend(sender){
  3420.     ws.send(new Uint8Array(Array.from(msgpack5.encode(sender))));
  3421. }
  3422.  
  3423. function acc(id) {
  3424.     doNewSend(["13c", [0, 0, 1]]);
  3425.     doNewSend(["13c", [0, id, 1]]);
  3426. }
  3427.  
  3428. function hat(id) {
  3429.     doNewSend(["13c", [0, id, 0]]);
  3430. }
  3431.  
  3432.  
  3433. function place(id, angle = Math.atan2(mouseY - height / 2, mouseX - width / 2)) {
  3434.     doNewSend(["5", [id, null]]);
  3435.     doNewSend(["c", [1, angle]]);
  3436.     doNewSend(["c", [0, angle]]);
  3437.     doNewSend(["5", [myPlayer.weapon, true]]);
  3438. }
  3439.  
  3440. function boostSpike() {
  3441.     if(boostDir == null) {
  3442.         boostDir = nearestEnemyAngle;
  3443.     }
  3444.     boostDir = nearestEnemyAngle;
  3445.     place(spikeType, boostDir + toRad(90));
  3446.     place(spikeType, boostDir - toRad(90));
  3447.     place(boostType, boostDir);
  3448.     doNewSend(["33", [boostDir]]);
  3449. }
  3450. function boostWall() {
  3451.     if(boostDir == null) {
  3452.         boostDir = nearestEnemyAngle;
  3453.     }
  3454.     place(wallType, boostDir + toRad(90));
  3455.     place(wallType, boostDir - toRad(90));
  3456.     place(boostType, boostDir);
  3457.     doNewSend(["33", [boostDir]]);
  3458. }
  3459. function fourSpike() {
  3460.     place(spikeType, myPlayer.dir + toRad(0));
  3461.     place(spikeType, myPlayer.dir - toRad(90));
  3462.     place(spikeType, myPlayer.dir + toRad(90));
  3463.     place(spikeType, myPlayer.dir - toRad(180));
  3464.     place(spikeType, myPlayer.dir + toRad(45));
  3465.     place(spikeType, myPlayer.dir - toRad(45));
  3466.     place(spikeType, myPlayer.dir + toRad(135));
  3467.     place(spikeType, myPlayer.dir - toRad(135));
  3468.     place(spikeType, myPlayer.dir + toRad(60));
  3469.     place(spikeType, myPlayer.dir - toRad(60));
  3470.     place(spikeType, myPlayer.dir + toRad(150));
  3471.     place(spikeType, myPlayer.dir - toRad(150));
  3472.     place(spikeType, myPlayer.dir + toRad(30));
  3473.     place(spikeType, myPlayer.dir - toRad(30));
  3474.     place(spikeType, myPlayer.dir + toRad(120));
  3475.     place(spikeType, myPlayer.dir - toRad(120));
  3476. }
  3477. setInterval(MATK,0);
  3478. function MATK(){if(matk){
  3479.     doNewSend(["c", [1]]);
  3480.     doNewSend(["c", [0, null]]);
  3481. }}
  3482. function botmode(){
  3483.     if(bot){
  3484.         if(yes){
  3485.             if(run){boostDir = nearestEnemyAngle;
  3486.                     doNewSend(["33", [-boostDir]]);}else{
  3487.                         if(!atk){
  3488.                             boostDir = nearestEnemyAngle;
  3489.                             doNewSend(["33", [boostDir]]);
  3490.                             matk=false;
  3491.                         }else{
  3492.                             matk=true
  3493.                         }
  3494.                     }
  3495.         }
  3496.     }
  3497. }
  3498. var repeater = function(key, action, interval) {
  3499.     let _isKeyDown = false;
  3500.     let _intervalId = undefined;
  3501.  
  3502.     return {
  3503.         start(keycode) {
  3504.             if(keycode == key && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3505.                 _isKeyDown = true;
  3506.                 if(_intervalId === undefined) {
  3507.                     _intervalId = setInterval(() => {
  3508.                         action();
  3509.                         if(!_isKeyDown){
  3510.                             clearInterval(_intervalId);
  3511.                             _intervalId = undefined;
  3512.                             console.log("claered");
  3513.                         }
  3514.                     }, interval);
  3515.                 }
  3516.             }
  3517.         },
  3518.  
  3519.         stop(keycode) {
  3520.             if(keycode == key && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3521.                 _isKeyDown = false;
  3522.             }
  3523.         }
  3524.     };
  3525.  
  3526.  
  3527. }
  3528. var again=true;
  3529. const healer = repeater(81, () => {place(foodType)}, 0);
  3530. const boostPlacer = repeater(70, () => {place(boostType)}, 0);
  3531. const spikePlacer = repeater(86, () => {place(spikeType)}, 0);
  3532. const millPlacer = repeater(78, () => {place(millType)}, 0);
  3533. const turretPlacer = repeater(56, () => {place(turretType)}, 0);
  3534. const wallPlacer = repeater(52, () => {place(wallType)}, 0);
  3535. const boostSpiker = repeater(71, boostSpike, 0);
  3536. const boostWaller = repeater(191, boostWall, 0);
  3537. const fourSpiker = repeater(66, fourSpike, 0);
  3538. var autokill=false
  3539. var a=true;
  3540. var autoinsta = setInterval(function () {
  3541.     if (autokill) {
  3542.         if(yes){
  3543.             if (run) {
  3544.                 boostDir = nearestEnemyAngle;
  3545.                 doNewSend(["33", [-boostDir]]);
  3546.             }
  3547.             else {
  3548.                 if (!atk) {
  3549.                     if (a) {
  3550.                         a = false;
  3551.                         autoaim = true;
  3552.                         doNewSend(["5", [primary, true]]);
  3553.                         doNewSend(["13c", [0, 7, 0]]);
  3554.                         doNewSend(["13c", [0, 0, 1]]);
  3555.                         doNewSend(["13c", [0, 18, 1]]);
  3556.                         doNewSend(["c", [1]]);
  3557.                         setTimeout(() => {
  3558.                             doNewSend(["13c", [0, 53, 0]]);
  3559.                             doNewSend(["5", [secondary, true]]);
  3560.                         }, instaSpeed - 130);
  3561.  
  3562.                         setTimeout(() => {
  3563.                             doNewSend(["5", [primary, true]]);
  3564.                             doNewSend(["c", [0, null]]);
  3565.                             doNewSend(["13c", [0, 0, 0]]);
  3566.                             doNewSend(["13c", [0, 6, 0]]);
  3567.                             doNewSend(["13c", [0, 19, 1]]);
  3568.                             autoaim = false;
  3569.                             setTimeout(function () {
  3570.                                 doNewSend(["5", [secondary, true]]);
  3571.                                 setTimeout(function () { setTimeout(function(){a = true ;},300);doNewSend(["5", [primary, true]]);}, stuff.SS + 100)
  3572.                             }, stuff.PS + 100);
  3573.                         }, instaSpeed);
  3574.                     }
  3575.                 }
  3576.                 else {
  3577.                     boostDir = nearestEnemyAngle;
  3578.                     doNewSend(["33", [boostDir]]);
  3579.                     if(boost){place(boostType, boostDir);}
  3580.                 }
  3581.             }
  3582.         }
  3583.     }
  3584. }, 0);
  3585. document.addEventListener('keydown', (e)=>{
  3586.     spikePlacer.start(e.keyCode);
  3587.     healer.start(e.keyCode);
  3588.     boostPlacer.start(e.keyCode);
  3589.     boostWaller.start(e.keyCode);
  3590.     fourSpiker.start(e.keyCode);
  3591.     boostSpiker.start(e.keyCode);
  3592.     millPlacer.start(e.keyCode);
  3593.     wallPlacer.start(e.keyCode);
  3594.     turretPlacer.start(e.keyCode);
  3595.     if (e.keyCode == 186 && document.activeElement.id.toLowerCase() !== 'chatbox'){
  3596.         autokill=!autokill;
  3597.         if(autokill){if(!a){a=!a;}}
  3598.     }
  3599.  
  3600.     if (e.keyCode == 79 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3601.         for (let i=0;i<5;i++){
  3602.             let angle = myPlayer.dir + toRad(i * 72);
  3603.             place(millType, angle)
  3604.         }
  3605.     }
  3606.     if (e.keyCode == 80 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3607.         for (let i=0;i<4;i++){
  3608.             let angle = myPlayer.dir + toRad(i * 90);
  3609.             place(wallType, angle)
  3610.         }
  3611.     }
  3612.     if (e.keyCode == 72 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3613.         place(turretType, myPlayer.dir + toRad(45));
  3614.         place(turretType, myPlayer.dir - toRad(45));
  3615.     }
  3616.     if (e.keyCode == 188 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3617.         place(wallType, myPlayer.dir + toRad(90));
  3618.         place(spikeType, myPlayer.dir + toRad(180));
  3619.         place(boostType, myPlayer.dir + toRad(270));
  3620.         place(millType, myPlayer.dir + toRad(0));
  3621.     }
  3622.     if (e.keyCode == 33 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3623.         place(boostType, myPlayer.dir + toRad(45));
  3624.         place(boostType, myPlayer.dir - toRad(45));
  3625.         place(spikeType, myPlayer.dir + toRad(135));
  3626.         place(spikeType, myPlayer.dir + toRad(225));
  3627.     }
  3628.     if (e.keyCode == 73 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3629.         place(boostType, myPlayer.dir + toRad(45));
  3630.         place(boostType, myPlayer.dir - toRad(45));
  3631.         place(boostType, myPlayer.dir + toRad(135));
  3632.         place(boostType, myPlayer.dir + toRad(225));
  3633.     }
  3634.  
  3635.     if(e.keyCode == 113 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3636.         doNewSend(["6", [8]]);
  3637.         doNewSend(["6", [17]]);
  3638.         doNewSend(["6", [31]]);
  3639.         doNewSend(["6", [23]]);
  3640.         doNewSend(["6", [10]]);
  3641.         doNewSend(["6", [33]]);
  3642.         doNewSend(["6", [28]]);
  3643.         doNewSend(["6", [25]]);
  3644.         doNewSend(["5", [1]]);
  3645.         doNewSend(["c", [1]]);
  3646.         doNewSend(["c", [0]]);
  3647.     }
  3648.     if(e.keyCode == 118 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3649.  
  3650.         doNewSend(["6", [3]]);
  3651.         doNewSend(["6", [17]]);
  3652.         doNewSend(["6", [31]]);
  3653.         doNewSend(["6", [23]]);
  3654.         doNewSend(["6", [9]]);
  3655.         doNewSend(["6", [33]]);
  3656.         doNewSend(["6", [4]]);
  3657.         doNewSend(["6", [15]]);
  3658.     }
  3659.     if(e.keyCode == 119 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3660.  
  3661.         doNewSend(["6", [1]]);
  3662.         doNewSend(["6", [17]]);
  3663.         doNewSend(["6", [31]]);
  3664.         doNewSend(["6", [23]]);
  3665.         doNewSend(["6", [9]]);
  3666.         doNewSend(["6", [33]]);
  3667.         doNewSend(["6", [2]]);
  3668.         doNewSend(["6", [15]]);
  3669.     }
  3670.     if(e.keyCode == 121 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3671.         doNewSend(["6", [5]]);
  3672.         doNewSend(["6", [17]]);
  3673.         doNewSend(["6", [31]]);
  3674.         doNewSend(["6", [23]]);
  3675.         doNewSend(["6", [9]]);
  3676.         doNewSend(["6", [33]]);
  3677.         doNewSend(["6", [12]]);
  3678.         doNewSend(["6", [15]]);
  3679.  
  3680.     }
  3681.     if (e.keyCode == 16 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3682.         if (myPlayer.y < 2400){
  3683.             hat(15);
  3684.         } else if (myPlayer.y > 6850 && myPlayer.y < 7550){
  3685.             hat(31);
  3686.         } else {
  3687.             hat(12);
  3688.         }
  3689.         acc(11);
  3690.     }
  3691.  
  3692.     if (e.keyCode == 84 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3693.         hat(7);
  3694.         acc(18);
  3695.     }
  3696.  
  3697.  
  3698.     if (e.keyCode == 89 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3699.         hat(6);
  3700.         acc(19);
  3701.     }
  3702.     if (e.keyCode == 192 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3703.         hat(0);
  3704.         acc(0);
  3705.     }
  3706.  
  3707.     if(e.keyCode == 82 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3708.         a=false;
  3709.         autoaim = true;
  3710.         doNewSend(["5", [primary, true]]);
  3711.         doNewSend(["ch", [mess(true, 5)]]);
  3712.         doNewSend(["13c", [0, 21, 1]]);
  3713.         doNewSend(["13c", [0, 7, 0]]);
  3714.         doNewSend(["13c", [0, 0, 1]]);
  3715.         doNewSend(["c", [1]]);
  3716.         setTimeout( () => {
  3717.             doNewSend(["13c", [0, 53, 0]]);
  3718.             doNewSend(["5", [secondary, true]]);
  3719.         }, instaSpeed - 130);
  3720.  
  3721.         setTimeout( () => {
  3722.             doNewSend(["5", [primary, true]]);
  3723.             doNewSend(["c", [0, null]]);
  3724.             doNewSend(["13c", [0, 6, 0]]);
  3725.             doNewSend(["13c", [0, 6, 0]]);
  3726.             doNewSend(["13c", [0, 19, 1]]);
  3727.             autoaim = false;
  3728.             setTimeout(function(){
  3729.                 doNewSend(["5", [secondary, true]]);
  3730.                 setTimeout(function(){a=true;doNewSend(["5", [primary, true]]);},stuff.SS+100)
  3731.             },stuff.PS+100);
  3732.         }, instaSpeed);
  3733.     }
  3734.  
  3735.  
  3736.     if(e.keyCode == 85 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3737.         autoaim = true;
  3738.         doNewSend(["5", [primary, true]]);
  3739.         doNewSend(["13c", [0, 7, 0]]);
  3740.         doNewSend(["13c", [0, 0, 1]]);
  3741.         doNewSend(["13c", [0, 18, 1]]);
  3742.         doNewSend(["c", [1]]);
  3743.  
  3744.         setTimeout( () => {
  3745.             doNewSend(["6", [5]]);
  3746.         }, 100);
  3747.  
  3748.         setTimeout( () => {
  3749.             doNewSend(["13c", [0, 53, 0]]);
  3750.             place(spikeType, myPlayer.dir + toRad(0));
  3751.         }, 200);
  3752.  
  3753.         setTimeout( () => {
  3754.             doNewSend(["5", [primary, true]]);
  3755.             doNewSend(["c", [0, null]]);
  3756.             doNewSend(["13c", [0, 0, 0]]);
  3757.             doNewSend(["13c", [0, 6, 0]]);
  3758.             doNewSend(["13c", [0, 19, 1]]);
  3759.             autoaim = false;
  3760.         }, 300);
  3761.     }
  3762.  
  3763.     if(e.keyCode == 32 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3764.         autoaim = true;
  3765.         doNewSend(["5", [primary, true]]);
  3766.         doNewSend(["13c", [0, 7, 0]]);
  3767.         doNewSend(["13c", [0, 0, 1]]);
  3768.         doNewSend(["13c", [0, 19, 1]]);
  3769.         place(spikeType, myPlayer.dir + toRad(45));
  3770.         place(spikeType, myPlayer.dir - toRad(45));
  3771.         doNewSend(["c", [1]]);
  3772.  
  3773.         setTimeout( () => {
  3774.             doNewSend(["13c", [0, 53, 0]]);
  3775.         }, 100);
  3776.  
  3777.         setTimeout( () => {
  3778.             doNewSend(["c", [0, null]]);
  3779.             doNewSend(["13c", [0, 0, 0]]);
  3780.             doNewSend(["13c", [0, 6, 0]]);
  3781.             autoaim = false;
  3782.         }, 200);
  3783.     }
  3784.  
  3785.     if(e.keyCode == 120 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3786.         autoaim = false;
  3787.         doNewSend(["5", [primary, true]]);
  3788.         doNewSend(["13c", [0, 7, 0]]);
  3789.         doNewSend(["13c", [0, 0, 1]]);
  3790.         doNewSend(["13c", [0, 18, 1]]);
  3791.         doNewSend(["c", [1]]);
  3792.  
  3793.         setTimeout( () => {
  3794.             doNewSend(["13c", [0, 53, 0]]);
  3795.         }, 120);
  3796.  
  3797.         setTimeout( () => {
  3798.             doNewSend(["c", [0, null]]);
  3799.             doNewSend(["13c", [0, 0, 0]]);
  3800.             doNewSend(["13c", [0, 11, 1]]);
  3801.             doNewSend(["13c", [0, 12, 0]]);
  3802.             autoaim = false;
  3803.         }, 220);
  3804.     }
  3805.  
  3806.  
  3807.     if(e.keyCode == 106 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3808.         healToggle = (healToggle + 1) % 2;
  3809.         if(healToggle == 0) {
  3810.             if(hatToggle == 0) {
  3811.                 document.title = "Heal: OFF | Hat: OFF"
  3812.             } else {
  3813.                 document.title = "Heal: OFF | Hat: ON"
  3814.             }
  3815.         } else {
  3816.             if(hatToggle == 0) {
  3817.                 document.title = "Heal: ON | Hat: OFF"
  3818.             } else {
  3819.                 document.title = "Heal: ON | Hat: ON"
  3820.             }
  3821.         }
  3822.     }
  3823.     if(e.keyCode == 76 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3824.         autoaim = true;
  3825.         doNewSend(["5", [secondary, true]]);
  3826.         doNewSend(["13c", [0, 53, 0]]);
  3827.         doNewSend(["c", [1]]);
  3828.  
  3829.         setTimeout( () => {
  3830.             doNewSend(["13c", [0, 10, 0]]);
  3831.             doNewSend(["6", [12]]);
  3832.  
  3833.         }, 100);
  3834.  
  3835.         setTimeout( () => {
  3836.             doNewSend(["6", [15]]);
  3837.  
  3838.         }, 200);
  3839.  
  3840.         setTimeout( () => {
  3841.             doNewSend(["c", [0]]);
  3842.             doNewSend(["5", [primary, true]]);
  3843.             autoaim = false;
  3844.         }, 300);
  3845.     }
  3846.  
  3847.     if(e.keyCode == 221 && document.activeElement.id.toLowerCase() !== 'chatbox') { ///num1 katana [age 8]
  3848.         doNewSend(["6", [4]]);
  3849.     }
  3850.     if(e.keyCode == 220 && document.activeElement.id.toLowerCase() !== 'chatbox') { ///num2 musket [age 9]
  3851.         doNewSend(["6", [15]]);
  3852.     }
  3853.     if(e.keyCode == 219 && document.activeElement.id.toLowerCase() !== 'chatbox') { ///num1 stick [age 2]
  3854.         doNewSend(["6", [8]]);
  3855.     }
  3856.     if(e.keyCode == 98 && document.activeElement.id.toLowerCase() !== 'chatbox') { ///num2 crossbow [age 8]
  3857.         doNewSend(["6", [12]]);
  3858.     }
  3859.     if(e.keyCode == 105 && document.activeElement.id.toLowerCase() !== 'chatbox') { ///num9 max mill [age 8]
  3860.         doNewSend(["6", [28]]);
  3861.     }
  3862.     if(e.keyCode == 104 && document.activeElement.id.toLowerCase() !== 'chatbox') { ///num8 max wall [age 7]
  3863.         doNewSend(["6", [21]]);
  3864.     }
  3865.     if(e.keyCode == 101 && document.activeElement.id.toLowerCase() !== 'chatbox') { ///num5 spin spike [age 9]
  3866.         doNewSend(["6", [25]]);
  3867.     }
  3868.     if(e.keyCode == 102 && document.activeElement.id.toLowerCase() !== 'chatbox') { ///num6 fast crossbow [age 9]
  3869.         doNewSend(["6", [13]]);
  3870.     }
  3871.     if(e.keyCode == 222 && document.activeElement.id.toLowerCase() !== 'chatbox') { ///num3 great axe [age 8]
  3872.         doNewSend(["6", [2]]);
  3873.     }
  3874.     if(e.keyCode == 9 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3875.         hatToggle = (hatToggle + 1) % 2;
  3876.         if(healToggle == 0) {
  3877.             if(hatToggle == 0) {
  3878.                 document.title = "Heal: OFF | Hat: OFF"
  3879.             } else {
  3880.                 document.title = "Heal: OFF | Hat: ON"
  3881.             }
  3882.         } else {
  3883.             if(hatToggle == 0) {
  3884.                 document.title = "Heal: ON | Hat: OFF"
  3885.             } else {
  3886.                 document.title = "Heal: ON | Hat: ON"
  3887.             }
  3888.         }
  3889.     }
  3890. })
  3891.  
  3892. document.addEventListener('keyup', (e)=>{console.log([stuff,run,autokill,myPlayer,yes,boost,atk,matk])
  3893.                                          spikePlacer.stop(e.keyCode);
  3894.                                          boostPlacer.stop(e.keyCode);
  3895.                                          boostWaller.stop(e.keyCode);
  3896.                                          fourSpiker.stop(e.keyCode);
  3897.                                          boostSpiker.stop(e.keyCode);
  3898.                                          millPlacer.stop(e.keyCode);
  3899.                                          turretPlacer.stop(e.keyCode);
  3900.                                          wallPlacer.stop(e.keyCode);
  3901.                                          healer.stop(e.keyCode);
  3902.                                          if(e.keyCode == 71 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3903.                                              setTimeout( () => {
  3904.                                                  doNewSend(["33", [null]]);
  3905.                                                  boostDir = null;
  3906.                                              }, 10);
  3907.                                          }
  3908.                                          if(e.keyCode == 221 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3909.                                              setTimeout( () => {
  3910.                                                  doNewSend(["33"]);
  3911.                                              }, 1);
  3912.                                          }
  3913.                                          if(e.keyCode == 191 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  3914.                                              setTimeout( () => {
  3915.                                                  doNewSend(["33", [null]]);
  3916.                                                  boostDir = null;
  3917.                                              }, 10);
  3918.                                          }
  3919.                                         })
  3920. function isElementVisible(e) {
  3921.     return (e.offsetParent !== null);
  3922. }
  3923.  
  3924.  
  3925. function toRad(angle) {
  3926.     return angle * 0.01745329278;
  3927. }
  3928.  
  3929. function dist(a, b){
  3930.     return Math.sqrt( Math.pow((b.y-a[2]), 2) + Math.pow((b.x-a[1]), 2) );
  3931. }
  3932.  
  3933. function animate(space, chance) {
  3934.     let result = '';
  3935.     let characters;
  3936.     if(space) {
  3937.         characters = 'Want~Cookieor~DIE?';
  3938.     } else {
  3939.         characters = 'NICE';
  3940.     }
  3941.     if(space) {
  3942.         characters = characters.padStart((30 - characters.length) / 2 + characters.length)
  3943.         characters = characters.padEnd(30);
  3944.     }
  3945.     let count = 0;
  3946.     for (let i = 0; i < characters.length; i++ ) {
  3947.         if(Math.floor(Math.random() * chance) == 1 && characters.charAt(i) != "-" && count < 2 && characters.charAt(i) != " ") {
  3948.             result += "w1";
  3949.             count++
  3950.         } else {
  3951.             result += characters.charAt(i);
  3952.         }
  3953.     }
  3954.     return result;
  3955. }
  3956.  
  3957.  
  3958. function update() {
  3959.     for (let i=0;i<9;i++){
  3960.         if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  3961.             primary = i;
  3962.         }
  3963.     }
  3964.  
  3965.     for (let i=9;i<16;i++){
  3966.         if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  3967.             secondary = i;
  3968.         }
  3969.     }
  3970.  
  3971.     for (let i=16;i<19;i++){
  3972.         if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  3973.             foodType = i - 16;
  3974.         }
  3975.     }
  3976.  
  3977.     for (let i=19;i<22;i++){
  3978.         if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  3979.             wallType = i - 16;
  3980.         }
  3981.     }
  3982.  
  3983.     for (let i=22;i<26;i++){
  3984.         if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  3985.             spikeType = i - 16;
  3986.         }
  3987.     }
  3988.  
  3989.     for (let i=26;i<29;i++){
  3990.         if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  3991.             millType = i - 16;
  3992.         }
  3993.     }
  3994.  
  3995.     for (let i=29;i<31;i++){
  3996.         if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  3997.             mineType = i - 16;
  3998.         }
  3999.     }
  4000.  
  4001.     for (let i=31;i<33;i++){
  4002.         if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  4003.             boostType = i - 16;
  4004.         }
  4005.     }
  4006.  
  4007.     for (let i=33;i<39;i++){
  4008.         if (isElementVisible(document.getElementById("actionBarItem" + i.toString())) && i != 36){
  4009.             turretType = i - 16;
  4010.         }
  4011.     }
  4012.     food=id('foodDisplay').innerText*1
  4013.     run=(food<50)
  4014.     if(document.domain.includes('sanbox')){run=false}
  4015.     for(let i=0;i<weapons.length;i++){
  4016.         if(weapons[i].id==primary){
  4017.             stuff.PN=weapons[i].name;
  4018.             stuff.PR=weapons[i].range;
  4019.             stuff.PS=weapons[i].speed}
  4020.         if(weapons[i].id==secondary){
  4021.             stuff.SS=weapons[i].speed;
  4022.             stuff.SN=weapons[i].name;
  4023.         }
  4024.     }
  4025.  
  4026.     spawnpadType = 36;
  4027. }
  4028. document.addEventListener('keyup', (e)=>{
  4029.     spikePlacer.stop(e.keyCode);
  4030.     boostPlacer.stop(e.keyCode);
  4031.     boostSpiker.stop(e.keyCode);
  4032.     millPlacer.stop(e.keyCode);
  4033.     turretPlacer.stop(e.keyCode);
  4034.     healer.stop(e.keyCode);
  4035.     if(e.keyCode == 71 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  4036.         setTimeout( () => {
  4037.             doNewSend(["33", [null]]);
  4038.             boostDir = null;
  4039.         }, 10);
  4040.     }
  4041. })// ==UserScript==
  4042. // @name         New Userscript
  4043. // @namespace    http://tampermonkey.net/
  4044. // @version      0.1
  4045. // @description  try to take over the world!
  4046. // @author       You
  4047. // @match        http://*/*
  4048. // @grant        none
  4049. // ==/UserScript==
  4050.  
  4051. (function() {
  4052.     'use strict';
  4053.  
  4054.     // Your code here...
  4055. })();// ==UserScript==
  4056. // @name         New Userscript
  4057. // @namespace    http://tampermonkey.net/
  4058. // @version      0.1
  4059. // @description  try to take over the world!
  4060. // @author       You
  4061. // @match        http://*/*
  4062. // @grant        none
  4063. // ==/UserScript==
  4064.  
  4065. (function() {
  4066.     'use strict';
  4067.  
  4068.     // Your code here...
  4069. })();// ==UserScript==
  4070. // @name         New Userscript
  4071. // @namespace    http://tampermonkey.net/
  4072. // @version      0.1
  4073. // @description  try to take over the world!
  4074. // @author       You
  4075. // @match        https://discord.com/channels/@me/714528066235531264
  4076. // @grant        none
  4077. // ==/UserScript==
  4078.  
  4079. (function() {
  4080.     'use strict';
  4081.  
  4082.     // Your code here...
  4083. })();