GameTabs

Methods to interact with the gametab buttons.

_images/gametabs_compact.png
_images/gametabs_flat.png

By default it will attempt to use “F-Keys” to open gametabs. You can turn this off by setting TRSGameTabs.KeybindsEnabled to False.

The way keybindings work in WaspLib is that it will try a random “F-Key” everytime you want to open a gametab. Because it uses a random “F-Key”, it will probably not open the gametab you want but whatever opens, gets cached and mapped to the random “F-Key” used.

Next time you want to open a gametab that has already been mapped, it will use the correct “F-Key”.


ERSGameTab

ERSGameTab = enum(NONE, COMBAT, STATS, ACHIEVEMENTS, INVENTORY, EQUIPMENT, PRAYER, MAGIC, CLAN, FRIENDS, ACCOUNT, LOGOUT, OPTIONS, EMOTES, MUSIC);

TRSGameTabs

Main record responsible for handling the gametabs.


GameTabs.SetupInterface

procedure TRSGameTabs.SetupInterface();

Internal method responsible for setting up coordinates for the TRSGameTabs.

This is automatically called for you on the GameTabs variable.


GameTabs.GetCurrent

function TRSGameTabs.GetCurrent(): ERSGametab;

Get the currently active ERSGameTab.

Example:

ShowOnTarget(GameTabs.Tabs[GameTabs.GetCurrent()]);
_images/gametabs_selected.png

GameTabs.IsOpen

function TRSGameTabs.IsOpen(tab: ERSGameTab): Boolean;

Returns true/false if the specified tab is currently open.

Example:

WriteLn GameTabs.IsOpen(ERSGameTab.INVENTORY);

GameTabs.WaitOpen

function TRSGameTabs.WaitOpen(tab: ERSGameTab; time: Integer = 600; interval: Integer = -1): Boolean;

Returns true/false if the specified tab opens within the specified time.

Example:

Mouse.Click(GameTabs.Get(ERSGameTab.INVENTORY), EMouseButton.LEFT);
WriteLn GameTabs.WaitOpen(ERSGameTab.INVENTORY);

GameTabs.FKeyOpen

function TRSGameTabs.FKeyOpen(tab: ERSGameTab): Boolean;

Attempts to open the specified tab gametab with an FKey. This works by randomly using FKeys that haven’t been tried yet and slowly caching which gametabs they open. At first most times this is used it won’t open the tab specified, but as more EKeyCode/ERSGameTab pairs get mapped this starts getting them right.

Example:

WriteLn GameTabs.FKeyOpen(ERSGameTab.INVENTORY);

GameTabs.Open

function TRSGameTabs.Open(tab: ERSGameTab; fkeyProbability: Single = -1): Boolean;

Attempts to open the specified tab gametab. If TRSGameTabs.KeybindsEnabled is true, we might attempt to open the tab with GameTabs.FKeyOpen, subject to fkeyProbability.

Example:

WriteLn GameTabs.Open(ERSGameTab.INVENTORY);

GameTabs variable

Global TRSGameTabs variable.


GameTab

Gametabs interfaces core. Whenever you want to use gametab coordinates that are not unique to a specific tab you should use this.

Check TRSInterface to see what coordinates it has available.


TRSGameTab

The TRSGameTab type that holds the core coordinates of a gametab.


GameTab.SetupInterface

procedure TRSGameTab.SetupInterface();

Internal method used to setup the TRSGameTab coordinates.

This is automatically called for you on the GameTab variable.


GameTab variable

Global TRSGameTab variable.