Skip 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's Health? Bugged?

Featured Replies

Hey all, again I come with a question that needs answering.

 

So for some odd reason, the script I am developing is having some issues eating.

 

At first I thought the problem lied within the id but that wasn't the case, nor was it the case with the functions I have created and how they are formatted inside my code.

 

I have found the source of the problem and was wondering if anyone could tell me on whats happening or how I could fix it.

 

if(myPlayer().getHealth() < randomHealth) {
	this.log("Trying to eat");
	Item food = inventory.getItem(Library.foodId);
	food.interact("Eat");
			
}

The integer randomHealth is capped at 30 for the testing and it still doesn't work, thoughts anyone? It's been returning 39 hp when I'm actually at 36.

 

Thanks!

 

health returns a % and only when in combat.

best to compare static/dynamic level of hitpoints

  • Author

health returns a % and only when in combat.

best to compare static/dynamic level of hitpoints

 

Why does it only work in combat?

Why does it only work in combat?

Really unsure sorry :s 

int currentHealth(){
         int percperone = (100 / skills.getStatic(Skill.HITPOINTS));
         return (percperone * skills.getDynamic(Skill.HITPOINTS));
     }

I think would do it 

or just

int currentHealth(){
         return ((100 / skills.getStatic(Skill.HITPOINTS)) * skills.getDynamic(Skill.HITPOINTS));
     }

Edited by Isolate

Why does it only work in combat?

 

Due to this being pulled from the health bar above your head.

  • Author

 

Really unsure sorry :s 

int currentHealth(){
         int percperone = (100 / skills.getStatic(Skill.HITPOINTS));
         return (percperone * skills.getDynamic(Skill.HITPOINTS));
     }

I think would do it 

or just

int currentHealth(){
         return ((100 / skills.getStatic(Skill.HITPOINTS)) * skills.getDynamic(Skill.HITPOINTS));
     }

Thanks a lot bro

 

Due to this being pulled from the health bar above your head.

 

That makes sense, thanks a lot too.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.