Class Vars

java.lang.Object
net.storm.sdk.game.Vars

public class Vars extends Object
Provides static utility methods for accessing game variables (varps, varbits, and varcs). Game variables store various state information about the player, quests, settings, and game mechanics.

Variable types:

  • Varps (Variable Parameters) - Server-side variables that persist across sessions
  • Varbits - Bit-packed values within varps, allowing multiple values in a single varp
  • VarcInt - Client-side integer variables
  • VarcStr - Client-side string variables

Example usage:


 // Read a varbit value (e.g., quest state)
 int questState = Vars.getBit(QUEST_VARBIT_ID);

 // Read a varp value directly
 int varpValue = Vars.getVarp(VARP_ID);

 // Read client variables
 int clientInt = Vars.getVarcInt(VARC_INT_ID);
 String clientStr = Vars.getVarcStr(VARC_STR_ID);

 // Set a varbit value (use with caution)
 Vars.setBit(VARBIT_ID, newValue);
 
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    getBit(int id)
    Gets the value of a varbit.
    static int
    getVarcInt(int varClientInt)
    Gets the value of a client integer variable.
    static String
    getVarcStr(int varClientStr)
    Gets the value of a client string variable.
    static int
    getVarp(int id)
    Gets the value of a varp (variable parameter).
    static void
    setBit(int id, int value)
    Sets the value of a varbit.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Vars

      public Vars()
  • Method Details

    • getBit

      public static int getBit(int id)
      Gets the value of a varbit. Varbits are bit-packed values within varps that store specific game state information.
      Parameters:
      id - the varbit ID
      Returns:
      the varbit value
    • setBit

      public static void setBit(int id, int value)
      Sets the value of a varbit. Use with caution as modifying varbits can affect game state.
      Parameters:
      id - the varbit ID
      value - the value to set
    • getVarp

      public static int getVarp(int id)
      Gets the value of a varp (variable parameter). Varps are server-side variables that store game state.
      Parameters:
      id - the varp ID
      Returns:
      the varp value
    • getVarcInt

      public static int getVarcInt(int varClientInt)
      Gets the value of a client integer variable. VarcInts are client-side variables that do not persist on the server.
      Parameters:
      varClientInt - the variable ID
      Returns:
      the integer value
    • getVarcStr

      public static String getVarcStr(int varClientStr)
      Gets the value of a client string variable. VarcStrs are client-side string variables.
      Parameters:
      varClientStr - the variable ID
      Returns:
      the string value, or null if not set