Want more features on Pastebin? Sign Up, it's FREE!
Guest

Paintforpowerminer

By: pokaymahn on Jan 4th, 2013  |  syntax: None  |  size: 3.94 KB  |  views: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  public void onRepaint(Graphics g) {
  2.        
  3.         if (!onstartHasRan) {
  4.                 return;
  5.         }
  6.        
  7.         Point m = Mouse.getLocation();
  8.                 g.setColor(Color.cyan);
  9.                 g.drawRoundRect(m.x - 6, m.y, 15, 3, 5, 5);
  10.                 g.drawRoundRect(m.x, m.y - 6, 3, 15, 5, 5);
  11.                 g.fillRoundRect(m.x - 6, m.y, 15, 3, 5, 5);
  12.                 g.fillRoundRect(m.x, m.y - 6, 3, 15, 5, 5);
  13.                
  14.                
  15.                 //draw background
  16.         g.setColor(new Color(0, 0, 0, 180));
  17.         g.fillRect(0, 50, 130, 160);
  18.        
  19.         g.setColor(Color.white);
  20.         g.setFont(new Font("Tahoma", Font.BOLD, 11));
  21.         g.drawString("Power Miner " + version, 0, 50);
  22.        
  23.                 g.setColor(Color.red);
  24.         g.setFont(new Font("Tahoma", Font.PLAIN, 11));
  25.  
  26.         double milliseconds = System.currentTimeMillis() - starttime;
  27.         seconds = milliseconds / 1000;
  28.         minutes = seconds / 60;
  29.         hours = minutes / 60;
  30.        
  31.         display_hours = (long)seconds / 3600;
  32.         long remaining_seconds = (long)seconds - ( display_hours * 3600 );
  33.         display_minutes = remaining_seconds / 60;
  34.         display_seconds = remaining_seconds - ( display_minutes * 60 );
  35.        
  36.         g.drawString("Time: " + display_hours + ":" + display_minutes + ":" + display_seconds , 0, 65);
  37.                
  38.         g.setColor(Color.red);
  39.         g.setFont(new Font("Tahoma", Font.PLAIN, 11));
  40.  
  41.         currentlevel = Skills.getRealLevel(Skills.MINING);
  42.        
  43.         levelsgained = currentlevel - startinglevel;
  44.        
  45.         currentexperience = Skills.getExperience(Skills.MINING);
  46.        
  47.         experiencegained = currentexperience - startingexperience;
  48.        
  49.         experienceperhour = experiencegained/ hours;
  50.        
  51.         experiencetonextlevel = Skills.getExperienceToLevel(Skills.MINING, Skills.getLevel(Skills.MINING) + 1);
  52.        
  53.         //percenttonextlevel = Skills.getPercentToNextLevel(Skills.MINING);
  54.  
  55.         g.setColor(Color.red);
  56.         g.fillRect(0, 194, 100,12 );  
  57.        
  58.        
  59.         g.drawString("Mining: " + ore_type , 0, 80);
  60.         g.drawString("Current level: " + currentlevel, 0, 95);
  61.         g.drawString("Levels Gained: " + levelsgained, 0, 110);
  62.         g.drawString("Current Exp: " + currentexperience, 0, 125);
  63.         g.drawString("Exp Gained: " + experiencegained,0, 140);
  64.         g.drawString("Exp / Hour: " + formatdouble(experienceperhour), 0, 155);
  65.         g.drawString("Exp TNL: " + experiencetonextlevel, 0, 185);
  66.         int [] diff={83,91,102,112,124,138,151,168,185,204,226,249,274,304,335,369,408,450,497,548,606,
  67.                         667,737,814,898,990,1094,1207,1332,1470,1623,1791,1977,2182,2409,2658,2935,3240,3576,3947,4358,4810,5310,5863,6471,7144,7887,8707,      9612,10612,11715,12934,14278,15764,17404,19214,21212,23420,25856,28546,31516,34795, 38416,42413,46826,51699,57079,63019,69576,76818,84812,93638,103383,114143,126022,139138,153619,169608,187260,206750,228269,252027,278259,307221,339198,374502,413482,456519,504037,556499,614422,678376,748985,826944,913019,1008052,1112977,1228825};
  68.         double percent= 10000.0*(diff[currentlevel-1]-experiencetonextlevel)/diff[currentlevel-1];
  69.         percent=Math.floor(percent);
  70.         percent/=100;
  71.        
  72.         g.setColor(Color.green);
  73.         g.fillRect(0, 194, (int)percent, 12);
  74.         g.setColor(Color.black);
  75.         g.drawString((percent)+"% to level "+(currentlevel+1), 5, 203);
  76.         double experience_per_millisecond = ( (double)experiencegained ) / milliseconds;
  77.  
  78.         if (experiencegained == 0) {
  79.                 g.drawString("Time TNL: ", 0, 155);
  80.         }else{
  81.                 double milliseconds_to_next_level =  (experiencetonextlevel  / experience_per_millisecond);
  82.                 g.setColor(Color.red);
  83.                 g.drawString("Time TNL: " + formatTime(milliseconds_to_next_level), 0, 170);
  84.         }
  85.      
  86.     }
clone this paste RAW Paste Data