POH API

Interact with Player Owned House features including Portal Nexus, Fairy Ring, Xeric's Talisman, and stat restore objects (pools/altars).

Core Functions

inside

poh:inside(check_loading?: boolean) -> boolean

Check if the player is inside their house. Optionally verifies that loading is complete.

Parameters:

ParameterTypeRequiredDescription
check_loadingbooleanNoIf true, also checks that the house loading indicator is not present. Defaults to false.

Returns:

  • boolean - true if the player is inside the house

Example:

-- Simple check
if poh:inside() then
    logger:info("Inside house")
end

-- Wait for house to finish loading
if poh:inside(true) then
    logger:info("House loaded and ready")
end

is_loading

poh:is_loading() -> boolean

Check if the house is still loading when entering (checks for the loading component).

Returns:

  • boolean - true if the loading component is visible

Example:

-- Wait for house to finish loading
while poh:is_loading() do
    sleep(100)
end
logger:info("House loading complete")

Portal Nexus

The Portal Nexus allows teleportation to various destinations around Gielinor.

get_portal_nexus

poh:get_portal_nexus(distance?: integer) -> LuaGameObject?

Get the Portal Nexus object within the specified distance.

Parameters:

ParameterTypeRequiredDescription
distanceintegerNoMaximum distance to search in tiles. Defaults to 20.

Returns:

  • LuaGameObject? - The nearest Portal Nexus GameObject, or nil if not found

Example:

local nexus = poh:get_portal_nexus(30)
if nexus then
    logger:info("Found Portal Nexus")
end

portal_nexus_opened

poh:portal_nexus_opened() -> boolean

Check if the Portal Nexus interface is open.

Returns:

  • boolean - true if the Portal Nexus widget is visible

open_portal_nexus

poh:open_portal_nexus() -> boolean

Open the Portal Nexus interface by interacting with the Portal Nexus object.

Returns:

  • boolean - true if the interface was opened successfully

Example:

if not poh:portal_nexus_opened() then
    if poh:open_portal_nexus() then
        logger:info("Portal Nexus opened")
        sleep(500)
    end
end

close_portal_nexus

poh:close_portal_nexus() -> boolean

Close the Portal Nexus interface.

Returns:

  • boolean - true if the interface was closed successfully

portal_nexus_teleport

poh:portal_nexus_teleport(destination: string) -> boolean

Teleport using the Portal Nexus to the specified destination. The interface must be open before calling this.

Parameters:

ParameterTypeRequiredDescription
destinationstringYesThe destination name. Valid destinations include:
  • "Ardougne", "East Ardougne", "West Ardougne"
  • "Grand Exchange", "Seers' Village" (or "Seers Village")
  • "Watchtower", "Yanille", "Catherby"
  • "Kourend Castle", "Lunar Isle", "Barrows"
  • "Senntisten", "Kharyrll", "Waterbirth Island"
  • "Troll Stronghold", "Weiss", "Ghorrock"
  • And many more (see PortalNexusDestination enum below)

Returns:

  • boolean - true if the teleport was successful

Example:

-- Open nexus and teleport
if poh:open_portal_nexus() then
    sleep(500)
    if poh:portal_nexus_teleport("Varrock") then
        logger:info("Teleported to Varrock")
    end
end

Note: The function accepts destination names as shown in the Portal Nexus interface. You can also use enum values from poh.PortalNexusDestination:

-- Using enum (the enum values are the destination names)
local dest = poh.PortalNexusDestination.VARROCK  -- Returns "Varrock"
poh:portal_nexus_teleport(dest)

PortalNexusDestination Enum

The poh.PortalNexusDestination enum contains all available Portal Nexus destinations as string values:

  • poh.PortalNexusDestination.ARDOUGNE"Ardougne"
  • poh.PortalNexusDestination.ARCEUUS_LIBRARY"Arceuus Library"
  • poh.PortalNexusDestination.DRAYNOR_MANOR"Draynor Manor"
  • poh.PortalNexusDestination.BATTLEFRONT"Battlefront"
  • poh.PortalNexusDestination.VARROCK"Varrock"
  • poh.PortalNexusDestination.GRAND_EXCHANGE"Grand Exchange"
  • poh.PortalNexusDestination.MIND_ALTAR"Mind Altar"
  • poh.PortalNexusDestination.LUMBRIDGE"Lumbridge"
  • poh.PortalNexusDestination.FALADOR"Falador"
  • poh.PortalNexusDestination.SALVE_GRAVEYARD"Salve Graveyard"
  • poh.PortalNexusDestination.CAMELOT"Camelot"
  • poh.PortalNexusDestination.SEERS_VILLAGE"Seers' Village"
  • poh.PortalNexusDestination.FENKENSTRAINS_CASTLE"Fenkenstrain's Castle"
  • poh.PortalNexusDestination.EAST_ARDOUGNE"East Ardougne"
  • poh.PortalNexusDestination.WATCHTOWER"Watchtower"
  • poh.PortalNexusDestination.YANILLE"Yanille"
  • poh.PortalNexusDestination.SENNTISTEN"Senntisten"
  • poh.PortalNexusDestination.WEST_ARDOUGNE"West Ardougne"
  • poh.PortalNexusDestination.MARIM"Marim"
  • poh.PortalNexusDestination.HARMONY_ISLAND"Harmony Island"
  • poh.PortalNexusDestination.KHARYRLL"Kharyrll"
  • poh.PortalNexusDestination.KOUREND_CASTLE"Kourend Castle"
  • poh.PortalNexusDestination.LUNAR_ISLE"Lunar Isle"
  • poh.PortalNexusDestination.FORGOTTEN_CEMETERY"The Forgotten Cemetery"
  • poh.PortalNexusDestination.WATERBIRTH_ISLAND"Waterbirth Island"
  • poh.PortalNexusDestination.BARROWS"Barrows"
  • poh.PortalNexusDestination.CARRALLANGER"Carrallanger"
  • poh.PortalNexusDestination.FISHING_GUILD"Fishing Guild"
  • poh.PortalNexusDestination.CATHERBY"Catherby"
  • poh.PortalNexusDestination.ANNAKARL"Annakarl"
  • poh.PortalNexusDestination.APE_ATOLL_DUNGEON"Ape Atoll Dungeon"
  • poh.PortalNexusDestination.GHORROCK"Ghorrock"
  • poh.PortalNexusDestination.WEISS"Weiss"
  • poh.PortalNexusDestination.TROLL_STRONGHOLD"Troll Stronghold"

Stat Restore Objects

Functions to find and interact with restoration pools and altars in the house.

get_prayer_restore

poh:get_prayer_restore() -> LuaGameObject?

Get the nearest prayer restore object (altar or pool that restores prayer).

Returns:

  • LuaGameObject? - The nearest prayer restore GameObject, or nil if not found

Supported Objects:

  • Ornate pool of Rejuvenation
  • Fiery Ornate Pool of Rejuvenation
  • Fancy pool of Rejuvenation
  • Pool of Rejuvenation
  • Pool of Revitalisation
  • Altar

Example:

local prayer_pool = poh:get_prayer_restore()
if prayer_pool then
    prayer_pool:interact("Drink")
    wait_until(function() return skills:prayer() == skills:prayer_max() end, 5000)
end

get_health_restore

poh:get_health_restore() -> LuaGameObject?

Get the nearest health/poison restore object (ornate pool that fully restores health and cures poison).

Returns:

  • LuaGameObject? - The nearest health restore GameObject, or nil if not found

Supported Objects:

  • Ornate pool of Rejuvenation
  • Fiery Ornate Pool of Rejuvenation

Example:

local health_pool = poh:get_health_restore()
if health_pool then
    health_pool:interact("Drink")
    wait_until(function() return skills:health() == skills:health_max() end, 5000)
end

get_energy_restore

poh:get_energy_restore() -> LuaGameObject?

Get the nearest energy restore object (pool that restores run energy).

Returns:

  • LuaGameObject? - The nearest energy restore GameObject, or nil if not found

Supported Objects:

  • Ornate pool of Rejuvenation
  • Fiery Ornate Pool of Rejuvenation
  • Fancy pool of Rejuvenation
  • Pool of Rejuvenation
  • Pool of Revitalisation

Example:

local energy_pool = poh:get_energy_restore()
if energy_pool then
    energy_pool:interact("Drink")
    sleep(1000)
    logger:info("Energy restored")
end

get_special_restore

poh:get_special_restore() -> LuaGameObject?

Get the nearest special attack restore object (pool that restores special attack energy).

Returns:

  • LuaGameObject? - The nearest special restore GameObject, or nil if not found

Supported Objects:

  • Ornate pool of Rejuvenation
  • Fiery Ornate Pool of Rejuvenation
  • Fancy pool of Rejuvenation
  • Pool of Rejuvenation
  • Pool of Revitalisation
  • Pool of Restoration

Example:

local special_pool = poh:get_special_restore()
if special_pool then
    special_pool:interact("Drink")
    sleep(1000)
end

Fairy Ring

The Fairy Ring allows teleportation to various locations using a three-letter code system.

get_fairy_ring

poh:get_fairy_ring(distance?: integer) -> LuaGameObject?

Get the Fairy Ring object within the specified distance.

Parameters:

ParameterTypeRequiredDescription
distanceintegerNoMaximum distance to search in tiles. Defaults to 20.

Returns:

  • LuaGameObject? - The nearest Fairy Ring GameObject, or nil if not found

Example:

local fairy_ring = poh:get_fairy_ring()
if fairy_ring then
    logger:info("Found Fairy Ring")
end

fairy_ring_opened

poh:fairy_ring_opened() -> boolean

Check if the Fairy Ring interface is open.

Returns:

  • boolean - true if the Fairy Ring interface is open

open_fairy_ring

poh:open_fairy_ring() -> boolean

Open the Fairy Ring interface by interacting with the Fairy Ring object.

Returns:

  • boolean - true if the interface was opened successfully

Example:

if not poh:fairy_ring_opened() then
    if poh:open_fairy_ring() then
        logger:info("Fairy Ring opened")
        sleep(500)
    end
end

fairy_ring_teleport

poh:fairy_ring_teleport(destination: string) -> boolean

Teleport using a Fairy Ring with the specified destination code. Opens the interface if needed.

Parameters:

ParameterTypeRequiredDescription
destinationstringYesThe destination code (e.g., "BKS", "DKR", "CIS", "AFL"). The code must be exactly 3 letters.

Returns:

  • boolean - true if the teleport was successful

Example:

-- Teleport to Edgeville (code: DKR)
if poh:fairy_ring_teleport("DKR") then
    logger:info("Teleported via Fairy Ring")
end

-- Common destinations:
-- "BKS" - Mount Karuulm
-- "DKR" - Edgeville
-- "CIS" - Arceuus Library
-- "AFL" - Rellekka
-- "CKR" - Shilo Village
-- "DJP" - Zanaris

Xeric's Talisman

Xeric's Talisman allows teleportation to various locations in Great Kourend.

get_xerics_talisman

poh:get_xerics_talisman(distance?: integer) -> LuaGameObject?

Get Xeric's Talisman object within the specified distance.

Parameters:

ParameterTypeRequiredDescription
distanceintegerNoMaximum distance to search in tiles. Defaults to 20.

Returns:

  • LuaGameObject? - The nearest Xeric's Talisman GameObject, or nil if not found

Example:

local talisman = poh:get_xerics_talisman()
if talisman then
    logger:info("Found Xeric's Talisman")
end

xerics_talisman_opened

poh:xerics_talisman_opened() -> boolean

Check if Xeric's Talisman interface is open.

Returns:

  • boolean - true if the Xeric's Talisman widget is visible

open_xerics_talisman

poh:open_xerics_talisman() -> boolean

Open Xeric's Talisman interface by interacting with the talisman object.

Returns:

  • boolean - true if the interface was opened successfully

Example:

if not poh:xerics_talisman_opened() then
    if poh:open_xerics_talisman() then
        logger:info("Xeric's Talisman opened")
        sleep(500)
    end
end

close_xerics_talisman

poh:close_xerics_talisman() -> boolean

Close Xeric's Talisman interface.

Returns:

  • boolean - true if the interface was closed successfully

xerics_talisman_teleport

poh:xerics_talisman_teleport(destination: string) -> boolean

Teleport using Xeric's Talisman to the specified destination. The interface must be open before calling this.

Parameters:

ParameterTypeRequiredDescription
destinationstringYesThe destination name. Valid destinations:
  • "Xeric's Glade" (or "Glade" or "Xerics Glade")
  • "Xeric's Inferno" (or "Inferno" or "Xerics Inferno")
  • "Xeric's Heart" (or "Heart" or "Xerics Heart")
  • "Xeric's Honour" (or "Honour" or "Xerics Honour")
  • "Nowhere"

Returns:

  • boolean - true if the teleport was successful

Example:

-- Open talisman and teleport
if poh:open_xerics_talisman() then
    sleep(500)
    if poh:xerics_talisman_teleport("Xeric's Lookout") then
        logger:info("Teleported to Xeric's Lookout")
    end
end

Note: You can also use enum values from poh.XericsDestination:

local dest = poh.XericsDestination.LOOKOUT  -- Returns "Xeric's Lookout"
poh:xerics_talisman_teleport(dest)

XericsDestination Enum

The poh.XericsDestination enum contains all available Xeric's Talisman destinations as string values:

  • poh.XericsDestination.LOOKOUT"Xeric's Lookout"
  • poh.XericsDestination.GLADE"Xeric's Glade"
  • poh.XericsDestination.INFERNO"Xeric's Inferno"
  • poh.XericsDestination.HEART"Xeric's Heart"
  • poh.XericsDestination.HONOUR"Xeric's Honour"
  • poh.XericsDestination.NOWHERE"Nowhere"

Common Patterns

Full Stat Restore

local function restore_all_stats()
    if not poh:inside() then
        logger:warn("Not inside house")
        return false
    end
    
    -- Restore prayer
    local prayer_pool = poh:get_prayer_restore()
    if prayer_pool then
        prayer_pool:interact("Drink")
        wait_until(function() return skills:prayer() == skills:prayer_max() end, 5000)
    end
    
    -- Restore health and cure poison
    local health_pool = poh:get_health_restore()
    if health_pool then
        health_pool:interact("Drink")
        wait_until(function() return skills:health() == skills:health_max() end, 5000)
    end
    
    -- Restore energy
    local energy_pool = poh:get_energy_restore()
    if energy_pool then
        energy_pool:interact("Drink")
        sleep(1000)
    end
    
    -- Restore special attack
    local special_pool = poh:get_special_restore()
    if special_pool then
        special_pool:interact("Drink")
        sleep(1000)
    end
    
    return true
end

Teleport and Restore

local function teleport_to_house_and_restore()
    -- Enter house (assuming player is at house portal)
    -- Wait for house to load
    wait_until(function() return poh:inside(true) end, 10000)
    
    if not poh:inside() then
        logger:error("Failed to enter house")
        return false
    end
    
    -- Restore stats
    restore_all_stats()
    
    return true
end

Portal Nexus Teleport Routine

local function teleport_via_nexus(destination)
    -- Ensure we're in the house
    if not poh:inside(true) then
        logger:warn("Not in house, cannot use Portal Nexus")
        return false
    end
    
    -- Open Portal Nexus
    if not poh:portal_nexus_opened() then
        if not poh:open_portal_nexus() then
            logger:error("Failed to open Portal Nexus")
            return false
        end
        sleep(500)
    end
    
    -- Teleport
    if poh:portal_nexus_teleport(destination) then
        logger:info("Teleported to " .. destination)
        return true
    else
        logger:error("Failed to teleport")
        return false
    end
end

-- Usage
teleport_via_nexus("Varrock")

Fairy Ring Teleport Routine

local function teleport_via_fairy_ring(code)
    -- Ensure we're in the house
    if not poh:inside(true) then
        logger:warn("Not in house, cannot use Fairy Ring")
        return false
    end
    
    -- Teleport (opens interface automatically if needed)
    if poh:fairy_ring_teleport(code) then
        logger:info("Teleported via Fairy Ring code: " .. code)
        return true
    else
        logger:error("Failed to teleport via Fairy Ring")
        return false
    end
end

-- Usage
teleport_via_fairy_ring("DKR")  -- Edgeville

House Loading Handler

local function wait_for_house_to_load()
    -- Wait for house loading to complete
    local start_time = os.time()
    while poh:is_loading() do
        sleep(100)
        if os.time() - start_time > 10 then
            logger:error("House loading timed out")
            return false
        end
    end
    
    -- Verify we're actually inside
    if not poh:inside(true) then
        logger:error("Not inside house after loading")
        return false
    end
    
    logger:info("House loaded successfully")
    return true
end

Related APIs

  • Movement API - Player movement and pathfinding
  • Skills API - Check skill levels and experience
  • GameObjects API - Interact with game objects
  • Inventory API - Inventory management