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.

Player health getters returning weird values

Featured Replies

For some odd reason, no matter the method of trying to return the player's current health (percent or current). a weird value is returned. I'm accessing the getter through a private API instance, so it's being called as follows:

api.myPlayer().getHealthPrecent();

OR

api.myPlayer().getHealth();

OR

api.myPlayer().getCurrentHealth();

All of these return odd values. As an example, the account I've been testing scripts with has 13 HP, but getCurrentHealth() returns a different value than that.

 

Any ideas on what could be causing this?

Edited by Bitshift

well, why not just use getSkills().getDynamic(Skill.HITPOINTS); ? :xdoge:

  • Author

well, why not just use getSkills().getDynamic(Skill.HITPOINTS); ? 78ZISi3.png

I suppose that will suffice for now. I would still like to know if this is a fault on my end or some hooks are not working properly at the moment.

I suppose that will suffice for now. I would still like to know if this is a fault on my end or some hooks are not working properly at the moment.

Well you didn't tell us what values it was returning tho, which makes it harder to know whats up with it.

Health returns odd values if the HP bar is not rendered, so I assume you were not in combat?

For some odd reason, no matter the method of trying to return the player's current health (percent or current). a weird value is returned. I'm accessing the getter through a private API instance, so it's being called as follows:

api.myPlayer().getHealthPrecent();

OR

api.myPlayer().getHealth();

OR

api.myPlayer().getCurrentHealth();

All of these return odd values. As an example, the account I've been testing scripts with has 13 HP, but getCurrentHealth() returns a different value than that.

 

Any ideas on what could be causing this?

 

those methods all fall back to the health bar your character displays on top of its head when in combat. SO for example if you are fighting and you can see it. You will get the right values. If the hp bar goes way and you eat food. It will still have the old value instead of the new updated values. When the hp bar Is visible again the value gets updates.

 

Edited by Joseph

Create an account or sign in to comment

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.