Options

Methods to interact with the options gametab.

_images/options.png

ERSOptionsTab

ERSOptionsTab = enum(CONTROLS, AUDIO, DISPLAY);

Enum representing each of the options tabs.


ERSOptionsSlider

ERSOptionsSlider = enum(BRIGHTNESS, ZOOM);

Enum representing the 2 important sliders the options gametab has available. Could be expanded in the future to include the sound sliders but for now only has this 2.


ERSOptionsDropDown

ERSOptionsDropDown = enum(PLAYER_ATTACK, NPC_ATTACK, CLIENT_MODE);

Enum representing each of the options gametab dropdowns.


ERSOptionsButton

ERSOptionsButton = enum(AID, RUN, HOUSE, BOND, ALL_SETTINGS);

Enum representing each of the options gametab buttons.


TRSOptions

Main record responsible with interacting with the Options gametab.


Options.SetupGameTab

procedure TRSOptions.SetupGameTab();

Internal method used to setup the TRSOptions coordinates.

This is automatically called for you on the Options variable.


TRSOptions.Buttons

Buttons: array [ERSOptionsButton] of TRSButton;

TRSButton for each of the Options buttons.

Example:

ShowOnTarget(Options.Buttons);
_images/options_buttons.png

You can also access each button with an index or, more conveniently, with a ERSHouseOptionsButton.

Example:

ShowOnTarget(Options.Buttons[ERSOptionsButton.HOUSE]);
_images/options_button.png

Options.IsOpen

function TRSOptions.IsOpen(): Boolean;

Returns true/false if the options gametab is open or not.

Example:

WriteLn Options.IsOpen();

Options.Open

function TRSOptions.Open(): Boolean;

Attempts to open the options gametab.

Example:

WriteLn Options.Open();

Options.GetTab

function TRSOptions.GetTab(): ERSOptionsTab;

Returns the currently active ERSOptionsTab.

Example:

WriteLn Options.GetTab();

Options.OpenTab

function TRSOptions.OpenTab(tab: ERSOptionsTab): Boolean;

Attempts to open the specified tab ERSOptionsTab.

Example:

WriteLn Options.OpenTab(ERSOptionsTab.DISPLAY);

Options.GetZoomLevel

function TRSOptions.GetZoomLevel(useCache: Boolean = True): Integer;

Retrieves the current zoom level. By default it uses the value cached in TRSOptions.ZoomLevel if it is already set. If it’s not set or if you decide to use this with useCache set to False, TRSOptions.ZoomLevel will be updated with the value this returns.

Example:

WriteLn Options.GetZoomLevel();

Options.SetZoomLevel

function TRSOptions.SetZoomLevel(level: Integer): Boolean;

Sets a new zoom level through the options gametab. If we successfully update the zoom level we update the cached TRSOptions.ZoomLevel, if we don’t, we reset it to -1.

Example:

Options.SetZoomLevel(30);

Options.SetPlayerAttack

function TRSOptions.SetPlayerAttack(index: Integer): Boolean;
function TRSOptions.SetPlayerAttack(option: String): Boolean; overload;

Attempts to set the specified attack option for players.

Example:

WriteLn Options.SetPlayerAttack('Depends on combat levels');
WriteLn Options.SetPlayerAttack(2);

Options.SetNPCAttack

function TRSOptions.SetNPCAttack(index: Integer): Boolean;
function TRSOptions.SetNPCAttack(option: String): Boolean; overload;

Attempts to set the specified attack option for NPCs.

Example:

WriteLn Options.SetNPCAttack('Depends on combat levels');
WriteLn Options.SetNPCAttack(2);

Options.SetClientMode

function TRSOptions.SetClientMode(mode: ERSMode): Boolean;

Attempts to set the specified mode client mode.

Example:

WriteLn Options.SetClientMode('Fixed');

Options.RenderSelf

TRSOptions.RenderSelf();

Writes “::renderself” on the chat and presses enter.

This toggles your character being rendered.

Example:

Options.RenderSelf();

Options.GetRoofsState

function TRSOptions.GetRoofsState(): Boolean;

Returns the roofs state.

Example:

Options.GetRoofsState();

Options.HideRoofs

function TRSOptions.HideRoofs(): Boolean;

Attempts to hide roofs.

Example:

Options.HideRoofs();

Options.ShowRoofs

function TRSOptions.ShowRoofs(): Boolean;

Attempts to show roofs.

Example:

Options.ShowRoofs();

Options.GetBrightness

function TRSOptions.GetBrightness(): Integer;

Returns the current brightness level. By default it uses RSCacheParser for this so it doesn’t need to open the options tab.

Example:

WriteLn Options.GetBrightness();

Options.SetMaxBrightness

function TRSOptions.SetMaxBrightness(): Boolean;

Attempts to set your brightness to 100, which is the only value supported by WaspLib.

Example:

WriteLn Options.SetMaxBrightness();

Options variable

Global TRSOptions variable.