This AI is still in early stages of development.
chat.get()
Owned by Aubergine
Get the object associated with a multi-message conversation with a specific player.
Syntax
var cdo = chat.get(player);
Parameters
Parameter | Type | Mandatory | Notes | Chat Ver |
---|---|---|---|---|
player | Number | The ID of the player to retrieve the conversation object for. | 0.1 |
Return Values
Value | Type | Notes | Chat Ver |
---|---|---|---|
<error> | Error | Parameters specified were invalid (see error message for details). | 0.1 |
<cdo> | Conversation Descriptor Object | The CDO associated with the player. | 0.1 |
Example
Get conversation object for player 4
var p4cdo = chat.get(4); // get player 4's conversation object if (now < p4cdo.timeout) { // conversation still active } // better way to check if not expired: if (chat.isActive(4)) { // conversation still active } p4cdo.message; // most recent message from player // set a different function to handle this conversation p4cdo.fn = someNewHandlerFn; // add custom "foo" property with value "bar". p4cdo.foo = "bar";
Contents
Jump to:
Chat API
Topics:
- Chat API Diagnostics — The Chat API provides the following diagnostic routines...
- Conversation Descriptor Object — Each player is assigned a Conversation Descriptor Object that defines the current state of their chat conversation...
- Conversation Mode — Quick start guide for making and using conversations...
- chat.isActive() — Determine conversation state for a specific player.
- chat.get() — Get the object associated with a multi-message conversation with a specific player.
- chat.stop() — Stop a conversation with a specific player.
- chat.extend() — Extend the "Time to Live" of the most recent conversation with a player.
- Conversation Handler Functions — How to define a conversation handler function....
- chat.start() — Start a multi-message conversation with a player.
- Command Mode — Quick start guide for creating and using commands...
- Command Handler Functions — How to define a command handler function....
- chat.on() — Define a chat command and it's handler function.