Repository navigation
eve-online-mining-bot: add aggressive=yes flag to fight rather than flee - #493
Merged
Merged
Conversation
Adds an `aggressive` setting (yes/no, default no) that replaces both of this bot's flee responses -- the shield-percentage trigger and (from #490/#491) the wormhole D-Scan hostile trigger -- with launching drones, locking the highest-priority hostile on the overview, and sending the drones after it. Hostile identification reuses what already exists rather than adding new parsing: a rat by the client's own icon colour (`ratsOnTheOverview`, already built for the wormhole feature) and anything reading `commonIndications.isWarpDisruptingMe`, which is checked first regardless of distance since it is the one thing standing between the ship and leaving -- the same priority every combat-capable bot in this repo gives a scrambler. `engageHostiles` is the single gate: it reads the setting once and answers `Nothing` immediately when it is off or when there is nothing on the overview to fight, so both callers fall back to their existing `runAway` unchanged. Locking reuses `lockTargetFromOverviewEntryAndEnsureIsInRange` with the existing `targeting-range` setting; engaging is a new context-menu cascade ("Engage Target") on the drones-in-space group, the same shape `launchDrones`/`returnDronesToBay` already use on the sibling group. Drone-only, deliberately -- this bot has no weapon-activation logic and adding one is out of scope here. Verified without a live client: the whole file compiles clean under `elm make`, and `chooseHostileToEngage`/`hostileEngagementPriority` (the warp-disruptor-first, then-nearest selection) were executed through the real `Bot.elm` in `elm repl` against synthetic overview entries, including the empty-list and no-scrambler cases. `hostileOverviewEntries` and the two call-site wirings are exercised only by the whole-file compile, since building a full synthetic `ReadingFromGameClient` for the repl was not practical in the time available. Not run against a live client. Fixes #492 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #491 (
mining-bot-wormhole-dscan), since this reuseswormholeSafetyStep's D-Scan hostile trigger as one of its two flee-replacement points -- this diff is just the aggressive-mode commit on top of it and will shrink to that alone once #491 merges and this is retargeted atmain.aggressivesetting (yes/no, defaultno). Wherever this bot would otherwise flee -- the shield-percentage trigger, or (withwormhole=yes) the D-Scan hostile trigger -- it instead launches drones, locks the highest-priority hostile on the overview, and sends the drones after it.ratsOnTheOverview), plus anything readingcommonIndications.isWarpDisruptingMe-- checked first regardless of distance, since a scrambler is the one thing standing between the ship and leaving.engageHostilesis the single gate reading the setting; both callers fall back to their existingrunAwayunchanged when it's off or when there's nothing on the overview to fight (e.g. a wormhole hostile the Directional Scanner has seen but that hasn't arrived on grid yet).Fixes #492.
Test plan
elm make Bot.elmcompiles clean.elm-format --validatepasses.chooseHostileToEngage/hostileEngagementPriority(warp-disruptor-first, then-nearest) executed through the realBot.elminelm replagainst synthetic overview entries: a scrambler farther away still wins over two closer rats; the nearest rat wins with no scrambler present; an empty list answersNothing.hostileOverviewEntriesand both call-site wirings are exercised only by the whole-file compile -- building a full syntheticReadingFromGameClientfor the repl wasn't practical in the time available.aggressive=yesrun: drones launching and the status line'sAggressive: fighting '<name>'clause naming a hostile, a warp-disrupting entry being locked ahead of a nearer plain rat when both are present, and the ship still fleeing (not sitting idle) on a trigger where nothing is on the overview to fight.🤖 Generated with Claude Code