-
Notifications
You must be signed in to change notification settings - Fork 191
Hunting Buddy Plugins
Mahtra edited this page Aug 2, 2026
·
1 revision
hunting-buddy supports the shared Script Plugin System - read that page first for how plugins are written, loaded, and dispatched. This page lists the hooks hunting-buddy fires.
| Plugin file | scripts/custom/hunting-buddy-plugin-<name>.rb |
| Register with | HuntingBuddy.register_plugin(MyPlugin.new) |
| Global handle | $HUNTING_BUDDY |
| Debug flag | $debug_mode_hunting |
In the signatures below, buddy is the live HuntingBuddy instance. Kind is either decision (first non-nil return wins) or notify (all plugins called, return ignored).
| Hook | Kind | Fires |
|---|---|---|
after_initialize(buddy) |
notify | Once, when hunting-buddy has finished constructing |
find_room(buddy, zones_to_search, waiting_room) |
decision | When hunting-buddy needs to choose a room to hunt in |
before_hunt(buddy, hunting_room:) |
notify | Once, before the hunt loop begins |
hunt_tick(buddy, counter:) |
decision | Once per hunt-loop iteration |
hunt_status(buddy, counter:, duration:) |
notify | On the periodic status update (every 60th tick, roughly once a minute) |
after_hunt(buddy, hunting_room:, counter:) |
notify | Once, after the hunt loop ends |
cleanup(buddy) |
notify | Once, during teardown |
Decision hooks:
-
find_room- return a non-nilresult to take over room selection (this becomes hunting-buddy'sfind_hunting_room?result); returnnilto let hunting-buddy find the room itself.zones_to_searchandwaiting_roomare the context hunting-buddy computed. -
hunt_tick- return:breakto stop the hunt loop.counteris the 1-based iteration count.
Implement only the hooks you need, and tolerate new ones appearing over time.
# scripts/custom/hunting-buddy-plugin-lifelog.rb
class LifeLogPlugin
def after_initialize(_buddy)
echo '[lifelog] hunting-buddy loaded'
end
def before_hunt(_buddy, hunting_room:)
echo "[lifelog] starting hunt in room #{hunting_room}"
end
def after_hunt(_buddy, hunting_room:, counter:)
echo "[lifelog] hunt ended after #{counter} ticks in room #{hunting_room}"
end
end
HuntingBuddy.register_plugin(LifeLogPlugin.new)