Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • How do I get xp a hour?


    Zompies

    Recommended Posts

    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

    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

    • 5 months later...

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.