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 TypeMethodDescriptionboolean
autoCastSpell
(int spell) Auto-casts a spell via the magic tab.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.boolean
castSpellOn
(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.int
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.boolean
Determines whether a spell is currently set to autocast.boolean
Checks whether a spell is selected.
-
Method Details
-
isSpellSelected
public boolean isSpellSelected()Checks whether a spell is selected.- Returns:
true
if a spell is selected; otherwisefalse
.
-
isAutoCasting
public boolean isAutoCasting()Determines whether a spell is currently set to autocast.- Returns:
true
if 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:
true
if 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:
true
if 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:
true
if 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:
true
if casted; otherwisefalse
.
-
convertSpellBookToVariables
Converts the spell list to variables to be used *Variable updating usage*- Returns:
- string containing the spells in variable form
-