Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name ADIPRate 2.0
- // @version 0.1
- // @description Add an IP/whatever display to the main page
- // @author Nyan cat
- // @match http*://e666666.github.io/
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- var node=document.createElement("span");
- node.style.display="inline-block";
- $("#infinityPoints2")[0].parentNode.appendChild(node);
- $("#infinityPoints2")[0].setAttribute("class","");
- node.parentNode.setAttribute("class","IP");
- node.parentNode.style.position="absolute";
- node.parentNode.style.left="62.5%";
- window.bestippm=new Decimal(0);
- window.bestip=new Decimal(0);
- var reset=document.createElement("button");
- reset.onclick=function(){bestippm=0;};
- reset.innerHTML="Reset";
- $("#infinityPoints2")[0].parentNode.appendChild(reset);
- setInterval(function(){
- var tempTime = new Decimal(0)
- var tempIP = new Decimal(0)
- for (var i=0; i<10;i++) {
- tempTime = tempTime.plus(player.lastTenRuns[i][0])
- tempIP = tempIP.plus(player.lastTenRuns[i][1])
- }
- var ippm = tempIP.dividedBy(tempTime/600)
- var ippm2=player.lastTenRuns[0][1]
- if (player.thisInfinityTime>1&&gainedInfinityPoints().div(player.thisInfinityTime).gt(bestippm)) {
- bestippm=gainedInfinityPoints().div(player.thisInfinityTime)
- bestip=gainedInfinityPoints()
- }
- 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";
- },100);
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement