Uses of Class
privbot.api.Observed
Packages that use Observed
Package
Description
The PrivBot plugin API boundary: what is supported, and which version of it a runtime provides.
ctx.* facades: inventory, bank, NPCs, widgets, and the other one-liners.-
Uses of Observed in privbot.api
Methods in privbot.api that return ObservedModifier and TypeMethodDescriptionstatic <T> Observed<T> Observed.absent()A successful read that observed nothing.static <T> Observed<T> A successful read that observed nothing, with a note saying what was looked for.static <T> Observed<T> Runs a read and turns any exception it throws into UNREADABLE.Keeps a VALUE that matchestest; a VALUE that does not becomes ABSENT.<R> Observed<R> Chains a read that depends on this one.<R> Observed<R> Transforms a VALUE.static <T> Observed<T> Observed.of(T value) A successful read holdingvalue.static <T> Observed<T> Observed.ofNullable(T value, String reasonIfNull) Converts an existing nullable read whosenullmeans "could not read" (the convention ofSkills.observedLevel,Game.observedRunEnabledand the otherobserved*reads that predate this class).static <T> Observed<T> Observed.ofPresentOrAbsent(T value) Converts a read whosenullgenuinely means "observed: nothing there" (a resolved interacting target on a client where the read itself cannot fail).Falls back to another read only when this one is UNREADABLE (a second source for the same fact).static <T> Observed<T> Observed.unreadable(String reason) A read that could not be made.Methods in privbot.api with parameters of type ObservedModifier and TypeMethodDescriptionstatic booleanstatic booleanstatic BooleanObserved.toNullableBoolean(Observed<Boolean> o) Converts a boolean read into the nullableBooleanconvention (null = cannot tell).Method parameters in privbot.api with type arguments of type Observed -
Uses of Observed in privbot.hooks
Methods in privbot.hooks that return ObservedModifier and TypeMethodDescriptionLocalPlayer.animation()The player's current animation id in this server's numbering;-1is a real answer (no animation).The value of a variable by name, from this server's evidence-backed names (VarRegistry).Loadouts.captureCarried()Reads what is carried, one entry per item id, with the role of each.Loadouts.captureWorn()Reads what is worn, by slot.Pvp.fight(PvpQuery players, ThreatQuery threats) Collects the local player, opponents, threats, containers and spec orb within one client-thread callback.Observed<net.runelite.api.Player> LocalPlayer.get()The localPlayer.LocalPlayer.healthRatio()The health bar's filled amount (out ofLocalPlayer.healthScale());-1means no health bar is drawn, which is a real answer, not "dead".LocalPlayer.healthScale()Recovery.held()Whether bot actions are held because the client saw a forced move (a jail pull, a burst of teleports).LocalPlayer.hitpoints()Current (boosted) hitpoints (Skills.observedLevel(net.runelite.api.Skill, boolean)).Recovery.holdReason()Observed<net.runelite.api.Actor> LocalPlayer.interacting()Who the player is interacting with.Recovery.isActive()LocalPlayer.isAnimating()Whether the player stands atdestination's landing point (Impact: within a few tiles of the catalog's point, same plane).LocalPlayer.isMoving()Whether the player is moving: the pose animation differs from the idle pose (the same test asctx.user.isMoving(), which answers false when it cannot tell).Loads a saved setup.What a name resolves to on this server, without reading it.LocalPlayer.maxHitpoints()Pvp.measuredDamage(String weapon, boolean special) Historical Elorin PvP capture distribution for a weapon and attack kind.LocalPlayer.name()Pvp.FightObserver.observe()Batch one frame and new local events.Prayer.observedActive(String name) Whether the prayer with this in-game name ("Protect from Melee") is on, with "cannot tell" kept apart:Prayer.isActive(String)answers false for that, and a guard that re-toggles a prayer it cannot read turns it OFF.Skills.observedBoosted(String skillName) Skills.observedBoosted(Skill)by in-game name.Skills.observedBoosted(net.runelite.api.Skill skill) The current (boosted or drained) level as anObserved; UNREADABLE as forSkills.observedReal(Skill).Dialogue.observedCanContinue()Whether a "Continue" surface is shown, or UNREADABLE when the read could not be made (Dialogue.canContinue()answers false for that).Dialogue.observedEnterInputOpen()Whether an enter-amount / enter-text prompt owns the chatbox, or UNREADABLE when that cannot be read.Bank.observedOpen()Whether the bank interface is drawn, or UNREADABLE when that cannot be told.Dialogue.observedOpen()Whether a dialogue is open, or UNREADABLE when the read could not be made.Prayer.observedQuickPrayersActive()Whether quick prayers are on, or UNREADABLE wherePrayer.isQuickPrayersActive()would log UNSUPPORTED and answer false (this client's quick-prayer flag cannot be read, or Orion's varbit could not be read).Skills.observedReal(String skillName) Skills.observedReal(Skill)by in-game name ("Attack", "Hitpoints").Skills.observedReal(net.runelite.api.Skill skill) The base (real) level as anObserved: UNREADABLE when this client's skill levels cannot be read or have not arrived from the server yet, never a placeholder 99 or a 0.Combat.observedSpecialAttackArmed()Whether the special attack orb is armed as anObserved:Combat.specialAttackArmedOrNull()with its null turned into UNREADABLE.Combat.observedSpecialAttackPercent()Special attack energy 0–100 as anObserved:Combat.specialAttackPercentOrNull()with its null turned into UNREADABLE (never the 0Combat.getSpecialAttackPercent()answers for that).Game.observedTicksSince(int earlierTick) Ticks elapsed sinceearlierTick(a value an earlierGame.tick()returned).Vars.observedVarbit(int id) A varbit's value, or UNREADABLE when it cannot be read: this client's varbits cannot be read, the id has no definition on this client, or its varp is out of range.Vars.observedVarp(int id) A varp's value, or UNREADABLE when it cannot be read.Pvp.riskValue(FightFrame frame, Map<Integer, RiskValuation.ItemRule> itemRules, Boolean skulled, Boolean protectItem, int ordinarySlots, int skulledSlots, boolean prayerAddsSlot) Estimate loss from both containers in a detached fight frame using caller-verified item values, death rules, skull and prayer observations.Observed<net.runelite.api.coords.WorldPoint> Finds the nearest tile out of every hazard.Observed<net.runelite.api.coords.WorldPoint> LocalPlayer.serverTile()Where the SERVER has put the player: the first tile of its path, which leads the drawnLocalPlayer.tile()while walking.Reads the fight once.Threats.snapshot(ThreatQuery query) Reads the fight once.Game.tick()The game's tick counter (one per 600 ms server tick), with "cannot read" kept apart:Game.getTickCount()answers -1 for that, which tick arithmetic easily mistakes for a number.Observed<net.runelite.api.coords.WorldPoint> LocalPlayer.tile()Where the player is drawn (the client's player location).Pvp.wildernessLevel(WildernessModel verifiedRules) Read the local server tile and apply caller-verified wilderness rules.Skills.xp(Skill)by in-game name.Skills.xp(net.runelite.api.Skill skill) Experience inskill.Methods in privbot.hooks with parameters of type ObservedModifier and TypeMethodDescriptionEvents.Frame.Builder.localAnimation(Observed<Integer> v) Events.Frame.Builder.localHitpoints(Observed<Integer> v)