Guest User

Untitled

a guest
Aug 16th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. public void onRepaint(Graphics g1) {
  2. if (getMyPlayer().isOnScreen() && !hidePaint) {
  3.  
  4. int xpGained = 0;
  5. long millis = System.currentTimeMillis() - startTime;
  6. long hours = millis / (1000 * 60 * 60);
  7. millis -= hours * (1000 * 60 * 60);
  8. long minutes = millis / (1000 * 60);
  9. millis -= minutes * (1000 * 60);
  10. long seconds = millis / 1000;
  11.  
  12. if (startXp == 0) {
  13. startXp = skills.getCurrentExp(skills.FISHING);
  14. }
  15. xpGained = skills.getCurrentExp(skills.FISHING) - startXp;
  16. float xpsec = 0;
  17. if ((minutes > 0 || hours > 0 || seconds > 0) && xpGained > 0) {
  18. xpsec = ((float) xpGained)
  19. / (float) (seconds + (minutes * 60) + (hours * 60 * 60));
  20. }
  21. float xpmin = xpsec * 60;
  22. float xphour = xpmin * 60;
  23. float caughtPerSec = 0;
  24. if ((minutes > 0 || hours > 0 || seconds > 0) && caught > 0) {
  25. caughtPerSec = ((float) caught)
  26. / (float) (seconds + (minutes * 60) + (hours * 60 * 60));
  27. }
  28. float caughtPerMin = caughtPerSec * 60;
  29. float caughtPerHour = caughtPerMin * 60;
  30.  
  31. Graphics2D g = (Graphics2D) g1;
  32. g.setRenderingHints(antialiasing);
  33.  
  34. g.setColor(color1);
  35. g.fill(polygon1);
  36. g.setColor(color2);
  37. g.setStroke(stroke1);
  38. g.draw(polygon1);
  39. g.drawImage(img1, 230, 109, null);
  40. g.setFont(font1);
  41. g.drawString("XP/hr: " + Math.round(xphour), 42, 45);
  42. g.drawString("Fish/hr: " + Math.round(caughtPerHour), 28, 71);
  43. g.drawString("Fish caught: " + caught, 40, 121);
  44. g.drawString("XP gained: " + xpGained, 36, 97);
  45. g.drawString("Time ran: " + hours + ":" + minutes + ":" + seconds
  46. + ".", 127, 67);
  47. g.drawImage(img2, 152, 22, null);
  48. g.drawString("" + levelsGained, 255, 83);
  49. g.setColor(color3);
  50. g.drawString("XavierGmail", 165, 99);
  51. if (pic) {
  52. g.drawImage(red, 520, 97, null);
  53. } else {
  54. g.drawImage(redO, 520, 97, null);
  55. }
  56. }
  57.  
  58. else if (hidePaint) {
  59. Graphics2D g = (Graphics2D) g1;
  60. g.setRenderingHints(antialiasing);
  61. if (pic) {
  62. g.drawImage(green, 520, 97, null);
  63. } else {
  64. g.drawImage(greenO, 520, 97, null);
  65. }
  66. }
  67. }
Add Comment
Please, Sign In to add comment