Listen Tags
Listen tags are tags that can receive shouts and whispers from other bots and actions that happen from the user. To create a listen tag, you make a normal tag and enter a "@" as the first character of the tag's value.
Each listen tag has some predefined variables that can be used. You can read about those here.
Whisper Tags
Whispers are shouts that are sent to specific bots instead of all bots.
@onCreate
A whisper that is sent to a bot when it is first created.
@onDestroy
A whisper that is sent to a bot when it is being destroyed.
@onModDrop
A whisper that is sent to a bot that a mod was dropped on.
If a custom @onModDrop
is not specified, then the mod will be applied automatically.
If a custom @onModDrop
is specified, then the mod needs to be applied manually via applyMod(bot, ...mods)
.
Arguments:
interface Mod {
[tag: string]: any;
}
let that: {
mod: Mod
};
@onModDropEnter
A whisper that is sent to the bot that a mod started to be dragged onto.
Arguments:
let that: {
mod: Mod,
dimension: string
};
@onModDropExit
A whisper that is sent to the bot that a mod was just dragged off of.
Arguments:
let that: {
mod: Mod,
dimension: string
};
@onClick
A whisper that is sent to the bot that was clicked.
Arguments:
let that: {
/**
* The face of the bot that was clicked.
*/
face: 'left' | 'right' | 'front' | 'back' | 'top' | 'bottom';
/**
* The dimension that the bot was clicked in.
*/
dimension: string;
/**
* The UV Coordinates that were clicked on the bot.
*/
uv: Vector2;
/**
* The modality that was used to click the bot.
*
* - `mouse` - The mouse was used to click the bot.
* - `touch` - A touch screen was used to click the bot.
* - `controller` - A XR controller was used to click the bot.
* - `finger` - A finger was used to click the bot in XR.
*/
modality: 'mouse' | 'touch' | 'controller' | 'finger';
/**
* For "finger" modalities, which hand was used to click the bot.
*/
hand: 'left' | 'right';
/**
* For "finger" modalities, which finger was used to click the bot.
*/
finger: 'index' | 'middle' | 'ring' | 'pinky' | 'thumb' | 'unknown';
/**
* For "mouse" modalities, which button was used to click the bot.
*/
buttonId: 'left' | 'middle' | 'right';
};
@onKeyClick
A whisper that is sent to the bot when a key is clicked on it.
This event will only be available for bots that have their #form
set to keyboard
.
Arguments:
let that: {
key: string
};
@onPointerEnter
A whisper that is sent to a bot when the mouse cursor starts to hover over it.
Arguments:
let that: {
/**
* The bot that the pointer hovered.
*/
bot: Bot;
/**
* The dimension that the bot was hovered in.
*/
dimension: string;
/**
* The modality that was used to hover over the bot.
*
* - `mouse` - The mouse was used to hover over the bot.
* - `touch` - A touch screen was used to hover over the bot.
* - `controller` - A XR controller was used to hover over the bot.
* - `finger` - A finger was used to hover over the bot in XR.
*/
modality: 'mouse' | 'touch' | 'controller' | 'finger';
/**
* For "finger" modalities, which hand was used to hover over the bot.
*/
hand: 'left' | 'right';
/**
* For "finger" modalities, which finger was used to hover over the bot.
*/
finger: 'index' | 'middle' | 'ring' | 'pinky' | 'thumb' | 'unknown';
/**
* For "mouse" modalities, which button was used to hover over the bot.
*/
buttonId: 'left' | 'middle' | 'right';
};
@onPointerExit
A whisper that is sent to a bot when the mouse cursor stops hovering over it.
Arguments:
let that: {
/**
* The bot that the pointer hovered.
*/
bot: Bot;
/**
* The dimension that the bot was hovered in.
*/
dimension: string;
/**
* The modality that was used to hover over the bot.
*
* - `mouse` - The mouse was used to hover over the bot.
* - `touch` - A touch screen was used to hover over the bot.
* - `controller` - A XR controller was used to hover over the bot.
* - `finger` - A finger was used to hover over the bot in XR.
*/
modality: 'mouse' | 'touch' | 'controller' | 'finger';
/**
* For "finger" modalities, which hand was used to hover over the bot.
*/
hand: 'left' | 'right';
/**
* For "finger" modalities, which finger was used to hover over the bot.
*/
finger: 'index' | 'middle' | 'ring' | 'pinky' | 'thumb' | 'unknown';
/**
* For "mouse" modalities, which button was used to hover over the bot.
*/
buttonId: 'left' | 'middle' | 'right';
};
@onPointerDown
A whipser that is sent to a bot when the user starts clicking it.
Arguments:
let that: {
/**
* The bot that the pointer started clicking.
*/
bot: Bot;
/**
* The dimension that the bot was clicked in.
*/
dimension: string;
/**
* The modality that was used to click the bot.
*
* - `mouse` - The mouse was used to click the bot.
* - `touch` - A touch screen was used to click the bot.
* - `controller` - A XR controller was used to click the bot.
* - `finger` - A finger was used to click the bot in XR.
*/
modality: 'mouse' | 'touch' | 'controller' | 'finger';
/**
* For "finger" modalities, which hand was used to click the bot.
*/
hand: 'left' | 'right';
/**
* For "finger" modalities, which finger was used to click the bot.
*/
finger: 'index' | 'middle' | 'ring' | 'pinky' | 'thumb' | 'unknown';
/**
* For "mouse" modalities, which button was used to click the bot.
*/
buttonId: 'left' | 'middle' | 'right';
};
@onPointerUp
A whisper that is sent to a bot when the user stops clicking it.
Arguments:
let that: {
/**
* The bot that the pointer stopped clicking.
*/
bot: Bot;
/**
* The dimension that the bot was clicked in.
*/
dimension: string;
/**
* The modality that was used to click the bot.
*
* - `mouse` - The mouse was used to click the bot.
* - `touch` - A touch screen was used to click the bot.
* - `controller` - A XR controller was used to click the bot.
* - `finger` - A finger was used to click the bot in XR.
*/
modality: 'mouse' | 'touch' | 'controller' | 'finger';
/**
* For "finger" modalities, which hand was used to click the bot.
*/
hand: 'left' | 'right';
/**
* For "finger" modalities, which finger was used to click the bot.
*/
finger: 'index' | 'middle' | 'ring' | 'pinky' | 'thumb' | 'unknown';
/**
* For "mouse" modalities, which button was used to click the bot.
*/
buttonId: 'left' | 'middle' | 'right';
};
@onDrag
A whisper that is sent whenever a bot is starting to be dragged.
Arguments:
let that: {
bot: Bot,
face: 'left' | 'right' | 'front' | 'back' | 'top' | 'bottom',
from: {
x: number,
y: number,
dimension: string
},
uv: Vector2
};
@onDragging
A whisper that is sent whenever a bot would be moved while dragging.
Note that this whisper is only sent for drag operations that have called os.enableCustomDragging()
.
Arguments:
let that: {
bot: Bot,
to: {
x: number,
y: number,
bot: Bot,
dimension: string
},
from: {
x: number,
y: number,
dimension: string
}
};
@onDrop
A whisper that is sent whenever a bot has been dropped after being dragged. The whisper is sent to both the bot that was dropped and the bot that was dropped on.
Arguments
let that: {
bot: Bot,
to: {
bot: Bot,
x: number,
y: number,
dimension: string
},
from: {
x: number,
y: number,
dimension: string
}
};
@onDropEnter
A whisper that is sent to both bots when a bot is dragged onto another bot.
Arguments
let that: {
dragBot: Bot,
to: {
bot: Bot,
x: number,
y: number,
dimension: string
},
from: {
x: number,
y: number,
dimension: string
}
};
@onDropExit
A whisper that is sent to both bots when a bot is dragged off of another bot.
Arguments
let that: {
dragBot: Bot,
to: {
bot: Bot,
x: number,
y: number,
dimension: string
},
from: {
x: number,
y: number,
dimension: string
}
};
@onSaveInput
A whisper that is sent when the input box for a bot has been changed by the user.
Arguments:
let that = null;
@onCloseInput
A whisper that is sent when the input box for a bot has been closed by the user.
Arguments:
let that = null;
@onListen
A whisper that is sent whenever this bot receives a whisper or shout.