daily pastebin goal
37%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 54 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. /**
  2.      * Created by IntelliJ IDEA. User: Tim Date: 9/8/11 Time: 5:05 PM To change
  3.      * this template use File | Settings | File Templates.
  4.      */
  5.     public class Tracker {
  6.         long start;
  7.         public int length = 40;
  8.         int bSkills[] = new int[7];// attack,str,def,range,mage,hp,prayer
  9.         int cSkills[] = new int[7];// attack,str,def,range,mage,hp,prayer
  10.         MethodContext m;
  11.         String skillNames[] = { "Attack", "Strength", "Defense", "Range",
  12.                 "Magic", "Consitution", "Prayer" };
  13.  
  14.         /**
  15.          * @param methodGather
  16.          *            Obtains all information to be tracked
  17.          */
  18.         public Tracker() {
  19.             start = System.currentTimeMillis();
  20.             m = ctx;
  21.             bSkills[0] = m.skills.getCurrentExp(Skills.ATTACK);
  22.             bSkills[1] = m.skills.getCurrentExp(Skills.STRENGTH);
  23.             bSkills[2] = m.skills.getCurrentExp(Skills.DEFENSE);
  24.             bSkills[3] = m.skills.getCurrentExp(Skills.RANGE);
  25.             bSkills[4] = m.skills.getCurrentExp(Skills.MAGIC);
  26.             bSkills[5] = m.skills.getCurrentExp(Skills.CONSTITUTION);
  27.             bSkills[6] = m.skills.getCurrentExp(Skills.PRAYER);
  28.         }
  29.  
  30.         /**
  31.          * Updates skill exp
  32.          */
  33.         void updateSkills() {
  34.             cSkills[0] = m.skills.getCurrentExp(Skills.ATTACK);
  35.             cSkills[1] = m.skills.getCurrentExp(Skills.STRENGTH);
  36.             cSkills[2] = m.skills.getCurrentExp(Skills.DEFENSE);
  37.             cSkills[3] = m.skills.getCurrentExp(Skills.RANGE);
  38.             cSkills[4] = m.skills.getCurrentExp(Skills.MAGIC);
  39.             cSkills[5] = m.skills.getCurrentExp(Skills.CONSTITUTION);
  40.             cSkills[6] = m.skills.getCurrentExp(Skills.PRAYER);
  41.         }
  42.  
  43.         /**
  44.          * Draws all possible xp gains
  45.          *
  46.          * @param g
  47.          * @return g
  48.          */
  49.         public Graphics drawAnyIfChanged(Graphics g, int xl, int yl) {
  50.             int a = 1;
  51.             for (int i = 0; i < skillNames.length; i++) {
  52.                 if (skillChanged(i)) {
  53.                     a++;
  54.                     g.setColor(Color.WHITE);
  55.                     g.drawString(skillNames[i] + " exp gained: "
  56.                             + (cSkills[i] - bSkills[i]), xl, yl + (a * 30));
  57.                     g.drawString(skillNames[i] + " exp/h: "
  58.                             + (PerHour(cSkills[i] - bSkills[i])), xl, yl
  59.                             + (a * 30) + 15);
  60.                 }
  61.  
  62.             }
  63.             length = (a) * 35;
  64.             return g;
  65.         }
  66.  
  67.         public int addAll() {
  68.             int all = 0;
  69.             for (int i = 0; i < skillNames.length; i++) {
  70.                 if (skillChanged(i)) {
  71.                     all += cSkills[i] - bSkills[i];
  72.                 }
  73.             }
  74.             return all;
  75.  
  76.         }
  77.  
  78.         public int allPerHour() {
  79.             return PerHour(addAll());
  80.         }
  81.  
  82.         boolean skillChanged(int skill) {
  83.             return cSkills[skill] > bSkills[skill];
  84.         }
  85.  
  86.         /**
  87.          *
  88.          * @return if skills have been changed
  89.          */
  90.         boolean skillsChanged() {
  91.             updateSkills();
  92.             for (int i : bSkills) {
  93.                 for (int j : cSkills) {
  94.                     if (j > i) {
  95.                         return true;
  96.                     }
  97.                 }
  98.             }
  99.             return false;
  100.  
  101.         }
  102.     }
  103. //our mouse
  104. private void drawMouse(Graphics g1) {
  105.         ((Graphics2D) g1).setRenderingHints(new RenderingHints(
  106.                 RenderingHints.KEY_ANTIALIASING,
  107.                 RenderingHints.VALUE_ANTIALIAS_ON));
  108.         Point p = mouse.getLocation();
  109.         Graphics2D spinG = (Graphics2D) g1.create();
  110.         Graphics2D spinGRev = (Graphics2D) g1.create();
  111.         spinG.setColor(Color.red);
  112.         spinGRev.setColor(Color.white);
  113.         spinG.rotate(System.currentTimeMillis() % 2000d / 2000d * (360d) * 2
  114.                 * Math.PI / 180.0, p.x, p.y);
  115.         spinGRev.rotate(System.currentTimeMillis() % 2000d / 2000d * (-360d)
  116.                 * 2 * Math.PI / 180.0, p.x, p.y);
  117.         final int outerSize = 20;
  118.         final int innerSize = 15;
  119.         spinG.setStroke(new BasicStroke(4.0f, BasicStroke.CAP_ROUND,
  120.                 BasicStroke.JOIN_ROUND));
  121.         spinGRev.setStroke(new BasicStroke(4.0f, BasicStroke.CAP_ROUND,
  122.                 BasicStroke.JOIN_ROUND));
  123.         spinG.drawArc(p.x - (outerSize / 2), p.y - (outerSize / 2), outerSize,
  124.                 outerSize, 100, 75);
  125.         spinG.drawArc(p.x - (outerSize / 2), p.y - (outerSize / 2), outerSize,
  126.                 outerSize, -100, 75);
  127.         spinGRev.drawArc(p.x - (innerSize / 2), p.y - (innerSize / 2),
  128.                 innerSize, innerSize, 100, 75);
  129.         spinGRev.drawArc(p.x - (innerSize / 2), p.y - (innerSize / 2),
  130.                 innerSize, innerSize, -100, 75);
  131.     }
  132. //paint always over chat with logo.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top