feat: add Attack Ranges Plus plugin#477
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds the new Attack Ranges Plus plugin to the Microbot RuneLite client, including overlay rendering, configuration, and user-facing documentation.
Changes:
- Introduces plugin entrypoint, config options, and display/range mode enums.
- Implements an overlay that computes LoS-clipped attackable tiles and renders an outline (and optional fill) for player and optionally opponent.
- Adds end-user README documentation for features, setup, and limitations.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/resources/net/runelite/client/plugins/microbot/attackrangesplus/docs/README.md | Adds user documentation for the plugin’s purpose, features, configuration, and limitations. |
| src/main/java/net/runelite/client/plugins/microbot/attackrangesplus/RangeMode.java | Adds range sizing modes (auto vs fixed overrides) for configuration/UI. |
| src/main/java/net/runelite/client/plugins/microbot/attackrangesplus/DisplayMode.java | Adds overlay visibility modes (always / PvP areas / wilderness). |
| src/main/java/net/runelite/client/plugins/microbot/attackrangesplus/AttackRangesPlusPlugin.java | Registers the plugin and overlay with the client and provides config injection. |
| src/main/java/net/runelite/client/plugins/microbot/attackrangesplus/AttackRangesPlusOverlay.java | Implements LoS-clipped tile computation plus cached path rendering for player/opponent. |
| src/main/java/net/runelite/client/plugins/microbot/attackrangesplus/AttackRangesPlusConfig.java | Adds configuration items and in-client config panel information text. |
| src/main/java/net/runelite/client/plugins/microbot/attackrangesplus/AttackRangesPlusCalc.java | Adds radius resolution for player (auto via Rs2Combat) and opponent (weapon data lookup). |
| | Feature | Description | | ||
| |---------|-------------| | ||
| | **Attack style - Auto (detect)** | Reads your equipped weapon and selected attack style to show your exact reach - long-range, autocast spell range, halberds at 2 tiles, melee at 1. Recommended. | | ||
| | **Attack style - Melee / Ranged / Magic** | Fixed overrides: Melee forces 1 tile, Ranged forces 7 tiles (representative preview), Magic forces 10 tiles (use this when you click-cast without autocast set). | | ||
| | **Line color** | Color of the attack-range outline drawn on the ground. | | ||
| | **Fill area** | Shades the tiles inside your attack range. Off by default - the fill is repainted every frame and costs FPS at large ranges such as magic. The outline alone is cheap. | | ||
| | **Fill color** | Color and opacity of the shaded area (used only when Fill area is on). | | ||
| | **Show overlay** | Controls when the overlay appears: Always, In PvP areas (Wilderness, PvP/Deadman worlds, and PvP-flagged zones), or Wilderness only. | | ||
| | **Show target's range** | Also outlines the attack range of the player you are currently fighting, based on their equipped weapon's base reach. | | ||
| | **Target line color** | Outline color used for the target's range indicator. | |
| private void buildPaths(WorldView wv, int plane) | ||
| { | ||
| final GeneralPath f = new GeneralPath(GeneralPath.WIND_NON_ZERO); | ||
| final GeneralPath o = new GeneralPath(); |
| if (!set.contains(tile.dy(1)) && nw != null && ne != null) // north | ||
| { | ||
| segment(o, nw, ne); | ||
| } | ||
| if (!set.contains(tile.dy(-1)) && sw != null && se != null) // south | ||
| { | ||
| segment(o, sw, se); | ||
| } | ||
| if (!set.contains(tile.dx(1)) && se != null && ne != null) // east | ||
| { | ||
| segment(o, se, ne); | ||
| } | ||
| if (!set.contains(tile.dx(-1)) && sw != null && nw != null) // west | ||
| { | ||
| segment(o, sw, nw); | ||
| } |
| private static Map<Integer, Weapon> weaponsMap; | ||
|
|
||
| private static Map<Integer, Weapon> weapons() | ||
| { | ||
| if (weaponsMap == null) | ||
| { | ||
| weaponsMap = WeaponsGenerator.generate(); | ||
| } | ||
| return weaponsMap; | ||
| } |
| try | ||
| { | ||
| return Math.max(Rs2Combat.getAttackRange(), 0); | ||
| } | ||
| catch (Exception e) | ||
| { | ||
| return MELEE_RADIUS; | ||
| } |
…read-safe weapon map, log AUTO fallback Addresses Copilot review feedback on chsami#477. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Addressed: the fill path is now only built while Show fill is enabled, the weapon map uses an initialization-on-demand holder (thread-safe), and the AUTO range fallback logs once at debug instead of failing silently. On the remaining two: the README table uses standard single-pipe rows (there are no double pipes in the file), and the neighbor-check allocations are bounded (the LoS set rebuilds at most once per game tick at radius 10 or less, roughly 1.7k short-lived WorldPoints), so the readable WorldPoint-set form is kept. |
Summary
New plugin: Attack Ranges Plus, an overlay that draws your attack range on the ground, clipped to line of sight, with the radius auto-detected from your equipped weapon and combat style (melee, ranged including longrange, magic while autocasting) via
Rs2Combat.getAttackRange(). An optional second outline shows the interacting player's threat range (their weapon's base reach). Display can be gated to PvP areas or the Wilderness only.Pure overlay, no automation: it never clicks, moves, or casts.
Implementation notes:
WorldArea.hasLineOfSightToper tile; the boundary is built as one cachedGeneralPath, rebuilt only on origin, radius, or game-tick change, with the translucent fill OFF by default to keep FPS at baseline.render()on the client thread.PluginConstants.javaas a follow-up if preferred.Contents
attackrangesplus/(6 classes: Plugin, Config, Overlay, Calc, RangeMode, DisplayMode)resources/.../attackrangesplus/docs/README.md+assets/icon.png+assets/card.pngTesting
./gradlew clean buildgreen on JDK 11 (Temurin), matching CI;generatePluginsJsonpicks the plugin up with the correct metadata.🤖 Generated with Claude Code