Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Excerpt

Message output handler.

 

Syntax

Code Block
themeRDark
languagejavascript
linenumberstrue
uOut(sMsg_aMsg, oSelf, cOutout(message[, sdo[, method[, config]]]);

Parameters

sMsg_aMsg
ParameterTypeMandatoryDescriptionUtil.js versionAPI Version
message

String

Array of String

(tick)

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

1.0.8
oSelfsdoSelf Descriptor Object(error)

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

Example object: {file: "foo.js", ver: 1.2}

0.8cOut

If you're using the method or config params, but don't want to use an SDO, specify null.

Default: No prefix

1.0
methodConstant(error)

Constant defining desired output destination:

Child pages (Children Display)
excerpttrue

Default: OUT_out.DEFAULT

1.0.8
configVariant(error)

Optional method-specific config:

  • If using method out.CHAT, config can be either a specific player ID, ALLIES or 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_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};
  function bar() {
  uOut("bar() called
out("hello", self, OUT_out.CONSOLE); }
 
bar(); // "[foo.js v1.2] bar() calledhello"
Code Block
themeRDark
languagejavascript
titleMulti-line output
linenumberstrue
function foo() {
  var names = out(["bob", "jim", "kate"];
  uOut(names); }
 
foo(); // outputs each of thename names on a new line to OUT_out.DEFAULT
Div
classbox
Availability
Status
colourGreen
titleStable

This feature requires:

  • Util.js v0.8 and aboveWarzone 3.1 or above
  • Util API
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