Package org.dreambot.api.methods.combat
Class Combat
- java.lang.Object
-
- org.dreambot.api.methods.combat.Combat
-
public class Combat extends java.lang.ObjectA class used to handle and retrieve data related to combat.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static intgetCombatLevel()Returns the current player's combat levelstatic intgetCombatModeIndex()Returns the current combat style's mode index Index 4 is Magic autocasting Index 5 is Defensive Magic autocastingstatic @Nullable CombatStylegetCombatStyle()Returns the current combat stylestatic intgetHealthPercent()Gets your players health percentage as an int (0 - 100), based skills.static intgetSpecialModifier()Gets the actual value of the special attack barstatic intgetSpecialPercentage()Gets the percentage of special attack bar.static intgetWildernessLevel()Gets the wilderness level that your player is in.static booleanhasPoisonImmunity()Checks whether your player is immune to poison.static booleanisAntiFireEnabled()Checks antifire potion protection is activestatic booleanisAutoRetaliateOn()Checks whether autoretaliate is on.static booleanisDiseased()Checks whether your player is diseased.static booleanisEnvenomed()Checks whether your player is envenomed.static booleanisExtAntiFireEnabled()Deprecated.seeisAntiFireEnabled()for the normal antifire orisSuperAntiFireEnabled()for the super antifirestatic booleanisInMultiCombat()Checks whether your player is in a multiway combat zone.static booleanisInWild()Checks whether your player is in the wilderness.static booleanisPoisoned()Checks whether your player is poisoned.static booleanisSpecialActive()Checks whether special attack is active.static booleanisSuperAntiFireEnabled()Checks if the super antifire potion protection is activestatic booleanopenTab()Opens the Combat tab.static booleansetCombatModeIndex(int index)Sets the current combat style by index (almost always 0-3 inclusive)static booleansetCombatStyle(@NonNull CombatStyle combatStyle)Sets your active combat stylestatic booleantoggleAutoRetaliate(boolean enable)Toggles the autoretaliate option.static booleantoggleSpecialAttack(boolean enable)Toggles the special attack option.
-
-
-
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
-
isExtAntiFireEnabled
@Deprecated public static boolean isExtAntiFireEnabled()
Deprecated.seeisAntiFireEnabled()for the normal antifire orisSuperAntiFireEnabled()for the super antifireChecks if the super antifire potion protection is active- Returns:
- true if the super 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 Index 4 is Magic autocasting Index 5 is Defensive Magic autocasting- 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
-
-