(info) This AI is still in early stages of development.

chat.start()

Start a multi-message conversation with a player.

 

Syntax

chat.start(player, fn, ttl);

Parameters

ParameterTypeMandatoryNotesChat Ver
playerNumber(tick)

The ID of the player to start a conversation with.

0.1
fnConversation Handler Function(tick)The function that will be called when the player sends you a message.0.1
ttlNumber(error)

Time To Live (TTL) specified in milliseconds.

Defaults to: 15000

A conversation will expire after this amount of time unless it is extended.

0.1

Return Values

ValueTypeNotesChat Ver
<error>ErrorParameters specified were invalid (see error message for details).0.1
<cdo>Conversation Descriptor Object

The CDO associated with the player (typecasts to true).

0.1

Example

Start a conversation with player 4
// will expire after 15 seconds
chat.start(4, myConvHandlerFn);
 
// will expire after 10 seconds
chat.start(3, myConvHandlerFn, 10000);
Availability BETA

Requires:

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...

Â