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
## Summary
- Adds a generic plugin architecture to hunting-buddy that lets custom
scripts hook into the hunting lifecycle without modifying the core
script
- Plugins auto-load from `scripts/custom/hunting-buddy-plugin-*.rb` and
register via `HuntingBuddy.register_plugin(instance)`
- Fixes combat-trainer stop to use a 30s timeout with force-kill instead
of an infinite `pause 1 while` loop
## Plugin hooks
| Hook | Type | Purpose |
|------|------|---------|
| `:after_initialize` | notify | Post-setup customization |
| `:find_room` | fire (first non-nil wins) | Plugin-first room finding |
| `:before_hunt` / `:after_hunt` | notify | Pre/post combat setup and
teardown |
| `:hunt_tick` | fire (return `:break` to end) | Per-second loop
injection |
| `:hunt_status` | notify | Periodic status reporting |
| `:cleanup` | notify | `before_dying` teardown |
## Design
- `fire_hook` returns the first non-nil result from any plugin (for
decision hooks like `:find_room`)
- `notify_hook` calls all plugins and swallows errors (for event hooks)
- `method_missing` forwards unknown calls to plugins, enabling external
API like `$HUNTING_BUDDY.custom_method`
- All hooks are no-ops when no plugins are registered -- zero behavior
change for existing users
## Test plan
- [x] Run hunting-buddy with no plugins in `scripts/custom/` -- behavior
identical to current
- [x] Run hunting-buddy with a test plugin that implements
`after_initialize` -- verify hook fires
- [x] Run hunting-buddy with a plugin that raises in a hook -- verify
error is logged and script continues
- [x] Verify combat-trainer force-kill after 30s timeout works when CT
hangs
- [x] Verify `$HUNTING_BUDDY.stop_hunting` and
`$HUNTING_BUDDY.next_hunt` still work as before
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
hunting_room = Room.current.id # Update in case a plugin relocated us
554
+
return if @stop_hunting
555
+
487
556
Flags.add('hunting-buddy-familiar-drag', /^Your .+ grabs ahold of you and drags you .+, out of combat.+$/)
488
557
Flags.add('hunting-buddy-stop-to-burgle', /^A tingling on the back of your neck draws attention to itself by disappearing, making you believe the heat is off from your last break in/)
489
558
DRC.message("***STATUS*** Beginning hunt '#{args}' for '#{duration}' minutes")
0 commit comments