Advertisement
Nyan-Cat

ADIPRate 2.0

Aug 28th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         ADIPRate 2.0
  3. // @version      0.1
  4. // @description  Add an IP/whatever display to the main page
  5. // @author       Nyan cat
  6. // @match        http*://e666666.github.io/
  7. // @grant        none
  8. // ==/UserScript==
  9.  
  10. (function() {
  11.     'use strict';
  12.  
  13.  
  14.     var node=document.createElement("span");
  15.     node.style.display="inline-block";
  16.     $("#infinityPoints2")[0].parentNode.appendChild(node);
  17.     $("#infinityPoints2")[0].setAttribute("class","");
  18.     node.parentNode.setAttribute("class","IP");
  19.     node.parentNode.style.position="absolute";
  20.     node.parentNode.style.left="62.5%";
  21.     window.bestippm=new Decimal(0);
  22.     window.bestip=new Decimal(0);
  23.     var reset=document.createElement("button");
  24.     reset.onclick=function(){bestippm=0;};
  25.     reset.innerHTML="Reset";
  26.     $("#infinityPoints2")[0].parentNode.appendChild(reset);
  27.     setInterval(function(){
  28.         var tempTime = new Decimal(0)
  29.         var tempIP = new Decimal(0)
  30.         for (var i=0; i<10;i++) {
  31.             tempTime = tempTime.plus(player.lastTenRuns[i][0])
  32.             tempIP = tempIP.plus(player.lastTenRuns[i][1])
  33.         }
  34.         var ippm = tempIP.dividedBy(tempTime/600)
  35.         var ippm2=player.lastTenRuns[0][1]
  36.         if (player.thisInfinityTime>1&&gainedInfinityPoints().div(player.thisInfinityTime).gt(bestippm)) {
  37.             bestippm=gainedInfinityPoints().div(player.thisInfinityTime)
  38.             bestip=gainedInfinityPoints()
  39.         }
  40.         node.innerHTML="Last 10: "+formatValue(player.options.notation,ippm,2,0)+" IP/min<br>Last: "+formatValue(player.options.notation,ippm2,2,0)+" IP/min<br>Best IP amount: "+formatValue(player.options.notation,bestip,2,0)+"<br>Best IP rate:"+formatValue(player.options.notation,bestippm.times(600),2,0)+" IP/min";
  41.     },100);
  42. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement