Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

Extend the "Time to Live" of a conversation.

 

Syntax

Code Block
themeRDark
languagejavascript
linenumberstrue
chat.extend(player, ttl);

Parameters

ParameterTypeMandatoryNotesChat Ver
playerNumber(tick)

The ID of the player whose conversation will be extended.

0.1
ttlNumber(error)

Time To Live (TTL) specified in milliseconds.

Default: 15000

0.1

Return Values

ValueTypeNotesChat Ver
<error>ErrorParameters specified were invalid (see error message for details) or the Conversation Handler Function for the player is missing or invalid.0.1
<conversation><cdo>Conversation Descriptor Object

An object describing the conversation with the following properties:

  • fn– the conversation handler function
  • timeout– the real-world time (in ms) when the conversation will expire

The same object is used throughout a game session (does not survive the save/load cycle) so you can use it to store custom properties relating to conversations. Just remember to re-initialise any properties whenever a conversation startsIf the conversation was extended successfully, it's CDO will be returned.

0.1

Example

Code Block
themeRDark
languagejavascript
titleExtend conversation with player 4
linenumberstrue
// conversation with player 4 will be extended for 15 seconds from current time
chat.extend(4);
Div
classbox notice ping

The conversation cannot be extended if the CDO associated with the player has a missing or invalid Conversation Handler Function.

Div
classbox
Availability
Status
colourYellow
titleBeta

Requires:

Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Div
classbox

Chat API

Topics:

Child pages (Children Display)
alltrue
depthall
pageChat API
excerpttrue