SafespotAPI
PvP safespot API based on the local PK API rules.
Final classRLPlugins API
public final class SafespotAPIThis API is for player-versus-player combat. It resolves the same focused target as CombatTimingAPI, scans walkable tiles around that player, and returns tiles where the target does not have line of sight. It deliberately does not run the heavier gap/escape path engine. Use these results as a cheap combat geometry layer, then issue movement through MovementAPI.
Default bucket rules:
- getSafeSpots0To10: tiles at distance 0..10 from the target with blocked target line of sight.
- getSafeSpots10Plus: tiles at distance 11..15 from the target with blocked target line of sight.
- getClosestAttackTile: nearest walkable tile within 10 tiles of the target that has line of sight to attack.
Members
Static methods
- SafespotResultanalyze()
Builds a safespot result for the currently resolved combat target.
- SafespotResultanalyze(PlayerEx)
Builds a safespot result for an explicit player target.
- SafespotResultanalyze(PlayerEx, SafespotOptions)
Builds a safespot result for a player target.
- SafespotResultanalyzeTargetName(String)
Builds a safespot result after resolving a player name as the combat focus.
- SafespotResultanalyzeTargetName(String, SafespotOptions)
Builds a safespot result after resolving a player name as the combat focus.
- voidclearPlan()
Clears the cached safespot result.
- List<WorldPoint>getAllSafeSpots()
Returns all safespot tiles for the resolved target.
- List<WorldPoint>getAllSafeSpots(PlayerEx)
Returns all safespot tiles for an explicit target.
- WorldPointgetClosestAttackTile()
Returns the closest visible attack tile for the resolved target.
- WorldPointgetClosestAttackTile(PlayerEx)
Returns the closest visible attack tile for an explicit target.
- WorldPointgetClosestSafeSpotTile()
Returns the closest reachable safespot for the resolved target.
- WorldPointgetClosestSafeSpotTile(PlayerEx)
Returns the closest reachable safespot for an explicit target.
- SafespotPlangetLatestPlan()
Returns the latest completed safespot plan.
- SafespotResultgetLatestResult()
Returns the latest safespot query result.
- List<WorldPoint>getSafeSpots0To10()
Returns close safespot tiles for the resolved target.
- List<WorldPoint>getSafeSpots0To10(PlayerEx)
Returns close safespot tiles for an explicit target.
- List<WorldPoint>getSafeSpots10Plus()
Returns long-distance safespot tiles for the resolved target.
- List<WorldPoint>getSafeSpots10Plus(PlayerEx)
Returns long-distance safespot tiles for an explicit target.
- voidwalkTo(SafespotPlan)
Walks to a plan's closest safespot tile.
- booleanwalkToClosest()
Queries the resolved target and walks to the closest safespot when one is available.
- booleanwalkToClosest(PlayerEx)
Queries an explicit target and walks to the closest safespot when one is available.
analyze()static
public static SafespotResult analyze()Builds a safespot result for the currently resolved combat target.
Returns
Safespot query result.
analyze(PlayerEx)static
public static SafespotResult analyze(PlayerEx target)Builds a safespot result for an explicit player target.
Parameters
target- Wrapped player to inspect, or
nullfor the resolved target.
Returns
Safespot query result.
analyze(PlayerEx, SafespotOptions)static
public static SafespotResult analyze(PlayerEx target, SafespotOptions options)Builds a safespot result for a player target.
The target is resolved through CombatTimingAPI. Passing a non-null target also makes that player the explicit combat focus for timer, freeze, and PID tracking.
Parameters
target- Wrapped player to inspect, or
nullfor the resolved target. options- Query options, or
nullfor defaults.
Returns
Safespot query result.
analyzeTargetName(String)static
public static SafespotResult analyzeTargetName(String playerName)Builds a safespot result after resolving a player name as the combat focus.
Parameters
playerName- RuneScape name to inspect.
Returns
Safespot query result.
analyzeTargetName(String, SafespotOptions)static
public static SafespotResult analyzeTargetName(String playerName, SafespotOptions options)Builds a safespot result after resolving a player name as the combat focus.
Parameters
playerName- RuneScape name to inspect.
options- Query options, or
nullfor defaults.
Returns
Safespot query result.
clearPlan()static
public static void clearPlan()Clears the cached safespot result.
getAllSafeSpots()static
public static List<WorldPoint> getAllSafeSpots()Returns all safespot tiles for the resolved target.
Returns
Immutable combined safespot list.
getAllSafeSpots(PlayerEx)static
public static List<WorldPoint> getAllSafeSpots(PlayerEx target)Returns all safespot tiles for an explicit target.
Parameters
target- Wrapped player to inspect, or
nullfor the resolved target.
Returns
Immutable combined safespot list.
getClosestAttackTile()static
public static WorldPoint getClosestAttackTile()Returns the closest visible attack tile for the resolved target.
Returns
Closest attack tile, or null.
getClosestAttackTile(PlayerEx)static
public static WorldPoint getClosestAttackTile(PlayerEx target)Returns the closest visible attack tile for an explicit target.
Parameters
target- Wrapped player to inspect, or
nullfor the resolved target.
Returns
Closest attack tile, or null.
getClosestSafeSpotTile()static
public static WorldPoint getClosestSafeSpotTile()Returns the closest reachable safespot for the resolved target.
Returns
Closest safespot tile, or null.
getClosestSafeSpotTile(PlayerEx)static
public static WorldPoint getClosestSafeSpotTile(PlayerEx target)Returns the closest reachable safespot for an explicit target.
Parameters
target- Wrapped player to inspect, or
nullfor the resolved target.
Returns
Closest safespot tile, or null.
getLatestPlan()static
public static SafespotPlan getLatestPlan()Returns the latest completed safespot plan.
Returns
Latest plan, or null.
getLatestResult()static
public static SafespotResult getLatestResult()Returns the latest safespot query result.
Returns
Latest result.
getSafeSpots0To10()static
public static List<WorldPoint> getSafeSpots0To10()Returns close safespot tiles for the resolved target.
Returns
Immutable list of tiles at target distance 0..10.
getSafeSpots0To10(PlayerEx)static
public static List<WorldPoint> getSafeSpots0To10(PlayerEx target)Returns close safespot tiles for an explicit target.
Parameters
target- Wrapped player to inspect, or
nullfor the resolved target.
Returns
Immutable list of tiles at target distance 0..10.
getSafeSpots10Plus()static
public static List<WorldPoint> getSafeSpots10Plus()Returns long-distance safespot tiles for the resolved target.
Returns
Immutable list of tiles at target distance 11+.
getSafeSpots10Plus(PlayerEx)static
public static List<WorldPoint> getSafeSpots10Plus(PlayerEx target)Returns long-distance safespot tiles for an explicit target.
Parameters
target- Wrapped player to inspect, or
nullfor the resolved target.
Returns
Immutable list of tiles at target distance 11+.
walkTo(SafespotPlan)static
public static void walkTo(SafespotPlan plan)Walks to a plan's closest safespot tile.
Parameters
plan- Safespot plan to apply.
walkToClosest()static
public static boolean walkToClosest()Queries the resolved target and walks to the closest safespot when one is available.
Returns
true when a movement command was issued.
walkToClosest(PlayerEx)static
public static boolean walkToClosest(PlayerEx target)Queries an explicit target and walks to the closest safespot when one is available.
Parameters
target- Wrapped player to inspect, or
nullfor the resolved target.
Returns
true when a movement command was issued.
Also allowed
Every class has these, as in plain Java.
equals, toString