Record Class GameAction

java.lang.Object
java.lang.Record
com.botwithus.bot.api.model.GameAction
Record Components:
actionId - the action type ID (see ActionTypes)
param1 - first action parameter (often the option / op index)
param2 - second action parameter (for a COMPONENT action, the slot / sub-component id, or -1 when there is none)
param3 - third action parameter (for a COMPONENT action, the packed (iface<<16)|comp component hash)

public record GameAction(int actionId, int param1, int param2, int param3) extends Record
A game action to be queued for execution via the pipe RPC.

Actions represent interactions such as clicking entities, using items, or interacting with interface components. The meaning of the parameters depends on the actionId.

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    GameAction(int actionId, int param1, int param2, int param3)
    Creates an instance of a GameAction record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the actionId record component.
    static GameAction
    componentTrigger(int interfaceId, int componentId, int subId, int triggerType, int arg)
    A ActionTypes.COMPONENT_TRIGGER action: fire the CS2 event trigger of type triggerType on a component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the param1 record component.
    int
    Returns the value of the param2 record component.
    int
    Returns the value of the param3 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

    • GameAction

      public GameAction(int actionId, int param1, int param2, int param3)
      Creates an instance of a GameAction record class.
      Parameters:
      actionId - the value for the actionId record component
      param1 - the value for the param1 record component
      param2 - the value for the param2 record component
      param3 - the value for the param3 record component
  • Method Details

    • componentTrigger

      public static GameAction componentTrigger(int interfaceId, int componentId, int subId, int triggerType, int arg)
      A ActionTypes.COMPONENT_TRIGGER action: fire the CS2 event trigger of type triggerType on a component. The packing is the agent's: param1 = (interfaceId << 16) | componentId, param2 = (triggerType << 16) | (subId & 0xFFFF), param3 = arg.
      Parameters:
      subId - sub-component id, or -1 for the component itself
      arg - type-dependent argument; for a key trigger the packed KeyStroke.packed()
    • 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.
    • actionId

      public int actionId()
      Returns the value of the actionId record component.
      Returns:
      the value of the actionId record component
    • param1

      public int param1()
      Returns the value of the param1 record component.
      Returns:
      the value of the param1 record component
    • param2

      public int param2()
      Returns the value of the param2 record component.
      Returns:
      the value of the param2 record component
    • param3

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