From d4bac820b4b5fbacc8d463152f91a954778fcbf3 Mon Sep 17 00:00:00 2001 From: Eric Ahn Date: Sun, 21 Jun 2015 04:54:16 -0500 Subject: [PATCH] working autoreport --- autoPlay.user.js | 8 ++++---- autoPlay.user.min.js | 2 +- chrome_extension/js/background.js | 12 ++++++------ chrome_extension/manifest.json | 22 +++++++++++----------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/autoPlay.user.js b/autoPlay.user.js index 772b446..68806eb 100644 --- a/autoPlay.user.js +++ b/autoPlay.user.js @@ -2,7 +2,7 @@ // @name /u/wchill Monster Minigame Auto-script w/ anti-troll // @namespace https://github.com/wchill/steamSummerMinigame // @description A script that runs the Steam Monster Minigame for you. -// @version 7.4.5 +// @version 7.4.6 // @match *://steamcommunity.com/minigame/towerattack* // @match *://steamcommunity.com//minigame/towerattack* // @grant none @@ -16,7 +16,7 @@ "use strict"; //Version displayed to client, update along with the @version above - var SCRIPT_VERSION = '7.4.5'; + var SCRIPT_VERSION = '7.4.6'; // OPTIONS var clickRate = 20; @@ -673,11 +673,11 @@ this.m_eleUpdateLogContainer[0].insertBefore(ele[0], this.m_eleUpdateLogContainer[0].firstChild); advLog(rgEntry.actor_name + " used " + this.m_Game.m_rgTuningData.abilities[ rgEntry.ability ].name + " on level " + getGameLevel(), 1); w.$J('.name', ele).attr( "style", "color: red; font-weight: bold;" ); - w.$J.post({ + w.$J.ajax({ type: 'POST', url: 'http://steam.intense.io:8080/report', crossDomain: true, - data: {"name":rgEntry.actor_name, "steamid":rgEntry.actor, "round":getGameLevel(), "ability":rgEntry.ability, "time":rgEntry.time}, + data: JSON.stringify({"name":rgEntry.actor_name, "steamid":rgEntry.actor, "round":getGameLevel(), "ability":rgEntry.ability, "time":rgEntry.time}), dataType: 'json', success: function(responseData, textStatus, jqXHR) { advLog("Reported " + rgEntry.actor_name + " at time " + rgEntry.time, 2); diff --git a/autoPlay.user.min.js b/autoPlay.user.min.js index 7ca0573..375383d 100644 --- a/autoPlay.user.min.js +++ b/autoPlay.user.min.js @@ -1 +1 @@ -!function(e){"use strict";function t(){return e.g_Minigame.m_CurrentScene}function n(){se("Starting /u/wchill's script (version "+Le+")",1),e.document.addEventListener("event:welcomePanelVisible",function(){e.$J("#badge_items > .purchase_ability_item > .sub_item").each(function(){var t=e.$J(this),n=e.$J('
x100
');n.click(function(t){e.g_Minigame.CurrentScene().TrySpendBadgePoints(this,100),t.stopPropagation()}),n.data(t.data()),t.css("margin-right","50px"),t.after(n)});var t=e.g_Minigame.CurrentScene().m_UI.UpdateSpendBadgePointsDialog;e.g_Minigame.CurrentScene().m_UI.UpdateSpendBadgePointsDialog=function(){t.apply(e.g_Minigame.CurrentScene().m_UI,arguments);var n=e.g_Minigame.CurrentScene().m_rgPlayerTechTree.badge_points;e.$J("#badge_items > .purchase_ability_item > .sub_item.x100").each(function(){var t=e.$J(this);n<100*t.data().cost?t.addClass("disabled"):t.removeClass("disabled")})}},!1),Qe=t().DoCritEffect,Ve=t().m_rgClickNumbers.push,je=e.g_Minigame.Render,A(),Ae&&r(),Pe&&e.CEnemy&&(e.CEnemy.prototype.TakeDamage=function(){},e.CEnemySpawner.prototype.TakeDamage=function(){},e.CEnemyBoss.prototype.TakeDamage=function(){}),xe&&b(),Ie&&T();var n=document.getElementById("abilities");n&&(n.style.textAlign="left"),Me&&(n=document.getElementById("global_header"),n&&n.parentNode&&n.parentNode.removeChild(n),n=document.getElementById("footer"),n&&n.parentNode&&n.parentNode.removeChild(n),n=document.getElementById("footer_spacer"),n&&n.parentNode&&n.parentNode.removeChild(n),n=document.querySelector(".pagecontent"),n&&(n.style["padding-bottom"]=0),document.body.style.backgroundPosition="0 0"),Oe&&p(Ue),Ge&&ve(),ke&&C(),void 0!==e.CSceneGame&&(e.CSceneGame.prototype.DoScreenShake=function(){}),i();var a=document.createElement("span");a.className="toggle_music_btn",a.textContent="Easter Egg",a.onclick=function(){e.SmackTV()},document.querySelector(".game_options").insertBefore(a,document.querySelector(".leave_game_btn"));var o=document.querySelector(".title_activity"),l=document.createElement("span");l.innerHTML='0/1500 Players in room
',o.insertBefore(l,o.firstChild);var m=document.getElementById("activitylog");m.style.marginTop="33px";var c=document.createElement("div");document.getElementsByClassName("pagecontent")[0].insertBefore(c,document.getElementsByClassName("footer_spacer")[0]),c.className="options_box";var _=document.querySelector(".options_box");_||(_=document.querySelector(".options_box")),_.innerHTML="OPTIONS (v"+Le+')
Settings marked with a * requires a refresh to take effect.
',_.className="options_box",_.style.backgroundColor="#000000",_.style.width="600px",_.style.marginTop="12px",_.style.padding="12px",_.style.boxShadow="2px 2px 0 rgba( 0, 0, 0, 0.6 )",_.style.color="#ededed",_.style.marginLeft="auto",_.style.marginRight="auto";var h=_.cloneNode(!0),y=document.createElement("div");y.style["-moz-column-count"]=3,y.style["-webkit-column-count"]=3,y.style["column-count"]=3,y.style.width="100%",y.appendChild(g("removeInterface","Remove interface",Me,u,!0)),y.appendChild(g("removeParticles","Remove particle effects",Ae,u,!0)),y.appendChild(g("removeFlinching","Remove flinching effects",Pe,u,!0)),y.appendChild(g("removeCritText","Remove crit text",xe,b,!1)),y.appendChild(g("removeGoldText","Remove gold text",Ne,u,!1)),y.appendChild(g("removeAllText","Remove all text",Ie,T,!1)),y.appendChild(g("disableRenderer","Throttle game renderer",ke,C,!0)),("undefined"!=typeof GM_info||"undefined"!==e.usingMsgScript)&&y.appendChild(g("enableAutoRefresh","Enable auto-refresh",Oe,v,!1)),y.appendChild(g("enableFingering","Enable targeting pointer",Ge,u,!0)),y.appendChild(g("useTrollTracker","Track improper ability use",we,u,!0)),y.appendChild(g("praiseGoldHelm","Praise Gold Helm!",Be,f,!1)),y.appendChild(d("praiseGoldHelmImage","",Ye,Xe,E)),y.appendChild(s("setLogLevel","Change the log level","25px",De,0,5,L)),_.appendChild(y),h.innerHTML="GAME INFO
",h.className="info_box",h.style.right="0px",ot=document.createElement("div"),ot.style["-moz-column-count"]=3,ot.style["-webkit-column-count"]=3,ot.style["column-count"]=3,ot.appendChild(document.createElement("div")),ot.appendChild(document.createElement("div")),ot.appendChild(document.createElement("div")),h.appendChild(ot),_.parentElement.appendChild(h);var S=document.querySelector(".leave_game_helper");S.parentElement.removeChild(S),Ce(),Se();var R=e.g_Minigame.CurrentScene().m_rgPlayerTechTree.badge_points,D=e.g_steamID%10+1;e.g_Minigame.CurrentScene().TrySpendBadgePoints(e.$J(""),D),R-=200*D;var M=Math.floor(R/200);e.g_Minigame.CurrentScene().TrySpendBadgePoints(e.$J(""),M),e.g_Minigame.CurrentScene().TrySpendBadgePoints(e.$J(""),M),e.g_Minigame.CurrentScene().TrySpendBadgePoints(e.$J(""),R%100)}function a(){for(var e={1:":shelterwildfire:",2:":waterrune:",3:":Wisp:",4:":FateTree:"},n=0;3>n;n++){var a=t().m_rgGameData.lanes[n].element,i=t().m_rgLaneData[n].abilities;i||(i={});for(var r=[],o=0;4>o;o++){var l=t().GetEnemy(n,o);l&&r.push(l)}var m=t().m_rgLaneData[n].players,c="Lane "+(n+1)+' -
'+m+" players";ot.children[n].innerHTML=c}}function i(){Be?(e.$J(".tv_ui").css("background-image","url("+Ye+")"),e.$J(".pagecontent").attr("style","padding-bottom: 0px; background-image: url('http://cdn.akamai.steamstatic.com/steamcommunity/public/images/items/368020/7b933b3766d64ec0525c86891dedb4b699a25fb9.jpg')")):e.$J(".tv_ui").css("background-image","url("+ze+")"),e.$J("#activeinlanecontainer").css("height","154px"),e.$J("#activitycontainer").css("height","270px"),e.$J("#activityscroll").css("height","270px")}function r(){e.CSceneGame&&(e.CSceneGame.prototype.DoScreenShake=function(){},Ae&&(e.CSceneGame.prototype.SpawnEmitter=function(e){return e.emit=!1,e}))}function o(){var e=new Date,t=e.getUTCHours(),n=e.getUTCMinutes(),a=60-n;return 15==t&&a<=Ze.minsLeft?!0:!1}function l(){var e=Math.floor(t().m_nTime)%86400;return e-=57600,0>e&&(e+=86400),86400-e}function m(){if(!He){He=!0;var n=be();if(10>n&&Ze.useSlowMode)return;mt.forEach(K),$e=3*l()0&&n%Ze.rainingRounds<100-Ze.rainingSafeRounds||$e,a(),q(),it&&(e.clearInterval(it),it=!1),rt&&(e.clearInterval(rt),rt=!1),n%Ze.rainingRounds>0&&n%Ze.rainingRounds<100-Ze.rainingSafeRounds&&!$e?(n%Ze.rainingRounds===0?N():I(),O(),k(),G(),B(),(nZe.useGoldThreshold&&U(),J()):(n%Ze.rainingRounds===0||$e?N():I(),O(),G(),w(),F(),J(),H(),$(),W(n)),x(),n!==Ke&&(Ke=n,c()),ue(n),qe=S(),t().m_nClicks=qe,t().m_nLastTick=!1,e.g_msTickRate=1e3;var i=t().CalculateDamage(t().m_rgPlayerTechTree.damage_per_click,t().m_rgGameData.lanes[t().m_rgPlayerData.current_lane].element);se("Ticked. Current clicks per second: "+qe+". Current damage per second: "+i*qe,4),ke&&(t().Tick(),requestAnimationFrame(function(){e.g_Minigame.Renderer.render(t().m_Container)})),He=!1;var r=t().GetEnemy(t().m_rgPlayerData.current_lane,t().m_rgPlayerData.target);if(qe>0&&r){if(P(r.m_Sprite.position.x-440*r.m_nLane,r.m_Sprite.position.y-52,"-"+e.FormatNumberForDisplay(i*qe,5),"#aaf"),t().m_rgStoredCrits.length>0){var o=t().m_rgStoredCrits.reduce(function(e,t){return e+t});t().m_rgStoredCrits.length=0,t().DoCritEffect(o,r.m_Sprite.position.x-440*r.m_nLane,r.m_Sprite.position.y+17,"Crit!")}var m=t().m_rgGameData.lanes[t().m_rgPlayerData.current_lane].active_player_ability_gold_per_click;if(m>0&&r.m_data.hp>0){var d=r.m_data.gold*m*qe;t().ClientOverride("player_data","gold",t().m_rgPlayerData.gold+d),t().ApplyClientOverrides("player_data",!0),se("Raining gold ability is active in current lane. Percentage per click: "+m+"%. Approximately gold per second: "+d,4),Ne||P(r.m_Sprite.position.x-440*r.m_nLane,r.m_Sprite.position.y-17,"+"+e.FormatNumberForDisplay(d,5),"#e1b21e")}}mt.forEach(K)}e.CUI&&!et&&(et=!0,se("Anti nuke in effect",1),e.CUI.prototype.UpdateLog=function(t){this.m_Game.m_rgTuningData.abilities;if(this.m_Game.m_rgPlayerTechTree){for(var n=0,a=t.length-1;a>=0;a--){var i=t[a];if(isNaN(i.time)&&(i.time=this.m_nActionLogTime+1),!(i.time<=this.m_nActionLogTime)){switch(i.type){case"ability":var r=this.m_eleUpdateLogTemplate.clone();if(we)if(be()%100===0&&[10,11,12,15,20].indexOf(i.ability)>-1){if(e.$J(r).data("abilityid",i.ability),e.BigNumber){var o=new e.BigNumber(i.actor);e.$J(".name",r).append(''+i.actor_name+"")}else e.$J(".name",r).text(i.actor_name);e.$J(".ability",r).text(this.m_Game.m_rgTuningData.abilities[i.ability].name+" on level "+be()),e.$J("img",r).attr("src",e.g_rgIconMap["ability_"+i.ability].icon),e.$J(r).v_tooltip({tooltipClass:"ta_tooltip",location:"top"}),this.m_eleUpdateLogContainer[0].insertBefore(r[0],this.m_eleUpdateLogContainer[0].firstChild),se(i.actor_name+" used "+this.m_Game.m_rgTuningData.abilities[i.ability].name+" on level "+be(),1),e.$J(".name",r).attr("style","color: red; font-weight: bold;"),e.$J.post({type:"POST",url:"http://steam.intense.io:8080/report",crossDomain:!0,data:{name:i.actor_name,steamid:i.actor,round:be(),ability:i.ability,time:i.time},dataType:"json",success:function(e,t,n){se("Reported "+i.actor_name+" at time "+i.time,2)},error:function(e,t,n){console.log("POST failed.",2)}})}else be()%100!==0&&be()%100>90&&26===i.ability&&(e.$J(r).data("abilityid",i.ability),e.$J(".name",r).text(i.actor_name),e.$J(".ability",r).text(this.m_Game.m_rgTuningData.abilities[i.ability].name+" on level "+be()),e.$J("img",r).attr("src",e.g_rgIconMap["ability_"+i.ability].icon),e.$J(".name",r).attr("style","color: yellow"),e.$J(r).v_tooltip({tooltipClass:"ta_tooltip",location:"top"}),this.m_eleUpdateLogContainer[0].insertBefore(r[0],this.m_eleUpdateLogContainer[0].firstChild));else e.$J(r).data("abilityid",i.ability),e.$J(".name",r).text(i.actor_name),e.$J(".ability",r).text(this.m_Game.m_rgTuningData.abilities[i.ability].name+" on level "+be()),e.$J("img",r).attr("src",e.g_rgIconMap["ability_"+i.ability].icon),e.$J(r).v_tooltip({tooltipClass:"ta_tooltip",location:"top"}),this.m_eleUpdateLogContainer[0].insertBefore(r[0],this.m_eleUpdateLogContainer[0].firstChild);break;default:console.log("Unknown action log type: %s",i.type),console.log(i)}i.time>n&&(n=i.time)}}n>this.m_nActionLogTime&&(this.m_nActionLogTime=n);for(var l=this.m_eleUpdateLogContainer[0];l.children.length>20;)l.children[l.children.length-1].remove()}},this.m_eleUpdateLogContainer&&(this.m_eleUpdateLogContainer[0].innerHTML=""))}function c(){se("Refreshing player data",2),K("25"),e.g_Server.GetPlayerData(function(n){var a=t();n.response.player_data&&(a.m_rgPlayerData=n.response.player_data,a.ApplyClientOverrides("player_data"),a.ApplyClientOverrides("ability")),n.response.tech_tree&&(a.m_rgPlayerTechTree=n.response.tech_tree,n.response.tech_tree.upgrades?a.m_rgPlayerUpgrades=e.V_ToArray(n.response.tech_tree.upgrades):a.m_rgPlayerUpgrades=[]),a.OnReceiveUpdate()},function(){},!0)}function d(e,t,n,a,i){var r=document.createElement("label"),o=document.createTextNode(t),l=document.createElement("select");for(var m in a){var c=document.createElement("option");c.value=a[m],c.textContent=m,a[m]==n&&(c.selected=!0),l.appendChild(c)}return l.name=e,l.style.marginRight="5px",l.onchange=i,r.appendChild(l),r.appendChild(o),r.appendChild(document.createElement("br")),r}function s(t,n,a,i,r,o,l){var m=document.createElement("label"),c=document.createTextNode(n),d=document.createElement("input");return d.type="number",d.name=t,d.style.width=a,d.style.marginRight="5px",d.value=i,d.min=r,d.max=o,d.onchange=l,e[d.name]=d,m.appendChild(d),m.appendChild(c),m.appendChild(document.createElement("br")),m}function g(t,n,a,i,r){var o=document.createElement("span");o.appendChild(document.createTextNode("*")),o.style.color="#FF5252",o.style.fontSize="22px",o.style.lineHeight="14px",o.style.verticalAlign="bottom";var l=document.createElement("label"),m=document.createTextNode(n),c=document.createElement("input");return c.type="checkbox",c.name=t,c.checked=a,c.onclick=i,e[c.name]=c.checked,l.appendChild(c),l.appendChild(m),r&&l.appendChild(o),l.appendChild(document.createElement("br")),l}function u(e){h(e)}function p(e){var t=60*(e+Fe*Math.random())*1e3;We=setTimeout(function(){_()},t)}function _(){var n=t().GetEnemy(t().m_rgPlayerData.current_lane,t().m_rgPlayerData.target).m_data;if("undefined"!=typeof n){var a=n.type;a!=dt.BOSS?(se("Refreshing, not boss",5),e.location.reload(!0)):(se("Not refreshing, A boss!",5),setTimeout(_,3e3))}else setTimeout(_,1e3)}function h(t){var n=t.target;return R(n.name,n.checked),e[n.name]=n.checked,n.checked}function y(t){var n=t.target;return R(n.name,n.value),e[n.name]=n.value,n.value}function f(e){void 0!==e&&(Be=h(e)),i()}function E(e){void 0!==e&&(Ye=y(e)),i()}function v(e){var t=Oe;void 0!==e&&(t=h(e)),t?p(Ue):clearTimeout(We)}function C(t){var n=ke;void 0!==t&&(n=ke=h(t));var a=e.PIXI.ticker.shared;n?(a.autoStart=!1,a.stop(),e.g_Minigame.Render=function(){}):(a.autoStart=!0,a.start(),e.g_Minigame.Render=je,e.g_Minigame.Render())}function b(e){var n=xe;void 0!==e&&(n=h(e)),n?t().DoCritEffect=function(e,t,n,a){}:t().DoCritEffect=Qe}function T(e){var n=Ie;void 0!==e&&(n=h(e)),n?t().m_rgClickNumbers.push=function(e){e.container.removeChild(e)}:t().m_rgClickNumbers.push=Ve}function S(){var e=be();return e%Ze.rainingRounds===0?0:Re}function L(e){void 0!==e&&(De=e.target.value)}function R(e,t){try{void 0!==localStorage&&localStorage.setItem("steamdb-minigame/"+e,t)}catch(n){console.log(n)}}function D(e,t){try{if(void 0!==localStorage){var n=localStorage.getItem("steamdb-minigame/"+e);return null!==n?n:t}}catch(a){return console.log(a),t}}function M(e,t){return"true"==D(e,t.toString())}function A(){for(var e=document.querySelector('a.link.element_upgrade_btn[data-type="3"]'),t=document.querySelector('a.link.element_upgrade_btn[data-type="4"]'),n=document.querySelector('a.link.element_upgrade_btn[data-type="5"]'),a=document.querySelector('a.link.element_upgrade_btn[data-type="6"]'),i=[e,t,n,a],r=0;re;e++)for(var v=0;4>v;v++){var C=t().GetEnemy(e,v);C&&C.m_data.type==g[f]&&(E[E.length]=C)}if(!h&&!y)for(var b=0,T=le(),S=0;Sb&&(b=L*D,s=t().m_rgEnemies[R].m_nID,d=e)}}var M=0;for(e=0;er||E[e].m_flDisplayedHP=M))continue;M=P,i=!0,r=E[e].m_flDisplayedHP,l=E[e].m_nLane,m=E[e].m_nID}var x=E[e].m_flDisplayedHP/E[e].m_data.max_hp;(0===c||c>x)&&(c=x)}-1!=d&&-1!=s&&(l=d,m=s,se("Switching to a lane with best raining gold benefit",2)),g[f]==dt.SPAWNER&&c>n&&-1==d&&(p=l,_=m,u=!0,i=!1),u&&g[f]==dt.CREEP&&c>a&&(l=p,m=_)}if(i){t().m_nExpectedLane!=l&&(se("Switching to lane"+l,3),t().TryChangeLane(l)),t().m_nTarget!=m&&(se("Switching targets",3),t().TryChangeTarget(m));var N=be();h||y&&(N0?void K(lt.DECREASE_COOLDOWNS):(z(lt.DECREASE_COOLDOWNS)||X(lt.DECREASE_COOLDOWNS),void j(lt.DECREASE_COOLDOWNS))}function G(e){return re(lt.PUMPED_UP)?void se("Pumped up is always good.",2):void(Ze.medicChanceZe.reflectDamageThreshold&&re(lt.REFLECT_DAMAGE)?se("We have reflect damage, cooled down. Trigger it.",2):e>Ze.stealHealthThreshold&&re(lt.STEAL_HEALTH)?se("We have steal health, cooled down. Trigger it.",2):re(lt.GOD_MODE)&&se("We have god mode, cooled down. Trigger it.",2)))}function k(){re(lt.CRIT)&&se("Crit chance is always good.",3),Ze.goodLuckChancei;i++){var r=t().GetEnemy(e,i);r&&0===r.m_data.type&&(n=!0,a=r.m_flDisplayedHP/r.m_data.max_hp)}n&&a>.95&&(se("Cripple Spawner available, and needed. Cripple 'em.",2),oe(lt.CRIPPLE_SPAWNER))}}function U(){oe(lt.RAINING_GOLD)&&se("Gold Rain is purchased and cooled down, triggering it.",2)}function F(){Z(lt.METAL_DETECTOR)&&se("Max Elemental Damage is purchased and cooled down, triggering it.",2)}function J(){re(lt.MAX_ELEMENTAL_DAMAGE,!0)&&se("Max Elemental Damage is purchased and cooled down, triggering it.",2)}function $(){var t=be();(t%Ze.rainingRounds===0||Je||$e)&&(it||(it=e.setInterval(function(){e.g_Minigame.m_CurrentScene.m_rgAbilityQueue.push({ability:26}),e.g_Minigame.m_CurrentScene.m_nLastTick=0,e.g_Minigame.m_CurrentScene.Tick()},100)))}function H(){var t=be();(t%Ze.rainingRounds===0||Je||$e)&&(rt||(rt=e.setInterval(function(){e.g_Minigame.m_CurrentScene.m_rgAbilityQueue.push({ability:27}),e.g_Minigame.m_CurrentScene.m_nLastTick=0,e.g_Minigame.m_CurrentScene.Tick()},500)))}function W(e){e%10===9&&re(lt.RESURRECTION)&&se("Triggered Resurrect.")}function q(){t().m_bIsDead&&t().m_rgPlayerData.time_died+5=1?"hidden"!==t.childElements()[0].style.visibility:!1}function V(e){return te(e)&&!ee(e)&&Q(e)}function j(e){return V(e)?(Z(e),!0):!1}function Z(e){t().m_rgAbilityQueue.push({ability:e})}function ee(e){return t().GetCooldownForAbility(e)>0}function te(e){return 1<0?!1:(oe(e),!0):!1}function oe(e){var n=document.getElementById("abilityitem_"+e);n&&n.childElements()&&n.childElements().length>=1&&t().TryAbility(document.getElementById("abilityitem_"+e).childElements()[0])}function le(){for(var e=[t().m_rgPlayerTechTree.damage_multiplier_fire,t().m_rgPlayerTechTree.damage_multiplier_water,t().m_rgPlayerTechTree.damage_multiplier_air,t().m_rgPlayerTechTree.damage_multiplier_earth],n=t().m_rgGameData.lanes,a=[],i=0;i=1?"hidden"!==t.childElements()[0].style.visibility:!1}function se(e,t){De>=t&&console.log(e)}function ge(e){for(var t=0,n=0,a=0;24>a;a++)e>=3600&&(e-=3600,t+=1);for(var i=0;60>i;i++)e>=60&&(e-=60,n+=1);return{hours:t,minutes:n}}function ue(n){var a=Math.floor(t().m_nTime)%86400;a-=57600,0>a&&(a+=86400);var i=86400-a,r=ge(i);document.ExpectedLevel.textContent="Level: "+e.FormatNumberForDisplay(n,5)+", Expected Jump: "+e.FormatNumberForDisplay(Te(),5),document.RemainingTime.textContent="Remaining Time: "+r.hours+" hours, "+r.minutes+" minutes."}function pe(){return 100*t().m_rgPlayerTechTree.crit_percentage}function _e(){return t().m_rgPlayerTechTree.damage_multiplier_crit}function he(){return t().m_rgPlayerTechTree.dps}function ye(){return t().m_rgPlayerTechTree.damage_per_click}function fe(){return t().m_rgPlayerTechTree.damage_per_click_multiplier}function Ee(){return 100*t().m_rgPlayerTechTree.boss_loot_drop_percentage}function ve(){e.CSceneGame.prototype.ClearNewPlayer=function(){},t().m_spriteFinger||(e.WebStorage.SetLocal("mg_how2click",0),t().CheckNewPlayer(),e.WebStorage.SetLocal("mg_how2click",1)),document.getElementById("newplayer").style.display="none"}function Ce(){var t=e.fnTooltipUpgradeDesc;e.fnTooltipUpgradeDesc=function(n){var a=e.$J(n),i=a.data("desc"),r=i,o=parseFloat(a.data("multiplier"));switch(a.data("upgrade_type")){case 2:r=t(n);var l=ye()*_e(),m=e.g_Minigame.CurrentScene().m_rgTuningData.player.damage_per_click*(fe()+o)*_e();r+="

Crit Click: "+e.FormatNumberForDisplay(l)+" => "+e.FormatNumberForDisplay(m);break;case 7:var c=_e(),d=c+o,s=he(),g=ye();r+="

You can have multiple crits in a second. The server combines them into one.",r+="

Crit Percentage: "+pe().toFixed(1)+"%",r+="

Critical Damage Multiplier:",r+="
Current: "+c+"x",r+="
Next Level: "+d+"x",r+="

Damage with one crit:",r+="
DPS: "+e.FormatNumberForDisplay(c*s)+" => "+e.FormatNumberForDisplay(d*s),r+="
Click: "+e.FormatNumberForDisplay(c*g)+" => "+e.FormatNumberForDisplay(d*g),r+="

Base Increased By: "+o.toFixed(1)+"x";break;case 9:r+="

Boss Loot Drop Rate:",r+="
Current: "+Ee().toFixed(0)+"%",r+="
Next Level: "+(Ee()+100*o).toFixed(0)+"%",r+="

Base Increased By: "+e.FormatNumberForDisplay(100*o)+"%";break;default:return t(n)}return r}}function be(){return t().m_rgGameData.level+1}function Te(){for(var n=be(),a=0,i=0;2>=i;i++)void 0!==typeof e.g_Minigame.m_CurrentScene.m_rgLaneData[i].abilities[26]&&(a+=e.g_Minigame.m_CurrentScene.m_rgLaneData[i].abilities[26]);return n%Ze.rainingRounds!=0?(tt=0,nt=0,at=0,0):(at!==a&&(tt++,nt+=a,at=a),nt/tt*(t().m_rgGameData.timestamp-t().m_rgGameData.timestamp_level_start))}function Se(){var t=20,n=setInterval(function(){var a=e.$J(".spend_badge_ponts_ctn"),i=!!(a&&a.length&&a.is(":visible"));i?(window.document.dispatchEvent(new Event("event:welcomePanelVisible")),clearInterval(n)):e.g_Minigame&&e.g_Minigame.CurrentScene()&&e.g_Minigame.CurrentScene().m_rgPlayerTechTree&&!e.g_Minigame.CurrentScene().m_rgPlayerTechTree.badge_points?clearInterval(n):--t<=0&&clearInterval(n)},500)}var Le="7.4.5",Re=20,De=1,Me=M("removeInterface",!0),Ae=M("removeParticles",!0),Pe=M("removeFlinching",!0),xe=M("removeCritText",!1),Ne=M("removeGoldText",!1),Ie=M("removeAllText",!1),Oe=M("enableAutoRefresh","undefined"!=typeof GM_info||!!e.usingMsgScript),Ge=M("enableFingering",!0),ke=M("disableRenderer",!1),we=M("useTrollTracker",!1),Be=M("praiseGoldHelm",!0),Ue=30,Fe=10,Je=!1,$e=!1,He=!1,We=null,qe=Re,Ke=0,Xe={"Original Gold Helm":"https://i.imgur.com/1zRXQgm.png","Moving Gold Helm":"http://i.imgur.com/XgT8Us8.gif","Golden Gaben":"http://i.imgur.com/ueDBBrA.png","Gaben + Snoop Dogg":"http://i.imgur.com/9R0436k.gif","Wormhole Gaben":"http://i.imgur.com/6BuBgxY.png",MSG2015:"http://i.imgur.com/zHI6C6X.png","Matrix Gaben":"http://i.imgur.com/titbsfQ.png","Praising Intensifies":"http://i.imgur.com/1ynXett.gif"},Ye=D("praiseGoldHelmImage",Xe["Golden Gaben"]),ze="http://i.imgur.com/ieDoLnx.png",Qe=function(){},Ve=function(){},je=function(){},Ze={speedThreshold:2e3,rainingSafeRounds:25,rainingRounds:100,timePerUpdate:6e4,useSlowMode:!1,minsLeft:60,allowWormholeLevel:18e4,githubVersion:Le,useLikeNewMinChance:.02,useLikeNewMaxChance:1,useGoldThreshold:200,goodLuckChance:.02,medicChance:.02},et=!1,tt=0,nt=0,at=0,it=!1,rt=!1,ot=(M("showedUpdateInfo",!1),{}),lt={FIRE_WEAPON:1,CHANGE_LANE:2,RESPAWN:3,CHANGE_TARGET:4,MORALE_BOOSTER:5,GOOD_LUCK_CHARMS:6,MEDICS:7,METAL_DETECTOR:8,DECREASE_COOLDOWNS:9,TACTICAL_NUKE:10,CLUSTER_BOMB:11,NAPALM:12,RESURRECTION:13,CRIPPLE_SPAWNER:14,CRIPPLE_MONSTER:15,MAX_ELEMENTAL_DAMAGE:16,RAINING_GOLD:17,CRIT:18,PUMPED_UP:19,THROW_MONEY_AT_SCREEN:20,GOD_MODE:21,TREASURE:22,STEAL_HEALTH:23,REFLECT_DAMAGE:24,FEELING_LUCKY:25,WORMHOLE:26,LIKE_NEW:27},mt=[lt.TACTICAL_NUKE,lt.CLUSTER_BOMB,lt.NAPALM,lt.CRIPPLE_MONSTER,lt.MAX_ELEMENTAL_DAMAGE,lt.THROW_MONEY_AT_SCREEN,lt.TREASURE,lt.STEAL_HEALTH,lt.REFLECT_DAMAGE,lt.FEELING_LUCKY],ct=[lt.MORALE_BOOSTER,lt.GOOD_LUCK_CHARMS,lt.TACTICAL_NUKE,lt.CLUSTER_BOMB,lt.NAPALM,lt.CRIT,lt.CRIPPLE_SPAWNER,lt.CRIPPLE_MONSTER,lt.MAX_ELEMENTAL_DAMAGE,lt.REFLECT_DAMAGE,lt.THROW_MONEY_AT_SCREEN],dt={SPAWNER:0,CREEP:1,BOSS:2,MINIBOSS:3,TREASURE:4};r(),e.SteamDB_Minigame_Timer&&e.clearInterval(e.SteamDB_Minigame_Timer),e.SteamDB_Minigame_Timer=e.setInterval(function(){e.g_Minigame&&t().m_bRunning&&t().m_rgPlayerTechTree&&t().m_rgGameData&&(e.clearInterval(e.SteamDB_Minigame_Timer),n(),e.SteamDB_Minigame_Timer=e.setInterval(m,1e3))},1e3);var st=document.querySelector(".breadcrumbs");if(st){var gt=document.createElement("span");gt.textContent=" > ",st.appendChild(gt),gt=document.createElement("span"),gt.style.color="#D4E157",gt.style.textShadow="1px 1px 0px rgba( 0, 0, 0, 0.3 )",gt.textContent="Room "+e.g_GameID,st.appendChild(gt),gt=document.createElement("span"),gt.textContent=" > ",st.appendChild(gt),gt=document.createElement("span"),gt.style.color="#FFA07A",gt.style.textShadow="1px 1px 0px rgba( 0, 0, 0, 0.3 )",gt.textContent="Level: 0, Expected Level: 0, Likely Level: 0",st.appendChild(gt),document.ExpectedLevel=gt,gt=document.createElement("span"),gt.textContent=" > ",st.appendChild(gt),gt=document.createElement("span"),gt.style.color="#9AC0FF",gt.style.textShadow="1px 1px 0px rgba( 0, 0, 0, 0.3 )",gt.textContent="Remaining Time: 0 hours, 0 minutes.",st.appendChild(gt),document.RemainingTime=gt}}(window); \ No newline at end of file +!function(e){"use strict";function t(){return e.g_Minigame.m_CurrentScene}function n(){se("Starting /u/wchill's script (version "+Le+")",1),e.document.addEventListener("event:welcomePanelVisible",function(){e.$J("#badge_items > .purchase_ability_item > .sub_item").each(function(){var t=e.$J(this),n=e.$J('
x100
');n.click(function(t){e.g_Minigame.CurrentScene().TrySpendBadgePoints(this,100),t.stopPropagation()}),n.data(t.data()),t.css("margin-right","50px"),t.after(n)});var t=e.g_Minigame.CurrentScene().m_UI.UpdateSpendBadgePointsDialog;e.g_Minigame.CurrentScene().m_UI.UpdateSpendBadgePointsDialog=function(){t.apply(e.g_Minigame.CurrentScene().m_UI,arguments);var n=e.g_Minigame.CurrentScene().m_rgPlayerTechTree.badge_points;e.$J("#badge_items > .purchase_ability_item > .sub_item.x100").each(function(){var t=e.$J(this);n<100*t.data().cost?t.addClass("disabled"):t.removeClass("disabled")})}},!1),Qe=t().DoCritEffect,Ve=t().m_rgClickNumbers.push,je=e.g_Minigame.Render,A(),Ae&&r(),Pe&&e.CEnemy&&(e.CEnemy.prototype.TakeDamage=function(){},e.CEnemySpawner.prototype.TakeDamage=function(){},e.CEnemyBoss.prototype.TakeDamage=function(){}),xe&&b(),Ie&&T();var n=document.getElementById("abilities");n&&(n.style.textAlign="left"),Me&&(n=document.getElementById("global_header"),n&&n.parentNode&&n.parentNode.removeChild(n),n=document.getElementById("footer"),n&&n.parentNode&&n.parentNode.removeChild(n),n=document.getElementById("footer_spacer"),n&&n.parentNode&&n.parentNode.removeChild(n),n=document.querySelector(".pagecontent"),n&&(n.style["padding-bottom"]=0),document.body.style.backgroundPosition="0 0"),Oe&&p(Ue),Ge&&ve(),ke&&C(),void 0!==e.CSceneGame&&(e.CSceneGame.prototype.DoScreenShake=function(){}),i();var a=document.createElement("span");a.className="toggle_music_btn",a.textContent="Easter Egg",a.onclick=function(){e.SmackTV()},document.querySelector(".game_options").insertBefore(a,document.querySelector(".leave_game_btn"));var o=document.querySelector(".title_activity"),l=document.createElement("span");l.innerHTML='0/1500 Players in room
',o.insertBefore(l,o.firstChild);var m=document.getElementById("activitylog");m.style.marginTop="33px";var c=document.createElement("div");document.getElementsByClassName("pagecontent")[0].insertBefore(c,document.getElementsByClassName("footer_spacer")[0]),c.className="options_box";var _=document.querySelector(".options_box");_||(_=document.querySelector(".options_box")),_.innerHTML="OPTIONS (v"+Le+')
Settings marked with a * requires a refresh to take effect.
',_.className="options_box",_.style.backgroundColor="#000000",_.style.width="600px",_.style.marginTop="12px",_.style.padding="12px",_.style.boxShadow="2px 2px 0 rgba( 0, 0, 0, 0.6 )",_.style.color="#ededed",_.style.marginLeft="auto",_.style.marginRight="auto";var h=_.cloneNode(!0),y=document.createElement("div");y.style["-moz-column-count"]=3,y.style["-webkit-column-count"]=3,y.style["column-count"]=3,y.style.width="100%",y.appendChild(g("removeInterface","Remove interface",Me,u,!0)),y.appendChild(g("removeParticles","Remove particle effects",Ae,u,!0)),y.appendChild(g("removeFlinching","Remove flinching effects",Pe,u,!0)),y.appendChild(g("removeCritText","Remove crit text",xe,b,!1)),y.appendChild(g("removeGoldText","Remove gold text",Ne,u,!1)),y.appendChild(g("removeAllText","Remove all text",Ie,T,!1)),y.appendChild(g("disableRenderer","Throttle game renderer",ke,C,!0)),("undefined"!=typeof GM_info||"undefined"!==e.usingMsgScript)&&y.appendChild(g("enableAutoRefresh","Enable auto-refresh",Oe,v,!1)),y.appendChild(g("enableFingering","Enable targeting pointer",Ge,u,!0)),y.appendChild(g("useTrollTracker","Track improper ability use",we,u,!0)),y.appendChild(g("praiseGoldHelm","Praise Gold Helm!",Be,f,!1)),y.appendChild(d("praiseGoldHelmImage","",Ye,Xe,E)),y.appendChild(s("setLogLevel","Change the log level","25px",De,0,5,L)),_.appendChild(y),h.innerHTML="GAME INFO
",h.className="info_box",h.style.right="0px",ot=document.createElement("div"),ot.style["-moz-column-count"]=3,ot.style["-webkit-column-count"]=3,ot.style["column-count"]=3,ot.appendChild(document.createElement("div")),ot.appendChild(document.createElement("div")),ot.appendChild(document.createElement("div")),h.appendChild(ot),_.parentElement.appendChild(h);var S=document.querySelector(".leave_game_helper");S.parentElement.removeChild(S),Ce(),Se();var R=e.g_Minigame.CurrentScene().m_rgPlayerTechTree.badge_points,D=e.g_steamID%10+1;e.g_Minigame.CurrentScene().TrySpendBadgePoints(e.$J(""),D),R-=200*D;var M=Math.floor(R/200);e.g_Minigame.CurrentScene().TrySpendBadgePoints(e.$J(""),M),e.g_Minigame.CurrentScene().TrySpendBadgePoints(e.$J(""),M),e.g_Minigame.CurrentScene().TrySpendBadgePoints(e.$J(""),R%100)}function a(){for(var e={1:":shelterwildfire:",2:":waterrune:",3:":Wisp:",4:":FateTree:"},n=0;3>n;n++){var a=t().m_rgGameData.lanes[n].element,i=t().m_rgLaneData[n].abilities;i||(i={});for(var r=[],o=0;4>o;o++){var l=t().GetEnemy(n,o);l&&r.push(l)}var m=t().m_rgLaneData[n].players,c="Lane "+(n+1)+' -
'+m+" players";ot.children[n].innerHTML=c}}function i(){Be?(e.$J(".tv_ui").css("background-image","url("+Ye+")"),e.$J(".pagecontent").attr("style","padding-bottom: 0px; background-image: url('http://cdn.akamai.steamstatic.com/steamcommunity/public/images/items/368020/7b933b3766d64ec0525c86891dedb4b699a25fb9.jpg')")):e.$J(".tv_ui").css("background-image","url("+ze+")"),e.$J("#activeinlanecontainer").css("height","154px"),e.$J("#activitycontainer").css("height","270px"),e.$J("#activityscroll").css("height","270px")}function r(){e.CSceneGame&&(e.CSceneGame.prototype.DoScreenShake=function(){},Ae&&(e.CSceneGame.prototype.SpawnEmitter=function(e){return e.emit=!1,e}))}function o(){var e=new Date,t=e.getUTCHours(),n=e.getUTCMinutes(),a=60-n;return 15==t&&a<=Ze.minsLeft?!0:!1}function l(){var e=Math.floor(t().m_nTime)%86400;return e-=57600,0>e&&(e+=86400),86400-e}function m(){if(!He){He=!0;var n=be();if(10>n&&Ze.useSlowMode)return;mt.forEach(K),$e=3*l()0&&n%Ze.rainingRounds<100-Ze.rainingSafeRounds||$e,a(),q(),it&&(e.clearInterval(it),it=!1),rt&&(e.clearInterval(rt),rt=!1),n%Ze.rainingRounds>0&&n%Ze.rainingRounds<100-Ze.rainingSafeRounds&&!$e?(n%Ze.rainingRounds===0?N():I(),O(),k(),G(),B(),(nZe.useGoldThreshold&&U(),J()):(n%Ze.rainingRounds===0||$e?N():I(),O(),G(),w(),F(),J(),H(),$(),W(n)),x(),n!==Ke&&(Ke=n,c()),ue(n),qe=S(),t().m_nClicks=qe,t().m_nLastTick=!1,e.g_msTickRate=1e3;var i=t().CalculateDamage(t().m_rgPlayerTechTree.damage_per_click,t().m_rgGameData.lanes[t().m_rgPlayerData.current_lane].element);se("Ticked. Current clicks per second: "+qe+". Current damage per second: "+i*qe,4),ke&&(t().Tick(),requestAnimationFrame(function(){e.g_Minigame.Renderer.render(t().m_Container)})),He=!1;var r=t().GetEnemy(t().m_rgPlayerData.current_lane,t().m_rgPlayerData.target);if(qe>0&&r){if(P(r.m_Sprite.position.x-440*r.m_nLane,r.m_Sprite.position.y-52,"-"+e.FormatNumberForDisplay(i*qe,5),"#aaf"),t().m_rgStoredCrits.length>0){var o=t().m_rgStoredCrits.reduce(function(e,t){return e+t});t().m_rgStoredCrits.length=0,t().DoCritEffect(o,r.m_Sprite.position.x-440*r.m_nLane,r.m_Sprite.position.y+17,"Crit!")}var m=t().m_rgGameData.lanes[t().m_rgPlayerData.current_lane].active_player_ability_gold_per_click;if(m>0&&r.m_data.hp>0){var d=r.m_data.gold*m*qe;t().ClientOverride("player_data","gold",t().m_rgPlayerData.gold+d),t().ApplyClientOverrides("player_data",!0),se("Raining gold ability is active in current lane. Percentage per click: "+m+"%. Approximately gold per second: "+d,4),Ne||P(r.m_Sprite.position.x-440*r.m_nLane,r.m_Sprite.position.y-17,"+"+e.FormatNumberForDisplay(d,5),"#e1b21e")}}mt.forEach(K)}e.CUI&&!et&&(et=!0,se("Anti nuke in effect",1),e.CUI.prototype.UpdateLog=function(t){this.m_Game.m_rgTuningData.abilities;if(this.m_Game.m_rgPlayerTechTree){for(var n=0,a=t.length-1;a>=0;a--){var i=t[a];if(isNaN(i.time)&&(i.time=this.m_nActionLogTime+1),!(i.time<=this.m_nActionLogTime)){switch(i.type){case"ability":var r=this.m_eleUpdateLogTemplate.clone();if(we)if(be()%100===0&&[10,11,12,15,20].indexOf(i.ability)>-1){if(e.$J(r).data("abilityid",i.ability),e.BigNumber){var o=new e.BigNumber(i.actor);e.$J(".name",r).append(''+i.actor_name+"")}else e.$J(".name",r).text(i.actor_name);e.$J(".ability",r).text(this.m_Game.m_rgTuningData.abilities[i.ability].name+" on level "+be()),e.$J("img",r).attr("src",e.g_rgIconMap["ability_"+i.ability].icon),e.$J(r).v_tooltip({tooltipClass:"ta_tooltip",location:"top"}),this.m_eleUpdateLogContainer[0].insertBefore(r[0],this.m_eleUpdateLogContainer[0].firstChild),se(i.actor_name+" used "+this.m_Game.m_rgTuningData.abilities[i.ability].name+" on level "+be(),1),e.$J(".name",r).attr("style","color: red; font-weight: bold;"),e.$J.ajax({type:"POST",url:"http://steam.intense.io:8080/report",crossDomain:!0,data:JSON.stringify({name:i.actor_name,steamid:i.actor,round:be(),ability:i.ability,time:i.time}),dataType:"json",success:function(e,t,n){se("Reported "+i.actor_name+" at time "+i.time,2)},error:function(e,t,n){console.log("POST failed.",2)}})}else be()%100!==0&&be()%100>90&&26===i.ability&&(e.$J(r).data("abilityid",i.ability),e.$J(".name",r).text(i.actor_name),e.$J(".ability",r).text(this.m_Game.m_rgTuningData.abilities[i.ability].name+" on level "+be()),e.$J("img",r).attr("src",e.g_rgIconMap["ability_"+i.ability].icon),e.$J(".name",r).attr("style","color: yellow"),e.$J(r).v_tooltip({tooltipClass:"ta_tooltip",location:"top"}),this.m_eleUpdateLogContainer[0].insertBefore(r[0],this.m_eleUpdateLogContainer[0].firstChild));else e.$J(r).data("abilityid",i.ability),e.$J(".name",r).text(i.actor_name),e.$J(".ability",r).text(this.m_Game.m_rgTuningData.abilities[i.ability].name+" on level "+be()),e.$J("img",r).attr("src",e.g_rgIconMap["ability_"+i.ability].icon),e.$J(r).v_tooltip({tooltipClass:"ta_tooltip",location:"top"}),this.m_eleUpdateLogContainer[0].insertBefore(r[0],this.m_eleUpdateLogContainer[0].firstChild);break;default:console.log("Unknown action log type: %s",i.type),console.log(i)}i.time>n&&(n=i.time)}}n>this.m_nActionLogTime&&(this.m_nActionLogTime=n);for(var l=this.m_eleUpdateLogContainer[0];l.children.length>20;)l.children[l.children.length-1].remove()}},this.m_eleUpdateLogContainer&&(this.m_eleUpdateLogContainer[0].innerHTML=""))}function c(){se("Refreshing player data",2),K("25"),e.g_Server.GetPlayerData(function(n){var a=t();n.response.player_data&&(a.m_rgPlayerData=n.response.player_data,a.ApplyClientOverrides("player_data"),a.ApplyClientOverrides("ability")),n.response.tech_tree&&(a.m_rgPlayerTechTree=n.response.tech_tree,n.response.tech_tree.upgrades?a.m_rgPlayerUpgrades=e.V_ToArray(n.response.tech_tree.upgrades):a.m_rgPlayerUpgrades=[]),a.OnReceiveUpdate()},function(){},!0)}function d(e,t,n,a,i){var r=document.createElement("label"),o=document.createTextNode(t),l=document.createElement("select");for(var m in a){var c=document.createElement("option");c.value=a[m],c.textContent=m,a[m]==n&&(c.selected=!0),l.appendChild(c)}return l.name=e,l.style.marginRight="5px",l.onchange=i,r.appendChild(l),r.appendChild(o),r.appendChild(document.createElement("br")),r}function s(t,n,a,i,r,o,l){var m=document.createElement("label"),c=document.createTextNode(n),d=document.createElement("input");return d.type="number",d.name=t,d.style.width=a,d.style.marginRight="5px",d.value=i,d.min=r,d.max=o,d.onchange=l,e[d.name]=d,m.appendChild(d),m.appendChild(c),m.appendChild(document.createElement("br")),m}function g(t,n,a,i,r){var o=document.createElement("span");o.appendChild(document.createTextNode("*")),o.style.color="#FF5252",o.style.fontSize="22px",o.style.lineHeight="14px",o.style.verticalAlign="bottom";var l=document.createElement("label"),m=document.createTextNode(n),c=document.createElement("input");return c.type="checkbox",c.name=t,c.checked=a,c.onclick=i,e[c.name]=c.checked,l.appendChild(c),l.appendChild(m),r&&l.appendChild(o),l.appendChild(document.createElement("br")),l}function u(e){h(e)}function p(e){var t=60*(e+Fe*Math.random())*1e3;We=setTimeout(function(){_()},t)}function _(){var n=t().GetEnemy(t().m_rgPlayerData.current_lane,t().m_rgPlayerData.target).m_data;if("undefined"!=typeof n){var a=n.type;a!=dt.BOSS?(se("Refreshing, not boss",5),e.location.reload(!0)):(se("Not refreshing, A boss!",5),setTimeout(_,3e3))}else setTimeout(_,1e3)}function h(t){var n=t.target;return R(n.name,n.checked),e[n.name]=n.checked,n.checked}function y(t){var n=t.target;return R(n.name,n.value),e[n.name]=n.value,n.value}function f(e){void 0!==e&&(Be=h(e)),i()}function E(e){void 0!==e&&(Ye=y(e)),i()}function v(e){var t=Oe;void 0!==e&&(t=h(e)),t?p(Ue):clearTimeout(We)}function C(t){var n=ke;void 0!==t&&(n=ke=h(t));var a=e.PIXI.ticker.shared;n?(a.autoStart=!1,a.stop(),e.g_Minigame.Render=function(){}):(a.autoStart=!0,a.start(),e.g_Minigame.Render=je,e.g_Minigame.Render())}function b(e){var n=xe;void 0!==e&&(n=h(e)),n?t().DoCritEffect=function(e,t,n,a){}:t().DoCritEffect=Qe}function T(e){var n=Ie;void 0!==e&&(n=h(e)),n?t().m_rgClickNumbers.push=function(e){e.container.removeChild(e)}:t().m_rgClickNumbers.push=Ve}function S(){var e=be();return e%Ze.rainingRounds===0?0:Re}function L(e){void 0!==e&&(De=e.target.value)}function R(e,t){try{void 0!==localStorage&&localStorage.setItem("steamdb-minigame/"+e,t)}catch(n){console.log(n)}}function D(e,t){try{if(void 0!==localStorage){var n=localStorage.getItem("steamdb-minigame/"+e);return null!==n?n:t}}catch(a){return console.log(a),t}}function M(e,t){return"true"==D(e,t.toString())}function A(){for(var e=document.querySelector('a.link.element_upgrade_btn[data-type="3"]'),t=document.querySelector('a.link.element_upgrade_btn[data-type="4"]'),n=document.querySelector('a.link.element_upgrade_btn[data-type="5"]'),a=document.querySelector('a.link.element_upgrade_btn[data-type="6"]'),i=[e,t,n,a],r=0;re;e++)for(var v=0;4>v;v++){var C=t().GetEnemy(e,v);C&&C.m_data.type==g[f]&&(E[E.length]=C)}if(!h&&!y)for(var b=0,T=le(),S=0;Sb&&(b=L*D,s=t().m_rgEnemies[R].m_nID,d=e)}}var M=0;for(e=0;er||E[e].m_flDisplayedHP=M))continue;M=P,i=!0,r=E[e].m_flDisplayedHP,l=E[e].m_nLane,m=E[e].m_nID}var x=E[e].m_flDisplayedHP/E[e].m_data.max_hp;(0===c||c>x)&&(c=x)}-1!=d&&-1!=s&&(l=d,m=s,se("Switching to a lane with best raining gold benefit",2)),g[f]==dt.SPAWNER&&c>n&&-1==d&&(p=l,_=m,u=!0,i=!1),u&&g[f]==dt.CREEP&&c>a&&(l=p,m=_)}if(i){t().m_nExpectedLane!=l&&(se("Switching to lane"+l,3),t().TryChangeLane(l)),t().m_nTarget!=m&&(se("Switching targets",3),t().TryChangeTarget(m));var N=be();h||y&&(N0?void K(lt.DECREASE_COOLDOWNS):(z(lt.DECREASE_COOLDOWNS)||X(lt.DECREASE_COOLDOWNS),void j(lt.DECREASE_COOLDOWNS))}function G(e){return re(lt.PUMPED_UP)?void se("Pumped up is always good.",2):void(Ze.medicChanceZe.reflectDamageThreshold&&re(lt.REFLECT_DAMAGE)?se("We have reflect damage, cooled down. Trigger it.",2):e>Ze.stealHealthThreshold&&re(lt.STEAL_HEALTH)?se("We have steal health, cooled down. Trigger it.",2):re(lt.GOD_MODE)&&se("We have god mode, cooled down. Trigger it.",2)))}function k(){re(lt.CRIT)&&se("Crit chance is always good.",3),Ze.goodLuckChancei;i++){var r=t().GetEnemy(e,i);r&&0===r.m_data.type&&(n=!0,a=r.m_flDisplayedHP/r.m_data.max_hp)}n&&a>.95&&(se("Cripple Spawner available, and needed. Cripple 'em.",2),oe(lt.CRIPPLE_SPAWNER))}}function U(){oe(lt.RAINING_GOLD)&&se("Gold Rain is purchased and cooled down, triggering it.",2)}function F(){Z(lt.METAL_DETECTOR)&&se("Max Elemental Damage is purchased and cooled down, triggering it.",2)}function J(){re(lt.MAX_ELEMENTAL_DAMAGE,!0)&&se("Max Elemental Damage is purchased and cooled down, triggering it.",2)}function $(){var t=be();(t%Ze.rainingRounds===0||Je||$e)&&(it||(it=e.setInterval(function(){e.g_Minigame.m_CurrentScene.m_rgAbilityQueue.push({ability:26}),e.g_Minigame.m_CurrentScene.m_nLastTick=0,e.g_Minigame.m_CurrentScene.Tick()},100)))}function H(){var t=be();(t%Ze.rainingRounds===0||Je||$e)&&(rt||(rt=e.setInterval(function(){e.g_Minigame.m_CurrentScene.m_rgAbilityQueue.push({ability:27}),e.g_Minigame.m_CurrentScene.m_nLastTick=0,e.g_Minigame.m_CurrentScene.Tick()},500)))}function W(e){e%10===9&&re(lt.RESURRECTION)&&se("Triggered Resurrect.")}function q(){t().m_bIsDead&&t().m_rgPlayerData.time_died+5=1?"hidden"!==t.childElements()[0].style.visibility:!1}function V(e){return te(e)&&!ee(e)&&Q(e)}function j(e){return V(e)?(Z(e),!0):!1}function Z(e){t().m_rgAbilityQueue.push({ability:e})}function ee(e){return t().GetCooldownForAbility(e)>0}function te(e){return 1<0?!1:(oe(e),!0):!1}function oe(e){var n=document.getElementById("abilityitem_"+e);n&&n.childElements()&&n.childElements().length>=1&&t().TryAbility(document.getElementById("abilityitem_"+e).childElements()[0])}function le(){for(var e=[t().m_rgPlayerTechTree.damage_multiplier_fire,t().m_rgPlayerTechTree.damage_multiplier_water,t().m_rgPlayerTechTree.damage_multiplier_air,t().m_rgPlayerTechTree.damage_multiplier_earth],n=t().m_rgGameData.lanes,a=[],i=0;i=1?"hidden"!==t.childElements()[0].style.visibility:!1}function se(e,t){De>=t&&console.log(e)}function ge(e){for(var t=0,n=0,a=0;24>a;a++)e>=3600&&(e-=3600,t+=1);for(var i=0;60>i;i++)e>=60&&(e-=60,n+=1);return{hours:t,minutes:n}}function ue(n){var a=Math.floor(t().m_nTime)%86400;a-=57600,0>a&&(a+=86400);var i=86400-a,r=ge(i);document.ExpectedLevel.textContent="Level: "+e.FormatNumberForDisplay(n,5)+", Expected Jump: "+e.FormatNumberForDisplay(Te(),5),document.RemainingTime.textContent="Remaining Time: "+r.hours+" hours, "+r.minutes+" minutes."}function pe(){return 100*t().m_rgPlayerTechTree.crit_percentage}function _e(){return t().m_rgPlayerTechTree.damage_multiplier_crit}function he(){return t().m_rgPlayerTechTree.dps}function ye(){return t().m_rgPlayerTechTree.damage_per_click}function fe(){return t().m_rgPlayerTechTree.damage_per_click_multiplier}function Ee(){return 100*t().m_rgPlayerTechTree.boss_loot_drop_percentage}function ve(){e.CSceneGame.prototype.ClearNewPlayer=function(){},t().m_spriteFinger||(e.WebStorage.SetLocal("mg_how2click",0),t().CheckNewPlayer(),e.WebStorage.SetLocal("mg_how2click",1)),document.getElementById("newplayer").style.display="none"}function Ce(){var t=e.fnTooltipUpgradeDesc;e.fnTooltipUpgradeDesc=function(n){var a=e.$J(n),i=a.data("desc"),r=i,o=parseFloat(a.data("multiplier"));switch(a.data("upgrade_type")){case 2:r=t(n);var l=ye()*_e(),m=e.g_Minigame.CurrentScene().m_rgTuningData.player.damage_per_click*(fe()+o)*_e();r+="

Crit Click: "+e.FormatNumberForDisplay(l)+" => "+e.FormatNumberForDisplay(m);break;case 7:var c=_e(),d=c+o,s=he(),g=ye();r+="

You can have multiple crits in a second. The server combines them into one.",r+="

Crit Percentage: "+pe().toFixed(1)+"%",r+="

Critical Damage Multiplier:",r+="
Current: "+c+"x",r+="
Next Level: "+d+"x",r+="

Damage with one crit:",r+="
DPS: "+e.FormatNumberForDisplay(c*s)+" => "+e.FormatNumberForDisplay(d*s),r+="
Click: "+e.FormatNumberForDisplay(c*g)+" => "+e.FormatNumberForDisplay(d*g),r+="

Base Increased By: "+o.toFixed(1)+"x";break;case 9:r+="

Boss Loot Drop Rate:",r+="
Current: "+Ee().toFixed(0)+"%",r+="
Next Level: "+(Ee()+100*o).toFixed(0)+"%",r+="

Base Increased By: "+e.FormatNumberForDisplay(100*o)+"%";break;default:return t(n)}return r}}function be(){return t().m_rgGameData.level+1}function Te(){for(var n=be(),a=0,i=0;2>=i;i++)void 0!==typeof e.g_Minigame.m_CurrentScene.m_rgLaneData[i].abilities[26]&&(a+=e.g_Minigame.m_CurrentScene.m_rgLaneData[i].abilities[26]);return n%Ze.rainingRounds!=0?(tt=0,nt=0,at=0,0):(at!==a&&(tt++,nt+=a,at=a),nt/tt*(t().m_rgGameData.timestamp-t().m_rgGameData.timestamp_level_start))}function Se(){var t=20,n=setInterval(function(){var a=e.$J(".spend_badge_ponts_ctn"),i=!!(a&&a.length&&a.is(":visible"));i?(window.document.dispatchEvent(new Event("event:welcomePanelVisible")),clearInterval(n)):e.g_Minigame&&e.g_Minigame.CurrentScene()&&e.g_Minigame.CurrentScene().m_rgPlayerTechTree&&!e.g_Minigame.CurrentScene().m_rgPlayerTechTree.badge_points?clearInterval(n):--t<=0&&clearInterval(n)},500)}var Le="7.4.6",Re=20,De=1,Me=M("removeInterface",!0),Ae=M("removeParticles",!0),Pe=M("removeFlinching",!0),xe=M("removeCritText",!1),Ne=M("removeGoldText",!1),Ie=M("removeAllText",!1),Oe=M("enableAutoRefresh","undefined"!=typeof GM_info||!!e.usingMsgScript),Ge=M("enableFingering",!0),ke=M("disableRenderer",!1),we=M("useTrollTracker",!1),Be=M("praiseGoldHelm",!0),Ue=30,Fe=10,Je=!1,$e=!1,He=!1,We=null,qe=Re,Ke=0,Xe={"Original Gold Helm":"https://i.imgur.com/1zRXQgm.png","Moving Gold Helm":"http://i.imgur.com/XgT8Us8.gif","Golden Gaben":"http://i.imgur.com/ueDBBrA.png","Gaben + Snoop Dogg":"http://i.imgur.com/9R0436k.gif","Wormhole Gaben":"http://i.imgur.com/6BuBgxY.png",MSG2015:"http://i.imgur.com/zHI6C6X.png","Matrix Gaben":"http://i.imgur.com/titbsfQ.png","Praising Intensifies":"http://i.imgur.com/1ynXett.gif"},Ye=D("praiseGoldHelmImage",Xe["Golden Gaben"]),ze="http://i.imgur.com/ieDoLnx.png",Qe=function(){},Ve=function(){},je=function(){},Ze={speedThreshold:2e3,rainingSafeRounds:25,rainingRounds:100,timePerUpdate:6e4,useSlowMode:!1,minsLeft:60,allowWormholeLevel:18e4,githubVersion:Le,useLikeNewMinChance:.02,useLikeNewMaxChance:1,useGoldThreshold:200,goodLuckChance:.02,medicChance:.02},et=!1,tt=0,nt=0,at=0,it=!1,rt=!1,ot=(M("showedUpdateInfo",!1),{}),lt={FIRE_WEAPON:1,CHANGE_LANE:2,RESPAWN:3,CHANGE_TARGET:4,MORALE_BOOSTER:5,GOOD_LUCK_CHARMS:6,MEDICS:7,METAL_DETECTOR:8,DECREASE_COOLDOWNS:9,TACTICAL_NUKE:10,CLUSTER_BOMB:11,NAPALM:12,RESURRECTION:13,CRIPPLE_SPAWNER:14,CRIPPLE_MONSTER:15,MAX_ELEMENTAL_DAMAGE:16,RAINING_GOLD:17,CRIT:18,PUMPED_UP:19,THROW_MONEY_AT_SCREEN:20,GOD_MODE:21,TREASURE:22,STEAL_HEALTH:23,REFLECT_DAMAGE:24,FEELING_LUCKY:25,WORMHOLE:26,LIKE_NEW:27},mt=[lt.TACTICAL_NUKE,lt.CLUSTER_BOMB,lt.NAPALM,lt.CRIPPLE_MONSTER,lt.MAX_ELEMENTAL_DAMAGE,lt.THROW_MONEY_AT_SCREEN,lt.TREASURE,lt.STEAL_HEALTH,lt.REFLECT_DAMAGE,lt.FEELING_LUCKY],ct=[lt.MORALE_BOOSTER,lt.GOOD_LUCK_CHARMS,lt.TACTICAL_NUKE,lt.CLUSTER_BOMB,lt.NAPALM,lt.CRIT,lt.CRIPPLE_SPAWNER,lt.CRIPPLE_MONSTER,lt.MAX_ELEMENTAL_DAMAGE,lt.REFLECT_DAMAGE,lt.THROW_MONEY_AT_SCREEN],dt={SPAWNER:0,CREEP:1,BOSS:2,MINIBOSS:3,TREASURE:4};r(),e.SteamDB_Minigame_Timer&&e.clearInterval(e.SteamDB_Minigame_Timer),e.SteamDB_Minigame_Timer=e.setInterval(function(){e.g_Minigame&&t().m_bRunning&&t().m_rgPlayerTechTree&&t().m_rgGameData&&(e.clearInterval(e.SteamDB_Minigame_Timer),n(),e.SteamDB_Minigame_Timer=e.setInterval(m,1e3))},1e3);var st=document.querySelector(".breadcrumbs");if(st){var gt=document.createElement("span");gt.textContent=" > ",st.appendChild(gt),gt=document.createElement("span"),gt.style.color="#D4E157",gt.style.textShadow="1px 1px 0px rgba( 0, 0, 0, 0.3 )",gt.textContent="Room "+e.g_GameID,st.appendChild(gt),gt=document.createElement("span"),gt.textContent=" > ",st.appendChild(gt),gt=document.createElement("span"),gt.style.color="#FFA07A",gt.style.textShadow="1px 1px 0px rgba( 0, 0, 0, 0.3 )",gt.textContent="Level: 0, Expected Level: 0, Likely Level: 0",st.appendChild(gt),document.ExpectedLevel=gt,gt=document.createElement("span"),gt.textContent=" > ",st.appendChild(gt),gt=document.createElement("span"),gt.style.color="#9AC0FF",gt.style.textShadow="1px 1px 0px rgba( 0, 0, 0, 0.3 )",gt.textContent="Remaining Time: 0 hours, 0 minutes.",st.appendChild(gt),document.RemainingTime=gt}}(window); \ No newline at end of file diff --git a/chrome_extension/js/background.js b/chrome_extension/js/background.js index f6aea31..ad1ce51 100644 --- a/chrome_extension/js/background.js +++ b/chrome_extension/js/background.js @@ -10,15 +10,15 @@ console.log('background working'); chrome.webRequest.onHeadersReceived.addListener(function (details) { for (var i = 0; i < details.responseHeaders.length; i++) { - + var headerName = details.responseHeaders[i].name.toUpperCase(); - + if (headerName == 'CONTENT-SECURITY-POLICY' || headerName == 'X-WEBKIT-CSP') { - + var csp = details.responseHeaders[i].value; - - csp = csp.replace("connect-src 'self'", "connect-src 'self' http://188.166.36.23:3900/"); - + + csp = csp.replace("connect-src 'self'", "connect-src 'self' http://188.166.36.23:3900/ http://steam.intense.io:8080/"); + details.responseHeaders[i].value = csp; } } diff --git a/chrome_extension/manifest.json b/chrome_extension/manifest.json index 6eeb573..529de39 100755 --- a/chrome_extension/manifest.json +++ b/chrome_extension/manifest.json @@ -6,21 +6,21 @@ }, "content_scripts": [ { "js": [ "js/jQuery.min.js", "js/mainloop.js", "js/bignumber.js" ], - "matches": [ "*://steamcommunity.com/minigame/towerattack", - "*://steamcommunity.com/minigame/towerattack/", - "*://steamcommunity.com//minigame//towerattack/", + "matches": [ "*://steamcommunity.com/minigame/towerattack", + "*://steamcommunity.com/minigame/towerattack/", + "*://steamcommunity.com//minigame//towerattack/", "*://steamcommunity.com//minigame//towerattack//", - "*://steamcommunity.com/minigame/", - "*://steamcommunity.com//minigame/", + "*://steamcommunity.com/minigame/", + "*://steamcommunity.com//minigame/", "*://steamcommunity.com//minigame//" ], "run_at": "document_end" }], - "version": "1.5.0", - "permissions": [ - "https://github.com/wchill/steamSummerMinigame/*", - "https://raw.githubusercontent.com/wchill/steamSummerMinigame/*", - "https://github.com/codetorex/SteamMonsterLobby/*", + "version": "1.5.1", + "permissions": [ + "https://github.com/wchill/steamSummerMinigame/*", + "https://raw.githubusercontent.com/wchill/steamSummerMinigame/*", + "https://github.com/codetorex/SteamMonsterLobby/*", "https://raw.githubusercontent.com/codetorex/SteamMonsterLobby/*", "http://steamcommunity.com/minigame/*", "http://steamcommunity.com/minigame/towerattack/*", @@ -33,7 +33,7 @@ "web_accessible_resources": [ "js/mainloop.js", "js/bignumber.js" ], "content_security_policy": "script-src 'self' https://raw.githubusercontent.com; object-src 'self'", "minimum_chrome_version": "9", - "manifest_version": 4, + "manifest_version": 5, "background": { "scripts": ["js/jQuery.min.js", "js/background.js"], "persistent": true