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.

Character#getHitBarLoopCycle() && Client#getCurrentTick()

Featured Replies

1. OSBot Version (do NOT put "current version", be specific) 2.4.95

2. A description of the issue. Include relevant logs.

 

I'm not sure what is the difference between client tick and client loop cycle but if they were supposed to be the same, the following doesn't work properly since last loop cycle is always slightly higher than the client tick. If not, then we could use a Client#getCurrentLoopCycle() so that we can perform accurate combat time computations

 

cVwfZZY.png

 

U1WfbhP.png

log("Current: " + client.getCurrentTick() + "; Last: " + myPlayer().getHitBarLoopCycle());

OVVDEVW.gif

 

 

3. Are you receiving any errors in the client canvas or the logger? ^ 

4. How can you replicate the issue? ^

5. Has this issue persisted through multiple versions? If so, how far back? Idk

 

1. OSBot Version (do NOT put "current version", be specific) 2.4.95

2. A description of the issue. Include relevant logs.

 

I'm not sure what is the difference between client tick and client loop cycle but if they were supposed to be the same, the following doesn't work properly since last loop cycle is always slightly higher than the client tick. If not, then we could use a Client#getCurrentLoopCycle() so that we can perform accurate combat time computations

 

 

I believe that

getHitBarLoopCycle()

Returns the last hit tick + 300

 

300 Is most likely the number of ticks that the health bar is visible for, as the getHitBarLoopCycle() value is used to determine if the health bar is visible:

public boolean isHitBarVisible() {
    return this.getHitBarLoopCycle() > getClient().accessor.getCurrentTime();
}

So to get the last hit time just subtract 300

 

Or you could try using:

int[] splatTimes = myPlayer().accessor.getSplatTime();

Edited by Explv

  • Author

 

I believe that

getHitBarLoopCycle()

Returns the last hit tick + 300

 

300 Is most likely the number of ticks that the health bar is visible for, as the getHitBarLoopCycle() value is used to determine if the health bar is visible:

public boolean isHitBarVisible() {
    return this.getHitBarLoopCycle() > getClient().accessor.getCurrentTime();
}

So to get the last hit time just subtract 300

 

Or you could try using:

int[] splatTimes = myPlayer().accessor.getSplatTime();

Probably, but the point of the bug report was that the method does not work as specified in the API docs. I was hoping the developers  could shed some light on this as only they know exactly what's going on in there, and this may be used internally for other methods like isUnderAttack() or isAttackable() which may return wrong results aswell. Substracting 300 is not a valid solution because if the method indeed returns a wrong value, it will be fixed, breaking this "temporary" solution

Probably, but the point of the bug report was that the method does not work as specified in the API docs. I was hoping the developers  could shed some light on this as only they know exactly what's going on in there, and this may be used internally for other methods like isUnderAttack() or isAttackable() which may return wrong results aswell. Substracting 300 is not a valid solution because if the method indeed returns a wrong value, it will be fixed, breaking this "temporary" solution

 

I think that the method works as intended, perhaps the API doc could be worded a bit better, but yeah wait for a dev :P

Edited by Explv

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.