public class Magic extends API
Modifier and Type | Class and Description |
---|---|
static class |
Magic.Book
Holds all the books
|
Modifier and Type | Field and Description |
---|---|
static int |
ANCIENT_INTERFACE |
static int |
ARCEUUS_INTERFACE |
static int |
LUNAR_INTERFACE |
static int |
NORMALS_INTERFACE |
bank, bot, camera, chatbox, client, colorPicker, combat, configs, depositBox, dialogues, diaries, display, doorHandler, equipment, experienceTracker, favour, grandExchange, graphicObjects, groundItems, hintArrow, inventory, keyboard, logger, logoutTab, magic, map, menu, mouse, npcs, objects, players, prayer, projectiles, quests, settings, skills, store, tabs, trade, walking, widgets, worlds
Constructor and Description |
---|
Magic() |
Modifier and Type | Method and Description |
---|---|
boolean |
canCast(MagicSpell spell)
Checks if you have the required items (runes/staffs) and magic level to cast a spell.
|
boolean |
canCast(MagicSpell spell,
boolean returnToTab)
Checks if you have the required items (runes/staffs) and magic level to cast a spell.
|
boolean |
canCast(MagicSpell spell,
Condition condition)
Checks if you have the required items (runes/staffs), magic level, and condition to cast a spell.
|
boolean |
castSpell(MagicSpell spell)
Casts a magic spell, opening the magic tab if not already open.
|
boolean |
castSpell(MagicSpell spell,
java.lang.String action)
Casts a magic spell, opening the magic tab if not already open.
|
boolean |
castSpellOnEntity(MagicSpell spell,
Entity entity)
Casts a spell on an
Entity , opens magic tab if it is not open. |
boolean |
deselectSpell()
Deselects an item if an item is selected by clicking on the inventory
tab.
|
Magic.Book |
getCurrentBook()
Gets the current spell book
|
java.lang.String |
getSelectedSpellName()
Returns the name of the selected spell.
|
RS2Widget |
getSpellWidget(MagicSpell spell)
Grabs the widget corresponding to the spell.
|
boolean |
hoverSpell(MagicSpell spell)
Hovers a specified spell, opens magic tab if it is not open.
|
void |
initializeModule() |
boolean |
isSpellSelected()
Returns whether you have a spell selected.
|
boolean |
open()
Opens the magic tab.
|
exchangeContext, execute, getBank, getBot, getCamera, getChatbox, getClient, getColorPicker, getCombat, getConfigs, getDepositBox, getDialogues, getDiaries, getDisplay, getDoorHandler, getEquipment, getExperienceTracker, getFavour, getGrandExchange, getGraphicObjects, getGroundItems, getHintArrow, getInventory, getKeyboard, getLogoutTab, getMagic, getMap, getMenuAPI, getMouse, getNpcs, getObjects, getPlayers, getPrayer, getProjectiles, getQuests, getSettings, getSkills, getStore, getTabs, getTrade, getWalking, getWidgets, getWorlds, gRandom, gRandom, gRandom, initializeContext, log, log, myPlayer, myPosition, random, random, sleep, stripFormatting, warn
public static final int NORMALS_INTERFACE
public static final int ANCIENT_INTERFACE
public static final int LUNAR_INTERFACE
public static final int ARCEUUS_INTERFACE
public Magic.Book getCurrentBook()
public boolean castSpell(MagicSpell spell)
spell
- the magic spell to cast.public boolean castSpell(MagicSpell spell, java.lang.String action)
spell
- the magic spell to cast.action
- the spell action to castpublic boolean castSpellOnEntity(MagicSpell spell, Entity entity)
Entity
, opens magic tab if it is not open.entity
- The entity to cast on.spell
- The spell to cast.public boolean open()
public boolean isSpellSelected()
public java.lang.String getSelectedSpellName()
public boolean deselectSpell()
public boolean hoverSpell(MagicSpell spell) throws java.lang.InterruptedException
spell
- The spell to hover.java.lang.InterruptedException
public RS2Widget getSpellWidget(MagicSpell spell)
spell
- the spell to get the widget forpublic boolean canCast(MagicSpell spell, boolean returnToTab) throws java.lang.InterruptedException
spell
- The spell you are inquiringreturnToTab
- If set to true, the method will return to the tab open previously before
calling this method. If set to false it will remain in the magic tab.java.lang.InterruptedException
public boolean canCast(MagicSpell spell) throws java.lang.InterruptedException
spell
- The spell you are inquiringjava.lang.InterruptedException
public boolean canCast(MagicSpell spell, Condition condition) throws java.lang.InterruptedException
spell
- The MagicSpell you are inquiringcondition
- An additional condition to check if a spell can be castedjava.lang.InterruptedException
public void initializeModule()
initializeModule
in class API