# GameTabs Methods to interact with the gametab buttons. ```{figure} ../../images/gametabs_compact.png ``` ```{figure} ../../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 ```pascal 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 ```pascal procedure TRSGameTabs.SetupInterface(); ``` Internal method responsible for setting up coordinates for the {ref}`TRSGameTabs`. This is automatically called for you on the {ref}`GameTabs variable`. - - - ## GameTabs.GetCurrent ```pascal function TRSGameTabs.GetCurrent(): ERSGametab; ``` Get the currently active ERSGameTab. Example: ```pascal ShowOnTarget(GameTabs.Tabs[GameTabs.GetCurrent()]); ``` ```{figure} ../../images/gametabs_selected.png ``` - - - ## GameTabs.IsOpen ```pascal function TRSGameTabs.IsOpen(tab: ERSGameTab): Boolean; ``` Returns true/false if the specified `tab` is currently open. Example: ```pascal WriteLn GameTabs.IsOpen(ERSGameTab.INVENTORY); ``` - - - ## GameTabs.WaitOpen ```pascal 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: ```pascal Mouse.Click(GameTabs.Get(ERSGameTab.INVENTORY), EMouseButton.LEFT); WriteLn GameTabs.WaitOpen(ERSGameTab.INVENTORY); ``` - - - ## GameTabs.FKeyOpen ```pascal 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: ```pascal WriteLn GameTabs.FKeyOpen(ERSGameTab.INVENTORY); ``` - - - ## GameTabs.Open ```pascal 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 {ref}`GameTabs.FKeyOpen`, subject to `fkeyProbability`. Example: ```pascal WriteLn GameTabs.Open(ERSGameTab.INVENTORY); ``` - - - ## GameTabs variable Global {ref}`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 {ref}`TRSInterface` to see what coordinates it has available. - - - ## TRSGameTab The TRSGameTab type that holds the core coordinates of a gametab. - - - ## GameTab.SetupInterface ```pascal procedure TRSGameTab.SetupInterface(); ``` Internal method used to setup the {ref}`TRSGameTab` coordinates. This is automatically called for you on the {ref}`GameTab variable`. - - - ## GameTab variable Global {ref}`TRSGameTab` variable.