java.lang.Object
net.botwithus.rs3.game.actionbar.ActionBar
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontainsAbility(String abilityName) Checks whether an ability is on one of the 5 action bars designated for use.static booleancontainsAbility(Pattern abilityPattern) Checks whether an ability is on one of the 5 action bars designated for use.static booleancontainsItem(String itemName) Checks if an item is avialable for use in the action bar.static booleancontainsItem(Pattern... patterns) Checks if an item is available for use in the action bar.static StructTypegetAbilityIn(int bar, int slot) Returns the struct for the ability in the requested slot.static StringgetActionDescription(Map<Integer, Serializable> params) Retrieves the description text of an action struct.static intgetActionIndex(int bar, int slot) Returns the index within combat enums that contains the struct for the ability in a given bar slot.static intgetActionLevelRequirement(Map<Integer, Serializable> params) Gets the level required for an actionstatic StringgetActionName(Map<Integer, Serializable> params) Gets the name of an actionstatic intgetActionSprite(Map<Integer, Serializable> params) Gets the actions's spriteIdstatic StructTypegetActionStruct(String abilityName) Gets an action structure matching the name provided.static StructTypegetActionStructByPattern(Pattern abilityNamePattern) Gets an action structure matching the pattern provided.static intgetActionType(int bar, int slot) Gets the action bar slot type integer which represents the kind of item in the slot.static intgetCooldown(String abilityName) Gets the cooldown of an ability.static longgetCooldownPrecise(String abilityName) Gets the cooldown of an ability.static ItemgetItemIn(int bar, int slot) Gets the item in an ability bar slotstatic booleanuseAbility(String abilityName) Fire an ability by name.static booleanUses an item by its namestatic booleanUses an item by its namestatic booleanFires the prayer name provided.static booleanuseTeleport(String teleportName) Fires the teleport name provided.
-
Method Details
-
getItemIn
Gets the item in an ability bar slot- Parameters:
bar- The bar number to retrieve, 1-18slot- The slot in the bar, 1-14- Returns:
- Returns the Item, or null if there isnt one in this slot.
-
getAbilityIn
Returns the struct for the ability in the requested slot.- Parameters:
bar- Bar number, 1-18slot- Slot on bar, 1-14- Returns:
- StructType with info about the ability in that slot.
-
getCooldown
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
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
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
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
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
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
Fires the prayer name provided.- Parameters:
prayerName- name of the teleport, case insensitive.- Returns:
- True if interacted, false if not.
-
useTeleport
Fires the teleport name provided.- Parameters:
teleportName- name of the teleport, case insensitive.- Returns:
- True if interacted, false if not.
-
useAbility
Fire an ability by name.- Parameters:
abilityName- The name of the ability, case insensitive.- Returns:
- True if interacted, False if not.
-
getActionName
Gets the name of an action- Parameters:
params- Params from an action StructType- Returns:
- Returns the name of an action or "Not found"
-
getActionDescription
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
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
Gets the actions's spriteId- Parameters:
params- Params from an ab ility StructType- Returns:
- Returns an integer, representing the spriteId of the object.
-
containsAbility
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
Checks whether an ability is on one of the 5 action bars designated for use.- Parameters:
abilityPattern-- Returns:
-
getActionStruct
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
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-18slot- 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-18slot- The bar slot, 1-14- Returns:
- Returns the index that the ability is located within the enum containing its combat style's abilities.
-