Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void onRepaint(Graphics g1) {
- if (getMyPlayer().isOnScreen() && !hidePaint) {
- int xpGained = 0;
- long millis = System.currentTimeMillis() - startTime;
- long hours = millis / (1000 * 60 * 60);
- millis -= hours * (1000 * 60 * 60);
- long minutes = millis / (1000 * 60);
- millis -= minutes * (1000 * 60);
- long seconds = millis / 1000;
- if (startXp == 0) {
- startXp = skills.getCurrentExp(skills.FISHING);
- }
- xpGained = skills.getCurrentExp(skills.FISHING) - startXp;
- float xpsec = 0;
- if ((minutes > 0 || hours > 0 || seconds > 0) && xpGained > 0) {
- xpsec = ((float) xpGained)
- / (float) (seconds + (minutes * 60) + (hours * 60 * 60));
- }
- float xpmin = xpsec * 60;
- float xphour = xpmin * 60;
- float caughtPerSec = 0;
- if ((minutes > 0 || hours > 0 || seconds > 0) && caught > 0) {
- caughtPerSec = ((float) caught)
- / (float) (seconds + (minutes * 60) + (hours * 60 * 60));
- }
- float caughtPerMin = caughtPerSec * 60;
- float caughtPerHour = caughtPerMin * 60;
- Graphics2D g = (Graphics2D) g1;
- g.setRenderingHints(antialiasing);
- g.setColor(color1);
- g.fill(polygon1);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.draw(polygon1);
- g.drawImage(img1, 230, 109, null);
- g.setFont(font1);
- g.drawString("XP/hr: " + Math.round(xphour), 42, 45);
- g.drawString("Fish/hr: " + Math.round(caughtPerHour), 28, 71);
- g.drawString("Fish caught: " + caught, 40, 121);
- g.drawString("XP gained: " + xpGained, 36, 97);
- g.drawString("Time ran: " + hours + ":" + minutes + ":" + seconds
- + ".", 127, 67);
- g.drawImage(img2, 152, 22, null);
- g.drawString("" + levelsGained, 255, 83);
- g.setColor(color3);
- g.drawString("XavierGmail", 165, 99);
- if (pic) {
- g.drawImage(red, 520, 97, null);
- } else {
- g.drawImage(redO, 520, 97, null);
- }
- }
- else if (hidePaint) {
- Graphics2D g = (Graphics2D) g1;
- g.setRenderingHints(antialiasing);
- if (pic) {
- g.drawImage(green, 520, 97, null);
- } else {
- g.drawImage(greenO, 520, 97, null);
- }
- }
- }
Add Comment
Please, Sign In to add comment