Dorten

AMD Endgame Helper

Dec 12th, 2017
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function() {
  2.     'use strict';
  3.     var node=document.createElement("span");
  4.     node.style.display="inline-block";
  5.     $("#infinityPoints2")[0].parentNode.appendChild(node);
  6.     $("#infinityPoints2")[0].setAttribute("class","");
  7.     node.parentNode.setAttribute("class","IP");
  8.     node.parentNode.style.position="absolute";
  9.     node.parentNode.style.left="65%";
  10.     window.bestExppm=-100000;
  11.     window.prevExpP=-1;
  12.     window.bestIP=0;
  13.     window.crunchTimer=60;
  14.     //window.eterniTimer=60;
  15.     window.lastBest=-100000;
  16.     window.bestEPm=new Decimal(0);
  17.     window.bestEP=0;
  18.     window.NeedRGal=40;
  19.     window.NeedGal=198;
  20.     window.lbMant=0;
  21.     window.ptimer=0;
  22.     window.PrcM=0;
  23.     window.EPmP=1;
  24.    
  25.     window.Search=false;
  26.     window.FinishLine=false;
  27.    
  28.     window.PeakedThisInfinity=false;
  29.    
  30.     window.preEPM=1;
  31.     window.Paused=false;
  32.     window.EPm=new Decimal(0);
  33.    
  34.     var node2=document.createElement("span");
  35.     node.style.display="inline-block";
  36.     $("#eternityPoints2")[0].parentNode.appendChild(node2);
  37.     $("#eternityPoints2")[0].setAttribute("class","");
  38.     node2.parentNode.setAttribute("class","IP");
  39.     node2.parentNode.style.position="absolute";
  40.     node2.parentNode.style.left="20.5%";
  41.    
  42.     $('#eternitybtn').click(function() {
  43.         bestEP=0;
  44.         bestEPm=new Decimal(0);
  45.         FinishLine=false;
  46.         if (Search)
  47.         {
  48.             NeedGal=0;
  49.             NeedRGal=0;
  50.         }
  51.         setTimeout(
  52.         function()
  53.         {
  54.             if (player.eternityPoints.div(1.2).gte(player.epmultCost))
  55.             {
  56.                 buyEPMult();
  57.             }
  58.            
  59.             if (player.eternityPoints.multiply(5).lt(player.epmultCost))
  60.             {
  61.                 buyMaxTimeDimensions();
  62.                 while (player.eternityPoints.gte(player.timestudy.epcost.multiply(16)) && buyWithEP()) continue
  63.             }          
  64.         }
  65.         ,1000);
  66.     });
  67.    
  68.     window.fakeGainedEternityPoints=function(IPs) {
  69.         var ret = Decimal.pow(5, (IPs.e+Math.log10(IPs.mantissa))/308 -0.7).times(player.epmult)
  70.         if (player.timestudy.studies.includes(61)) ret = ret.times(10)
  71.         if (player.timestudy.studies.includes(121)) ret = ret.times(((253 - averageEp.dividedBy(player.epmult).dividedBy(10).min(248).max(3))/5)) //x300 if tryhard, ~x60 if not
  72.         else if (player.timestudy.studies.includes(122)) ret = ret.times(35)
  73.         else if (player.timestudy.studies.includes(123)) ret = ret.times(Math.sqrt(1.39*player.thisEternity/10))
  74.  
  75.         return ret.floor()
  76.     }
  77.    
  78.     window.fakeGainedInfinityPoints=function(AM) {
  79.         var pme=(AM.e+Math.log10(AM.mantissa));
  80.         let div = 308;
  81.         if (player.timestudy.studies.includes(111)) div = 285;
  82.         else if (player.achievements.includes("r103")) div = 307.8;
  83.        
  84.         var ret = Decimal.pow(10, pme/div -0.75).times(player.infMult).times(kongIPMult)
  85.         if (player.timestudy.studies.includes(41)) ret = ret.times(Decimal.pow(1.2, player.galaxies + player.replicanti.galaxies))
  86.         if (player.timestudy.studies.includes(51)) ret = ret.times(1e15)
  87.         if (player.timestudy.studies.includes(141)) ret = ret.times(new Decimal(1e45).dividedBy(Decimal.pow(15, Math.log(player.thisInfinityTime+1)*Math.pow(player.thisInfinityTime+1, 0.125))).max(1))
  88.         if (player.timestudy.studies.includes(142)) ret = ret.times(1e25)
  89.         if (player.timestudy.studies.includes(143)) ret = ret.times(Decimal.pow(15, Math.log(player.thisInfinityTime+1)*Math.pow(player.thisInfinityTime+1, 0.125)))
  90.         if (player.achievements.includes("r116")) ret = ret.times(Decimal.pow(2, Math.log10(getInfinitied()+1)))
  91.         return ret.floor()
  92.     }
  93.    
  94.     $('#postInfinityButton').click(function() {
  95.         bestExppm=-100000;     
  96.         lbMant=0;
  97.         PeakedThisInfinity=false;      
  98.     });
  99.    
  100.     setInterval(function(){
  101.         if (!Search)
  102.         {
  103.             if (player.timestudy.studies.includes(181) || NeedRGal<=player.replicanti.galaxies && NeedGal<=player.galaxies)
  104.             {
  105.                 FinishLine=true;
  106.             }
  107.         }
  108.     },1000);
  109.     window.Exppm=new Decimal("0");
  110.     setInterval(function(){
  111.         var ipAlready=player.lastTenRuns[0][1];
  112.         var ipGain=fakeGainedInfinityPoints(player.money);
  113.         var ipSum=(ipAlready.exponent-10>ipGain.exponent)?ipGain:ipAlready.plus(ipGain);
  114.         var ipGainLog=ipSum.exponent+Math.log10(ipSum.mantissa);
  115.         var ipAlreadyLog=ipAlready.exponent+Math.log10(ipAlready.mantissa);
  116.         var newExpP=(ipGainLog-ipAlreadyLog)/player.thisInfinityTime;
  117.         Exppm=newExpP;
  118.         ptimer++;
  119.         if (ptimer==20)
  120.         {
  121.             PrcM=(newExpP-prevExpP)/prevExpP*50*60;
  122.             prevExpP=newExpP;
  123.             ptimer=0;
  124.         }
  125.         if(player.thisInfinityTime>1&&Exppm>bestExppm){
  126.             bestExppm=Exppm;
  127.             bestIP=ipGain;
  128.         }
  129.         node.innerHTML="BIP:"+shorten(bestIP)+"<br> BEpH:"+shorten(bestExppm*36000)+"<br>NIP:"+shorten(ipGain)+" ("+(Paused?"P":crunchTimer)+")<br>NEpH:"+shorten(Exppm*36000)+" "+shorten(PrcM)+"%";
  130.         if (!player.timestudy.studies.includes(181))
  131.         {
  132.             if (!Paused && ipGainLog-ipAlreadyLog>100 && (player.replicanti.galaxies==0 || (player.replicanti.galaxies==player.replicanti.gal && player.replicanti.amount.gt(1.5e308))))
  133.             {
  134.                 $('#postInfinityButton').click();
  135.             }
  136.         }
  137.         else
  138.         {
  139.             if (player.infinitied<1000000 && player.thisInfinityTime>50)
  140.             {
  141.                 $('#postInfinityButton').click();
  142.             }
  143.         }
  144.     },100);
  145.    
  146.     setInterval(function(){
  147.         while (buyWithAntimatter()) continue
  148.         while (buyWithIP()) continue
  149.     },10000);
  150.    
  151.     setInterval(function(){
  152.         var EP=fakeGainedEternityPoints(player.infinityPoints.add(fakeGainedInfinityPoints(player.money)));
  153.         if (player.eternityPoints.exponent>307 && player.eternityPoints.exponent<=400)
  154.         {
  155.             var epAlready=player.eternityPoints;
  156.             var epGain=EP;
  157.             var epSum=(epAlready.exponent-10>epGain.exponent)?new Decimal(0):epAlready.plus(epGain);
  158.             var epGainLog=epSum.exponent+Math.log10(epSum.mantissa);
  159.             var epAlreadyLog=epAlready.exponent+Math.log10(epAlready.mantissa);
  160.             EPm=new Decimal((epGainLog-epAlreadyLog)/(player.thisEternity+1));
  161.         }
  162.         else
  163.         {
  164.             EPm=EP.div(player.thisEternity+1);
  165.         }
  166.         EPmP=EPm.minus(preEPM).div(preEPM).multiply(6000);
  167.         var wh=bestEPm.minus(EPm).div(EPm.minus(preEPM));
  168.         preEPM=EPm;
  169.        
  170.         if (Search)
  171.         {
  172.             if (EPm.gt(bestEPm))
  173.             {
  174.                 bestEPm=EPm;
  175.                 bestEP=EP;
  176.                 NeedGal=player.galaxies;
  177.                 NeedRGal=player.replicanti.galaxies;
  178.             }
  179.             PeakedThisInfinity=true;
  180.         }
  181.         else
  182.         {
  183.             if (EPm.gt(bestEPm) || !FinishLine)
  184.             {
  185.                 bestEPm=EPm;
  186.                 bestEP=EP;
  187.                 PeakedThisInfinity=true;
  188.                 NeedGal=Math.max(player.galaxies,NeedGal);
  189.                 NeedRGal=Math.max(player.replicanti.galaxies,NeedRGal);
  190.             }
  191.         }
  192.                
  193.         node2.innerHTML=(Search?("Bat: "+NeedRGal+"/"+NeedGal+"<br>BEH:"+shorten(bestEPm.multiply(36000))+"("+(wh.lessThan(0)?"*":shorten(wh))+")"):((FinishLine?("BEP:"+shorten(bestEP)+" "+player.replicanti.galaxies+"/"+player.replicanti.gal+"<br> BEH:"+shorten(bestEPm.multiply(36000))+" "+(PeakedThisInfinity?"+":"-")+"("+(wh.lessThan(0)?"*":shorten(wh))+")"):
  194.             ("RG: "+player.replicanti.galaxies+"/"+player.replicanti.gal+"/"+NeedRGal+"<br>NG: "+player.galaxies+"/"+NeedGal))))
  195.             +"<br>NEP:"+shorten(EP)+"<br>NEH:"+shorten(EPm.multiply(36000))+" "+shorten(EPmP)+"%";
  196.     },1000);
  197.    
  198.     setInterval(function(){
  199.         if (lastBest!=bestExppm)
  200.         {
  201.              let interval = player.replicanti.interval
  202.             if (player.timestudy.studies.includes(62)) interval = interval/3
  203.             if (player.timestudy.studies.includes(133) /*|| player.replicanti.amount.gt(Number.MAX_VALUE)*/) interval *= 10
  204.             if (player.timestudy.studies.includes(213)) interval /= 20
  205.             //if (player.replicanti.amount.gt(Number.MAX_VALUE)) interval = Math.max(interval * Math.pow(1.2, (player.replicanti.amount.log10() - 308)/308), interval)
  206.             var est = Math.log(player.replicanti.chance+1) * 1000 / interval;
  207.             var estimate = Math.max(Math.log(Number.MAX_VALUE) / est, 0)
  208.             crunchTimer=(estimate<60 && estimate>6 && player.replicanti.galaxies<player.replicanti.gal)?(Math.ceil(estimate*2.1)):15;
  209.             lastBest=bestExppm;
  210.             lbMant=player.money.e
  211.         }
  212.         else
  213.         {
  214.             if (!Paused)
  215.             {
  216.                 if (player.timestudy.studies.includes(181))
  217.                 {
  218.                     var Thr=0.99;
  219.                     if (player.eternityPoints.exponent>307 && player.eternityPoints.exponent<=400)
  220.                     {
  221.                         Thr=0.99;
  222.                     }
  223.                     if (EPmP.lessThan(0) && EPm.lessThan(bestEPm.multiply(Thr))  )
  224.                     {                      
  225.                         $('#eternitybtn').click();
  226.                         FinishLine=false;
  227.                         TM=0;
  228.                     }                  
  229.                 }
  230.                 else
  231.                 {
  232.                     crunchTimer=Math.max(crunchTimer-1,0);
  233.                     if (crunchTimer<=0 && lbMant<player.money.e && fakeGainedInfinityPoints(player.money).sub(player.infinityPoints).gt(100000) && EPmP.lessThan(0))
  234.                     {
  235.                         if (!PeakedThisInfinity && NeedRGal<=player.replicanti.galaxies && NeedGal<=player.galaxies)
  236.                         {
  237.                             $('#eternitybtn').click();
  238.                             FinishLine=false;
  239.                         }
  240.                         else
  241.                         {
  242.                             $('#postInfinityButton').click();
  243.                         }
  244.                     }  
  245.                 }
  246.             }          
  247.         }
  248.     }
  249. ,1000);
  250.  
  251. setInterval("replicantiGalaxy()",100)
  252.  
  253. setInterval(function(){
  254.     var gep=player.eternityPoints.add(gainedEternityPoints());
  255.     if (
  256.         player.replicanti.galaxies==player.replicanti.gal &&
  257.         (
  258.             //player.thisEternity>=10*60*60*24 ||
  259.             (
  260.                 gep.div(1.25).gte(player.epmultCost) ||
  261.                 gep.multiply(5).lt(player.epmultCost) && gep.gte(player.timeDimension1.cost.add(player.timeDimension2.cost).add(player.timeDimension3.cost).add(player.timeDimension4.cost).dividedBy(3))
  262.             ) &&
  263.             player.thisEternity>=10*60*5
  264.         )
  265.        )
  266.     {
  267.         $('#eternitybtn').click();
  268.         FinishLine=false;
  269.     }
  270. },5000);
  271.  
  272. })();
  273.  
  274. window.LastFive=[0,0,0,0,0];
  275. window.oldAddData=addData;
  276.  
  277. addData=function(chart, label, data){
  278.     var dt=0;
  279.     if (player.options.notation === "Logarithm") {
  280.         dt = Math.max(data.log(10), 0.1);
  281.     } else {
  282.         dt = data.exponent + (data.mantissa / 10);
  283.     }
  284.     if (dt<Array.max(LastFive)/2)
  285.     {
  286.         data.exponent=Array.max(LastFive);
  287.     }
  288.    
  289.     LastFive=[LastFive[LastFive.length-19],LastFive[LastFive.length-18],LastFive[LastFive.length-17],LastFive[LastFive.length-16],LastFive[LastFive.length-15],LastFive[LastFive.length-14],LastFive[LastFive.length-13],LastFive[LastFive.length-12],LastFive[LastFive.length-11],LastFive[LastFive.length-10],LastFive[LastFive.length-9],LastFive[LastFive.length-8],LastFive[LastFive.length-7],LastFive[LastFive.length-6],LastFive[LastFive.length-5],LastFive[LastFive.length-4],LastFive[LastFive.length-3],LastFive[LastFive.length-2],LastFive[LastFive.length-1],dt];
  290.        
  291.     oldAddData(chart,label,data);
  292. }
  293.  
  294. function addDataCorr(chart, label, data)
  295. {
  296.     if (chart.data.datasets[0].data.length >= Math.ceil(player.options.chart.duration / player.options.chart.updateRate * 1000)) {
  297.         chart.data.labels.shift();
  298.         chart.data.datasets[0].data.shift();
  299.     }
  300.     if (player.options.notation === "Logarithm") {
  301.         data = Math.max(data.log(10), 0.1);
  302.     } else {
  303.         data = data.exponent + Math.log10(data.mantissa);
  304.     }
  305.     comp1 = Array.max(chart.data.datasets[0].data);
  306.     comp2 = Array.min(chart.data.datasets[0].data);
  307.     if (data > comp1) {
  308.         chart.options.scales.yAxes[0].ticks.max = data;
  309.     }
  310.     if (chart.options.scales.yAxes[0].ticks.min < comp2) {
  311.         chart.options.scales.yAxes[0].ticks.min = comp2;
  312.     }
  313.     if (data < chart.options.scales.yAxes[0].ticks.min) {
  314.         chart.options.scales.yAxes[0].ticks.min = data;
  315.     }
  316.     var preservedChartValues = false;
  317.     let failSafe = 0;
  318.     while (chart.data.datasets[0].data.length < Math.ceil(player.options.chart.duration / player.options.chart.updateRate * 1000 - 1)) {
  319.         if (preservedChartValues) {
  320.             chart.data.labels.push(label);
  321.             chart.data.datasets.forEach((dataset) => {
  322.             dataset.data.push(data);
  323.             });
  324.         } else {
  325.             var temp = chart.data.datasets[0].data.slice()
  326.             var tempData = data;
  327.             preservedChartValues = true;
  328.         }
  329.         if (chart.data.datasets[0].data.length >= Math.ceil(player.options.chart.duration / player.options.chart.updateRate * 1000 - 1)) {
  330.             var temp2 = chart.data.datasets[0].data.slice()
  331.             for (i=0; i<temp.length; i++) {
  332.                 temp2[chart.data.datasets[0].data.length - temp.length + i] = temp[i];
  333.                 temp2[i] = data;
  334.             }
  335.             chart.data.datasets[0].data = temp2;
  336.         }
  337.     }
  338.     while (chart.data.datasets[0].data.length > Math.ceil(player.options.chart.duration / player.options.chart.updateRate * 1000 - 1) && failSafe < (player.options.chart.duration / player.options.chart.updateRate * 1000 - 1)) {
  339.         chart.data.labels.pop(label);
  340.         chart.data.datasets.forEach((dataset) => {
  341.             dataset.data.pop(data);
  342.         });
  343.         failSafe++;
  344.     }
  345.     chart.data.labels.push(label);
  346.     chart.data.datasets.forEach((dataset) => {
  347.         dataset.data.push(data);
  348.     });
  349.     chart.update(300); 
  350. }
  351.  
  352. function addDataNoLog(chart, label, data)
  353. {
  354.     if (chart.data.datasets[0].data.length >= Math.ceil(player.options.chart.duration / player.options.chart.updateRate * 1000)) {
  355.         chart.data.labels.shift();
  356.         chart.data.datasets[0].data.shift();
  357.     }
  358.     data=Math.pow(10.0,data.exponent)*data.mantissa;
  359.     comp1 = Array.max(chart.data.datasets[0].data);
  360.     comp2 = Array.min(chart.data.datasets[0].data);
  361.     if (data > comp1) {
  362.         chart.options.scales.yAxes[0].ticks.max = data;
  363.     }
  364.     if (chart.options.scales.yAxes[0].ticks.min < comp2) {
  365.         chart.options.scales.yAxes[0].ticks.min = comp2;
  366.     }
  367.     if (data < chart.options.scales.yAxes[0].ticks.min) {
  368.         chart.options.scales.yAxes[0].ticks.min = data;
  369.     }
  370.     var preservedChartValues = false;
  371.     let failSafe = 0;
  372.     while (chart.data.datasets[0].data.length < Math.ceil(player.options.chart.duration / player.options.chart.updateRate * 1000 - 1)) {
  373.         if (preservedChartValues) {
  374.             chart.data.labels.push(label);
  375.             chart.data.datasets.forEach((dataset) => {
  376.             dataset.data.push(data);
  377.             });
  378.         } else {
  379.             var temp = chart.data.datasets[0].data.slice()
  380.             var tempData = data;
  381.             preservedChartValues = true;
  382.         }
  383.         if (chart.data.datasets[0].data.length >= Math.ceil(player.options.chart.duration / player.options.chart.updateRate * 1000 - 1)) {
  384.             var temp2 = chart.data.datasets[0].data.slice()
  385.             for (i=0; i<temp.length; i++) {
  386.                 temp2[chart.data.datasets[0].data.length - temp.length + i] = temp[i];
  387.                 temp2[i] = data;
  388.             }
  389.             chart.data.datasets[0].data = temp2;
  390.         }
  391.     }
  392.     while (chart.data.datasets[0].data.length > Math.ceil(player.options.chart.duration / player.options.chart.updateRate * 1000 - 1) && failSafe < (player.options.chart.duration / player.options.chart.updateRate * 1000 - 1)) {
  393.         chart.data.labels.pop(label);
  394.         chart.data.datasets.forEach((dataset) => {
  395.             dataset.data.pop(data);
  396.         });
  397.         failSafe++;
  398.     }
  399.     chart.data.labels.push(label);
  400.     chart.data.datasets.forEach((dataset) => {
  401.         dataset.data.push(data);
  402.     });
  403.     chart.update(300); 
  404. }
  405.  
  406. addData=function(chart, label, data){
  407.     if (player.eternityPoints.exponent<=307 || player.eternityPoints.exponent>400)
  408.     {
  409.         addDataCorr(chart,label,EPm.multiply(36000));
  410.     }
  411.     else if (EPm.mantissa<0)
  412.     {
  413.         addDataNoLog(chart,label,new Decimal(0));
  414.     }
  415.     else
  416.     {
  417.         addDataNoLog(chart,label,EPm.multiply(36000));
  418.     }
  419. }
Advertisement
Add Comment
Please, Sign In to add comment