Actionbar¶
The actionbar file holds functions and procedures that are used in the runescape Action Bar.
The source for this file can be found here.
Consts, Types, Vars¶
The following constants, types and variables are used throughout the actionBar methods.
const Action Bar Stat Bars
Constants that represent the stat bars on the action bar
- AB_BAR_HP
- AB_BAR_ADRENALINE
- AB_BAR_PRAYER
- AB_BAR_SUMMONING
type TRSActionBar
type
TRSActioinBar = type TRSInterface;
A type that stores the action bar interface properties.
var actionBar
var
actionBar: TRSActionBar;
A variable through which scripters can access the TRSActionBar type methods.
TRSActionBar methods¶
The following methods should be called through the actionBar variable.
Example:
if actionBar.isEmpty() then
writeln('There is nothing in any of the slots');
minimize¶
function TRSActionBar.minimize(): boolean;
Returns true if it minimizes the action bar.
Note
- by Olly
- Last Updated: 12 December 2013 by Olly
Example:
actionBar.minimize();
maximize¶
function TRSActionBar.minimize(): boolean;
Returns true if it maximizes the action bar.
Note
- by Olly
- Last Updated: 12 December 2013 by Olly
Example:
actionBar.maximize();
getCurrentBar¶
function TRSActionBar.getCurrentBar(): Integer;
Returns the number of the Action Bar setup currently displayed. Members can have up to five different Action Bar setups.
Note
- by euphemism
- Last Updated: 13 April 2017 by acow
Example:
if (actionBar.getCurrentBar() = 1) then
writeln('The first Action Bar setup is currently displayed.');
switchToBar¶
function TRSActionBar.switchToBar(barNumber: integer; useBindKey: boolean = false): boolean;
Switches to the barNumber action bar setup. If useBindKey is set to true (default = false) it will use the keyboard, else it will use the mouse.
Note
- by euphemism
- Last Updated: 13 April 2017 by acow
Example:
if actionBar.switchToBar(3) then
writeln('Switched to bar number 3');
isSlotEmpty¶
function TRSActionBar.isSlotEmpty(slot: integer): boolean;
Returns true if the Action Bar slot slot is empty.
Note
- by euphemism
- Last Updated: 5th July 2014 by The Mayor
Example:
if actionBar.isSlotEmpty(1) then
writeln('The first Action Bar slot is empty.');
isEmpty¶
function TRSActionBar.isEmpty(): boolean;
Returns true if every slot in the Action Bar is empty.
Note
- by euphemism
- Last Updated: 18 April 2013 by euphemism
Example:
if actionBar.isEmpty() then
writeln('Every slot in the Action Bar is empty!');
getSlotBox¶
function TRSActionBar.getSlotBox(slot: integer): TBox;
Returns a TBox of the Action Bar slot, slot
Note
- by Olly
- Last Updated: 18 September 2013 by Olly
Example:
var
b: TBox;
begin
b := actionBar.getSlotBox(1);
end;
pointToSlot¶
function TRSActionBar.pointToSlot(pnt: TPoint): integer;
Returns the Action Bar slot which the TPoint pnt fall within. If it doesn’t fall within any slot, it returns -1.
Note
- by Olly
- Last Updated: 20 November 2013 by Olly
Example:
var
x, y, myDTM: Integer;
begin
myDTM := DTMFromString('heapsofstuff');
if findDTM(myDTM, x, y, actionBar.getBounds()) then
writeLn(Found DTM in slot ' + toStr(actionBar.pointToSlot([x, y]));
end;
clickSlot¶
function TRSActionBar.clickSlot(slot: integer; clickType: integer = MOUSE_LEFT): boolean;
Clicks the Action Bar slot slot using click type (default = MOUSE_LEFT)
Note
- by euphemism
- Last Updated: 18 April 2013 by euphemism
Example:
if (actionBar.clickSlot(1)) then
writeln('There was something in slot 1 and we clicked it!');
isSlotActive¶
function TRSActionBar.isSlotActive(slot: integer): boolean;
Returns true if the Action Bar slot slot is activated (i.e., it has been clicked/has the white border).
Note
- by Ashaman88
- Last Updated: 21 January 2014 by Ashaman88
Example:
if (actionBar.isSlotActive(1)) then
writeln('The first Action Bar slot is activated.');
isLocked¶
function TRSActionBar.isLocked(): boolean;
Returns true if the Action Bar is locked.
Note
- by euphemism
- Last Updated: 5 July 2014 by The Mayor
Example:
if actionBar.isLocked() then
writeln('The Action Bar is locked.');
lock¶
function TRSActionBar.lock(): boolean;
Returns true if the Action Bar is locked, or it successfully locks it.
Note
- by euphemism
- Last Updated: 18 April 2013 by euphemism
Example:
if actionBar.lock() then
writeln('Action Bar is now, or already was, locked.');
unlock¶
function TRSActionBar.unlock(): boolean;
Returns true if the Action Bar is unlocked, or it successfully unlocks it.
Note
- by euphemism
- Last Updated: 18 April 2013 by euphemism
Example:
if actionBar.unlock() then
writeln('Action Bar is now, or alreay was, unlocked.');
clearSlot¶
function TRSActionBar.clearSlot(slot: integer): boolean;
Returns true if it clears the specified Action Bar slot.
Note
- by euphemism
- Last Updated: 5 July 2014 by The Mayor
Example:
if actionBar.clearSlot(1) then
writeln('Successfully cleared slot 1 of the Action Bar.');
clear¶
function TRSActionBar.clear(): boolean;
Returns true if it successfully clears every slot on the Action Bar.
Note
- by euphemism
- Last Updated: 5 July 2014 by The Mayor
Example:
if actionBar.clear() then
writeln('Successfully cleared the Action Bar.');
getAbilityCooldown¶
function TRSActionBar.getAbilityCooldown(slot: integer): integer;
Returns integer representation (0 - 100) of the cooldown of the ability in the Action Bar slot slot
Note
- by euphemism
- Last Updated: 18 April 2013 by euphemism
Example:
if actionBar.getAbilityCooldown(1) = 100 then
writeln('The ability in slot 1 has cooled down 100% and is ready to use.');
getHPPercent¶
function TRSActionBar.getHPPercent(): integer;
Returns the players hitpoints percentage.
Note
- by Turpinator
- Last Updated: 12 December 2013 by Turpinator
Example:
writeln(actionBar.getHPPercent());
getAdrenalinePercent¶
function TRSActionBar.getAdrenalinePercent(): integer;
Returns the players adrenaline percentage.
Note
- by Turpinator
- Last Updated: 12 December 2013 by Turpinator
Example:
writeln(actionBar.getAdrenalinePercent());
getPrayerPercent¶
function TRSActionBar.getPrayerPercent(): integer;
Returns the players prayer percentage.
Note
- by Turpinator
- Last Updated: 12 December 2013 by Turpinator
Example:
writeln(actionBar.getPrayerPercent());
getSummoningPercent¶
function TRSActionBar.getSummoningPercent(): integer;
Returns the players summoning percent
Note
- by Turpinator
- Last Updated: 12 December 2013 by Turpinator
Example:
writeln(actionBar.getSummoningPercent());
mouseIcon¶
procedure TRSActionBar.mouseIcon(icon, button: integer = MOUSE_LEFT);
Returns true if it clicks the Action Bar stat icon icon using the mouse button button (default = MOUSE_LEFT)
Note
- by Ashaman88
- Last Updated: 22 August 2015 by Thomas
Example:
actionBar.mouseIcon(AB_BAR_SUMMONING);
isIconEnabled¶
function TRSActionBar.isIconEnabled(icon: integer): boolean;
Returns true if the selected icon (icon) is enabled.
Note
- by Thomas
- Last Updated: 2 September 2015 by Thomas
Example:
isIconEnabled(AB_BAR_PRAYER);
setRetaliate¶
function TRSActionBar.setRetaliate(enabled: boolean = true): boolean;
Returns true if it successfully enables or disables autoretaliate depending on the enabled parameter (default = true)
Note
- by Ashaman88
- Last Updated: 2 September 2015 by Thomas
Example:
actionBar.setRetaliate();
actionBar.setRetaliate(false); // To disable it
setQuickPrayer¶
function TRSActionBar.setQuickPrayer(enabled: boolean = true): boolean;
Returns true if it successfully enables or disables QuickPrayer depending on the enabled parameter (default = true)
Note
- by The Mayor
- Last Updated: 2 September 2015 by Thomas
Example:
actionBar.setQuickPrayer();
actionBar.setQuickPrayer(false); // To disable it
setHealing¶
function TRSActionBar.setHealing(enabled: boolean = true): boolean;
Returns true if it successfully enables or disables Healing depending on the enabled parameter (default = true)
Note
- by Thomas
- Last Updated: 2 September 2015 by Thomas
Example:
actionBar.setHealing();
actionBar.setHealing(false); // To disable it