Feedback
phantom.aj.feedbackThe screen and sound
The feedback form.
Scripts and plugins
A script has all of it, as phantom.aj.feedback, and so does a plugin, from ctx.phantom(): the SDK runs in the plugin's own frame. Each call is marked with what it needs: game:read for what the area knows and hears, which "game": "read" in the manifest grants, and game:act for doing things in it as the player, which needs "game": "act" (see Permissions).
Overview
| Member | What it does | Plugins |
|---|---|---|
close() | Takes the popup down without sending anything, as its close button does. | game:act |
current() | The question on screen now, or null when no feedback popup is up. | game:read |
isOpen() | Whether a feedback popup is on screen (_popup.visible: the client only ever hides it). | game:read |
maxLength() | The most characters an answer to this question may be (maxCharsForType); null before login. | game:read |
open() | Puts a question up for the player to answer, as the orbs about Jamaa do (openFeedbackPopup), and resolves with it once it is on screen. | game:act |
topics() | Every question whose def the client has loaded (_feedbackDefCache): the orbs in rooms the player has walked into, and every popup opened. | game:read |
onOpen() | Hears a question come up, whoever put it there: an orb, one of the game's "tell us" buttons, or open. | game:read |
Methods
close
close(options?: ActOptions) => Promise<void>Takes the popup down without sending anything, as its close button does. Nothing when closed.
Parameters
| Name | Type | |
|---|---|---|
options optional | ActOptions |
Returns
Promise<void>
Types
current
current() => Promise<FeedbackTopic | null>The question on screen now, or null when no feedback popup is up.
Returns
Promise<FeedbackTopic \| null>
Types
isOpen
isOpen() => Promise<boolean>Whether a feedback popup is on screen (_popup.visible: the client only ever hides it).
Returns
Promise<boolean>
maxLength
maxLength(type: number | "items" | "adventure" | "diamond" | "askBrady" | "howl" | "work" | "generic" | "flags" | "pets" | "parties" | "epicItems" | "arcade" | "askTierney" | "donation" | "carnival" | "artStudio" | "jamSession" | "dictionary" | "chatExperience" | "masterpieces" | "askCami" | "askGabby") => Promise<number | null>The most characters an answer to this question may be (maxCharsForType); null before login.
Parameters
| Name | Type | |
|---|---|---|
type | number | "items" | "adventure" | "diamond" | "askBrady" | "howl" | "work" | "generic" | "flags" | "pets" | "parties" | "epicItems" | "arcade" | "askTierney" | "donation" | "carnival" | "artStudio" | "jamSession" | "dictionary" | "chatExperience" | "masterpieces" | "askCami" | "askGabby" |
Returns
Promise<number \| null>
open
open(type: number | "items" | "adventure" | "diamond" | "askBrady" | "howl" | "work" | "generic" | "flags" | "pets" | "parties" | "epicItems" | "arcade" | "askTierney" | "donation" | "carnival" | "artStudio" | "jamSession" | "dictionary" | "chatExperience" | "masterpieces" | "askCami" | "askGabby", options?: ActOptions) => Promise<FeedbackTopic>Puts a question up for the player to answer, as the orbs about Jamaa do (openFeedbackPopup), and resolves with it once it is on screen. A question whose def is not loaded is loaded first; the client then sets most of them up as an orb in the room, as it always does, and the popup is asked for again.
Parameters
| Name | Type | |
|---|---|---|
type | number | "items" | "adventure" | "diamond" | "askBrady" | "howl" | "work" | "generic" | "flags" | "pets" | "parties" | "epicItems" | "arcade" | "askTierney" | "donation" | "carnival" | "artStudio" | "jamSession" | "dictionary" | "chatExperience" | "masterpieces" | "askCami" | "askGabby" | |
options optional | ActOptions |
Returns
Promise<FeedbackTopic>
Types
topics
topics() => Promise<FeedbackTopic[]>Every question whose def the client has loaded (_feedbackDefCache): the orbs in rooms the player has walked into, and every popup opened. Not every question there is.
Returns
Promise<FeedbackTopic[]>
Types
Events
onOpen
onOpen(listener: (topic: { id: number; type: "items" | "adventure" | "diamond" | "askBrady" | "howl" | "work" | "generic" | "flags" | "pets" | "parties" | "epicItems" | "arcade" | "askTierney" | "donation" | "carnival" | "artStudio" | "jamSession" | "dictionary" | "chatExperience" | "masterpieces" | "askCami" | "askGabby" | null; title: string; }) => void) => () => voidHears a question come up, whoever put it there: an orb, one of the game's "tell us" buttons, or open. It never carries what the player goes on to write.
Parameters
| Name | Type | |
|---|---|---|
listener | (topic: { id: number; type: "items" | "adventure" | "diamond" | "askBrady" | "howl" | "work" | "generic" | "flags" | "pets" | "parties" | "epicItems" | "arcade" | "askTierney" | "donation" | "carnival" | "artStudio" | "jamSession" | "dictionary" | "chatExperience" | "masterpieces" | "askCami" | "askGabby" | null; title: string; }) => void |
Returns
() => void. Call it to stop listening.
Types
The types the calls above take and give, with every field. Import any of them in a plugin from @phantomclient/plugin/sdk, or use them as they are in a script.
FeedbackTopic
One question, as the client caches it once its def has loaded, its words translated.
| Field | Type | |
|---|---|---|
id | number | The def's id, the same number as its FEEDBACK_TYPES entry. |
type | "items" | "adventure" | "diamond" | "askBrady" | "howl" | "work" | "generic" | "flags" | "pets" | "parties" | "epicItems" | "arcade" | "askTierney" | "donation" | "carnival" | "artStudio" | "jamSession" | "dictionary" | "chatExperience" | "masterpieces" | "askCami" | "askGabby" | null | |
title | string | The popup's heading. |
prompt | string | The prompt. A popup with a description splits it on |: blurb, then prompt. |
thanks | string | What the popup says once the player has sent their answer. |
allowsImage | boolean | |
seen | boolean | Whether the player has opened this question before, from their own stats. |
ActOptions
How long something that acts may take, and what may end it first.
| Field | Type | |
|---|---|---|
timeoutMs optional | number | undefined | 10 seconds by default. |
signal optional | AbortSignal | undefined |