Advertisement
icefireAlan6

script for moomoo.io/krunker.io

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