You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Welcome to BalatroBot! We're excited that you're interested in contributing to this Python framework and Lua mod for creating automated bots to play Balatro.
4
4
5
-
BalatroBot uses a unique dual-architecture approach with a Python framework that communicates with a Lua mod running inside Balatro via TCP sockets. This allows for real-time bot automation and game state analysis.
5
+
BalatroBot uses a dual-architecture approach with a Python framework that communicates with a Lua mod running inside Balatro via TCP sockets. This allows for real-time bot automation and game state analysis.
6
6
7
7
## Project Status & Priorities
8
8
9
9
We track all development work using the [BalatroBot GitHub Project](https://github.com/users/S1M0N38/projects/7). This is the best place to see current priorities, ongoing work, and opportunities for contribution.
10
10
11
-
**Current Focus**: We're heavily refactoring the Python framework while focusing development efforts on the Lua API (`src/lua/api.lua`). The existing Python code serves as reference but will be drastically simplified in future versions.
12
-
13
11
## Getting Started
14
12
15
13
### Prerequisites
@@ -20,10 +18,8 @@ Before contributing, ensure you have:
20
18
-**SMODS (Steamodded)**: Version 1.0.0-beta-0711a or newer
-**[DebugPlus](https://github.com/WilsontheWolf/DebugPlus)**: Essential for Lua API development and debugging
21
+
-**OS**: macOS, Linux. Windows is not currently supported
22
+
-**[DebugPlus](https://github.com/WilsontheWolf/DebugPlus) (optional)**: useful for Lua API development and debugging
27
23
28
24
### Development Environment Setup
29
25
@@ -40,30 +36,20 @@ Before contributing, ensure you have:
40
36
uv sync --all-extras
41
37
```
42
38
43
-
3. **Set Up Balatro with Mods**
44
-
45
-
**macOS** (currently supported):
39
+
3. **Stars Balatro with Mods**
46
40
47
41
```bash
48
-
./balatro.sh > balatro.log 2>&1& sleep 10 &&echo'Balatro started and ready'
42
+
./balatro.sh -p 12346
49
43
```
50
44
51
-
- **Linux**: We need a robust cross-platform script! Feel free to [open an issue](https://github.com/S1M0N38/balatrobot/issues/new) and contribute a Linux-compatible version.
52
-
53
-
- **Windows**: Development on Windows is not currently supported.
54
-
55
-
!!! Tip
56
-
57
-
Right now I'm using this [`balatro.sh`](https://gist.github.com/S1M0N38/4653c532bf048474100df3a270822bb4) script to start balatro with mods.
58
-
59
-
4. **Verify Game Setup**
45
+
4. **Verify Balatro is Running**
60
46
61
47
```bash
62
48
# Check if Balatro is running
63
-
ps aux | grep -E "(Balatro\.app|balatro\.sh)" | grep -v grep
49
+
./balatro.sh --status
64
50
65
51
# Monitor startup logs
66
-
tail -n 100 balatro.log
52
+
tail -n 100 logs/balatro_12346.log
67
53
```
68
54
69
55
Look for these success indicators:
@@ -72,7 +58,6 @@ Before contributing, ensure you have:
72
58
- "BalatroBot loaded - version X.X.X"
73
59
- "TCP socket created on port 12346"
74
60
75
-
76
61
## How to Contribute
77
62
78
63
### Types of Contributions Welcome
@@ -95,8 +80,6 @@ Before contributing, ensure you have:
95
80
96
81
```bash
97
82
git checkout -b feature/your-feature-name
98
-
# or
99
-
git checkout -b fix/issue-description
100
83
```
101
84
102
85
3. **Make Changes**
@@ -110,7 +93,7 @@ Before contributing, ensure you have:
110
93
- **Important**: Enable "Allow edits from maintainers" when creating your PR
111
94
- Link to related issues
112
95
- Provide clear description of changes
113
-
- Include testing instructions
96
+
- Include test for new functionality
114
97
115
98
### Commit Messages
116
99
@@ -143,27 +126,123 @@ basedpyright
143
126
### Testing Requirements
144
127
145
128
!!! warning
146
-
All tests require Balatro to be running in the background.
129
+
130
+
All tests require Balatro to be running in the background. Use `./balatro.sh --status` to check if the game is running.
131
+
132
+
#### Single Instance Testing
147
133
148
134
```bash
149
-
# Start Balatro first
150
-
./balatro.sh > balatro.log 2>&1& sleep 10
135
+
# Start Balatro with default port (12346)
136
+
./balatro.sh -p 12346
151
137
152
-
# Run all tests (stops on first failure)
153
-
pytest -x
138
+
# Run all tests
139
+
pytest
154
140
155
141
# Run specific test file
156
-
pytest -x tests/lua/test_api_functions.py
142
+
pytest tests/lua/test_api_functions.py
157
143
158
-
# Run with verbose output
144
+
# Run with verbose output and stop on first failure
#### Parallel Testing with Multiple Balatro Instances
152
+
153
+
The test suite supports running tests in parallel across multiple Balatro instances. This dramatically reduces test execution time by distributing tests across multiple game instances.
154
+
155
+
**Setup for Parallel Testing:**
156
+
157
+
1. **Check existing instances and start multiple Balatro instances on different ports**:
158
+
159
+
```bash
160
+
# First, check if any instances are already running
161
+
./balatro.sh --status
162
+
163
+
# If you need to kill all existing instances first:
164
+
./balatro.sh --kill
165
+
```
166
+
167
+
```bash
168
+
# Start two instances with a single command
169
+
./balatro.sh -p 12346 -p 12347
170
+
171
+
# With performance optimizations for faster testing
172
+
./balatro.sh --fast -p 12346
173
+
174
+
# Headless mode for server environments
175
+
./balatro.sh --headless -p 12346
176
+
177
+
# Fast Headless mode on 4 instances (recommended configuration)
0 commit comments