Zompies 20 Share Posted October 22, 2015 Title is my question. How do I get xp a hour for a certain skill? Link to comment Share on other sites More sharing options...
lily 490 Share Posted October 22, 2015 This little line of code shoulder do the trick! getSkillTracker().getGainedExperiencePerHour(Skill.FISHING); Obviously replace FISHING with whatever skill you'd like there. You can also get the 'per hour' calculation of any number with Timer.getHourlyRate(number); Link to comment Share on other sites More sharing options...
Nuclear Nezz 2012 Share Posted October 22, 2015 getSkillTracker().start(Skill.YOURSKILL); getSkillTracker().getGainedExpPerHour(Skill.YOURSKILL); Link to comment Share on other sites More sharing options...
lily 490 Share Posted October 22, 2015 Oh right, what Nezz said, you defi have to start it first Link to comment Share on other sites More sharing options...
RealEngine 24 Share Posted October 22, 2015 don't be a cheater and do it the old fashioned way. onstart timeBegan = System.currentTimeMillis(); xpBegan = getSkills().getExperience(Skill.ATTACK) + getSkills().getExperience(Skill.STRENGTH) + getSkills().getExperience(Skill.DEFENCE) + getSkills().getExperience(Skill.HITPOINTS); onpaint timeRan = System.currentTimeMillis() - timeBegan; String hms = String.format("%02d:%02d:%02d", TimeUnit.MILLISECONDS.toHours(timeRan), TimeUnit.MILLISECONDS.toMinutes(timeRan) % TimeUnit.HOURS.toMinutes(1), TimeUnit.MILLISECONDS.toSeconds(timeRan) % TimeUnit.MINUTES.toSeconds(1)); xp = (getSkills().getExperience(Skill.ATTACK) + getSkills().getExperience(Skill.STRENGTH) + getSkills().getExperience(Skill.DEFENCE) + getSkills().getExperience(Skill.HITPOINTS)) - xpBegan; int xph = (int) (xp / ((timeRan) / 3600000.0D)); g.drawString("xp = " + NumberFormat.getNumberInstance(Locale.US).format(xp), 345 + 2, 341 + 30); g.drawString("xph = " + NumberFormat.getNumberInstance(Locale.US).format(xph), 345 + 2, 341 + 48); Link to comment Share on other sites More sharing options...
Zompies 20 Author Share Posted October 22, 2015 getSkillTracker().start(Skill.YOURSKILL); getSkillTracker().getGainedExpPerHour(Skill.YOURSKILL); Thank you Link to comment Share on other sites More sharing options...
Juggles 18 Share Posted March 28, 2016 Do i need to add an import also to get this to work? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.