cookietouch

CookieTouch API Documentation

Summary | Single page summary


Table of Contents

Global

All useful functions in all circumstances.

isFighting()

Returns true if the character is fighting, otherwise returns false.

Example:

if (isFighting()) {
  printMessage("The character is fighting!");
}

isGathering()

Returns true if the character is gathering, otherwise returns false.

Example:

if (isGathering()) {
  printMessage("The character is gathering.");
}

isInDialog()

Returns true if the character is in a dialog (exchange, challenge, bank, NPC, etc…), otherwise returns false.

Example:

if (isInDialog()) {
  printMessage("A dialog is open!");
}

printMessage(message: string)

Prints a message in the console.

Example:

printMessage("This is a message.");

printDebug(message: string)

Prints a debug message in the console.

Example:

printDebug("This is a debug message.");

printSuccess(message: string)

Prints a success message in the console.

Example:

printSuccess("This is a succes message.");

printError(message: string)

Prints an error in the console.

Example:

printError("This is an error.");

stopScript()

Stops and ends the script immediately.

Example:

stopScript();

delay(ms: number)

Delays the script.

Example:

delay(3000); // Pauses 3000ms (3 seconds).

leaveDialogFunc()

Returns true and closes the dialog if there is one open, otherwise return false.

Example:

if (leaveDialogFunc()) {
  printMessage("A dialog was opened, now it's closed!");
}

leaveDialog()

Closes a dialog.

Example:

if (isInDialog()) {
  printMessage("A dialog is open, let's close it!");
  leaveDialog();
}