Versions Compared

Key

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

Message output handler.

 

Syntax

Code Block
themeRDark
languagejavascript
linenumberstrue
out(message[, self[, method[, config]]]);

Parameters

ParameterTypeMandatoryDescriptionAPI Version
message

String

Array of String

(tick)

The message to output – either a single string or an array of strings.

1.0
selfSelf Descriptor Object(error)

Optional descriptor object, used to create a prefix to the message before it is output.

Default: No prefix

1.0
methodConstant(error)

Constant defining desired output destination:

Child pages (Children Display)
excerpttrue

Default: out.DEFAULT

1.0
configVariant(error)

Optional method-specific config:

  • If using method out.CHAT, config can be either a specific player ID, ALLIES or ALLIES ALL_PLAYERS. Defaults to ALLIES.
  • If using method out.ERROR, config can specify a specific error class to use (eg. TypeError). Default: Error
  • If using method out.ASSERT, config is the value being asserted
1.0

Return value

The return value of the output method will be returned (see documentation for out.* constants above for more information).

Example

Code Block
themeRDark
languagejavascript
titleOutput single line of text to console
linenumberstrue
var self = {file: "foo.js", ver: 1.2};
 
out("hello", self, out.CONSOLE); // "[foo.js v1.2] hello"
Code Block
themeRDark
languagejavascript
titleMulti-line output
linenumberstrue
out(["bob", "jim", "kate"]); // outputs each name on a new line to out.DEFAULT
Div
classbox
Availability
Status
colourGreen
titleStable

This feature requires:

Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Div
classbox

See also

Related articles:

Related APIs:

  • Chat API – allows scripts to define chat commands and conversations.
  • Diag API – allows scripts to provide diagnostic routines.
Div
classbox

Globals

Topics:

Child pages (Children Display)
alltrue
depthall
pageGlobals
excerpttrue