cookietouch

CookieTouch API Documentation

Summary | Single page summary


Table of Contents

Storage

All functions related to storage.

All GID are available in items.txt file.

storage.itemCount(gid: number)

Returns the number of items in the inventory.

Example:

const itemCount = storage.itemCount(289); // Returns the number of wheat in the inventory.

storage.kamas

Returns the number of kamas in the inventory.

Example:

const kamas = storage.kamas;

yield*storage.putItem(gid: number, quantity: number)

Puts a given item in a given quantity.

Returns true if the items could be put, otherwise returns false.

Example:

yield* storage.putItem(367, 100); // Puts 100 Tofu eggs in the storage.

yield*storage.getItem(gid: number, quantity: number)

Gets a given item in a given amount.

Returns true if the items could be got, otherwise return false.

Example:

yield* storage.getItem(371, 200); // Gets 200 Moskito Eyebrows from the storage.

yield*storage.putKamas(quantity: number)

Puts kamas in the storage.

Returns true if kamas could be put, otherwise return false.

Example:

yield* storage.putKamas(1000000000); // Puts 1 billion kamas into the storage.

yield*storage.getKamas(quantity: number)

Gets kamas in the storage.

Returns true if kamas can be got, otherwise returns false.

Example:

yield* storage.getKamas(1000000000); // Gets 1 billion kamas from the chest.

yield*storage.putAllItems()

Puts all the elements in the storage.

Returns true if items can be put, otherwise returns false.

Example:

yield* storage.putAllItems(); // Puts all items.

yield*storage.getAllItems()

Gets all the items in the storage.

Returns true if the items could be got, otherwise return false.

Example:

yield* storage.getAllItems(); // Gets all items.

yield*storage.putExistingItems()

Puts all existing items into the storage.

Returns true if the items could be put, otherwise returns false.

Example:

yield* storage.putExistingItems(); // Puts all existing items into the storage.

yield*storage.getExistingItems()

Gets all existing items in the inventory.

Returns true if the items could be got, otherwise return false.

Example:

yield* storage.getExistingItems(); // Getx all existing items in the inventory.