aboutsummaryrefslogtreecommitdiffstats
path: root/docs/daffy.md
blob: d9a8311b217b0108d06ecd3c940efd673b68a8a3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# daffy

Duck hunting game bot. Ducks appear at random intervals; players race to shoot
them. Scores are stored in SQLite. The hunt auto-stops after a configurable
number of rounds with no participants.

## Dependencies

No external libraries required.

## Commands

### Game (anyone in channel)
| Command | Description |
|---------|-------------|
| `!bang` | Fire at the current duck |
| `!reload` | Refill ammo (3-second cooldown) |
| `!score` | Top 5 players for this channel |
| `!score clear` | Clear scores for this channel (owner/op) |

Owner can also use `!score clear all` or `!score clear #channel` from PM.

### Hunt control (owner / op)
| Command | Description |
|---------|-------------|
| `!hunt` | Show hunt state (on/off/active, idle counter) |
| `!hunt start` | Start the hunt |
| `!hunt stop` | Stop the hunt |
| `!hunt idle <N>` | Set empty-round auto-stop threshold (0 = never); takes effect immediately if threshold is already met |

### Admin (owner)
| Command | Description |
|---------|-------------|
| `!join #channel` | Join a channel |
| `!part [#channel]` | Leave a channel |
| `!chans` | List channels |
| `!help` | Show usage (PM) |

## How it works

- A duck spawns every `spawn_min` to `spawn_max` seconds (random, default 1-5 minutes).
- First player to `!bang` scores a point. Each player has one shell; use `!reload` to reload.
- `!bang` and `!reload` are ignored while the hunt is off.
- If no one shoots within `flee_time` seconds (default 45), the duck flees and the round is marked empty.
- After `idle_rounds` consecutive empty rounds the hunt auto-stops.

## Config keys

| Key | Default | Description |
|-----|---------|-------------|
| `[daffy] db_path` | `~/daffy_scores.db` | Path to SQLite scores database |
| `[daffy] idle_rounds` | 3 | Empty rounds before auto-stop (0 = never) |
| `[daffy] spawn_min` | 60 | Minimum seconds between duck spawns |
| `[daffy] spawn_max` | 300 | Maximum seconds between duck spawns |
| `[daffy] flee_time` | 45 | Seconds before an unshot duck flees |