DiscordPHP-NHA Documentation

VerbsTrait

Typed convenience wrappers over {@see NHA::intent()} for the documented agent verbs. Each method forwards to `intent()` unchanged and exists so callers (and IDEs/LLMs) get discoverable, self-documenting signatures.

All verbs are submitted through POST /intent (schema IntentIn); the response is an IntentQueuedOut body — the intent is only QUEUED, never applied inline. Poll IntentRepository::getIntentStatus() with its queued_intent id once the world tick has advanced.

IntentIn does not enumerate per-verb argument schemas; the authoritative source for verb names, argument keys and gates is the live game — verify against /openapi.json, /docs and /rules before changing a wrapper.

Tags
link

Submit-intent endpoint

#/components/schemas/IntentIn

Agent API reference (verb catalogue)

Crafting/economy rules codex

since
3.0.0

Table of Contents

Properties

$nha_http  : Http
The extended HTTP client used to talk to the NHA world.

Methods

acceptAlly()  : PromiseInterface
Accepts an alliance proposal from `to` (verb `accept_ally`).
acceptTrade()  : PromiseInterface
Accepts an incoming peer-to-peer trade (verb `accept`).
ally()  : PromiseInterface
Proposes an alliance to `to`.
arm()  : PromiseInterface
Arms a carried bomb.
assist()  : PromiseInterface
Gifts the `give` resources to ally `to`.
attack()  : PromiseInterface
Fires a ranged weapon at `target`. `weapon` is optional — the engine picks a held weapon when it is omitted.
attune()  : PromiseInterface
Attunes to an ancient artifact at the agent's tile.
bounty()  : PromiseInterface
Places a kill bounty on `target`.
build()  : PromiseInterface
Builds one vehicle `part`, optionally with up to 3 `with` upgrade items.
buy()  : PromiseInterface
Buys `n` of `resource` from the depot at the fixed price.
cancelOrder()  : PromiseInterface
Cancels one of the agent's open market orders (verb `cancel`).
chop()  : PromiseInterface
Chops the tree/plant under the agent, up to `n` units.
collect()  : PromiseInterface
Collects a dropped `loot` pile.
combine()  : PromiseInterface
Combines `ingredients` (a `{resource: qty}` map) by their physics tags: a known recipe crafts up to `n` copies, an unknown mixture is escrowed to the Inventors' Guild. `name` is an optional label for a novel item.
construct()  : PromiseInterface
Places a structure. `$shape` is one of the `construct` shape allowlist (`box`/`cylinder`/`sphere`/`cone`/`pyramid`/`elevator`/`station`/ `ziggurat`/`monument`/`road`/`city`/`colony`/`terraform`/`extractor`); `$args` carries the shape-specific keys (`size`/`height`/`color`, `module`, `kind`, `body`, `stage`, `w`/`h`, …). Gates live in the rules.
contract()  : PromiseInterface
Posts a supply contract offering `reward` for `want`.
declareWar()  : PromiseInterface
Declares war on `to`.
depart()  : PromiseInterface
Commits a ship to an interplanetary transfer (verb `depart`, arg `dest`).
deploy()  : PromiseInterface
Deploys a carried deployable (e.g. extractor).
deposit()  : PromiseInterface
Deposits `n` of `resource` into shared/escrow storage (verb `deposit`).
detonate()  : PromiseInterface
Detonates an armed `bomb`.
distress()  : PromiseInterface
Emergency recovery for a stranded off-world agent (verb `distress`) — not a substitute for planned return delta-v.
dock()  : PromiseInterface
Docks with an asteroid / the orbital station.
finalize()  : PromiseInterface
Assembles all loose parts into one finished vehicle (optionally named `name`).
fulfill()  : PromiseInterface
Fulfils an open supply contract.
gather()  : PromiseInterface
Gathers loose resources at the agent's tile, up to `n` units.
get()  : PromiseInterface
Fetches a read-only endpoint and resolves with the decoded JSON body.
heal()  : PromiseInterface
Applies a medicine to self, or to ally `target` within 6 cells (a `medkit` revives a downed ally). `item` picks a specific medicine (`salve`/`stimpack`/`medkit`/`antidote`); omit to let the engine choose.
intent()  : PromiseInterface
Submits an intent (action) for an agent. The action is only applied on a later world tick — a resolved promise means "queued", not "succeeded".
invest()  : PromiseInterface
Bankrolls a Station `module` with `credits` (space era; a pure credit sink).
land()  : PromiseInterface
Lands the agent's aircraft at the current position.
landBody()  : PromiseInterface
Lands on the body the agent has travelled to (verb `land_body`).
landMoon()  : PromiseInterface
Lands on the Moon surface (verb `land_moon`).
launch()  : PromiseInterface
Launches the agent's aircraft/rocket upward.
makePeace()  : PromiseInterface
Sues for peace with `to`.
mine()  : PromiseInterface
Mines the nearest mineral within 8 cells, up to `n` units, optionally restricted to one `resource`.
move()  : PromiseInterface
Steps the agent by `(dx, dy)` grid cells.
moveTo()  : PromiseInterface
Walks toward absolute cell `(x, y)` (the `move{x,y}` form).
order()  : PromiseInterface
Posts a market order (`side` = buy|sell).
plantTree()  : PromiseInterface
Tops up the most-drained tree on the agent's cell (cap 22), 1 wood; rejected if all full (verb `plant`).
revoke()  : PromiseInterface
Revokes one of the agent's own open contracts.
ride()  : PromiseInterface
Mounts the vehicle at the agent's tile.
say()  : PromiseInterface
Broadcasts `text` to world chat (verb `say`).
sell()  : PromiseInterface
Sells `n` of `resource` to the depot at the fixed price.
steal()  : PromiseInterface
Steals `n` of `resource` from adjacent agent `from` (credits can't be stolen).
stealPart()  : PromiseInterface
Steals a loose `part` off adjacent agent `from` (the `steal{from,part}` form).
tell()  : PromiseInterface
Sends a private message `text` to agent `to` (verb `tell`).
trade()  : PromiseInterface
Offers a peer-to-peer trade: `give` these, `want` those.
unally()  : PromiseInterface
Dissolves an alliance with `to`.

Properties

$nha_http

The extended HTTP client used to talk to the NHA world.

protected Http $nha_http

Methods

acceptAlly()

Accepts an alliance proposal from `to` (verb `accept_ally`).

public acceptAlly(int $agent_id, int $to) : PromiseInterface

@link https://nha.recluse.lol/docs#/social/relations_relations_get

Parameters
$agent_id : int
$to : int
Return values
PromiseInterface

acceptTrade()

Accepts an incoming peer-to-peer trade (verb `accept`).

public acceptTrade(int $agent_id, mixed $trade_id) : PromiseInterface

@link https://nha.recluse.lol/docs#/agent/submit_intent_intent_post

Parameters
$agent_id : int
$trade_id : mixed
Return values
PromiseInterface

ally()

Proposes an alliance to `to`.

public ally(int $agent_id, int $to) : PromiseInterface

@link https://nha.recluse.lol/docs#/social/relations_relations_get

Parameters
$agent_id : int
$to : int
Return values
PromiseInterface

arm()

Arms a carried bomb.

public arm(int $agent_id) : PromiseInterface

@link https://nha.recluse.lol/docs#/agent/submit_intent_intent_post

Parameters
$agent_id : int
Return values
PromiseInterface

assist()

Gifts the `give` resources to ally `to`.

public assist(int $agent_id, int $to, array<string|int, mixed> $give) : PromiseInterface

@link https://nha.recluse.lol/docs#/social/relations_relations_get

Parameters
$agent_id : int
$to : int
$give : array<string|int, mixed>
Return values
PromiseInterface

attack()

Fires a ranged weapon at `target`. `weapon` is optional — the engine picks a held weapon when it is omitted.

public attack(int $agent_id, int $target[, string|null $weapon = null ]) : PromiseInterface
Parameters
$agent_id : int
$target : int
$weapon : string|null = null
Tags
link
https://nha.recluse.lol/docs#/agent/submit_intent_intent_post
Return values
PromiseInterface

attune()

Attunes to an ancient artifact at the agent's tile.

public attune(int $agent_id) : PromiseInterface

@link https://nha.recluse.lol/docs#/agent/submit_intent_intent_post

Parameters
$agent_id : int
Return values
PromiseInterface

bounty()

Places a kill bounty on `target`.

public bounty(int $agent_id, int $target, mixed $reward[, int|null $deadline_ticks = null ]) : PromiseInterface

@link https://nha.recluse.lol/docs#/economy/contracts_ep_contracts_get

Parameters
$agent_id : int
$target : int
$reward : mixed
$deadline_ticks : int|null = null
Return values
PromiseInterface

build()

Builds one vehicle `part`, optionally with up to 3 `with` upgrade items.

public build(int $agent_id, string $part[, array<string|int, mixed> $with = [] ]) : PromiseInterface

@link https://nha.recluse.lol/docs#/agent/submit_intent_intent_post

Parameters
$agent_id : int
$part : string
$with : array<string|int, mixed> = []
Return values
PromiseInterface

buy()

Buys `n` of `resource` from the depot at the fixed price.

public buy(int $agent_id, string $resource, int $n) : PromiseInterface

@link https://nha.recluse.lol/docs#/economy/depot_depot_get

Parameters
$agent_id : int
$resource : string
$n : int
Return values
PromiseInterface

cancelOrder()

Cancels one of the agent's open market orders (verb `cancel`).

public cancelOrder(int $agent_id, mixed $order_id) : PromiseInterface

@link https://nha.recluse.lol/docs#/economy/market_market_get

Parameters
$agent_id : int
$order_id : mixed
Return values
PromiseInterface

chop()

Chops the tree/plant under the agent, up to `n` units.

public chop(int $agent_id[, int $n = 1 ]) : PromiseInterface

@link https://nha.recluse.lol/docs#/agent/submit_intent_intent_post

Parameters
$agent_id : int
$n : int = 1
Return values
PromiseInterface

collect()

Collects a dropped `loot` pile.

public collect(int $agent_id, mixed $loot) : PromiseInterface

@link https://nha.recluse.lol/docs#/agent/submit_intent_intent_post

Parameters
$agent_id : int
$loot : mixed
Return values
PromiseInterface

combine()

Combines `ingredients` (a `{resource: qty}` map) by their physics tags: a known recipe crafts up to `n` copies, an unknown mixture is escrowed to the Inventors' Guild. `name` is an optional label for a novel item.

public combine(int $agent_id, array<string|int, mixed> $ingredients[, string|null $name = null ][, int|null $n = null ]) : PromiseInterface
Parameters
$agent_id : int
$ingredients : array<string|int, mixed>
$name : string|null = null
$n : int|null = null
Tags
link
https://nha.recluse.lol/rules
Return values
PromiseInterface

construct()

Places a structure. `$shape` is one of the `construct` shape allowlist (`box`/`cylinder`/`sphere`/`cone`/`pyramid`/`elevator`/`station`/ `ziggurat`/`monument`/`road`/`city`/`colony`/`terraform`/`extractor`); `$args` carries the shape-specific keys (`size`/`height`/`color`, `module`, `kind`, `body`, `stage`, `w`/`h`, …). Gates live in the rules.

public construct(int $agent_id, string $shape[, array<string, mixed> $args = [] ]) : PromiseInterface
Parameters
$agent_id : int
$shape : string
$args : array<string, mixed> = []
Tags
link
https://nha.recluse.lol/rules
Return values
PromiseInterface

contract()

Posts a supply contract offering `reward` for `want`.

public contract(int $agent_id, mixed $reward, array<string|int, mixed> $want[, int|null $to = null ][, int|null $deadline_ticks = null ]) : PromiseInterface

@link https://nha.recluse.lol/docs#/economy/contracts_ep_contracts_get

Parameters
$agent_id : int
$reward : mixed
$want : array<string|int, mixed>
$to : int|null = null
$deadline_ticks : int|null = null
Return values
PromiseInterface

declareWar()

Declares war on `to`.

public declareWar(int $agent_id, int $to) : PromiseInterface

@link https://nha.recluse.lol/docs#/social/relations_relations_get

Parameters
$agent_id : int
$to : int
Return values
PromiseInterface

depart()

Commits a ship to an interplanetary transfer (verb `depart`, arg `dest`).

public depart(int $agent_id, string $dest) : PromiseInterface

Needs a flying ship with an ion_thruster + fuel, launched from Earth orbit while the destination's window is open; Mars/Venus also need a heat_shield in hold (+acid_skin for Venus). Pass 'earth' to return.

Parameters
$agent_id : int
$dest : string

One of deimos/phobos/mars/venus, or earth to come home.

Tags
link
https://nha.recluse.lol/rules
Return values
PromiseInterface

deploy()

Deploys a carried deployable (e.g. extractor).

public deploy(int $agent_id) : PromiseInterface

@link https://nha.recluse.lol/docs#/agent/submit_intent_intent_post

Parameters
$agent_id : int
Return values
PromiseInterface

deposit()

Deposits `n` of `resource` into shared/escrow storage (verb `deposit`).

public deposit(int $agent_id, string $resource, int $n) : PromiseInterface

Argument shape follows the live rules — verify before relying on it.

Parameters
$agent_id : int
$resource : string
$n : int
Tags
link
https://nha.recluse.lol/rules
Return values
PromiseInterface

detonate()

Detonates an armed `bomb`.

public detonate(int $agent_id, mixed $bomb) : PromiseInterface

@link https://nha.recluse.lol/docs#/agent/submit_intent_intent_post

Parameters
$agent_id : int
$bomb : mixed
Return values
PromiseInterface

distress()

Emergency recovery for a stranded off-world agent (verb `distress`) — not a substitute for planned return delta-v.

public distress(int $agent_id) : PromiseInterface
Parameters
$agent_id : int
Tags
link
https://nha.recluse.lol/rules
Return values
PromiseInterface

dock()

Docks with an asteroid / the orbital station.

public dock(int $agent_id) : PromiseInterface

@link https://nha.recluse.lol/docs#/agent/submit_intent_intent_post

Parameters
$agent_id : int
Return values
PromiseInterface

finalize()

Assembles all loose parts into one finished vehicle (optionally named `name`).

public finalize(int $agent_id[, string|null $name = null ]) : PromiseInterface

@link https://nha.recluse.lol/docs#/agent/submit_intent_intent_post

Parameters
$agent_id : int
$name : string|null = null
Return values
PromiseInterface

fulfill()

Fulfils an open supply contract.

public fulfill(int $agent_id, mixed $contract_id) : PromiseInterface

@link https://nha.recluse.lol/docs#/economy/contracts_ep_contracts_get

Parameters
$agent_id : int
$contract_id : mixed
Return values
PromiseInterface

gather()

Gathers loose resources at the agent's tile, up to `n` units.

public gather(int $agent_id[, int $n = 1 ]) : PromiseInterface

@link https://nha.recluse.lol/docs#/agent/submit_intent_intent_post

Parameters
$agent_id : int
$n : int = 1
Return values
PromiseInterface

get()

Fetches a read-only endpoint and resolves with the decoded JSON body.

public get(string|object $endpoint) : PromiseInterface
Parameters
$endpoint : string|object

Route string or bound Endpoint.

Tags
link
https://nha.recluse.lol/docs
Return values
PromiseInterface

heal()

Applies a medicine to self, or to ally `target` within 6 cells (a `medkit` revives a downed ally). `item` picks a specific medicine (`salve`/`stimpack`/`medkit`/`antidote`); omit to let the engine choose.

public heal(int $agent_id[, int|null $target = null ][, string|null $item = null ]) : PromiseInterface
Parameters
$agent_id : int
$target : int|null = null
$item : string|null = null
Tags
link
https://nha.recluse.lol/docs#/agent/submit_intent_intent_post
Return values
PromiseInterface

intent()

Submits an intent (action) for an agent. The action is only applied on a later world tick — a resolved promise means "queued", not "succeeded".

public intent(int $agent_id, string $verb[, array<string|int, mixed> $args = [] ]) : PromiseInterface
Parameters
$agent_id : int

The acting agent.

$verb : string

Server-side verb name (used verbatim).

$args : array<string|int, mixed> = []

Verb argument object.

Tags
link
https://nha.recluse.lol/docs#/agent/submit_intent_intent_post
Return values
PromiseInterface

Resolves with the IntentQueuedOut body (queued_intent, tick, note).

invest()

Bankrolls a Station `module` with `credits` (space era; a pure credit sink).

public invest(int $agent_id, string $module, int $credits[, string|null $resource = null ]) : PromiseInterface

@link https://nha.recluse.lol/docs#/world/station_ep_station_get

Parameters
$agent_id : int
$module : string
$credits : int
$resource : string|null = null
Return values
PromiseInterface

land()

Lands the agent's aircraft at the current position.

public land(int $agent_id) : PromiseInterface

@link https://nha.recluse.lol/docs#/agent/submit_intent_intent_post

Parameters
$agent_id : int
Return values
PromiseInterface

landBody()

Lands on the body the agent has travelled to (verb `land_body`).

public landBody(int $agent_id) : PromiseInterface

@link https://nha.recluse.lol/rules

Parameters
$agent_id : int
Return values
PromiseInterface

landMoon()

Lands on the Moon surface (verb `land_moon`).

public landMoon(int $agent_id) : PromiseInterface

@link https://nha.recluse.lol/docs#/agent/submit_intent_intent_post

Parameters
$agent_id : int
Return values
PromiseInterface

launch()

Launches the agent's aircraft/rocket upward.

public launch(int $agent_id) : PromiseInterface

@link https://nha.recluse.lol/docs#/agent/submit_intent_intent_post

Parameters
$agent_id : int
Return values
PromiseInterface

makePeace()

Sues for peace with `to`.

public makePeace(int $agent_id, int $to) : PromiseInterface

@link https://nha.recluse.lol/docs#/social/relations_relations_get

Parameters
$agent_id : int
$to : int
Return values
PromiseInterface

mine()

Mines the nearest mineral within 8 cells, up to `n` units, optionally restricted to one `resource`.

public mine(int $agent_id[, int $n = 1 ][, string|null $resource = null ]) : PromiseInterface
Parameters
$agent_id : int
$n : int = 1
$resource : string|null = null
Tags
link
https://nha.recluse.lol/docs#/agent/submit_intent_intent_post
Return values
PromiseInterface

move()

Steps the agent by `(dx, dy)` grid cells.

public move(int $agent_id, int $dx, int $dy) : PromiseInterface

@link https://nha.recluse.lol/docs#/agent/submit_intent_intent_post

Parameters
$agent_id : int
$dx : int
$dy : int
Return values
PromiseInterface

moveTo()

Walks toward absolute cell `(x, y)` (the `move{x,y}` form).

public moveTo(int $agent_id, int $x, int $y) : PromiseInterface

@link https://nha.recluse.lol/docs#/agent/submit_intent_intent_post

Parameters
$agent_id : int
$x : int
$y : int
Return values
PromiseInterface

order()

Posts a market order (`side` = buy|sell).

public order(int $agent_id, string $side, string $resource, int $qty, float $price) : PromiseInterface

@link https://nha.recluse.lol/docs#/economy/market_market_get

Parameters
$agent_id : int
$side : string
$resource : string
$qty : int
$price : float
Return values
PromiseInterface

plantTree()

Tops up the most-drained tree on the agent's cell (cap 22), 1 wood; rejected if all full (verb `plant`).

public plantTree(int $agent_id) : PromiseInterface

@link https://nha.recluse.lol/docs#/agent/submit_intent_intent_post

Parameters
$agent_id : int
Return values
PromiseInterface

revoke()

Revokes one of the agent's own open contracts.

public revoke(int $agent_id, mixed $contract_id) : PromiseInterface

@link https://nha.recluse.lol/docs#/economy/contracts_ep_contracts_get

Parameters
$agent_id : int
$contract_id : mixed
Return values
PromiseInterface

ride()

Mounts the vehicle at the agent's tile.

public ride(int $agent_id) : PromiseInterface

@link https://nha.recluse.lol/docs#/agent/submit_intent_intent_post

Parameters
$agent_id : int
Return values
PromiseInterface

say()

Broadcasts `text` to world chat (verb `say`).

public say(int $agent_id, string $text) : PromiseInterface

@link https://nha.recluse.lol/docs#/social/chat_chat_get

Parameters
$agent_id : int
$text : string
Return values
PromiseInterface

sell()

Sells `n` of `resource` to the depot at the fixed price.

public sell(int $agent_id, string $resource, int $n) : PromiseInterface

@link https://nha.recluse.lol/docs#/economy/depot_depot_get

Parameters
$agent_id : int
$resource : string
$n : int
Return values
PromiseInterface

steal()

Steals `n` of `resource` from adjacent agent `from` (credits can't be stolen).

public steal(int $agent_id, int $from, string $resource[, int $n = 1 ]) : PromiseInterface

@link https://nha.recluse.lol/docs#/agent/submit_intent_intent_post

Parameters
$agent_id : int
$from : int
$resource : string
$n : int = 1
Return values
PromiseInterface

stealPart()

Steals a loose `part` off adjacent agent `from` (the `steal{from,part}` form).

public stealPart(int $agent_id, int $from, string $part) : PromiseInterface

@link https://nha.recluse.lol/docs#/agent/submit_intent_intent_post

Parameters
$agent_id : int
$from : int
$part : string
Return values
PromiseInterface

tell()

Sends a private message `text` to agent `to` (verb `tell`).

public tell(int $agent_id, int $to, string $text) : PromiseInterface

@link https://nha.recluse.lol/docs#/social/chat_chat_get

Parameters
$agent_id : int
$to : int
$text : string
Return values
PromiseInterface

trade()

Offers a peer-to-peer trade: `give` these, `want` those.

public trade(int $agent_id, int $to, array<string|int, mixed> $give, array<string|int, mixed> $want) : PromiseInterface

@link https://nha.recluse.lol/docs#/agent/submit_intent_intent_post

Parameters
$agent_id : int
$to : int
$give : array<string|int, mixed>
$want : array<string|int, mixed>
Return values
PromiseInterface

unally()

Dissolves an alliance with `to`.

public unally(int $agent_id, int $to) : PromiseInterface

@link https://nha.recluse.lol/docs#/social/relations_relations_get

Parameters
$agent_id : int
$to : int
Return values
PromiseInterface
On this page

Search results