> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-crafting/commands.md).

# Commands and exports

CAS Crafting commands and exports: /craft, the /craftadmin actions, and the server and client exports for other resources.

## Players

| Command          |                                                                             |
| ---------------- | --------------------------------------------------------------------------- |
| `/craft` (key J) | the crafting menu: the satchel recipes, or the fire's when you stand at one |

## Admins

`/craftadmin <action> [player id]` (admins of your framework, or the ace `cas.crafting`; also from the server console):

| Action                 |                                                                   |
| ---------------------- | ----------------------------------------------------------------- |
| `learnall [id]`        | the player knows every recipe                                     |
| `forget [id] [recipe]` | forgets the learned recipes (or one)                              |
| `stock [id]`           | a test set of meat, herbs, rounds, a camp kit and a few pamphlets |
| `give <id> <item> [n]` | gives an item, or rounds (`AMMO_REVOLVER`)                        |
| `take <id> <item> [n]` | takes an item or rounds                                           |
| `fires`                | every burning player fire                                         |

## Server exports

```lua
exports['cas-crafting']:Knows(source, 'ammo_arrow_improved')         -- true / false
exports['cas-crafting']:Learn(source, { 'ammo_arrow_fire' })         -- the recipes that were new
exports['cas-crafting']:Forget(source, 'ammo_arrow_fire')            -- nil forgets all
exports['cas-crafting']:GetRecipe('consumable_potent_tonic')         -- the recipe table
exports['cas-crafting']:GetRecipes()
exports['cas-crafting']:GetFires()                                   -- the burning player fires
exports['cas-crafting']:AddFire(x, y, z, heading, minutes)           -- a fire of your own (camps, jobs); its id
exports['cas-crafting']:RemoveFire(id)
exports['cas-crafting']:GetStations()                                -- the work stations: { id, type, label, town, title, tabs }
exports['cas-crafting']:IsAtStation(source, 'val_forge')             -- true when the player stands at that station
```

Server event after a result is used: `cas-crafting:server:consumed` (source, item, effects).

## Client exports

```lua
exports['cas-crafting']:OpenCrafting()     -- the /craft menu
exports['cas-crafting']:IsCrafting()
exports['cas-crafting']:PlaceCampfire()    -- as if the camp kit was used
```
