Package rsb.methods

Class Magic


public class Magic extends MethodProvider
Magic tab and spell related operations.
Author:
Gigiaj
  • Method Details

    • isSpellSelected

      public boolean isSpellSelected()
      Checks whether a spell is selected.
      Returns:
      true if a spell is selected; otherwise false.
    • isAutoCasting

      public boolean isAutoCasting()
      Determines whether a spell is currently set to autocast.
      Returns:
      true if autocasting; otherwise false.
    • getSpell

      public int getSpell(String name)
    • 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; otherwise false.
    • 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; otherwise false.
    • 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; otherwise false.
    • getInterface

      public RSWidget getInterface()
      Gets the open magic book interface.
      Returns:
      The current magic RSWidget.
    • getCurrentSpellBook

      public Magic.MagicBook getCurrentSpellBook()
      Gets the current spell book.
      Returns:
      The Book enum of your current spell book.
    • castSpellOn

      public boolean castSpellOn(Object entity, int spell)
      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; otherwise false.
    • convertSpellBookToVariables

      public String convertSpellBookToVariables()
      Converts the spell list to variables to be used *Variable updating usage*
      Returns:
      string containing the spells in variable form