Class VarRegistry
java.lang.Object
privbot.hooks.VarRegistry
The evidence-backed names
ctx.vars.byName(...) knows on one server.
Two sources, in priority order:
- the named varps and varbits PrivBot itself uses on this client (Impact, Elorin, SpawnPK), each checked against the server, and kept current when the client updates;
- a bundled list per server for the others (Orion), each entry checked against that server.
A name in neither is unknown, and byName answers UNREADABLE for it: an OSRS id is never assumed to hold
on another server (Elorin's varbit ids are its own, OSRS raw + 22000; SpawnPK reads varbits as 0).
Names are matched case-insensitively with spaces, hyphens and underscores treated alike, so
"run enabled" finds RUN_ENABLED. Sub-keys such as Varp.RUN_ENABLED.trueValues are not
names. Immutable once built.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classOne named variable.static enumWhether a name resolves to a whole varp or a varbit. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic VarRegistryempty()names()static StringCanonical spelling: upper case, runs of anything other than letters and digits become one underscore.static VarRegistryof(Collection<VarRegistry.Entry> entries) Builds a registry from explicit entries (tests, or a plugin's own captured names).
-
Field Details
-
RESOURCE
-
-
Method Details
-
empty
- Returns:
- a registry that knows no names
-
of
Builds a registry from explicit entries (tests, or a plugin's own captured names). A later entry with the same name replaces an earlier one.- Parameters:
entries- the entries- Returns:
- the registry
-
find
- Parameters:
name- a name in any spelling- Returns:
- the entry, or null when the name has no evidence-backed entry on this server
-
names
-
normalize
-