Advertisement
Guest User

Antimatter Dimensions IP Rate

a guest
Apr 7th, 2020
390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         ADIP Rates
  3. // @version      0.1
  4. // @description  Add an IP/whatever display to the main page
  5. // @author       You
  6. // @match        http*://ivark.github.io/
  7. // ==/UserScript==
  8.  
  9. (function() {
  10.     'use strict';
  11.  
  12.     //ADIPRate Script
  13.  
  14.     $('body').append('<div id="ADIPfloat" style="font-family: Typewriter; font-size: 16px; border: 1px solid black; cursor: move; padding:5px; background: #222"></div>');
  15.     $('#ADIPfloat').append('<span></span>');
  16.     $("#ADIPfloat").css("position", "absolute").css("left", "1%").css("top", "68%");
  17.  
  18.     window.bestippm=0;
  19.     window.bestip=0;
  20.  
  21.     $("#ADIPfloat")[0].appendChild(document.createElement("br"));
  22.  
  23.     //Manual best IP set button
  24.     var IPsetbtn = document.createElement("button");
  25.     IPsetbtn.onclick = function() {
  26.  
  27.         player.autobuyers[11].priority.mantissa = bestip;
  28.         $("#priority12")[0].value = bestip;
  29.     };
  30.     IPsetbtn.innerHTML = "Set IP";
  31.     $("#ADIPfloat")[0].appendChild(IPsetbtn);
  32.  
  33.     var resetIP=document.createElement("button");
  34.     resetIP.onclick=function(){bestippm=0;};
  35.     resetIP.innerHTML="Reset";
  36.     $("#ADIPfloat").append(resetIP);
  37.  
  38.     setInterval(function(){
  39.         var ippm=$("#averagerun")[0].innerHTML.split(" ")[12];
  40.         var ippm2=$("#run1")[0].innerHTML.split(" ")[12];
  41.         var ADIPfloat = document.getElementById(("ADIPfloat"));
  42.  
  43.         if(player.thisInfinityTime>1&&gainedInfinityPoints()/player.thisInfinityTime>bestippm){bestippm=gainedInfinityPoints()/player.thisInfinityTime;bestip=gainedInfinityPoints();}
  44.         ADIPfloat.firstChild.innerHTML="Last 10: "+ippm+"/min<br>Last: "+ippm2+"/min<br>Best IP amount: "+bestip+"<br>Best IP rate: "+shorten(bestippm*600)+"/min";
  45.  
  46.     },100);
  47.  
  48.     //Draggable Script
  49.     dragElement(document.getElementById(("ADIPfloat")));
  50.  
  51.     function dragElement(elmnt) {
  52.         var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
  53.         elmnt.onmousedown = dragMouseDown;
  54.         function dragMouseDown(e) {
  55.             e = e || window.event;    // get the mouse cursor position at startup:
  56.             pos3 = e.clientX;
  57.             pos4 = e.clientY;
  58.             document.onmouseup = closeDragElement;    // removes action when the mouse button is raised
  59.             document.onmousemove = elementDrag;    // call a function whenever the cursor moves:
  60.         }
  61.         function elementDrag(e) {
  62.             e = e || window.event;
  63.             pos1 = pos3 - e.clientX; // calculate the new cursor position
  64.             pos2 = pos4 - e.clientY;
  65.             pos3 = e.clientX;
  66.             pos4 = e.clientY;
  67.             elmnt.style.top = (elmnt.offsetTop - pos2) + "px"; // set the element's new position
  68.             elmnt.style.left = (elmnt.offsetLeft - pos1) + "px";
  69.         }
  70.         function closeDragElement() { // stop moving when mouse button is released:
  71.             document.onmouseup = null;
  72.             document.onmousemove = null;
  73.         }
  74.     }
  75. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement