Package rs.kreme.ksbot.api.game
Class Vars
- java.lang.Object
-
- rs.kreme.ksbot.api.game.Vars
-
public class Vars extends java.lang.ObjectProvides 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 intgetBit(int id)Gets the value of a varbit.net.runelite.api.EnumCompositiongetEnum(int id)Retrieves the enum composition associated with a given ID.intgetVarcInt(int varClientInt)Gets the value of a client integer variable.java.lang.StringgetVarcStr(int varClientStr)Gets the value of a client string variable.intgetVarp(int id)Gets the value of a varp (player variable).voidsetVarbit(int id, int val)Sets the value of a varbit.voidsetVarcIntValue(int id, int val)Sets the value of a client integer variable.voidsetVarcStrValue(int[] arg, int arg1, int arg2)Sets a sequence of varbit values using an integer array and two bounds.voidsetVarcStrValue(int id, java.lang.String val)Sets the value of a client string variable.
-
-
-
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.
-
-