Magic#

Methods to interact with the magic tab.


Magic.Setup#

procedure TRSMagic.Setup; override;

Initializes Magic variables.

Note

This is automatically called on the Magic variable.


Magic.SetupAlignment#

procedure TRSMagic.SetupAlignment(Mode: ERSClientMode); override;

Setups up the interface aligment for the current client mode.

Note

This is automatically called on the TRSClient.ClientModeChanged function.


Magic.IsOpen#

function TRSMagic.IsOpen(): Boolean;

Returns true if the Magic tab is open.

Example:

WriteLn Magic.IsOpen();

Magic.Open#

function TRSMagic.Open(): Boolean;

Attempts to open the magic tab.

Example:

Magic.Open();

Magic.GetSpellBook#

function TRSMagic.GetSpellBook(): ERSSpellBook;

Returns the current spell book.

Example:

WriteLn Magic.GetSpellBook();

Magic.IsSpellBook#

function TRSMagic.IsSpellBook(book: ERSSpellBook): Boolean;

Returns true if we are using the specified spell book.

Example:

WriteLn Magic.IsSpellBook(ERSSpellBook.LUNAR);

Magic.InfoIsOpen#

function TRSMagic.InfoIsOpen(): Boolean;

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

Example:

WriteLn Magic.IsSpellBook(ERSSpellBook.LUNAR);

Magic._CloseInfoMouseCallback#

procedure TRSMagic._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 TRSMagic.CloseInfo(): Boolean;
function TRSMagic.CloseInfo(spell: ERSSpell): Boolean; overload;

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

Example:

WriteLn Magic.CloseInfo();

Magic.FindSpell#

function TRSMagic.FindSpell(spell: ERSSpell; out box: TBox): Boolean;

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


Magic.GetSpellBox#

function TRSMagic.GetSpellBox(spell: ERSSpell; out box: TBox): Boolean;

Internal function to get the specified spell bounds.


Magic.ContainsSpell#

function TRSMagic.ContainsSpell(spell: ERSSpell): Boolean;

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


Magic.MouseSpell#

function TRSMagic.MouseSpell(spell: ERSSpell): Boolean;

Used to move the mouse to the specified spell.

Example:

Magic.MouseSpell(ERSSpell.HIGH_LEVEL_ALCHEMY);

Magic.ClickSpell#

function TRSMagic.ClickSpell(spell: ERSSpell; option: String = ''): Boolean;

Used to interact with the specified spell.

Example:

Magic.ClickSpell(ERSSpell.HIGH_LEVEL_ALCHEMY);

Magic.FindSelected#

function TRSMagic.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 TRSMagic.ContainsSelected(): Boolean;

Returns the true if we have a selected spell.

Example:

WriteLn Magic.ContainsSelected();

Magic.IsSelected#

function TRSMagic.IsSelected(spell: ERSSpell): Boolean;
function TRSMagic.IsSelected(spell: ERSSpell; selected: TPointArray): Boolean; overload;

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

Example:

WriteLn Magic.IsSpellSelected(ERSSpell.ICE_BARRAGE);

Magic.CanActivate#

function TRSMagic.CanActivate(spell: ERSSpell): Boolean;

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

Example:

Magic.CanActivate(ERSSpell.HIGH_LEVEL_ALCHEMY);

Magic.SpellWasCast#

function TRSMagic.SpellWasCast(spell: ERSSpell): Boolean;

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

Example:

Magic.SpellWasCast(ERSSpell.ICE_BARRAGE);

Magic.CastSpell#

function TRSMagic.CastSpell(spell: ERSSpell): Boolean;

Attempts to cast the specified spell.

Example:

Magic.CastSpell(ERSSpell.LOW_LEVEL_ALCHEMY);

var Magic#

Global Magic variable.