Package org.dreambot.api.methods.magic
Class Magic
- java.lang.Object
- 
- org.dreambot.api.methods.magic.Magic
 
- 
 public class Magic extends java.lang.ObjectCreated by Pandemic
- 
- 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancanCast(@NonNull Spell spell)Checks if you can cast the given spell.static booleancanCast(@NonNull Spell spell, boolean useBank)Checks if you can cast the given spell Does account for any staffs equipped.static booleancastSpell(@NonNull Spell spell)Casts a spellstatic booleancastSpell(@NonNull Spell spell, @Nullable java.lang.String action)Casts a spell with the given actionstatic booleancastSpellOn(@NonNull Spell spell, @NonNull Entity entity)Casts a spell on an entitystatic booleancastSpellOn(@NonNull Spell spell, @NonNull Item item)Casts a spell on an item in inventorystatic booleandeselect()Deselects the current spell if one is selectedstatic @Nullable SpellgetAutocastSpell()Gets the active spell that is selected via autocaststatic @Nullable java.lang.StringgetSelectedSpellName()Gets the currently selected spell namestatic @Nullable SpellbookgetSpellbook()Returns the current spellbookstatic booleaninteract(@NonNull Spell spell, @Nullable java.lang.String action)Interacts with the spell with the given actionstatic booleanisAutocastDefensive()static booleanisAutocasting()static booleanisSpellFilteringEnabled()This is used to check if spell filtering is enabled.static booleanisSpellSelected()Checks if a spell is currently selectedstatic booleansetAutocastSpell(@NonNull Spell spell)static booleansetDefensiveAutocastSpell(@NonNull Spell spell)static booleansetSpellFilteringEnabled(boolean enabled)Either enables or disables the spell filtering options in the Magic tab
 
- 
- 
- 
Method Detail- 
interactpublic static boolean interact(@NonNull Spell spell, @Nullable java.lang.String action) Interacts with the spell with the given action- Parameters:
- spell- spell to be cast
- action- the action to perform on the spell widget
- Returns:
- true if successfully interacted with the spell
 
 - 
castSpellpublic static boolean castSpell(@NonNull Spell spell) Casts a spell- Parameters:
- spell- spell to be cast
- Returns:
- true if successfully clicked on spell
 
 - 
castSpellpublic static boolean castSpell(@NonNull Spell spell, @Nullable java.lang.String action) Casts a spell with the given action- Parameters:
- spell- spell to be cast
- Returns:
- true if successfully casted the spell with the action
 
 - 
castSpellOnpublic static boolean castSpellOn(@NonNull Spell spell, @NonNull Entity entity) Casts a spell on an entity- Parameters:
- spell- spell to be cast
- entity- entity to cast spell on
- Returns:
- true if successfully cast spell on entity
 
 - 
castSpellOnpublic static boolean castSpellOn(@NonNull Spell spell, @NonNull Item item) Casts a spell on an item in inventory- Parameters:
- spell- spell to be cast
- item- item to cast spell on
- Returns:
- true if successfully cast spell on item
 
 - 
isSpellSelectedpublic static boolean isSpellSelected() Checks if a spell is currently selected- Returns:
- True if a spell is selected, false if not
 
 - 
getSelectedSpellNamepublic static @Nullable java.lang.String getSelectedSpellName() Gets the currently selected spell name- Returns:
- Spell name if spell selected, otherwise null
 
 - 
canCastpublic static boolean canCast(@NonNull Spell spell) Checks if you can cast the given spell. Does account for any staffs equipped. UsesWebFinder.getCurrentPathQuery()to determine if bank should be included- Parameters:
- spell- The spell to check
- Returns:
- true if you have the level requirement and costs to cast the spell, otherwise false
 
 - 
canCastpublic static boolean canCast(@NonNull Spell spell, boolean useBank) Checks if you can cast the given spell Does account for any staffs equipped.- Parameters:
- spell- The spell to check
- useBank- whether it should include runes in your bank or not
- Returns:
- False if wearing greegree, True if you have level requirement, costs, and necessary equipment to cast the spell, otherwise false
 
 - 
deselectpublic static boolean deselect() Deselects the current spell if one is selected- Returns:
- true if successfully deselected spell or if no spell was selected to being with
 
 - 
getAutocastSpellpublic static @Nullable Spell getAutocastSpell() Gets the active spell that is selected via autocast- Returns:
- Spell if one is selected, null otherwise
 
 - 
isAutocastingpublic static boolean isAutocasting() 
 - 
isAutocastDefensivepublic static boolean isAutocastDefensive() 
 - 
setDefensiveAutocastSpellpublic static boolean setDefensiveAutocastSpell(@NonNull Spell spell) 
 - 
setAutocastSpellpublic static boolean setAutocastSpell(@NonNull Spell spell) 
 - 
isSpellFilteringEnabledpublic static boolean isSpellFilteringEnabled() This is used to check if spell filtering is enabled. If spell filtering is enabled, it does not necessarily mean something is currently being filtered, just that the ability to do so will be available via the "Filter" button in the Magic tab.- Returns:
- true if spell filtering is enabled, false otherwise
 
 - 
setSpellFilteringEnabledpublic static boolean setSpellFilteringEnabled(boolean enabled) Either enables or disables the spell filtering options in the Magic tab- Parameters:
- enabled- if spell filtering should be enabled
- Returns:
- true if it's already correctly set or if it's successfully changed
 
 - 
getSpellbookpublic static @Nullable Spellbook getSpellbook() Returns the current spellbook- Returns:
- the current spellbook, or null if not logged in
 
 
- 
 
-