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

# Configuration

Every option in the Rummiduck config.lua, with its default.

All options are in `config.lua`. Restart the resource after a change: `restart rummiduck`.

The Discord logging has a file of its own, `config_server.lua`, because `config.lua` is sent to every player. See [Discord logging](/organized-chaos-docs/rummiduck/discord-logging.md).

## Language

| Option          | Default | Meaning                                                    |
| --------------- | ------- | ---------------------------------------------------------- |
| `Config.Locale` | `'en'`  | Language, `'en'` or `'de'`. The texts are in `locales.lua` |

## Tables

| Option                  | Default                             | Meaning                                                                                               |
| ----------------------- | ----------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `Config.Tables`         | one table on Legion Square          | Fixed tables. `coords` is the centre on the ground, `heading` the way it faces                        |
| `Config.SnapToGround`   | `true`                              | Put the table on the ground under `coords` instead of exactly at its height                           |
| `Config.RenderDistance` | `45.0`                              | Metres from which a table, its chairs and the tiles are drawn                                         |
| `Config.Label`          | `false`                             | Yellow text over the table for players standing close. Off by default because it is drawn every frame |
| `Config.SeatDistance`   | `1.2`                               | Metres from a free chair at which sitting down is offered                                             |
| `Config.SitScenario`    | `'PROP_HUMAN_SEAT_CHAIR_MP_PLAYER'` | How a seated player sits                                                                              |
| `Config.SitOffsetZ`     | `0.5`                               | How far above the ground a seated player's hips are. Change it if the ped sits too high or too low    |
| `Config.WatchDistance`  | `3.5`                               | Metres from the table's centre within which a game can be watched                                     |

## Rules

| Option                      | Default | Meaning                                                                                    |
| --------------------------- | ------- | ------------------------------------------------------------------------------------------ |
| `Config.MinPlayers`         | `2`     | How many players are needed to start, 2 to 4. Computer players count                       |
| `Config.StartTiles`         | `14`    | Tiles every player starts with                                                             |
| `Config.InitialMeld`        | `30`    | Points a player's first move must be worth                                                 |
| `Config.JokerColourMatters` | `false` | `true` lets the red joker stand only for red tiles and the black joker only for black ones |
| `Config.JokerPoints`        | `30`    | What a joker left on the rack counts against its holder when a round ends                  |

## Turn timer

| Option                | Default                   | Meaning                                                              |
| --------------------- | ------------------------- | -------------------------------------------------------------------- |
| `Config.TurnTime`     | `120`                     | Seconds per turn a table starts out with. `0` for no limit           |
| `Config.TurnTimes`    | `{ 30, 45, 60, 90, 120 }` | The times on offer in the lobby. `{}` leaves it at `Config.TurnTime` |
| `Config.TimeoutTiles` | `1`                       | Tiles drawn when the time runs out                                   |
| `Config.TimerWarning` | `10`                      | Seconds left from which the clock turns red and pulses               |

## Computer players

| Option               | Default                           | Meaning                                                                             |
| -------------------- | --------------------------------- | ----------------------------------------------------------------------------------- |
| `Config.Bots`        | `true`                            | Allow computer players                                                              |
| `Config.BotDelay`    | `{ 1500, 3500 }`                  | The computer's thinking time in milliseconds, from and to                           |
| `Config.BotLevel`    | `2`                               | Strength of a newly added computer. 1 easy, 2 medium, 3 hard                        |
| `Config.BotStep`     | `350`                             | Milliseconds between the tiles of a computer's move. `0` shows the move all at once |
| `Config.BotPeds`     | four business peds                | The peds that sit in for the computers, by seat. `{}` leaves the chairs empty       |
| `Config.BotScenario` | `'PROP_HUMAN_SEAT_CHAIR_UPRIGHT'` | How those peds sit                                                                  |
| `Config.Hints`       | `false`                           | Offer the "Hint" button, which shows a move the hard computer would make            |

## Board

| Option                    | Default                                  | Meaning                                                                                                                                                  |
| ------------------------- | ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.ShiftSelect`      | `'set'`                                  | What dragging with Shift or the right mouse button picks up. `'set'` takes the valid set around the tile, `'block'` the whole unbroken row, valid or not |
| `Config.Keys`             | see below                                | The keys of the board, as the browser names them. `false` for none                                                                                       |
| `Config.Reactions`        | `{ '👏', '😂', '😱', '🍀', '🦆', 'GG' }` | The reactions a seated player can send: emoji or short words, up to eight. `{}` for none                                                                 |
| `Config.ReactionCooldown` | `2000`                                   | Milliseconds a player has to wait before the next reaction                                                                                               |

```lua
Config.Keys = {
    endTurn = 'Enter',
    draw = ' ',          -- the space bar
    reset = 'r',
    sortRuns = 'a',
    sortGroups = 'd',
    undo = 'z',          -- pressed with Ctrl
}
```

## Connection, sound and animation

| Option                 | Default                                        | Meaning                                                                      |
| ---------------------- | ---------------------------------------------- | ---------------------------------------------------------------------------- |
| `Config.ReconnectTime` | `120`                                          | Seconds a seat is kept after a lost connection. `0` drops the player at once |
| `Config.Sounds`        | `true`                                         | Sounds of the tiles for players near a table                                 |
| `Config.SoundDistance` | `12.0`                                         | How far those sounds carry, in metres                                        |
| `Config.DefaultVolume` | `0.7`                                          | Volume from 0 to 1 for players who have not set their own yet                |
| `Config.ReachAnim`     | `{ dict = 'mp_common', name = 'givetake1_a' }` | The gesture made when laying or drawing tiles. `false` for none              |

## Framework and stake

| Option                | Default   | Meaning                                                                                                                                                                                                                                                      |
| --------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Config.Framework`    | `'auto'`  | Where names and money come from. `'auto'` takes what is running: Qbox, QBCore, ESX, or failing those the cash of `ox_inventory`. Or name one: `'qbx'`, `'qb'`, `'esx'`, `'ox_inventory'`, `'none'`. For anything else, give functions of your own, see below |
| `Config.BuyIn`        | `0`       | Stake per player and round, paid when the round starts. The winner takes the pot. `0` plays for nothing. Needs a framework                                                                                                                                   |
| `Config.BuyInAccount` | `'money'` | The account the stake comes from, `'money'` (cash) or `'bank'`                                                                                                                                                                                               |

Rounds with computer players are never played for money.

Functions of your own, each taking the player's server id:

```lua
Config.Framework = {
    name = function(src) return ... end,              -- optional
    balance = function(src) return ... end,
    remove = function(src, amount) ... return true end,
    add = function(src, amount) ... return true end,
}
```

## Keys and messages

| Option               | Default  | Meaning                                                                                                                                                                                                                   |
| -------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.KeyInteract` | `38` (E) | Sit down, open the board                                                                                                                                                                                                  |
| `Config.KeyStandUp`  | `73` (X) | Stand up                                                                                                                                                                                                                  |
| `Config.KeyWatch`    | `47` (G) | Watch a game from beside the table                                                                                                                                                                                        |
| `Config.Notify`      | `'gta'`  | Where messages go while the board is closed. `'gta'` is the feed above the minimap, `'esx'` uses `esx:showNotification`, `'qb'` uses `QBCore:Notify`, `'ox'` uses `ox_lib:notify`, or give a `function(text)` of your own |
| `Config.Target`      | `true`   | Offer sitting down and watching through `ox_target` if it is running                                                                                                                                                      |

The three world keys are FiveM control ids, listed in the [FiveM controls reference](https://docs.fivem.net/docs/game-references/controls/).

## Commands

| Option                 | Default              | Meaning                                                    |
| ---------------------- | -------------------- | ---------------------------------------------------------- |
| `Config.CommandPlace`  | `'rummiduck_place'`  | The admin command that puts up a table                     |
| `Config.CommandRemove` | `'rummiduck_remove'` | The admin command that takes the nearest placed table away |

## Table item

`Config.Item`: players put up tables themselves from an inventory item. What it does, and how to add the item to your inventory, is on the [Table item](/organized-chaos-docs/rummiduck/table-item.md) page.

| Option                            | Default                     | Meaning                                                                                                                                                               |
| --------------------------------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Enabled`                         | `true`                      | `false`: no item                                                                                                                                                      |
| `Name`                            | `'rummiduck_table'`         | The item's name                                                                                                                                                       |
| `Framework`                       | `'auto'`                    | `'auto'` (Qbox, QBCore, ESX, else ox\_inventory), `'esx'`, `'qb'`, `'qbx'`, `'ox'`, or `false` for an inventory of your own that calls `exports.rummiduck:placeTable` |
| `Remove`                          | `true`                      | The item leaves the inventory while the table stands, and comes back when it is picked up. `false`: it stays, as a licence to put up tables                           |
| `MaxPerPlayer`                    | `1`                         | Tables a player may have up at once. `0` for any number                                                                                                               |
| `Place.Distance`                  | `4.0`                       | Metres from the player the table may stand                                                                                                                            |
| `Place.Spacing`                   | `3.5`                       | Metres it has to keep from the middle of any other table                                                                                                              |
| `Place.Radius`, `Place.Slope`     | `1.1`, `0.3`                | The ground this far around has to be free, and may rise or fall this much                                                                                             |
| `Place.Turn`                      | `7.5`                       | Degrees one click of the mouse wheel turns the table                                                                                                                  |
| `Place.Animation`, `Place.Time`   | `mini@repair`, `2500`       | What the player does while putting it up, and for how many milliseconds. `Animation = false` puts it up at once                                                       |
| `PickUp.Enabled`                  | `true`                      | `false`: tables cannot be picked up                                                                                                                                   |
| `PickUp.Target`                   | `'ox_target'`               | "Pick up the table" on the table. `false`: only the command                                                                                                           |
| `PickUp.Command`                  | `'rummiduck_pickup'`        | Takes down the nearest such table in reach. `false` for none                                                                                                          |
| `PickUp.Icon`, `PickUp.Distance`  | `'fa-solid fa-hand'`, `2.5` | The option's icon, and the metres from the table it shows                                                                                                             |
| `PickUp.OwnOnly`                  | `true`                      | Only the player who put a table up can pick it up                                                                                                                     |
| `PickUp.Animation`, `PickUp.Time` | `mini@repair`, `1500`       | What the player does while taking it down, and for how long                                                                                                           |
