Skip to content

Commit bf19dbc

Browse files
committed
Update README, add template .env file
1 parent a43d15b commit bf19dbc

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

.env.template

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Login information for each bot account on hanab.live
2+
export HANABI_USERNAME1=
3+
export HANABI_PASSWORD1=
4+
5+
export HANABI_USERNAME2=
6+
export HANABI_PASSWORD2=

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# hanabi-bot
22
A deterministic NodeJS bot that plays on the [hanab.live](https://hanab.live/) interface. Basic structure and ideas were taken from [Zamiell's example bot](https://github.com/Zamiell/hanabi-live-bot) (Python).
33

4-
Currently, it plays around level 4 of [H-Group](https://hanabi.github.io/). The goal of the bot is to play with humans, so it should be able to handle suboptimal play within reason. However, it still expects that the conventions are followed (in terms of focus, chop, etc.) and does not perform any "learning".
4+
Currently, it can play around levels 1-4 of [H-Group](https://hanabi.github.io/). The goal of the bot is to play with humans, so it should be able to handle suboptimal play within reason. However, it still expects that the conventions are followed (in terms of focus, chop, etc.) and does not perform any "learning".
55

66
https://user-images.githubusercontent.com/25177576/190633432-57b527da-786e-4c24-92d0-e1d01291986e.mp4
77

@@ -12,14 +12,15 @@ https://user-images.githubusercontent.com/25177576/190633432-57b527da-786e-4c24-
1212
- Export the environment variables `HANABI_USERNAME` and `HANABI_PASSWORD` for the bot to log in.
1313
- You'll need to create its account on hanab.live first.
1414
- Run `npm start` to start the bot.
15-
- If you want to run multiple bot accounts using one env file, export environment variables with a number at the end (like `HANABI_USERNAME2`) and use `npm start -- index=2`.
15+
- If you want to run multiple bot accounts using one env file, export environment variables with a number at the end (like `HANABI_USERNAME2`) and use `npm start -- index=2`. See `.env.template` for an example.
1616

1717
## Supported commands
18-
Send a PM to the bot on hanab.live to interact with it.
18+
Send a PM to the bot on hanab.live (`/pm <HANABI_USERNAME> <message>`) to interact with it.
1919
- `/join [password]` to join your current lobby. The bot will remain in your table until it is kicked with `/leave`.
2020
- `/rejoin` to rejoin a game that has already started (e.g. if it crashed).
2121
- `/leave` to kick the bot from your table.
2222
- `/create <name> <maxPlayers> <password>` to have the bot create a table. The name can't have spaces.
23-
- `/start <tableId>` to have the bot start the game (only works if it created the table).
23+
- `/start` to have the bot start the game (only works if it created the table).
24+
- `/settings [conventions='HGroup'] [level]` to set or view the bot's conventions and level. The bot plays with H-Group conventions at level 1 by default.
2425

2526
Feel free to report any issues [here](https://github.com/WillFlame14/hanabi-bot/issues)!

src/command-handler.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ export const handle = {
7676
const parts = data.msg.split(' ');
7777
Utils.sendCmd('tableCreate', { name: parts[1], maxPlayers: Number(parts[2]), password: parts[3] });
7878
}
79-
// Starts the game (format: /start <tableId>)
79+
// Starts the game (format: /start)
8080
else if (data.msg.startsWith('/start')) {
81-
Utils.sendCmd('tableStart', { tableID: Number(data.msg.slice(data.msg.indexOf(' ') + 1)) });
81+
Utils.sendCmd('tableStart', { tableID: state.tableID });
8282
}
8383
// Displays or modifies the current settings (format: /settings [convention = 'HGroup'] [level = 1])
8484
else if (data.msg.startsWith('/settings')) {

0 commit comments

Comments
 (0)