Item pictures in the interface
phantom.aj.guiItemsThe screen and sound
Item buttons across the client.
Scripts and plugins
A script has all of it, as phantom.aj.guiItems, 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 |
|---|---|---|
screens() | Every screen that has a grid, by the names the filters take. | game:read |
onHover() | Hears the mouse move on to an item window (action: 'over') and off it ('out'). | game:read |
onMembersOnly() | Hears a non-member press what only members may use, which the client answers with an ad. | game:read |
onPress() | Hears the player press an item window. | game:read |
Methods
screens
screens() => GuiItemScreen[]Every screen that has a grid, by the names the filters take.
Returns
GuiItemScreen[]
Types
Events
onHover
onHover(listener: (event: GuiItemEvent) => void, filter?: GuiItemFilter) => () => voidHears the mouse move on to an item window (action: 'over') and off it ('out').
Parameters
| Name | Type | |
|---|---|---|
listener | (event: GuiItemEvent) => void | |
filter optional | GuiItemFilter |
Returns
() => void. Call it to stop listening.
Types
onMembersOnly
onMembersOnly(listener: (event: GuiItemEvent) => void, filter?: GuiItemFilter) => () => voidHears a non-member press what only members may use, which the client answers with an ad.
Parameters
| Name | Type | |
|---|---|---|
listener | (event: GuiItemEvent) => void | |
filter optional | GuiItemFilter |
Returns
() => void. Call it to stop listening.
Types
onPress
onPress(listener: (event: GuiItemEvent) => void, filter?: GuiItemFilter) => () => voidHears the player press an item window.
Parameters
| Name | Type | |
|---|---|---|
listener | (event: GuiItemEvent) => void | |
filter optional | GuiItemFilter |
Returns
() => void. Call it to stop listening.
Types
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.
GuiItemScreen
The screens of the client that list things in a grid, by the names this area gives them.
type GuiItemScreen = | 'achievements'
| 'adventure'
| 'avatarEditor'
| 'avatarSwitcher'
| 'bradyExpeditions'
| 'buddyCard'
| 'buddyList'
| 'chatHistory'
| 'denEditor'
| 'denSwitcher'
| 'fashionShow'
| 'itemSelect'
| 'jamAGramInbox'
| 'jamAGramWriter'
| 'joinGames'
| 'newspaper'
| 'parties'
| 'petCreator'
| 'petInventory'
| 'playerWall'
| 'privateAdventure'
| 'recycle'
| 'referAFriend'
| 'serverSelector'
| 'shop'
| 'trade'
| 'volumeSelector'GuiItemEvent
One thing the player did to an item window.
| Field | Type | |
|---|---|---|
action | GuiItemAction | |
screen | GuiItemScreen | |
handler | string | The client's own handler that heard it, as phantom.flash.hook names it. |
index | number | null | Where the window sits in its grid; null when what was pressed is no item window. |
target | string | null | The name of what was pressed, which says which button it was. |
windowClass | string | null | The item window's class, dotted. |
item | GuiItem | null | What the window showed, or null when it showed nothing. |
stageX | number | |
stageY | number |
GuiItemAction
What the player did to an item window.
type GuiItemAction = 'press' | 'over' | 'out' | 'membersOnly'GuiItem
What an item window shows, as far as the client's own item says. A grid lists whatever its screen is about: clothing, den items and pets have a definition and an inventory slot; a buddy has a user name; a Jam-a-Gram a sender and an id. What the thing listed has not got is null.
| Field | Type | |
|---|---|---|
className | string | null | The client's class for it, dotted: item.Item, den.DenItem, pet.PetItem, buddy.Buddy. |
defId | number | null | |
invIdx | number | null | |
name | string | null | Its name, already in the player's language for an item. |
type | number | null | The client's own type number for it (Item.type, PetItem.type). |
colour | number | null | Its colour, for clothing (Item.color). |
membersOnly | boolean | null | |
userName | string | null | Whose it is, for a buddy or a Jam-a-Gram's sender. |
messageId | number | null | A Jam-a-Gram's id (ECard.msgId). |
GuiItemFilter
Which grids to hear. Every screen with a grid when left out; what is left out is never hooked.
| Field | Type | |
|---|---|---|
screens optional | readonly GuiItemScreen[] | undefined |