Record Class PlayerStat

java.lang.Object
java.lang.Record
com.botwithus.bot.api.model.PlayerStat
Record Components:
skillId - skill type id (StatType.id from the cache)
actualLevel - base/true level (e.g. 99); the "real" level
boostedLevel - current displayed level including buffs/drains
experience - total xp; fits in i32 (in-game cap is 200,000,000)

public record PlayerStat(int skillId, int actualLevel, int boostedLevel, int experience) extends Record
Snapshot of one of the local player's skill stats.

Distinct from the wire-level api.snapshot.Skill record: this is the script-facing model with a stable level() accessor (returns the unboosted base level — the value most level-gated content checks against).

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    PlayerStat(int skillId, int actualLevel, int boostedLevel, int experience)
    Creates an instance of a PlayerStat record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the actualLevel record component.
    int
    Returns the value of the boostedLevel record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the value of the experience record component.
    final int
    Returns a hash code value for this object.
    int
    The base (unboosted) level.
    int
    Returns the value of the skillId record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PlayerStat

      public PlayerStat(int skillId, int actualLevel, int boostedLevel, int experience)
      Creates an instance of a PlayerStat record class.
      Parameters:
      skillId - the value for the skillId record component
      actualLevel - the value for the actualLevel record component
      boostedLevel - the value for the boostedLevel record component
      experience - the value for the experience record component
  • Method Details

    • level

      public int level()
      The base (unboosted) level. Equivalent to actualLevel(); named level for ergonomics in level-gated scripts where "do I have level N" is the common question.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • skillId

      public int skillId()
      Returns the value of the skillId record component.
      Returns:
      the value of the skillId record component
    • actualLevel

      public int actualLevel()
      Returns the value of the actualLevel record component.
      Returns:
      the value of the actualLevel record component
    • boostedLevel

      public int boostedLevel()
      Returns the value of the boostedLevel record component.
      Returns:
      the value of the boostedLevel record component
    • experience

      public int experience()
      Returns the value of the experience record component.
      Returns:
      the value of the experience record component