Varbits

Intermediate

net.runelite.api

Constants for accessing game state variables (varbits). Used for special attack energy, run energy, combat style, and many other game values.

Category
Game State
Methods
0
Properties
3

Properties (3)

SPECIAL_ATTACK_PERCENT

int

Varbit ID for special attack energy percentage (0-100)

java
1int specEnergy = client.getVar(Varbits.SPECIAL_ATTACK_PERCENT);
2System.out.println("Special attack: " + specEnergy + "%");

RUN_SLOWED_DEPLETION_ACTIVE

int

Varbit ID for whether run energy depletion is slowed

java
1boolean runSlowed = client.getVar(Varbits.RUN_SLOWED_DEPLETION_ACTIVE) == 1;

COMBAT_STYLE

int

Varbit ID for current combat style (0=Aggressive, 1=Accurate, 2=Defensive, 3=Controlled)

java
1int style = client.getVar(Varbits.COMBAT_STYLE);
2String styleName = style == 0 ? "Aggressive" : 
3                  style == 1 ? "Accurate" : 
4                  style == 2 ? "Defensive" : "Controlled";

Related Classes

Plugins Using This Class