Ministry

Untitled

Apr 29th, 2011
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.51 KB | None | 0 0
  1. Rectangle tab1 = new Rectangle(496, 345, 30, 30);
  2.      //format is rectangle(xCORD, yCORD, WIDTH, HEIGHT)//
  3.         Rectangle tab2 = new Rectangle(496, 345, 30, 30);
  4.  
  5.         int tab = 1;
  6.         Point p;
  7.  
  8.     public void mouseClicked(MouseEvent e){
  9.     p = e.getPoint();
  10.     if(tab1.contains(p)){
  11.     tab = 1;
  12.     showPaint = true;
  13.     }
  14.     if(tab2.contains(p)){
  15.     tab = 2;
  16.     showPaint = false;
  17.         }
  18.     }
  19.         public void mouseEntered(MouseEvent e){
  20.         }
  21.         public void mouseExited(MouseEvent e){
  22.         }
  23.         public void mouseReleased(MouseEvent e){
  24.         }
  25.         public void mousePressed(MouseEvent e){
  26.         }
  27.  
  28.     public void onRepaint(Graphics g1) {
  29.            Graphics2D g = (Graphics2D)g1;
  30.                 if (game.isLoggedIn() && !game.isWelcomeScreen())
  31.             {
  32.         millis = System.currentTimeMillis() - startTime;
  33.         hours = millis / (1000 * 60 * 60);
  34.         millis -= hours * (1000 * 60 * 60);
  35.         minutes = millis / (1000 * 60);
  36.         millis -= minutes * (1000 * 60);
  37.         seconds = millis / 1000;
  38.         currLevel = skills.getCurrentLevel(Skills.PRAYER);
  39.                 currXP = skills.getCurrentExp(Skills.PRAYER);
  40.         lvlsGained = currLevel - startLevel;
  41.                 expGained = currXP - startExp;
  42.                 expToLevel = skills.getExpToNextLevel(Skills.PRAYER);
  43.                 percentTNL = skills.getPercentToNextLevel(skills.PRAYER);
  44.                 expHour = (int) ((expGained) * 3600000D / (System.currentTimeMillis() - startTime));
  45.  
  46.                   final int percentBar = (int) (skills.getPercentToNextLevel(Skills.PRAYER)*0.52);
  47.  
  48.                   if ((minutes > 0 || hours > 0 || seconds > 0) && expGained > 0) {
  49.             sXP = (float) expGained
  50.                                 / (float) (seconds + minutes * 60 + hours * 60 * 60);
  51.                 }
  52.                 mXP = sXP * 60;
  53.                 hXP = mXP * 60;
  54.  
  55.                   if (sXP > 0) {
  56.                 STL = (int) (expToLevel / sXP);
  57.                 }
  58.                 if (STL >= 60) {
  59.                     MTL = STL / 60;
  60.                     STL -= MTL * 60;
  61.                 } else {
  62.                     MTL = 0;
  63.                 }
  64.                 if (MTL >= 60) {
  65.                     HTL = MTL / 60;
  66.                     MTL -= HTL * 60;
  67.                 } else {
  68.                     HTL = 0;
  69.                 }
  70.           if (clicked != null) {
  71.                         final int mx = (int)mouse.getLocation().getX();
  72.                         final int my = (int)mouse.getLocation().getY();
  73.  
  74.                         final long mpt = System.currentTimeMillis() - mouse.getPressTime();
  75.                         if (mouse.getPressTime() == -1 || mpt >= 300)
  76.                                 g.drawImage(normal, mx - 10, my - 6, null);
  77.                         if (mpt < 300)
  78.                                 g.drawImage(clicked, mx - 10, my - 6, null);
  79.  
  80.                 }
  81.    if(showPaint == true) {
  82.         //this is so you can see where the location is at, you can delete these once you get the correct size and cords//
  83.         g.setRenderingHints(antialiasing);
  84.         g.setColor(color1);
  85.         g.fillRect(279, 351, 214, 104);
  86.         g.setStroke(stroke1);
  87.         g.drawRect(279, 351, 214, 104);
  88.         g.setColor(color2);
  89.         g.fillRect(276, 348, 214, 104);
  90.         g.setColor(color7);
  91.         g.drawRect(276, 348, 214, 104);
  92.         g.setFont(font1);
  93.         g.drawString("Grave Digger", 312, 364);
  94.         g.setFont(font2);
  95.         g.drawString("v1.2", 424, 366);
  96.         g.setFont(font3);
  97.         g.drawString("Bones Burried  : " + bonesburied , 282, 382);
  98.         g.drawString("Exp Gained      : " + expGained, 282, 394);
  99.         g.drawString("Current Level   : " + currLevel, 280, 408);
  100.         g.drawString("Runtime        : " +hours + ":" + minutes + ":" + seconds, 282, 436);
  101.         g.drawString("Time TNL       : " + HTL + ":" + MTL + ":" + STL, 282, 422);
  102.         g.drawImage(Zomzom, 444, 392, null);
  103.         g.setFont(font4);
  104.         g.setColor(color3);
  105.         g.drawString("© Ministry", 444, 448);
  106.         g.drawImage(pBar, 461, 480, null);
  107.         g.setColor(color4);
  108.         g.fillRoundRect(461, 480, percentBar, 22, 5, 5);
  109.  
  110.         g.setFont(font3);
  111.         g.setColor(color5);
  112.         g.drawString( percentTNL + " %", 468, 497);
  113.         tab = 1;
  114.         }
  115.  
  116.         if (tab == 1){
  117.         showPaint = true;
  118.         g.drawImage(Himg, 496, 345, null);
  119.         g.drawRect(tab1.x, tab1.y, tab1.width, tab1.height);}
  120.         g.fillRect(496, 346, 14, 12);
  121.         if (tab == 2) {
  122.         showPaint = false;
  123.         g.drawRect(tab2.x, tab2.y, tab1.width, tab2.height);
  124.         g.fillRect(496, 346, 14, 12);
  125.         g.drawImage(Simg, 496, 345, null);
  126.               }
  127.              }
  128.             }
Advertisement
Add Comment
Please, Sign In to add comment