Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
7fb2660
fix(birdhouse): invoke Rs2Walker in TELEPORTING state, hardcode musht…
runsonmypc May 25, 2026
e7fc932
feat(AutoLooter): add Priority Mode to interrupt other plugins for lo…
runsonmypc Jun 9, 2026
91dcae4
fix(eventdismiss): dismiss lamp award dialogue so blocking event rele…
runsonmypc Jun 9, 2026
3cb38b2
fix(motherloadmine): keep mining loop alive after a thrown tick
runsonmypc Jun 9, 2026
1f7e053
fix(cooking): correct botanical pie name typo and uncooked egg item ids
pjmarz Jun 9, 2026
ac17654
feat(attackrangesplus): add Attack Ranges Plus plugin (v0.2.3)
pjmarz Jun 9, 2026
0546f26
feat(firemakingplus): add Auto Firemaking Plus plugin (v0.2.2)
pjmarz Jun 9, 2026
4b8ac6d
feat(microbotdashboardplus): add Microbot Dashboard Plus plugin (v1.2.0)
pjmarz Jun 9, 2026
e376c0a
fix(cooking): keep uncooked egg cookable on both fire and range
pjmarz Jun 9, 2026
ed9276d
refactor(attackrangesplus): skip fill-path build when fill is off, th…
pjmarz Jun 9, 2026
4335509
fix(firemakingplus): bank-first stop conditions, snapshot-based tile …
pjmarz Jun 9, 2026
059b546
fix(microbotdashboardplus): bound XP history memory, fix races and st…
pjmarz Jun 9, 2026
30db47f
Publish BankOrganizer plugin
bgatfa Jun 10, 2026
054ea25
Publish BankOrganizer plugin
bgatfa Jun 10, 2026
49992b6
Update README.md
bgatfa Jun 10, 2026
24e7008
Publish plugin docs at Pages root
bgatfa Jun 11, 2026
055b15c
Publish BankOrganizer plugin
bgatfa Jun 11, 2026
240c59e
Publish BankOrganizer plugin
bgatfa Jun 11, 2026
a8c3472
Restore docs output path
bgatfa Jun 11, 2026
2e6ad08
Publish BankOrganizer plugin
bgatfa Jun 11, 2026
40df876
Delete src/main/resources/net/runelite/client/plugins/microbot/bankor…
bgatfa Jun 11, 2026
5aaaae2
Delete src/main/resources/net/runelite/client/plugins/microbot/bankor…
bgatfa Jun 11, 2026
cc98895
feat(microbotdashboardplus): pet drop alert (banner + Discord), from …
pjmarz Jun 12, 2026
ac8625f
fix(GotrPlugin): stop idle stalls in Guardians of the Rift
runsonmypc Jun 12, 2026
59fa46b
fix(GotrPlugin): always deposit crafted runes at the end of a round
runsonmypc Jun 13, 2026
10c1dc9
fix(karambwan): fairy ring interaction, remove isInteracting, deposit…
runsonmypc Jun 14, 2026
7b46dc9
fix(karambwan): Zanaris fairy ring interaction, remove isInteracting,…
runsonmypc Jun 14, 2026
c212fd6
Merge pull request #473 from runsonmypc/feature/looter-priority
chsami Jun 16, 2026
819aaa9
Merge pull request #474 from runsonmypc/fix/random-handler
chsami Jun 16, 2026
cedef73
Merge pull request #475 from runsonmypc/fix/mlm
chsami Jun 16, 2026
98d7b27
Merge pull request #476 from pjmarz/fix/cooking-cookingitem-data
chsami Jun 16, 2026
46e33e9
Merge pull request #477 from pjmarz/feat/attackrangesplus-plugin
chsami Jun 16, 2026
afa15a5
Merge pull request #478 from pjmarz/feat/firemakingplus-plugin
chsami Jun 16, 2026
e9b7be9
Merge pull request #479 from pjmarz/feat/microbotdashboardplus-plugin
chsami Jun 16, 2026
b7cffd9
Merge pull request #480 from bgatfa/development
chsami Jun 16, 2026
0edf83d
Merge pull request #481 from runsonmypc/fix/birdhouse-skip-steps
chsami Jun 16, 2026
68924fe
Merge pull request #484 from runsonmypc/fix/gotr-idle
chsami Jun 16, 2026
b5b5ec4
Merge pull request #485 from runsonmypc/fix/karambwan-fairy-ring
chsami Jun 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
package net.runelite.client.plugins.microbot.attackrangesplus;

import lombok.extern.slf4j.Slf4j;
import net.runelite.client.plugins.microbot.util.combat.Rs2Combat;
import net.runelite.client.plugins.microbot.util.combat.weapons.Melee;
import net.runelite.client.plugins.microbot.util.combat.weapons.Weapon;
import net.runelite.client.plugins.microbot.util.combat.weapons.WeaponsGenerator;

import javax.inject.Inject;
import java.util.Map;

/**
* Resolves the attack radius (in tiles) for the overlay.
*
* <p><b>Player:</b> AUTO delegates to {@link Rs2Combat#getAttackRange()}, the maintained Microbot
* helper that reads the equipped weapon and the selected attack style and returns the real range:
* accurate per weapon, long-range aware, the spell range while autocasting, halberds = 2, and 1 for
* melee/unknown. The manual modes are fixed representative ranges for previewing a style you are not
* currently using.</p>
*
* <p><b>Opponent:</b> another player's attack-style varbits are not readable, so their range is
* looked up from their equipped weapon id against the same weapon data Microbot uses
* ({@link WeaponsGenerator#generate()}). That gives the weapon's base reach (no style modifier);
* melee weapons resolve to 1 since their stored range is the special-attack range.</p>
*/
@Slf4j
public class AttackRangesPlusCalc
{
@Inject
private AttackRangesPlusConfig config;

private static final int MELEE_RADIUS = 1;
private static final int RANGED_PREVIEW_RADIUS = 7;
private static final int MAGIC_RADIUS = 10;

/**
* Initialization-on-demand holder: the map is built once, thread-safely, on first use.
* Same data Rs2Combat uses; reused for opponent weapon lookups.
*/
private static final class WeaponsHolder
{
private static final Map<Integer, Weapon> MAP = WeaponsGenerator.generate();
}

/** Set once when the AUTO range lookup fails, so the fallback is logged once rather than per tick. */
private boolean autoRangeFailureLogged;

/**
* @return the local player's attack radius in tiles (>= 0). Never throws.
*/
public int getPlayerRangeRadius()
{
switch (config.style())
{
case MELEE:
return MELEE_RADIUS;
case RANGED:
return RANGED_PREVIEW_RADIUS;
case MAGIC:
return MAGIC_RADIUS;
case AUTO:
default:
try
{
return Math.max(Rs2Combat.getAttackRange(), 0);
}
catch (Exception e)
{
if (!autoRangeFailureLogged)
{
autoRangeFailureLogged = true;
log.debug("Rs2Combat.getAttackRange failed; falling back to melee radius", e);
}
return MELEE_RADIUS;
}
}
}

/**
* Threat radius for another player's equipped weapon. Their attack style is not knowable, so
* this is the weapon's base reach.
*
* @param weaponId the opponent's equipped weapon item id
* @return the radius in tiles (>= 1)
*/
public int getWeaponRadius(int weaponId)
{
final Weapon w = WeaponsHolder.MAP.get(weaponId);
if (w == null)
{
return MELEE_RADIUS; // unknown weapon -> assume melee reach
}
if (w instanceof Melee)
{
return MELEE_RADIUS; // Melee.range stores the special-attack range, not normal reach
}
// "Accurate" yields the weapon's base (non-long-range) reach across all Weapon subtypes:
// Halberd=2, ranged base, magic/powered-staff spell range.
return Math.max(w.getRange("Accurate"), MELEE_RADIUS);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
package net.runelite.client.plugins.microbot.attackrangesplus;

import net.runelite.client.config.Alpha;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigInformation;
import net.runelite.client.config.ConfigItem;

import java.awt.Color;

@ConfigGroup("attackrangesplus")
@ConfigInformation("<h2>Attack Ranges Plus</h2>" +
"<h3>Version: " + AttackRangesPlusPlugin.version + "</h3>" +
"<p>This overlay draws your attack range on the ground, clipped to line of sight. It runs no script and never moves or banks for you.</p>" +
"<p></p>" +
"<p>1. <strong>Attack style:</strong> how the range is sized. Auto reads your weapon and falls back to melee. Pick Melee, Ranged, or Magic to force a size. Use Magic when casting at 10 tiles.</p>" +
"<p></p>" +
"<p>2. <strong>Line color:</strong> the color of the range outline.</p>" +
"<p></p>" +
"<p>3. <strong>Fill area:</strong> shades the tiles inside your range. The shading is redrawn every frame and can cost FPS at large ranges like magic. Leave it off for the cheapest outline only overlay.</p>" +
"<p></p>" +
"<p>4. <strong>Fill color:</strong> the color and opacity of the shaded area. Used only when Fill area is on.</p>" +
"<p></p>" +
"<p>5. <strong>Show overlay:</strong> when to draw it. Always shows it everywhere. In PvP areas limits it to the Wilderness, PvP and Deadman worlds, and PvP flagged zones.</p>" +
"<p></p>" +
"<p>6. <strong>Show target's range:</strong> also outline the range of the player you are fighting. Their exact style is not knowable, so this is their weapon's base reach.</p>" +
"<p></p>" +
"<p>7. <strong>Target line color:</strong> the outline color used for your target's range.</p>")
public interface AttackRangesPlusConfig extends Config
{
@ConfigItem(
keyName = "style",
name = "Attack style",
description = "How to size the overlay. Auto detects ranged weapons and falls back to melee. Pick Magic when casting (10 tiles).",
position = 0
)
default RangeMode style()
{
return RangeMode.AUTO;
}

@Alpha
@ConfigItem(
keyName = "borderColor",
name = "Line color",
description = "Color of the attack-range outline.",
position = 1
)
default Color borderColor()
{
return Color.WHITE;
}

@ConfigItem(
keyName = "showFill",
name = "Fill area",
description = "Shade the tiles inside your attack range. Note: the fill is repainted every frame and costs FPS at large ranges (e.g. magic). Leave off for the cheapest outline-only overlay.",
position = 2
)
default boolean showFill()
{
return false;
}

@Alpha
@ConfigItem(
keyName = "fillColor",
name = "Fill color",
description = "Color and opacity of the shaded area (used only when Fill area is on).",
position = 3
)
default Color fillColor()
{
return new Color(0, 0, 0, 35);
}

@ConfigItem(
keyName = "displayMode",
name = "Show overlay",
description = "When to show the overlay. 'In PvP areas' covers the Wilderness, PvP/Deadman worlds, and PvP-flagged zones.",
position = 4
)
default DisplayMode displayMode()
{
return DisplayMode.ALWAYS;
}

@ConfigItem(
keyName = "showOpponent",
name = "Show target's range",
description = "Also outline the attack range of the player you are fighting. Their exact style is not knowable, so this is their weapon's base reach.",
position = 5
)
default boolean showOpponent()
{
return false;
}

@Alpha
@ConfigItem(
keyName = "opponentColor",
name = "Target line color",
description = "Outline color for your target's range.",
position = 6
)
default Color opponentColor()
{
return new Color(255, 64, 64);
}
}
Loading
Loading