cookietouch

CookieTouch API Documentation

Summary | Single page summary


Table of Contents

Inventory

All functions related to the character’s inventory.

All GID are available in items.txt.

inventory.pods

Returns the number of pods used.

const pods = inventory.pods

inventory.podsMax

Returns the maximum pods of the character.

const podsMax = inventory.podsMax

inventory.podsP

Returns the number of pods used as a percentage.

const podsP = inventory.podsP

inventory.itemCount(gid: number)

Returns the number of items in the inventory.

Example:

const numberOfWheat = inventory.itemCount(289);

inventory.itemWeight(gid: number)

Returns the weight of an item in the inventory.

Example:

const wheatWeight = inventory.itemWeight(289); // Returns the weight of a wheat (2 pods).

yield*inventory.useItem(gid: number, quantity: number)

Allows you to use an item.

Returns true if the item was used, otherwise returns false.

Example:

yield* inventory.useItem(6965); // Use a Bontarian intercity-express potion

yield*inventory.equipItem(gid: number)

Allows you to equip an item.

Returns true if the object was equipped, otherwise returns false.

Example:

yield* inventory.equipItem(8575); // Equip your Ramboton.

yield*inventory.unEquipItem(gid: number)

Allows you to unequip an item.

Returns true if the object was unequiped, otherwise returns false.

Example:

yield* inventory.unEquipItem(7865); // Unequip your Skeleton DragoTurkey

yield*inventory.dropItem(gid: number, quantity: number)

Allows you to drop an item.

Returns true if the object was dropped, otherwise returns false.

Example:

yield* inventory.dropItem(289, 50); // Drop 50 wheat.

yield*inventory.deleteItem(gid: number, quantity: number)

Allows you to delete an item.

Returns true if the object was deleted, otherwise returns false.

Example:

yield* inventory.deleteItem(289, 100); // Delete 100 wheat.