> For the complete documentation index, see [llms.txt](https://corem.gitbook.io/corem/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://corem.gitbook.io/corem/crm-craftingcreator/exports.md).

# Exports

{% hint style="danger" %}
Prior experience as a developer or basic programming skills are recommended to effectively navigate this section of the documentation.
{% endhint %}

#### Crafting Creator Exports

*<mark style="color:$info;">This module provides a set of exports to interact with the Crafting Creator system, including player progression, slots, XP, and global crafting states</mark>*

You can use these exports from other resources with:

```lua
exports["crm-craftingcreator"]:functionName(args)
```

***

## Player Slots

### 🔸addSlots

<mark style="color:$info;">Add crafting slots to a specific character.</mark>

```lua
local success = exports["crm-craftingcreator"]:addSlots(crm_identifier, crm_slots)
```

**Parameters**

* `crm_identifier` *(string)* – Character identifier.
* `crm_slots` *(number)* – Number of slots to add.

**Returns**

* *(boolean)* – `true` if slots were added successfully, otherwise `false`.

**Example**

```lua
if exports["crm-craftingcreator"]:addSlots("RO7G58L8", 2) then
    print("Slots added successfully")
end
```

***

### 🔸removeSlots

<mark style="color:$info;">Remove crafting slots from a specific character.</mark>

```lua
local success = exports["crm-craftingcreator"]:removeSlots(crm_identifier, crm_slots)
```

**Parameters**

* `crm_identifier` *(string)* – Character identifier.
* `crm_slots` *(number)* – Number of slots to remove.

**Returns**

* *(boolean)* – `true` if slots were removed successfully, otherwise `false`.

**Example**

```lua
exports["crm-craftingcreator"]:removeSlots("RO7G58L8", 1)
```

***

### 🔸setSlots

<mark style="color:$info;">Set the exact number of crafting slots for a character.</mark>

```lua
local success = exports["crm-craftingcreator"]:setSlots(crm_identifier, crm_slots)
```

**Parameters**

* `crm_identifier` *(string)* – Character identifier.
* `crm_slots` *(number)* – Total number of crafting slots to set.

**Returns**

* *(boolean)* – `true` if slots were updated successfully, otherwise `false`.

**Example**

```lua
exports["crm-craftingcreator"]:setSlots("RO7G58L8", 5)
```

***

## Player XP

### 🔸addXP

<mark style="color:$info;">Add crafting XP to a character.</mark>

```lua
exports["crm-craftingcreator"]:addXP(crm_identifier, crm_xp)
```

**Parameters**

* `crm_identifier` *(string)* – Character identifier.
* `crm_xp` *(number)* – Amount of XP to add.

**Returns**

* *(boolean)* – `true` if xp was updated successfully, otherwise `false`.

**Example**

```lua
exports["crm-craftingcreator"]:addXP("RO7G58L8", 250)
```

***

### 🔸removeXP

<mark style="color:$info;">Remove crafting XP from a character.</mark>

```lua
exports["crm-craftingcreator"]:removeXP(crm_identifier, crm_xp)
```

**Parameters**

* `crm_identifier` *(string)* – Character identifier.
* `crm_xp` *(number)* – Amount of XP to remove.

**Returns**

* *(boolean)* – `true` if xp was updated successfully, otherwise `false`.

**Example**

```lua
exports["crm-craftingcreator"]:removeXP("RO7G58L8", 100)
```

***

### 🔸setXP

<mark style="color:$info;">Set the exact crafting XP for a character.</mark>

```lua
exports["crm-craftingcreator"]:setXP(crm_identifier, crm_xp)
```

**Parameters**

* `crm_identifier` *(string)* – Character identifier.
* `crm_xp` *(number)* – Total XP value to set.

**Returns**

* *(boolean)* – `true` if xp was updated successfully, otherwise `false`.

**Example**

```lua
exports["crm-craftingcreator"]:setXP("RO7G58L8", 1000)
```

***

### 🔸wipeXP

<mark style="color:$info;">Wipe crafting XP for all characters (sets XP to 0).</mark>

```lua
exports["crm-craftingcreator"]:wipeXP()
```

**Parameters**

* None

**Example**

```lua
exports["crm-craftingcreator"]:wipeXP()
```

{% hint style="danger" %}
This action affects **all players**. Use with caution.
{% endhint %}

***

## Global Toggles

### 🔸toggleAllCrafting

<mark style="color:$info;">Toggle crafting globally (enable or disable all crafting stations).</mark>

```lua
local state = exports["crm-craftingcreator"]:toggleAllCrafting()
```

**Parameters**

* None

**Returns**

* *(string)* – `"crm-disabled"` or `"crm-enabled"` depending on the new state.

**Example**

```lua
local state = exports["crm-craftingcreator"]:toggleAllCrafting()
print("Crafting state:", state)
```

***

### 🔸toggleAllResearch

Toggle research globally (enable or disable all research stations).

```lua
local state = exports["crm-craftingcreator"]:toggleAllResearch()
```

**Parameters**

* None

**Returns**

* *(string)* – `"crm-disabled"` or `"crm-enabled"` depending on the new state.

**Example**

```lua
local state = exports["crm-craftingcreator"]:toggleAllResearch()
print("Research state:", state)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://corem.gitbook.io/corem/crm-craftingcreator/exports.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
