Advertisement
Guest User

Untitled

a guest
May 10th, 2015
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. For time ran i used
  2. --------------------
  3.  
  4. {
  5.  
  6. timeRan = System.currentTimeMillis() - this.timeBegan;
  7. g.drawString(ft(timeRan), 174, 430);
  8. }
  9.  
  10. }
  11. private String ft(long duration)
  12. {
  13. String res = "";
  14. long days = TimeUnit.MILLISECONDS.toDays(duration);
  15. long hours = TimeUnit.MILLISECONDS.toHours(duration)
  16. - TimeUnit.DAYS.toHours(TimeUnit.MILLISECONDS.toDays(duration));
  17. long minutes = TimeUnit.MILLISECONDS.toMinutes(duration)
  18. - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS
  19. .toHours(duration));
  20. long seconds = TimeUnit.MILLISECONDS.toSeconds(duration)
  21. - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS
  22. .toMinutes(duration));
  23. if (days == 0) {
  24. res = (hours + ":" + minutes + ":" + seconds);
  25. } else {
  26. res = (days + ":" + hours + ":" + minutes + ":" + seconds);
  27. }
  28. return res;
  29.  
  30. }
  31.  
  32.  
  33. for time till next level i used
  34. --------------------------------
  35.  
  36.  
  37. final int[] XP_TABLE =
  38. {
  39. 0, 0, 83, 174, 276, 388, 512, 650, 801, 969, 1154,
  40. 1358, 1584, 1833, 2107, 2411, 2746, 3115, 3523, 3973, 4470, 5018,
  41. 5624, 6291, 7028, 7842, 8740, 9730, 10824, 12031, 13363, 14833,
  42. 16456, 18247, 20224, 22406, 24815, 27473, 30408, 33648, 37224,
  43. 41171, 45529, 50339, 55649, 61512, 67983, 75127, 83014, 91721,
  44. 101333, 111945, 123660, 136594, 150872, 166636, 184040, 203254,
  45. 224466, 247886, 273742, 302288, 333804, 368599, 407015, 449428,
  46. 496254, 547953, 605032, 668051, 737627, 814445, 899257, 992895,
  47. 1096278, 1210421, 1336443, 1475581, 1629200, 1798808, 1986068,
  48. 2192818, 2421087, 2673114, 2951373, 3258594, 3597792, 3972294,
  49. 4385776, 4842295, 5346332, 5902831, 6517253, 7195629, 7944614,
  50. 8771558, 9684577, 10692629, 11805606, 13034431, 200000000
  51. };
  52.  
  53.  
  54.  
  55. currentXp = skills.getExperience(Skill.FISHING);
  56. currentLevel = skills.getStatic(Skill.FISHING);
  57. currentLevelXp = XP_TABLE[currentLevel];
  58. nextLevelXp = XP_TABLE[currentLevel + 1];
  59. percentTNL = ((currentXp - currentLevelXp) / (nextLevelXp - currentLevelXp) * 100);
  60.  
  61. DecimalFormat df = new DecimalFormat("#.#");
  62. g.drawString("" + df.format(percentTNL), 224, 478);
  63.  
  64.  
  65. {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement