Class Combat


  • public class Combat
    extends java.lang.Object
    A class used to handle and retrieve data related to combat.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int getCombatLevel()
      Returns the current player's combat level
      static int getCombatModeIndex()
      Returns the current combat style's mode index (almost always 0-3 inclusive)
      static @Nullable CombatStyle getCombatStyle()
      Returns the current combat style
      static int getHealthPercent()
      Gets your players health percentage as an int (0 - 100), based skills.
      static int getSpecialModifier()
      Gets the actual value of the special attack bar
      static int getSpecialPercentage()
      Gets the percentage of special attack bar.
      static int getWildernessLevel()
      Gets the wilderness level that your player is in.
      static boolean hasPoisonImmunity()
      Checks whether your player is immune to poison.
      static boolean isAntiFireEnabled()
      Checks antifire potion protection is active
      static boolean isAutoRetaliateOn()
      Checks whether autoretaliate is on.
      static boolean isDiseased()
      Checks whether your player is diseased.
      static boolean isEnvenomed()
      Checks whether your player is envenomed.
      static boolean isInMultiCombat()
      Checks whether your player is in a multiway combat zone.
      static boolean isInWild()
      Checks whether your player is in the wilderness.
      static boolean isPoisoned()
      Checks whether your player is poisoned.
      static boolean isSpecialActive()
      Checks whether special attack is active.
      static boolean isSuperAntiFireEnabled()
      Checks if the super antifire potion protection is active
      static boolean openTab()
      Opens the Combat tab.
      static boolean setCombatModeIndex​(int index)
      Sets the current combat style by index (almost always 0-3 inclusive)
      static boolean setCombatStyle​(@NonNull CombatStyle combatStyle)
      Sets your active combat style
      static boolean toggleAutoRetaliate​(boolean enable)
      Toggles the autoretaliate option.
      static boolean toggleSpecialAttack​(boolean enable)
      Toggles the special attack option.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getCombatLevel

        public static int getCombatLevel()
        Returns the current player's combat level
        Returns:
        Combat level if logged in, -1 otherwise
      • isPoisoned

        public static boolean isPoisoned()
        Checks whether your player is poisoned.
        Returns:
        true if poisoned
      • isEnvenomed

        public static boolean isEnvenomed()
        Checks whether your player is envenomed.
        Returns:
        true if envenomed
      • hasPoisonImmunity

        public static boolean hasPoisonImmunity()
        Checks whether your player is immune to poison.
        Returns:
        true if immune
      • isDiseased

        public static boolean isDiseased()
        Checks whether your player is diseased.
        Returns:
        true if diseased
      • isAntiFireEnabled

        public static boolean isAntiFireEnabled()
        Checks antifire potion protection is active
        Returns:
        true if antifire potion active
      • isSuperAntiFireEnabled

        public static boolean isSuperAntiFireEnabled()
        Checks if the super antifire potion protection is active
        Returns:
        true if the super antifire potion active
      • isSpecialActive

        public static boolean isSpecialActive()
        Checks whether special attack is active.
        Returns:
        true if active
      • getSpecialPercentage

        public static int getSpecialPercentage()
        Gets the percentage of special attack bar.
        Returns:
        percentage of special attack bar
      • getSpecialModifier

        public static int getSpecialModifier()
        Gets the actual value of the special attack bar
        Returns:
        Value of special attack bar
      • isAutoRetaliateOn

        public static boolean isAutoRetaliateOn()
        Checks whether autoretaliate is on.
        Returns:
        true if autoretaliate is on
      • openTab

        public static boolean openTab()
        Opens the Combat tab.
        Returns:
        true if tab successfully opened
      • toggleAutoRetaliate

        public static boolean toggleAutoRetaliate​(boolean enable)
        Toggles the autoretaliate option. Will do nothing if already toggled to desired state.
        Parameters:
        enable - true to turn on autoretaliate, false to turn off
        Returns:
        true if toggled successfully (or already at desired state)
      • toggleSpecialAttack

        public static boolean toggleSpecialAttack​(boolean enable)
        Toggles the special attack option. Will do nothing if already toggled to desired state. Will use the orb if available, otherwise it'll fallback to the combat tab.
        Parameters:
        enable - true to turn on special attack, false to turn off
        Returns:
        true if toggled successfully (or already at desired state)
      • isInWild

        public static boolean isInWild()
        Checks whether your player is in the wilderness.
        Returns:
        true if in the wilderness
      • isInMultiCombat

        public static boolean isInMultiCombat()
        Checks whether your player is in a multiway combat zone.
        Returns:
        true if in multiway combat zone
      • getWildernessLevel

        public static int getWildernessLevel()
        Gets the wilderness level that your player is in.
        Returns:
        wilderness level, 0 if not in a wilderness
      • getHealthPercent

        public static int getHealthPercent()
        Gets your players health percentage as an int (0 - 100), based skills.
        Returns:
        the percent of health your players has as represented by your skills.
      • setCombatStyle

        public static boolean setCombatStyle​(@NonNull CombatStyle combatStyle)
        Sets your active combat style
        Parameters:
        combatStyle - the desired combat style
        Returns:
        true if changed successfully, false otherwise
      • getCombatStyle

        public static @Nullable CombatStyle getCombatStyle()
        Returns the current combat style
        Returns:
        Active combat style if logged in, null otherwise
      • getCombatModeIndex

        public static int getCombatModeIndex()
        Returns the current combat style's mode index (almost always 0-3 inclusive)
        Returns:
        the current combat style's mode index
      • setCombatModeIndex

        public static boolean setCombatModeIndex​(int index)
        Sets the current combat style by index (almost always 0-3 inclusive)
        Parameters:
        index - the combat mode's index
        Returns:
        true if successfully set, false otherwise