Game Settings API

Read and modify OSRS game settings programmatically.

Attack Options

The AttackOption table contains constants for NPC and Player attack options:

game_settings.AttackOption.DEPENDS_ON_COMBAT         -- "DEPENDS_ON_COMBAT"
game_settings.AttackOption.ALWAYS_RIGHT_CLICK        -- "ALWAYS_RIGHT_CLICK"
game_settings.AttackOption.LEFT_CLICK_WHERE_AVAILABLE -- "LEFT_CLICK_WHERE_AVAILABLE"
game_settings.AttackOption.HIDDEN                    -- "HIDDEN"
game_settings.AttackOption.RIGHT_CLICK_FOR_CLANMATES -- "RIGHT_CLICK_FOR_CLANMATES" (Player only)

Controls Tab Settings

accept_aid

game_settings:accept_aid() -> boolean

Check if Accept Aid is enabled.

Returns:

  • boolean - true if Accept Aid is enabled

Example:

if game_settings:accept_aid() then
    logger:info("Accept Aid is enabled")
end

set_accept_aid

game_settings:set_accept_aid(enabled: boolean) -> boolean

Enable or disable Accept Aid.

Parameters:

ParameterTypeRequiredDescription
enabledanyYes- true to enable, false to disable

Returns:

  • boolean - true if successful

Example:

-- Enable Accept Aid
if game_settings:set_accept_aid(true) then
    logger:info("Accept Aid enabled")
end

pk_skull_protection

game_settings:pk_skull_protection() -> boolean

Check if PK skull protection is enabled.

Returns:

  • boolean - true if PK skull protection is enabled

Example:

if game_settings:pk_skull_protection() then
    logger:info("PK skull protection is enabled")
end

set_pk_skull_protection

game_settings:set_pk_skull_protection(enabled: boolean) -> boolean

Enable or disable PK skull protection.

Parameters:

ParameterTypeRequiredDescription
enabledanyYes- true to enable, false to disable

Returns:

  • boolean - true if successful

Example:

-- Enable PK skull protection
if game_settings:set_pk_skull_protection(true) then
    logger:info("PK skull protection enabled")
end

npc_attack_option

game_settings:npc_attack_option() -> number?

Get current NPC attack option setting.

Returns:

  • number? - Attack option value (0-3), or nil if unavailable

Example:

local option = game_settings:npc_attack_option()
if option == game_settings.AttackOption.ALWAYS_RIGHT_CLICK then
    logger:info("NPCs set to always right-click")
end

set_npc_attack_option

game_settings:set_npc_attack_option(option: number) -> boolean

Set NPC attack option.

Parameters:

ParameterTypeRequiredDescription
optionanyYes- Attack option value (0-3, see AttackOption constants)

Returns:

  • boolean - true if successful

Example:

-- Set NPCs to always right-click
game_settings:set_npc_attack_option(game_settings.AttackOption.ALWAYS_RIGHT_CLICK)

player_attack_option

game_settings:player_attack_option() -> number?

Get current player attack option setting.

Returns:

  • number? - Attack option value (0-3), or nil if unavailable

Example:

local option = game_settings:player_attack_option()
if option == game_settings.AttackOption.HIDDEN then
    logger:info("Players set to hidden")
end

set_player_attack_option

game_settings:set_player_attack_option(option: number) -> boolean

Set player attack option.

Parameters:

ParameterTypeRequiredDescription
optionanyYes- Attack option value (0-3, see AttackOption constants)

Returns:

  • boolean - true if successful

Example:

-- Set players to hidden (PvP safety)
game_settings:set_player_attack_option(game_settings.AttackOption.HIDDEN)

tab_keybind

game_settings:tab_keybind(tab: string) -> integer

Get the keybinding currently assigned to a tab. Reads directly from game memory (instant). Returns a virtual key code integer — compare with tabs.Keybind constants.

Parameters:

  • tab - Tab name string (use tabs.Tab constants, e.g. tabs.Tab.COMBAT, tabs.Tab.INVENTORY)

Returns:

  • integer - Virtual key code (tabs.Keybind.F1 through tabs.Keybind.F12, tabs.Keybind.ESCAPE, or tabs.Keybind.NONE)

Example:

local key = game_settings:tab_keybind(tabs.Tab.COMBAT)
if key == tabs.Keybind.F1 then
    logger:info("Combat tab is bound to F1")
end

set_tab_keybind

game_settings:set_tab_keybind(tab: string, keybind: integer) -> boolean

Set the keybinding for a specific tab. Opens the All Settings window keybind dropdown to make the change. Pass a tabs.Keybind constant.

Parameters:

  • tab - Tab name string (use tabs.Tab constants, e.g. tabs.Tab.COMBAT, tabs.Tab.INVENTORY)
  • keybind - Virtual key code (tabs.Keybind.F1 through tabs.Keybind.F12, tabs.Keybind.ESCAPE, or tabs.Keybind.NONE)

Returns:

  • boolean - true if successful

Example:

-- Bind inventory to F1
game_settings:set_tab_keybind(tabs.Tab.INVENTORY, tabs.Keybind.F1)

-- Unbind magic tab
game_settings:set_tab_keybind(tabs.Tab.MAGIC, tabs.Keybind.NONE)

-- Bind logout to ESC
game_settings:set_tab_keybind(tabs.Tab.LOGOUT, tabs.Keybind.ESCAPE)

set_tab_keybinds

game_settings:set_tab_keybinds(bindings: table) -> boolean

Set multiple tab keybindings in one batch. The settings window stays open for the entire operation instead of reopening for each tab. Returns true if all bindings were applied successfully.

Parameters:

  • bindings - A table mapping tabs.Tab constants to tabs.Keybind constants

Returns:

  • boolean - true if all bindings were applied successfully

Example:

-- Configure all keybinds at once
local ok = game_settings:set_tab_keybinds({
    [tabs.Tab.COMBAT] = tabs.Keybind.F1,
    [tabs.Tab.STATS] = tabs.Keybind.F2,
    [tabs.Tab.QUESTS] = tabs.Keybind.F3,
    [tabs.Tab.INVENTORY] = tabs.Keybind.F4,
    [tabs.Tab.EQUIPMENT] = tabs.Keybind.F5,
    [tabs.Tab.PRAYER] = tabs.Keybind.F6,
    [tabs.Tab.MAGIC] = tabs.Keybind.F7,
    [tabs.Tab.LOGOUT] = tabs.Keybind.ESCAPE,
})
logger:info("Keybinds configured: " .. tostring(ok))

restore_default_keybinds

game_settings:restore_default_keybinds() -> boolean

Restore all tab keybindings to the OSRS defaults (F1-F12 mapped to tabs, ESC to Logout).

Returns:

  • boolean - true if successful

Example:

game_settings:restore_default_keybinds()

Audio Tab Settings

is_master_muted

game_settings:is_master_muted() -> boolean

Check if master audio is muted.

Returns:

  • boolean - true if muted

set_master_mute

game_settings:set_master_mute(muted: boolean) -> boolean

Mute or unmute master audio.

Parameters:

ParameterTypeRequiredDescription
mutedanyYes- true to mute, false to unmute

Returns:

  • boolean - true if successful

Example:

-- Mute all audio
game_settings:set_master_mute(true)

is_music_muted

game_settings:is_music_muted() -> boolean

Check if music is muted.

Returns:

  • boolean - true if muted

set_music_mute

game_settings:set_music_mute(muted: boolean) -> boolean

Mute or unmute music.

Parameters:

ParameterTypeRequiredDescription
mutedanyYes- true to mute, false to unmute

Returns:

  • boolean - true if successful

is_effects_muted

game_settings:is_effects_muted() -> boolean

Check if sound effects are muted.

Returns:

  • boolean - true if muted

set_effects_mute

game_settings:set_effects_mute(muted: boolean) -> boolean

Mute or unmute sound effects.

Parameters:

ParameterTypeRequiredDescription
mutedanyYes- true to mute, false to unmute

Returns:

  • boolean - true if successful

is_area_sounds_muted

game_settings:is_area_sounds_muted() -> boolean

Check if area sounds are muted.

Returns:

  • boolean - true if muted

set_area_sounds_mute

game_settings:set_area_sounds_mute(muted: boolean) -> boolean

Mute or unmute area sounds.

Parameters:

ParameterTypeRequiredDescription
mutedanyYes- true to mute, false to unmute

Returns:

  • boolean - true if successful

Common Patterns

Configure Audio for Botting

-- Mute all audio to reduce detection risk
game_settings:set_master_mute(true)

-- Or mute individual audio types
game_settings:set_music_mute(true)
game_settings:set_effects_mute(true)
game_settings:set_area_sounds_mute(true)

Configure Combat Settings

-- Set safe combat options
game_settings:set_npc_attack_option(game_settings.AttackOption.ALWAYS_RIGHT_CLICK)
game_settings:set_player_attack_option(game_settings.AttackOption.HIDDEN)

-- Disable Accept Aid for safety
game_settings:set_accept_aid(false)

Check Settings Before Starting

function script:on_start()
    -- Verify settings before starting bot
    if not game_settings:accept_aid() then
        logger:warn("Accept Aid is disabled")
    end

    local npc_option = game_settings:npc_attack_option()
    if npc_option ~= game_settings.AttackOption.ALWAYS_RIGHT_CLICK then
        logger:warn("NPC attack option is not set to always right-click")
        -- Optionally fix it
        game_settings:set_npc_attack_option(game_settings.AttackOption.ALWAYS_RIGHT_CLICK)
    end
end

All Settings (Advanced)

are_roofs_hidden

game_settings:are_roofs_hidden() -> boolean

Check if roofs are hidden.

Returns:

  • boolean - true if roofs are hidden

Example:

if game_settings:are_roofs_hidden() then
    logger:info("Roofs are hidden")
end

set_hide_roofs

game_settings:set_hide_roofs(hidden: boolean) -> boolean

Enable or disable Hide Roofs setting. This setting is accessed through the All Settings window.

Parameters:

ParameterTypeRequiredDescription
hiddenanyYes- true to hide roofs, false to show roofs

Returns:

  • boolean - true if successful

Example:

-- Hide roofs
if game_settings:set_hide_roofs(true) then
    logger:info("Roofs are now hidden")
end

-- Show roofs
if game_settings:set_hide_roofs(false) then
    logger:info("Roofs are now visible")
end

is_shift_click_drop_enabled

game_settings:is_shift_click_drop_enabled() -> boolean

Check if shift-click to drop is enabled.

Returns:

  • boolean - true if shift-click to drop is enabled

Example:

if game_settings:is_shift_click_drop_enabled() then
    logger:info("Shift-click to drop is enabled")
end

set_shift_click_drop

game_settings:set_shift_click_drop(enabled: boolean) -> boolean

Enable or disable shift-click to drop. This setting is accessed through the All Settings window.

Parameters:

ParameterTypeRequiredDescription
enabledanyYes- true to enable shift-click drop, false to disable

Returns:

  • boolean - true if successful

Example:

-- Enable shift-click to drop
if game_settings:set_shift_click_drop(true) then
    logger:info("Shift-click to drop enabled")
end

-- Disable shift-click to drop
if game_settings:set_shift_click_drop(false) then
    logger:info("Shift-click to drop disabled")
end

Notes

  • All setter methods automatically open the appropriate settings tab
  • Settings changes are applied immediately in-game
  • Getter methods read directly from game memory (instant)
  • Setter methods interact with UI components (takes ~500-1000ms)
  • Advanced settings (like Hide Roofs) use the All Settings window and may take slightly longer (~1-2 seconds)