Class Vars


  • public class Vars
    extends java.lang.Object
    Provides safe access and modification for game variables (varps, varbits, varcs) and enums in the RuneLite client, using proper client thread execution.
    • Constructor Summary

      Constructors 
      Constructor Description
      Vars()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getBit​(int id)
      Gets the value of a varbit.
      net.runelite.api.EnumComposition getEnum​(int id)
      Retrieves the enum composition associated with a given ID.
      int getVarcInt​(int varClientInt)
      Gets the value of a client integer variable.
      java.lang.String getVarcStr​(int varClientStr)
      Gets the value of a client string variable.
      int getVarp​(int id)
      Gets the value of a varp (player variable).
      void setVarbit​(int id, int val)
      Sets the value of a varbit.
      void setVarcIntValue​(int id, int val)
      Sets the value of a client integer variable.
      void setVarcStrValue​(int[] arg, int arg1, int arg2)
      Sets a sequence of varbit values using an integer array and two bounds.
      void setVarcStrValue​(int id, java.lang.String val)
      Sets the value of a client string variable.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Vars

        public Vars()
    • Method Detail

      • getVarp

        public int getVarp​(int id)
        Gets the value of a varp (player variable).
        Parameters:
        id - The varp ID.
        Returns:
        The current value, or -1 on failure.
      • getBit

        public int getBit​(int id)
        Gets the value of a varbit.
        Parameters:
        id - The varbit ID.
        Returns:
        The current value, or -1 on failure.
      • getVarcInt

        public int getVarcInt​(int varClientInt)
        Gets the value of a client integer variable.
        Parameters:
        varClientInt - The varc int ID.
        Returns:
        The value, or -1 on failure.
      • getVarcStr

        public java.lang.String getVarcStr​(int varClientStr)
        Gets the value of a client string variable.
        Parameters:
        varClientStr - The varc string ID.
        Returns:
        The string value, or null on failure.
      • getEnum

        public net.runelite.api.EnumComposition getEnum​(int id)
        Retrieves the enum composition associated with a given ID.
        Parameters:
        id - The enum ID.
        Returns:
        The enum object, or null on failure.
      • setVarbit

        public void setVarbit​(int id,
                              int val)
        Sets the value of a varbit.
        Parameters:
        id - The varbit ID.
        val - The value to set.
      • setVarcIntValue

        public void setVarcIntValue​(int id,
                                    int val)
        Sets the value of a client integer variable.
        Parameters:
        id - The varc int ID.
        val - The value to set.
      • setVarcStrValue

        public void setVarcStrValue​(int id,
                                    java.lang.String val)
        Sets the value of a client string variable.
        Parameters:
        id - The varc string ID.
        val - The string value to set.
      • setVarcStrValue

        public void setVarcStrValue​(int[] arg,
                                    int arg1,
                                    int arg2)
        Sets a sequence of varbit values using an integer array and two bounds.
        Parameters:
        arg - The array of varbit values.
        arg1 - The starting index.
        arg2 - The ending index.