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

chat.isBabel()

Quickly determine if a received message is in Babel format...

 

Syntax

var result = chat.isBabel(message);

Parameters

ParameterTypeMandatoryNotesAPI Version
messageString(tick)The message you want to check.1.0

Return values

ValueTypeNotesAPI Version
<result>Boolean

Is the message Babel formatted?

  • true – yes, it's Babel format, use chat.fromBabel() to decompile it.
  • false – no, it's some other format
1.0
<error>ErrorInvalid parameters passed to function.1.0

Example

function eventChat(sender, to, message) {
	if (chat.isBabel(message)) {
		// process babel-formatted message
	} else {
		// process other kinds of message
	}
}
Availability BETA

Requires:

Contents

Jump to:

Babel API

Topics:

  • Data types — Babel supports most types of data...
  • Error Dialect — A specific dialect for reporting errors within Babel...
  • Babel on Warzone 3.1 — Babel handles Warzone 3.1 gracefully...
  • Position-like Objects — If your data has {x, y} properties, Babel treats it like a Position object...
  • chat.toBabel() — Compiles a Babel format message, ready for sending to your AI buddies...
  • chat.isBabel() — Quickly determine if a received message is in Babel format...
  • chat.fromBabel() — Converts a Babel format message in to an array...
  • Handling Dialects — Some ideas on how to handle multiple dialects...

Â