Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Getting percentage to next level?

Featured Replies

Are you asking for the equation or code?

For the equation I believe it is:

Experience left / Total exp in the level * 100

I could be wrong

Edit: i actually think that is how much exp you have

So then you can do that 100 - number

Edited by Speakmore

  • Author

Are you asking for the equation or code?

For the equation I believe it is:

Experience left / Total exp in the level * 100

I could be wrong

Edit: i actually think that is how much exp you have

So then you can do that 100 - number

 

I got an F in maths so yeahh-.- xD

 

I got an F in maths so yeahh-.- xD

(Facepalm)

Yeah I'm pretty sure it's the first equation.

Then 100 - that number/percentage

public static final int[] XP_TABLE = {0, 0, 83, 174, 276, 388, 512, 650,		801, 969, 1154, 1358, 1584, 1833, 2107, 2411, 2746, 3115, 3523,		3973, 4470, 5018, 5624, 6291, 7028, 7842, 8740, 9730, 10824, 12031,		13363, 14833, 16456, 18247, 20224, 22406, 24815, 27473, 30408,		33648, 37224, 41171, 45529, 50339, 55649, 61512, 67983, 75127,		83014, 91721, 101333, 111945, 123660, 136594, 150872, 166636,		184040, 203254, 224466, 247886, 273742, 302288, 333804, 368599,		407015, 449428, 496254, 547953, 605032, 668051, 737627, 814445,		899257, 992895, 1096278, 1210421, 1336443, 1475581, 1629200,		1798808, 1986068, 2192818, 2421087, 2673114, 2951373, 3258594,		3597792, 3972294, 4385776, 4842295, 5346332, 5902831, 6517253,		7195629, 7944614, 8771558, 9684577, 10692629, 11805606, 13034431,		14391160, 15889109, 17542976, 19368992, 21385073, 23611006,		26068632, 28782069, 31777943, 35085654, 38737661, 42769801,		47221641, 52136869, 57563718, 63555443, 70170840, 77474828,		85539082, 94442737, 104273167};		public int getPercentToNextLevel(Skill skill) {		final int lvl = client.getSkills().getLevel(skill);		if (lvl == 99) {			return 0;		}		final int xpTotal = Skills.XP_TABLE[lvl + 1] - Skills.XP_TABLE[lvl];		if (xpTotal == 0) {			return 0;		}		final int xpDone = client.getSkills().getExperience(skill) - Skills.XP_TABLE[lvl];		return 100 * xpDone / xpTotal;	}

 

 

  • Author
public static final int[] XP_TABLE = {0, 0, 83, 174, 276, 388, 512, 650,		801, 969, 1154, 1358, 1584, 1833, 2107, 2411, 2746, 3115, 3523,		3973, 4470, 5018, 5624, 6291, 7028, 7842, 8740, 9730, 10824, 12031,		13363, 14833, 16456, 18247, 20224, 22406, 24815, 27473, 30408,		33648, 37224, 41171, 45529, 50339, 55649, 61512, 67983, 75127,		83014, 91721, 101333, 111945, 123660, 136594, 150872, 166636,		184040, 203254, 224466, 247886, 273742, 302288, 333804, 368599,		407015, 449428, 496254, 547953, 605032, 668051, 737627, 814445,		899257, 992895, 1096278, 1210421, 1336443, 1475581, 1629200,		1798808, 1986068, 2192818, 2421087, 2673114, 2951373, 3258594,		3597792, 3972294, 4385776, 4842295, 5346332, 5902831, 6517253,		7195629, 7944614, 8771558, 9684577, 10692629, 11805606, 13034431,		14391160, 15889109, 17542976, 19368992, 21385073, 23611006,		26068632, 28782069, 31777943, 35085654, 38737661, 42769801,		47221641, 52136869, 57563718, 63555443, 70170840, 77474828,		85539082, 94442737, 104273167};		public int getPercentToNextLevel(Skill skill) {		final int lvl = client.getSkills().getLevel(skill);		if (lvl == 99) {			return 0;		}		final int xpTotal = Skills.XP_TABLE[lvl + 1] - Skills.XP_TABLE[lvl];		if (xpTotal == 0) {			return 0;		}		final int xpDone = client.getSkills().getExperience(skill) - Skills.XP_TABLE[lvl];		return 100 * xpDone / xpTotal
; }

If this works thank you:D!!

 

Rather use this method to work out the XP for each level:

 

​public int experienceForLevel(int level) {         double total = 0;        for (int i = 1; i < level; i++) {            total += Math.floor(i + 300 * Math.pow(2, i / 7.0));        }         return (int) Math.floor(total / 4);    }

 

And then to get percentage, just apply simple math rules... Not trying to be mean or anything, but an understanding of math is instrumental to coding, at least algebra. You should be able to easily work it out in your head.

 

  int currentAttLevel = client.getSkills().getCurrentLevel(Skill.ATTACK); int xpForCurrentAttLevel = experienceForLevel(currentAttLevel); int currentAttLevelXp = client.getSkills().getExperience(Skill.ATTACK);  int nextAttLevel = currentAttLevel + 1; int nextAttLevelXp = experienceForLevel(nextAttLevel); int percentToNextLevel(nextAttLevelXp - currentAttLevelXp)/(nextAttLevelXp - currentAttLevelXp)*100;

 

Obviously you can make this into a method like Wiz did.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.