This AI is still in early stages of development.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Message output handler.

 

Syntax

out(message, self, method);

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:

Default: out.DEFAULT

1.0

Return value

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

Example

Output single line of text to console
var self = {file: "foo.js", ver: 1.2};
 
function bar() {
  out("bar() called", self, out.CONSOLE);
}
 
bar(); // "[foo.js v1.2] bar() called"
Multi-line output
function foo() {
  var names = ["bob", "jim", "kate"];
  out(names);
}
 
foo(); // outputs each of the names on a new line to OUT_DEFAULT
Availability STABLE

This feature requires:

Contents

Jump to:

See also

Related articles:

Related APIs:

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

Globals

Topics:

  • NativeAllows access to JS API natives that have been replaced or removed by the Define API...
  • toArray()Convert an array-like object in to an array...
  • nowReturn current universal time expressed as milliseconds since midnight, January 1, 1970.
  • out()Message output handler.
    • out.HOSTOutputs the message to the game host via in-game chat .
    • out.DEFAULTOutputs the message via out.HOST or out.CONSOLE depending on Warzone version.
    • out.ERROROutputs the message as an exception.
    • out.DEBUGOutput message to debug().
    • out.CONSOLEOutput message to console().
    • out.ASSERTAsserts whether config is truthy, and if not throws a game assert and a Javascript error...
    • out.CHATOutputs the message to allies of the script player via in-game chat.
    • out.RETURNReturns the message to the calling script.
  • difficultyScale()Select a value based on difficulty level...
  • globalA global reference to the global object...

 

  • No labels