Magic

Methods to interact with the magic tab.


Magic.Setup

procedure TMagic.Setup; override;

Initializes Magic variables.

Note

This is automatically called on the Magic variable.


Magic.SetupAlignment

procedure TMagic.SetupAlignment(); overload;

Setups up the interface aligment for the current client mode.

Note

This is automatically called on the TGameClient.ClientModeChanged function.


Magic.IsOpen

function TMagic.IsOpen(): Boolean;

Returns true if the Magic tab is open.

Example:

WriteLn Magic.IsOpen();

Magic.Open

function TMagic.Open(): Boolean;

Attempts to open the magic tab.

Example:

Magic.Open();

Magic.GetSpellBook

function TMagic.GetSpellBook(): ESpellBook;

Returns the current spell book.

Example:

WriteLn Magic.GetSpellBook();

Magic.IsSpellBook

function TMagic.IsSpellBook(book: ESpellBook): Boolean;

Returns true if we are using the specified spell book.

Example:

WriteLn Magic.IsSpellBook(ESpellBook.LUNAR);

Magic.InfoIsOpen

function TMagic.InfoIsOpen(): Boolean;

Returns true if the info black box about a spell is open.

Example:

WriteLn Magic.IsSpellBook(ESpellBook.LUNAR);

Magic._CloseInfoMouseCallback

procedure TMagic._CloseInfoMouseCallback(sender: PMouse; var x, y: Double; var done: Boolean);

Mouse movement callback to stop mouse movement when the spell info box closes. Do not touch this if you don’t understand it.


Magic.CloseInfo

function TMagic.CloseInfo(): Boolean;
function TMagic.CloseInfo(spell: ESpell): Boolean; overload;

Returns true if the info black box about a spell is open.

Example:

WriteLn Magic.CloseInfo();

Magic.FindSpell

function TMagic.FindSpell(spell: ESpell; out box: TBox): Boolean;

Return true or false wether we found a spell or not and return it’s bounds if found.


Magic.ContainsSpell

function TMagic.ContainsSpell(spell: ESpell): Boolean;

Return true or false wether we found a spell or not.


Magic.MouseSpell

function TMagic.MouseSpell(spell: ESpell): Boolean;

Used to move the mouse to the specified spell.

Example:

Magic.MouseSpell(ESpell.HIGH_LEVEL_ALCHEMY);

Magic.ClickSpell

function TMagic.ClickSpell(spell: ESpell; option: String = ''): Boolean;

Used to interact with the specified spell.

Example:

Magic.ClickSpell(ESpell.HIGH_LEVEL_ALCHEMY);

Magic.FindSelected

function TMagic.FindSelected(out tpa: TPointArray): Boolean;

Returns the true if we have a selected spell and returns it’s tpa.

Example:

if Magic.FindSelected(tpa) then
  Debug(tpa);

Magic.ContainsSelected

function TMagic.ContainsSelected(): Boolean;

Returns the true if we have a selected spell.

Example:

WriteLn Magic.ContainsSelected();

Magic.IsSelected

function TMagic.IsSelected(spell: ESpell): Boolean;
function TMagic.IsSelected(spell: ESpell; selected: TPointArray): Boolean; overload;

Returns true if the specified spell is currently active (with white outline).

Example:

WriteLn Magic.IsSpellSelected(ESpell.ICE_BARRAGE);

Magic.CanActivate

function TMagic.CanActivate(spell: ESpell): Boolean;

Returns true if we can activate the spell (we have runes, level and the spell unlocked).

Example:

Magic.CanActivate(ESpell.HIGH_LEVEL_ALCHEMY);

Magic.SpellWasCast

function TMagic.SpellWasCast(spell: ESpell): Boolean;

Returns true if we are in a state that casting a spell would leave you.

Example:

Magic.SpellWasCast(ESpell.ICE_BARRAGE);

Magic.CastSpell

function TMagic.CastSpell(spell: ESpell): Boolean;

Attempts to cast the specified spell.

Example:

Magic.CastSpell(ESpell.LOW_LEVEL_ALCHEMY);

var Magic

Global Magic variable.