OSRS Plugin API
    Preparing search index...

    Function getStatRemainingXPUntilLevel

    • Returns the amount of xp required for the specified stat to reach the specified level or, if level argument not provided, the next level. If stats were not transmitted yet, returns -1. If the specified level is below the current level or above level 99 or if the current level is 99, returns 0.

      Parameters

      • statId: number

        Id of the stat to query.

      • Optionallevel: number

        Level to calculate required xp to reach.

      Returns number

      Amount of xp required to reach the specified level, or next if no level was specified.

      osrs.printf("Remaining XP until level %d: %d", osrs.ClientState.getStatBaseLevel(2) + 1, osrs.ClientState.getStatRemainingXPUntilLevel(2))