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.

How to track XP drops?

Featured Replies

Hi, my Scripts needs exact time of xp drops, there's no such event handler for this (I couldn't find myself from the javadocs)?

Maybe you can store current xp in a global variable, and then check if your variable is different from current xp

public class MyAwesomeBot extends Script {

    private int currentExp;
    
    @Override
    public void onStart() {
        currentExp = getExperienceTracker().getGainedXP(Skill.STRENGTH);
    }

    @Override
    public int onLoop() {
        if(currentExp != getExperienceTracker().getGainedXP(Skill.STRENGTH)){
            log("Exp changed!");
            currentExp = getExperienceTracker().getGainedXP(Skill.STRENGTH);
        }
        return 500;
    }
}

 

Edited by Heiz
identation

  • Author

@HeizThanks, but I'm making a pking script, so I need exact time of the XP drop not the one that is based on the onLoop callback...

3 hours ago, maximiliano1 said:

@HeizThanks, but I'm making a pking script, so I need exact time of the XP drop not the one that is based on the onLoop callback...

Game ticks occur every ~600 ms

  • Author
37 minutes ago, ProjectPact said:

Game ticks occur every ~600 ms

So you're saying that the tick == update of the game and consequently the xp updates happen on tick updates? Didn't know that :D

  • Author
On 9/21/2021 at 9:45 PM, ProjectPact said:

Game ticks occur every ~600 ms

I've tested as you advised by computing the xp change directly through the onGameTick and then computing via ExperienceTracker, but still after capturing the video and checking the timings, it seems that ExperienceTracker lags behind couple ticks compared to the actual xp change.

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.