Skip to content

Commit 7dae8f5

Browse files
stirbyS1M0N38
authored andcommitted
documented rearrange_hand function
1 parent 93246f3 commit 7dae8f5

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

docs/developing-bots.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ BalatroBot allows you to create automated players (bots) that can play Balatro b
77
A bot is a finite state machine that implements a sequence of actions to play the game.
88
The bot can be in one state at a time and have access to a set of functions that can move the bot to other states.
99

10-
| **State** | **Description** | **Functions** |
11-
| ---------------- | -------------------------------------------- | ---------------------- |
12-
| `MENU` | The main menu | `start_run` |
13-
| `BLIND_SELECT` | Selecting or skipping the blind | `skip_or_select_blind` |
14-
| `SELECTING_HAND` | Selecting cards to play or discard | `play_hand_or_discard` |
15-
| `ROUND_EVAL` | Evaluating the round outcome and cashing out | `cash_out` |
16-
| `SHOP` | Buy items and move to the next round | `shop` |
17-
| `GAME_OVER` | Game has ended ||
10+
| **State** | **Description** | **Functions** |
11+
| ---------------- | -------------------------------------------- | ---------------------------------------- |
12+
| `MENU` | The main menu | `start_run` |
13+
| `BLIND_SELECT` | Selecting or skipping the blind | `skip_or_select_blind` |
14+
| `SELECTING_HAND` | Selecting cards to play or discard | `play_hand_or_discard`, `rearrange_hand` |
15+
| `ROUND_EVAL` | Evaluating the round outcome and cashing out | `cash_out` |
16+
| `SHOP` | Buy items and move to the next round | `shop` |
17+
| `GAME_OVER` | Game has ended | |
1818

1919
Developing a bot boils down to provide the action name and its parameters for each of the
2020

docs/protocol-api.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ All communication uses JSON messages with a standardized structure. The protocol
4646
"name": "function_name",
4747
"arguments": {
4848
"param1": "value1",
49-
"param2": [
50-
"array",
51-
"values"
52-
]
49+
"param2": ["array", "values"]
5350
}
5451
}
5552
```
@@ -86,14 +83,14 @@ The BalatroBot API operates as a finite state machine that mirrors the natural f
8683

8784
The game progresses through these states in a typical flow: `MENU``BLIND_SELECT``SELECTING_HAND``ROUND_EVAL``SHOP``BLIND_SELECT` (or `GAME_OVER`).
8885

89-
| State | Value | Description | Available Functions |
90-
| ---------------- | ----- | ---------------------------- | ---------------------- |
91-
| `MENU` | 11 | Main menu screen | `start_run` |
92-
| `BLIND_SELECT` | 7 | Selecting or skipping blinds | `skip_or_select_blind` |
93-
| `SELECTING_HAND` | 1 | Playing or discarding cards | `play_hand_or_discard` |
94-
| `ROUND_EVAL` | 8 | Round completion evaluation | `cash_out` |
95-
| `SHOP` | 5 | Shop interface | `shop` |
96-
| `GAME_OVER` | 4 | Game ended | `go_to_menu` |
86+
| State | Value | Description | Available Functions |
87+
| ---------------- | ----- | ---------------------------- | ---------------------------------------- |
88+
| `MENU` | 11 | Main menu screen | `start_run` |
89+
| `BLIND_SELECT` | 7 | Selecting or skipping blinds | `skip_or_select_blind` |
90+
| `SELECTING_HAND` | 1 | Playing or discarding cards | `play_hand_or_discard`, `rearrange_hand` |
91+
| `ROUND_EVAL` | 8 | Round completion evaluation | `cash_out` |
92+
| `SHOP` | 5 | Shop interface | `shop` |
93+
| `GAME_OVER` | 4 | Game ended | `go_to_menu` |
9794

9895
### Validation
9996

@@ -119,6 +116,7 @@ The BalatroBot API provides core functions that correspond to the main game acti
119116
| `start_run` | Starts a new game run with specified configuration |
120117
| `skip_or_select_blind` | Handles blind selection - either select the current blind to play or skip it |
121118
| `play_hand_or_discard` | Plays selected cards or discards them |
119+
| `rearrange_hand` | Reorders the current hand according to the supplied index list |
122120
| `cash_out` | Proceeds from round completion to the shop phase |
123121
| `shop` | Performs shop actions. Currently supports proceeding to the next round |
124122

@@ -131,6 +129,7 @@ The following table details the parameters required for each function. Note that
131129
| `start_run` | `deck` (string): Deck name<br>`stake` (number): Difficulty level 1-8<br>`seed` (string, optional): Seed for run generation<br>`challenge` (string, optional): Challenge name |
132130
| `skip_or_select_blind` | `action` (string): Either "select" or "skip" |
133131
| `play_hand_or_discard` | `action` (string): Either "play_hand" or "discard"<br>`cards` (array): Card indices (0-indexed, 1-5 cards) |
132+
| `rearrange_hand` | `action` (string): Must be "rearrange_hand"<br>`cards` (array): Card indices (0-indexed, exactly `hand_size` elements) |
134133
| `shop` | `action` (string): Shop action to perform ("next_round") |
135134

136135
### Errors

0 commit comments

Comments
 (0)