Skip to content

feat: add adaptive Pest Control strategy - #522

Open
JogOnJohn wants to merge 2 commits into
chsami:mainfrom
JogOnJohn:fix/pest-control-adaptive-strategy
Open

feat: add adaptive Pest Control strategy#522
JogOnJohn wants to merge 2 commits into
chsami:mainfrom
JogOnJohn:fix/pest-control-adaptive-strategy

Conversation

@JogOnJohn

@JogOnJohn JogOnJohn commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

This overhauls Pest Control from a configurable NPC-priority loop into an adaptive, portal-first strategy designed to contribute aggressively to fast mass-world wins.

The plugin now treats vulnerable portals as the main objective, preserves activity through deliberate fallback combat, handles Pest Control's gates and Brawler obstructions, supports ordered multi-style loadouts, and exposes its runtime decisions through a substantially expanded overlay.

Strategy and state machine

  • Replaces the old NPC Priority 1/2/3 configuration with explicit runtime states for initialization, travel, requeue, boat waiting, opening movement, portal pre-positioning, portal pursuit, Spinner combat, activity recovery, gate handling, Brawler avoidance, and error recovery.
  • Confirms Auto Retaliate is disabled at startup and every round entry.
  • Prioritizes active portal pressure, killing a Spinner healing the selected portal before resuming the portal attack.
  • Uses a 40% activity-recovery trigger and continues recovery toward 70%.
  • Activity recovery prefers a nearby Spinner, then a nearby Torcher for ranged-friendly recovery, then the lowest-level ordinary non-Brawler pest.
  • Excludes Brawlers from routine activity fallback; they are attacked only when they physically prevent movement and flanking cannot clear the route.
  • Uses a randomized opening target with configurable Purple, Blue, and Yellow weights. Red is intentionally excluded as an opening side.
  • Pre-positions at the remaining shielded portal when the round reaches a sole pending shield.

Adaptive portal targeting

  • Tracks shield drops from Pest Control game messages.
  • Independently verifies vulnerability from each portal NPC's Attack action, allowing recovery from missed chat messages or mid-round startup.
  • Counts nearby players and joins an active portal group instead of selecting solely by distance.
  • Retains a live target to avoid oscillation between portals as crowd counts fluctuate.
  • Uses Purple as the tie-break preference.

Movement, gates, and obstruction recovery

  • Favors direct NPC interaction when the target is visible and interactable.
  • Uses short, non-blocking canvas/minimap movement steps rather than blocking full-map walks during rounds.
  • Stages ranged and magic loadouts in front of portals at normal attack distance instead of repeatedly forcing the player behind them.
  • Steers the camera once toward newly selected portal objectives.
  • Routes east/west travel around the outer perimeter where appropriate.
  • Detects and opens intact lane gates, commits through confirmed openings, and suppresses repeated gate clicks.
  • Recognizes the totally destroyed Pest Control gate variant as passable even when its composition still advertises Open.
  • Detects Brawlers intersecting movement routes, attempts reachable compass-direction flanks, and attacks the Brawler as a deterministic fallback.
  • Includes a six-second movement/interaction watchdog that clears stale walking state and issues fresh commands based on observed progress.

Combat loadouts

  • Adds ordered Style 1, Style 2, and Style 3 configuration for Ranged, Magic, and Melee.
  • Keeps Style 1 mandatory and uses it as the fallback when an optional portal-specific weapon is blank or None.
  • Treats a blank or None off-hand as an explicitly empty shield slot.
  • Forces Ranged weapons onto Rapid and verifies the resulting combat mode.
  • Supports powered-staff Magic or one-time startup autocast preparation.
  • Supports Yellow portal Stab/Slash selection and a separate Red portal Crush loadout.
  • Switches the matching Void helmet automatically when the complete enabled-style helmet set is available; otherwise leaves the head slot untouched for non-Void setups.
  • Verifies weapon, off-hand, helmet, and combat mode before dispatching the final attack.
  • Remembers verified weapon/style pairs so routine weapon switches do not repeatedly open the Combat interface.
  • Adds independent portal-specific special-attack toggles.
  • Restores Style 1 after a round once boat entry has been confirmed.

Round lifecycle and accounting

  • Enables Moderate activity intensity when the plugin starts.
  • Handles Quick Prayer once per round without blocking round movement.
  • Clears stale walking routes immediately when a round ends.
  • Prioritizes immediate reboarding and guards the gangplank interaction for three seconds to prevent duplicate boarding clicks.
  • Preserves fast winning-team requeues where the next launch can occur within five seconds.
  • Reconciles played, won, and lost counters so played = won + lost.
  • Uses reward chat or a positive commendation-point delta as authoritative win evidence.
  • Deduplicates point-award messages and preserves delayed round evidence across the boat transition.
  • Tracks session points from award messages and the boat's total-points overlay without double-counting.

Diagnostics and configuration

  • Publishes every runtime state through Microbot.status and logs meaningful state transitions.
  • Expands the overlay with location, state detail, activity thresholds, target portal/crowd/source, portal counts, current weapon/style, Auto Retaliate state, boarding state, W/L/points, state age, progress age, and command age.
  • Reorganizes the configuration panel into General, Combat Styles, Ranged, Magic, Melee, Opening Strategy, and Special Attack sections.
  • Updates the public plugin documentation for the new strategy and loadout model.
  • Bumps Pest Control from 2.3.4 to 2.5.7 and requires Microbot 2.6.15 or newer.

Compatibility note

Melee mode detection matches visible Combat-tab option text. The intended Rapid, Dragon scimitar Slash, and DDS Stab options use matching names. A configured crush weapon whose button is named Pummel or Smash rather than Crush should be live-verified before relying on that switch.

Validation

  • PestControlPluginJar packaged successfully against Microbot 2.6.15.
  • The packaged 2.5.6 JAR was installed and smoke-tested; the final 2.5.7 compatibility bump packaged successfully against the same client baseline.
  • An operator smoke test completed one full round successfully on Microbot 2.6.16.
  • Focused regression coverage was added for combat-plan resolution, opening selection, loadout fallback, Void helmet requirements, reward-backed accounting, counter reconciliation, point deduplication, and destroyed-gate recognition.

@JogOnJohn
JogOnJohn marked this pull request as ready for review July 29, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant