Class ActionBar

java.lang.Object
net.botwithus.rs3.game.actionbar.ActionBar

public final class ActionBar extends Object
  • Method Details

    • getItemIn

      public static Item getItemIn(int bar, int slot)
      Gets the item in an ability bar slot
      Parameters:
      bar - The bar number to retrieve, 1-18
      slot - The slot in the bar, 1-14
      Returns:
      Returns the Item, or null if there isnt one in this slot.
    • getAbilityIn

      public static StructType getAbilityIn(int bar, int slot)
      Returns the struct for the ability in the requested slot.
      Parameters:
      bar - Bar number, 1-18
      slot - Slot on bar, 1-14
      Returns:
      StructType with info about the ability in that slot.
    • getCooldown

      public static int getCooldown(String abilityName)
      Gets the cooldown of an ability. Do not run this function frequently or you may experience slowness.
      Parameters:
      abilityName - The name of the ability, case insensitive.
      Returns:
      Returns cooldown in seconds if ability is on cooldown. If zero, no cooldown. If -1 ability not found.
    • getCooldownPrecise

      public static long getCooldownPrecise(String abilityName)
      Gets the cooldown of an ability. Do not run this function frequently or you may experience slowness.
      Parameters:
      abilityName - The name of the ability, case insensitive.
      Returns:
      Returns cooldown in milliseconds if ability is on cooldown. If zero, no cooldown. If -1 ability not found.
    • useItem

      public static boolean useItem(String itemName, String option)
      Uses an item by its name
      Parameters:
      itemName - The name of the item, case sensitive.
      option - The string option to interact with, case sensitive.
      Returns:
      True if successful interact, false if not.
    • containsItem

      public static boolean containsItem(Pattern... patterns)
      Checks if an item is available for use in the action bar.
      Parameters:
      patterns - Var args of patterns to look for
      Returns:
      True if found, false if not.
    • containsItem

      public static boolean containsItem(String itemName)
      Checks if an item is avialable for use in the action bar.
      Parameters:
      itemName - The name of the item, case-sensitive.
      Returns:
      True if found, false if not.
    • useItem

      public static boolean useItem(String itemName, int option)
      Uses an item by its name
      Parameters:
      itemName - The name of the item, case-sensitive.
      option - The integer option (2nd argument of minimenu overlay) to interact with, case sensitive.
      Returns:
      True if successful interact, false if not.
    • usePrayer

      public static boolean usePrayer(String prayerName)
      Fires the prayer name provided.
      Parameters:
      prayerName - name of the teleport, case insensitive.
      Returns:
      True if interacted, false if not.
    • useTeleport

      public static boolean useTeleport(String teleportName)
      Fires the teleport name provided.
      Parameters:
      teleportName - name of the teleport, case insensitive.
      Returns:
      True if interacted, false if not.
    • useAbility

      public static boolean useAbility(String abilityName)
      Fire an ability by name.
      Parameters:
      abilityName - The name of the ability, case insensitive.
      Returns:
      True if interacted, False if not.
    • getActionName

      public static String getActionName(Map<Integer,Serializable> params)
      Gets the name of an action
      Parameters:
      params - Params from an action StructType
      Returns:
      Returns the name of an action or "Not found"
    • getActionDescription

      public static String getActionDescription(Map<Integer,Serializable> params)
      Retrieves the description text of an action struct.
      Parameters:
      params - Params from an action StructType
      Returns:
      returns the description of the action or "Not found"
    • getActionLevelRequirement

      public static int getActionLevelRequirement(Map<Integer,Serializable> params)
      Gets the level required for an action
      Parameters:
      params - Params from an action StructType
      Returns:
      Returns an integer, the skill level required, or 0 if not found.
    • getActionSprite

      public static int getActionSprite(Map<Integer,Serializable> params)
      Gets the actions's spriteId
      Parameters:
      params - Params from an ab ility StructType
      Returns:
      Returns an integer, representing the spriteId of the object.
    • containsAbility

      public static boolean containsAbility(String abilityName)
      Checks whether an ability is on one of the 5 action bars designated for use.
      Parameters:
      abilityName - The name of the ability
      Returns:
      True if the ability is contained on bars for use, False if not.
    • containsAbility

      public static boolean containsAbility(Pattern abilityPattern)
      Checks whether an ability is on one of the 5 action bars designated for use.
      Parameters:
      abilityPattern -
      Returns:
    • getActionStruct

      public static StructType getActionStruct(String abilityName)
      Gets an action structure matching the name provided.
      Parameters:
      abilityName - The case insensitive name of th e ability to get information on.
      Returns:
      returns a StructType object with params about the ability, or null if the name doesnt match any ability struct in the game.
    • getActionStructByPattern

      public static StructType getActionStructByPattern(Pattern abilityNamePattern)
      Gets an action structure matching the pattern provided. The pattern is matched against the structure name.
      Parameters:
      abilityNamePattern - The case insensitive name of th e action to get information on.
      Returns:
      returns a StructType object with params about the action, or null if the name doesnt match any ability struct in the game.
    • getActionType

      public static int getActionType(int bar, int slot)
      Gets the action bar slot type integer which represents the kind of item in the slot. Ability, teleport, etc.
      Parameters:
      bar - The bar number, 1-18
      slot - The slot, 1-14
      Returns:
      returns the typeId of a bar slot, or -1 if not found.
    • getActionIndex

      public static int getActionIndex(int bar, int slot)
      Returns the index within combat enums that contains the struct for the ability in a given bar slot.
      Parameters:
      bar - The bar number, 1-18
      slot - The bar slot, 1-14
      Returns:
      Returns the index that the ability is located within the enum containing its combat style's abilities.