cookietouch

CookieTouch API Documentation

Summary Single page summary

Table of Contents

Map

All functions related to maps.

yield\*changeMap(where: string)

Allows you to change the map. The following directions are accepted:

Returns false if the bot could not change maps, otherwise returns true.

Example:

if (yield * changeMap("top") !== true) {
  // Try to go to the top map.
  yield * changeMap("right"); // If the top map is inaccessible, then go right.
}

yield\*moveToCell(cellId: number)

Allows to move on a cell according to the cellId.

Returns false if the cell is unreachable, otherwise returns true.

Example:

cellId = 0;
while (yield * moveToCell(cellId)) {
  cellId++; // As long as the cell is unreachable add 1 to cellId.
}

yield\*useById(elementId: number, skillInstanceUid?: number)

Allows you to use an action of an interactive element from its id.

Returns true if the element is usable, otherwise returns false.

Example:

TODO;

yield\*use(elementCellId: number, skillInstanceUid?: number)

Allows you to use an action of an interactive element on a given cell.

Returns true if the bot could interact with the element, otherwise return false.

Example:

TODO;

yield\*useLockedHouse(doorCellId: number, lockCode: string)

Allows you to use a house door protected by a code.

Returns true if the bot is entered, otherwise returns false.

Example:

yield * useLockedHouse(239, "00000000"); // Opens the door in cell 239 with code 00000000.

yield\*useLockedStorage(elementCellId: number, lockCode: string)

Allows you to use a home safe protected by a code.

Returns true if the bot opened the storage, otherwise returns false.

Example:

yield * useLockedStorage(127, "00000000"); // Open the storage in cell 127 with code 00000000.

yield\*useZaap(destinationMapId: number)

Allows you to use a zaap.

Returns true if the bot is able to use the zaap, otherwise returns false.

Example:

TODO;

yield\*useZaapi(destinationMapId: number)

Allows you to use a zaapi.

Returns true if the bot is able to use the zaapi, otherwise returns false.

Example:

TODO;

yield\*saveZaap()

Saves a Zaap for use as a default position of reappearance for your character.

Example:

if (onMap("0,-2")) {
  yield * saveZaap(); // Saves the Zaap in "0, -2".
}

yield\*waitMapChange(delay?: number)

Pauses the script until the map changes.

Example:

yield * waitMapChange(2000); // Wait 2 seconds.

yield\*joinFriend(name: string)

Allows you to join a friend. Available only if you are on Incarnam.

Example:

yield * joinFriend("Eausa");

onCell(cellId: number)

Returns true if the character is on the cell, otherwise returns false.

Example:

let cellId = 0;
while (!onCell(cellId)) {
  cellId++; // At the end of the loop, cellId is equal to the cell on which the character is located.
}
const characterCell = cellId;

onMap(coords: string)

Returns true if the character is on the given map, otherwise returns false.

Example:

if (onMap("-2,0")) {
  // Vous etes en "-2,0"
}

currentPos

Returns the coordinates of the current map.

Example:

onMap(currentPos); // Always returns true.

currentMapId

Returns the mapId of the current map.

Example:

if (currentMapId === 88081177) {
  // 88081177 is the external map "9,2".
  yield * useLockedHouse(cellId, "00000000"); // When the bot arrives on the map of your house, enter the house.
}

area

Returns the name of the area.

Example:

if (area === "Astrub") {
  // We are in the Astrub area.
}

subArea

Returns the name of the subarea.

Example:

if (subArea === "Astrub city") {
  // We are inside the city of Astrub.
}