Class User
java.lang.Object
privbot.hooks.User
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classOne read of the local overhead:User.Overhead.isReadable()false means nothing can be said about the prayer the server shows — never treat it as "no overhead". -
Method Summary
Modifier and TypeMethodDescriptionintboosted(net.runelite.api.Skill skill) intintgetExperience(net.runelite.api.Skill skill) intdoublenet.runelite.api.PlayerReturns the localPlayerthrough the game client.net.runelite.api.coords.WorldPointintintintbooleanbooleanisIdle()booleanbooleanisMoving()booleanThe overhead prayer icon the server draws on the local player, with "could not read it" kept apart from "nothing drawn" —getLocalPlayer().getOverheadIcon()answersnullfor both.intrealLevel(net.runelite.api.Skill skill)
-
Method Details
-
getUsername
- Returns:
- the local player's name, or "" when there is no player or no name (see
ctx.player.name())
-
getLocation
public net.runelite.api.coords.WorldPoint getLocation()- Returns:
- the player's drawn tile from the adapter, or null when unreadable (see
ctx.player.tile()andserverTile())
-
isMoving
public boolean isMoving()- Returns:
- whether the pose animation differs from the idle pose; false also when unreadable (see
ctx.player.isMoving())
-
getAnimation
public int getAnimation()- Returns:
- the current animation id, -1 for none and also when unreadable (see
ctx.player.animation())
-
isAnimating
public boolean isAnimating()- Returns:
- whether
getAnimation()is not -1
-
isIdle
public boolean isIdle()- Returns:
- neither animating nor moving (both read false when unreadable, so this reads true then)
-
isInCombat
public boolean isInCombat()- Returns:
- the adapter's in-combat read; false when unreadable
-
getOpponentName
- Returns:
- the adapter's current opponent name, or ""
-
getHitpoints
public int getHitpoints()- Returns:
- current (boosted) hitpoints; 0 when unreadable (see
ctx.player.hitpoints())
-
getMaxHitpoints
public int getMaxHitpoints()- Returns:
- base hitpoints level; 0 when unreadable
-
getHitpointsPercent
public double getHitpointsPercent()- Returns:
- current / base hitpoints as a percentage; 100 when the base level cannot be read
-
getRunEnergy
public int getRunEnergy()- Returns:
- run energy 0..100; 0 when unreadable (see
ctx.game.observedRunEnergy())
-
isRunEnabled
public boolean isRunEnabled()- Returns:
- whether OSRS varp 173 reads 1; false when unreadable (see
ctx.game.observedRunEnabled())
-
boosted
public int boosted(net.runelite.api.Skill skill) - Parameters:
skill- the skill- Returns:
- the current level; 0 when unreadable (see
ctx.skills.observedBoosted)
-
realLevel
public int realLevel(net.runelite.api.Skill skill) - Parameters:
skill- the skill- Returns:
- the base level; 0 when unreadable (see
ctx.skills.observedReal)
-
getExperience
public int getExperience(net.runelite.api.Skill skill) - Parameters:
skill- the skill- Returns:
- experience; 0 when unreadable (see
ctx.skills.xp)
-
getSpecialAttack
public int getSpecialAttack()- Returns:
- special attack energy 0..100 from the adapter; 0 when unreadable (see
ctx.combat.observedSpecialAttackPercent())
-
getLocalPlayer
public net.runelite.api.Player getLocalPlayer()Returns the localPlayerthrough the game client. Plugins should prefer this overclient.getLocalPlayer()so the adapter can route requests through its profile-aware accessors. -
overheadProtection
The overhead prayer icon the server draws on the local player, with "could not read it" kept apart from "nothing drawn" —getLocalPlayer().getOverheadIcon()answersnullfor both. On Impact, Elorin and SpawnPK the server's own icon id is translated to aHeadIcon(on Elorin curses included: Deflect Magic isHeadIcon.DEFLECT_MAGE); other servers read the RuneLite player. Never null.
-