> 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-poker/configuration.md).

# Configuration

Every CAS Poker option in config/config.lua with its default: framework, money, admin, turn timer and pace, rake, stakes, house players, keys, distances, blips, scenes, sounds and the Discord log.

Every option lives in `config/config.lua`. The tables themselves are in `config/tables.lua` (see [Tables and stakes](/script-documentation/cas-poker/tables-and-stakes.md)) and every word the players read is in `config/locale.lua`. Restart the resource after a change.

## General

| Option              | Default  | Meaning                                                                                                                                                                                                                                                                                       |
| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.Framework`  | `"auto"` | `"auto"` finds `vorp_core` or `rsg-core`. `"vorp"` or `"rsg"` forces one.                                                                                                                                                                                                                     |
| `Config.Locale`     | `"en"`   | The language table to use from `config/locale.lua`.                                                                                                                                                                                                                                           |
| `Config.Debug`      | `false`  | Prints traces to the server console and the F8 console. Keep it off on a live server.                                                                                                                                                                                                         |
| `Config.AnimScenes` | `true`   | Red Dead Online's sit-down and stand-up scenes (male and female sets, the stand-up sweeps your chips). `false` plays the story-mode sit-down and stand-up clips instead. It only covers sitting down and standing up: the dealing and every other move at the table play the same either way. |
| `Config.Sounds`     | `true`   | `false` mutes every table sound: the game's poker audio scene, the turn cue, the bet amount clicks and the chip clicks while the cards are dealt round the table.                                                                                                                             |

If a Red Dead Online scene does not load within a few seconds, the story-mode clip plays instead, so sitting down never gets stuck.

## Money

| Option                  | Default  | Meaning                                                                |
| ----------------------- | -------- | ---------------------------------------------------------------------- |
| `Config.VorpCurrency`   | `0`      | VORP only: `0` cash, `1` gold.                                         |
| `Config.RsgMoneyType`   | `"cash"` | RSG only: the money type buy-ins are taken from and cash-outs paid to. |
| `Config.CurrencySymbol` | `"$"`    | Shown in front of every amount.                                        |

## Admin

| Option                | Default        | Meaning                                                                                                                     |
| --------------------- | -------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `Config.AdminAce`     | `"command"`    | The ace a player needs for the admin command and the test commands.                                                         |
| `Config.AdminCommand` | `"pokeradmin"` | The name of the admin command.                                                                                              |
| `Config.TestCommands` | `false`        | `true` lets every player use `/pokertp` and `/pokermoney`. Test servers only: with it on, anyone can give themselves money. |

The two test commands can be renamed by adding `Config.TeleportCommand = "yourname"` and `Config.MoneyCommand = "yourname"` to `config/config.lua` (the defaults are `pokertp` and `pokermoney`). See [Admin and exports](/script-documentation/cas-poker/admin-and-exports.md).

## Pace of the game

| Option                    | Default | Meaning                                                                                                                               |
| ------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.TurnSeconds`      | `20`    | A player's time to act, as in Red Dead Online. When it runs out, the player checks if they can, otherwise they fold.                  |
| `Config.MaxTimeouts`      | `2`     | Let the clock run out this many turns in a row and you are sat out. It counts turns, not hands, and acting yourself resets the count. |
| `Config.HandPauseSeconds` | `10`    | The pause between hands, while the showdown plays out.                                                                                |
| `Config.Pace`             | table   | How long the table's own clips take, in milliseconds. Leave it as it is.                                                              |
| `Config.CatchUpQueue`     | `10`    | A client that falls this many moves behind (after a hitch, for example) plays the rest at once to catch up.                           |
| `Config.BustedSeconds`    | `30`    | A player who runs out of chips has this long to buy more. Otherwise they stand up.                                                    |

```lua
Config.Pace = {
    shuffle = 4500, deal = 6500, dealEach = 1200,
    flop = 7000, turn = 3400, river = 3400,
    action = 1600, fold = 2600,
}
```

`shuffle` is the dealer's shuffle, `deal` plus `dealEach` for every player is the cards going round and the pick-up, `flop`, `turn` and `river` are the dealer laying the board, `action` is a check, call, bet or raise and `fold` is a fold with the cards going back. The server adds this time to the next player's turn clock, so nobody loses time while the cards are still moving, and house players wait for it before they act.

## Rake

```lua
Config.Rake = { percent = 0, cap = 0, noFlopNoDrop = true }
```

| Field          | Default | Meaning                                                                                        |
| -------------- | ------- | ---------------------------------------------------------------------------------------------- |
| `percent`      | `0`     | The share of each pot the house keeps. `0` means no rake, as in the saloons of the story mode. |
| `cap`          | `0`     | The most the house takes from one pot, in the table money. `0` means no cap.                   |
| `noFlopNoDrop` | `true`  | `true`: no rake on a hand that ends before the flop.                                           |

For example `Config.Rake = { percent = 5, cap = 2.0, noFlopNoDrop = true }` keeps 5% of every pot that sees a flop, at most $2 per pot. A side pot that only one player can win is not raked. The rake is not paid to anyone, so it takes that money out of your economy.

## Stakes

```lua
Config.Stakes = {
    low    = { smallBlind = 0.25, bigBlind = 0.50, minBuyIn = 10,  maxBuyIn = 50 },
    medium = { smallBlind = 1,    bigBlind = 2,    minBuyIn = 40,  maxBuyIn = 200 },
    high   = { smallBlind = 5,    bigBlind = 10,   minBuyIn = 200, maxBuyIn = 1000 },
}
```

| Field        | Meaning                                                                                  |
| ------------ | ---------------------------------------------------------------------------------------- |
| `smallBlind` | The small blind, in the table money (dollars with the default cash setting).             |
| `bigBlind`   | The big blind. One step of the amount on the bet prompt is half the big blind.           |
| `minBuyIn`   | The smallest buy-in.                                                                     |
| `maxBuyIn`   | The largest buy-in, and the most a player can hold at the table after buying more chips. |

Each table picks a level by name with its `stakes` field, or gets its own stakes. See [Tables and stakes](/script-documentation/cas-poker/tables-and-stakes.md#stakes).

## House players

```lua
Config.Bots = {
    enabled = true,
    fillTo = 4,
    maxBots = 3,
    stackShare = 0.6,
    samples = 140,
    thinkScale = 1.0,
    styles = { "rock", "regular", "regular", "gambler", "drunk" },
    names = { "Cornelius Brandt", "Ezra Pike", ... },
    models = { "A_M_M_CARDGAMEPLAYERS_01" },
    outfits = 12,
}
```

| Field        | Default                                     | Meaning                                                                                                                                                                 |
| ------------ | ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `enabled`    | `true`                                      | `false` turns the house players off at every table. `/pokeradmin bots on\|off` switches them live but only until the next restart; set `enabled` here to make it stick. |
| `fillTo`     | `4`                                         | House players sit down until this many sit at the table, real players and house players together.                                                                       |
| `maxBots`    | `3`                                         | The most house players at one table.                                                                                                                                    |
| `stackShare` | `0.6`                                       | A house player sits down with this share of the table's maximum buy-in.                                                                                                 |
| `samples`    | `140`                                       | How hard they think: the deals they play out per decision after the flop.                                                                                               |
| `thinkScale` | `1.0`                                       | Their thinking time. `0.5` makes them act twice as fast.                                                                                                                |
| `styles`     | `rock`, `regular` twice, `gambler`, `drunk` | The personalities, picked at random. A style listed twice comes up twice as often.                                                                                      |
| `names`      | 16 western names                            | The names they sit down under.                                                                                                                                          |
| `models`     | `A_M_M_CARDGAMEPLAYERS_01`                  | The ped models, the story mode's card players. Add any ped model you like.                                                                                              |
| `outfits`    | `12`                                        | How many outfit presets to pick from.                                                                                                                                   |

Everything about them is on the [House players](/script-documentation/cas-poker/house-players.md) page.

## Keys

`Config.Keys` holds the controls. They are the story mode's own minigame inputs, which answer while the poker HUD is up. To use another key, put another control hash in its place.

| Key         | Default hash | PC default                   | Action                                                                                           |
| ----------- | ------------ | ---------------------------- | ------------------------------------------------------------------------------------------------ |
| `sit`       | `0xD51B784F` | E (hold)                     | Sit down at a free seat (opens the buy-in panel), or Ask for the Seat at a house player's chair  |
| `bet`       | `0xA9883369` | Enter                        | The move on the bet prompt: check, call, bet, raise or all in                                    |
| `fold`      | `0x49B4AD1E` | F                            | Fold                                                                                             |
| `alter`     | `0xBDC733EE` | Arrow Up / Down, mouse wheel | The key shown on the amount prompt. It does not change the keys that move the amount (see below) |
| `holeCards` | `0xF923B337` | Right mouse                  | Cards camera on / off (press, no need to hold)                                                   |
| `board`     | `0xE402B898` | Space                        | Board camera on / off (press, no need to hold)                                                   |
| `rebuy`     | `0x646A7792` | Tab                          | Buy more chips (between hands)                                                                   |
| `sitIn`     | `0x72A9D1F7` | G                            | Sit out / deal me in                                                                             |
| `leave`     | `0xE9094BA0` | Backspace (hold)             | Leave the table and cash out                                                                     |

{% hint style="info" %}
`alter` only sets the key shown on the amount prompt, by default the story mode's change bet axis (`INPUT_MINIGAME_CHANGE_BET_AXIS_Y`). The amount itself always moves with the story mode's bet up / down inputs: Arrow Up / Down and the mouse wheel on PC. Changing `alter` does not change those.
{% endhint %}

## Distances

| Option                 | Default | Meaning                                                                                                                                    |
| ---------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| `Config.SitDistance`   | `1.4`   | How close, in meters, you must be to a chair for its prompt: Sit Down at a free chair, Ask for the Seat at a house player's chair.         |
| `Config.WatchDistance` | `30.0`  | Within this range a table loads its cards, chips and house players and you see the hands play out. It unloads again 10 meters further out. |

## Blips

```lua
Config.Blips = { enabled = true, sprite = 1243830185, scale = 0.2 }
```

| Field     | Default      | Meaning                                                                                               |
| --------- | ------------ | ----------------------------------------------------------------------------------------------------- |
| `enabled` | `true`       | Map blips for the tables. One table can hide its own blip with `blip = false` in `config/tables.lua`. |
| `sprite`  | `1243830185` | The blip sprite hash.                                                                                 |
| `scale`   | `0.2`        | The blip size.                                                                                        |

Each blip is named after the locale's `blip` word and the table label, for example "Poker (Valentine Saloon)".

## Log

```lua
Config.Log = { console = false, webhook = "", username = "Poker tables" }
```

| Field      | Default          | Meaning                                                                                                                                        |
| ---------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `console`  | `false`          | `true` prints a line to the server console when a player sits down, when a player leaves and at the end of every hand.                         |
| `webhook`  | `""`             | A Discord webhook URL. When set, every sit-down (with the buy-in) and every leave (with the cash-out and what the player bought in) is posted. |
| `username` | `"Poker tables"` | The name the webhook posts under.                                                                                                              |

A log line looks like this (amounts are in cents):

```
[cas-poker] leave boughtIn=5000 char=vorp:12 chips=7350 name=John Smith table=valentine
```

See [Admin and exports](/script-documentation/cas-poker/admin-and-exports.md#table-log) for every line the log writes.

## More

* [Buy CAS Poker](https://codeaftersex.com/script/poker)
* [Support Discord](https://discord.gg/codeaftersex)
* [All CodeAfterSex scripts](https://codeaftersex.com/scripts)
