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

chat.get()

Get the object associated with a multi-message conversation with a specific player.

 

Syntax

var cdo = chat.get(player);

Parameters

ParameterTypeMandatoryNotesChat Ver
playerNumber(tick)

The ID of the player to retrieve the conversation object for.

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.

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";
Availability BETA

Requires:

Contents

Jump to:

Chat API

Topics: