Package rsb.methods
Class Magic
java.lang.Object
rsb.methods.MethodProvider
rsb.methods.Magic
Magic tab and spell related operations.
- Author:
- Gigiaj
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class rsb.methods.MethodProvider
methods -
Method Summary
Modifier and TypeMethodDescriptionbooleanautoCastSpell(int spell) Auto-casts a spell via the magic tab.booleancastSpell(int spell) Clicks a specified spell, opens magic tab if not open and uses interface of the spell to click it, so it works if the spells are layout in any sway.booleancastSpellOn(Object entity, int spell) Casts a spell on a Player/NPC/Object/Ground Item.Converts the spell list to variables to be used *Variable updating usage*Gets the current spell book.Gets the open magic book interface.intbooleanhoverSpell(int spell) Hovers a specified spell, opens magic tab if not open and uses interface of the spell to hover it, so it works if the spells are layout in any sway.booleanDetermines whether a spell is currently set to autocast.booleanChecks whether a spell is selected.
-
Method Details
-
isSpellSelected
public boolean isSpellSelected()Checks whether a spell is selected.- Returns:
trueif a spell is selected; otherwisefalse.
-
isAutoCasting
public boolean isAutoCasting()Determines whether a spell is currently set to autocast.- Returns:
trueif autocasting; otherwisefalse.
-
getSpell
-
castSpell
public boolean castSpell(int spell) Clicks a specified spell, opens magic tab if not open and uses interface of the spell to click it, so it works if the spells are layout in any sway.- Parameters:
spell- The spell to cast.- Returns:
trueif the spell was clicked; otherwisefalse.
-
hoverSpell
public boolean hoverSpell(int spell) Hovers a specified spell, opens magic tab if not open and uses interface of the spell to hover it, so it works if the spells are layout in any sway.- Parameters:
spell- The spell to hover.- Returns:
trueif the spell was clicked; otherwisefalse.
-
autoCastSpell
public boolean autoCastSpell(int spell) Auto-casts a spell via the magic tab.- Parameters:
spell- The spell to auto-cast.- Returns:
trueif the "Auto-cast" interface option was clicked; otherwisefalse.
-
getInterface
Gets the open magic book interface.- Returns:
- The current magic RSWidget.
-
getCurrentSpellBook
Gets the current spell book.- Returns:
- The Book enum of your current spell book.
-
castSpellOn
Casts a spell on a Player/NPC/Object/Ground Item.- Parameters:
entity- A Character or Animable.spell- The spell to cast.- Returns:
trueif casted; otherwisefalse.
-
convertSpellBookToVariables
Converts the spell list to variables to be used *Variable updating usage*- Returns:
- string containing the spells in variable form
-