Package rsb.methods

Class Combat


public class Combat extends MethodProvider
Combat related operations.
  • Constructor Details

  • Method Details

    • Eat

      @Deprecated public boolean Eat(int percent, int... foods)
      Deprecated.
      Eats at the desired HP %.
      Parameters:
      percent - The health percentage to eat at; 10%-90%
      foods - Array of Foods we can eat.
      Returns:
      true once we eaten to the health % (percent); otherwise false.
    • eat

      public boolean eat(int percent, int... foods)
      Eats at the desired HP %.
      Parameters:
      percent - The health percentage to eat at; 10%-90%
      foods - Array of Foods we can eat.
      Returns:
      true once we eaten to the health % (percent); otherwise false.
    • setAutoRetaliate

      public void setAutoRetaliate(boolean enable)
      Turns auto-retaliate on or off in the combat tab.
      Parameters:
      enable - true to enable; false to disable.
    • isAutoRetaliateEnabled

      public boolean isAutoRetaliateEnabled()
      Returns whether the auto-retaliate option is enabled.
      Returns:
      true if retaliate is enabled; otherwise false.
    • getFightMode

      public int getFightMode()
      Gets the attack mode.
      Returns:
      The current fight mode setting.
    • setFightMode

      public boolean setFightMode(int fightMode)
      Sets the attack mode.
      Parameters:
      fightMode - The fight mode to set it to. From 0-3 corresponding to the 4 attacking modes; Else if there is only 3 attacking modes then, from 0-2 corresponding to the 3 attacking modes
      Returns:
      true if the interface was clicked; otherwise false.
      See Also:
    • getWildernessLevel

      public int getWildernessLevel()
      Gets the current Wilderness Level.
      Returns:
      The current wilderness level otherwise, 0.
    • getLifePoints

      public int getLifePoints()
      Gets the current player's life points.
      Returns:
      The current life points if the interface is valid; otherwise 0.
    • isPoisoned

      public boolean isPoisoned()
      Returns whether we're poisoned.
      Returns:
      true if poisoned; otherwise false.
    • isEnvenomed

      public boolean isEnvenomed()
      Returns whether we're envenomed
      Returns:
      true if the local player is envenomed; otherwise false
    • getVenomDamage

      public int getVenomDamage()
      Returns the damage we're taking from venom
      Returns:
      the venom damage if envenomed; otherwise 0;
    • isSpecialEnabled

      public boolean isSpecialEnabled()
      Returns whether the special-attack option is enabled.
      Returns:
      true if special is enabled; otherwise false.
    • getSpecialBarEnergy

      public int getSpecialBarEnergy()
      Gets the special bar energy amount.
      Returns:
      The current spec energy.
    • getPrayerPoints

      public int getPrayerPoints()
      Gets the current player's prayer points.
      Returns:
      The current prayer points if the interface is valid; otherwise 0.
    • getHealth

      public int getHealth()
      Gets the current player's health as a percentage of full health.
      Returns:
      The current percentage health remaining.
    • isAttacking

      public boolean isAttacking(RSNPC npc)
      Checks if your character is interacting with an Npc.
      Parameters:
      npc - The Npc we want to fight.
      Returns:
      true if interacting; otherwise false.
    • isDead

      public boolean isDead(RSNPC npc)
      Checks whether the desired Npc is dead.
      Parameters:
      npc - The RSNPC to check.
      Returns:
      true if the Npc is dead or dying; otherwise false.