Class Blackboard
java.lang.Object
privbot.hooks.Blackboard
Run/script-scoped key-value scratchpad ("memory") for workflow flows and plugins.
Distinct from the Vars hook, which reads live game varbits/varps. A Blackboard
is created empty per workflow run (shared between the action executor and condition evaluator) and
carries author-defined state across steps and loop iterations — counters, a chosen target item, etc.
Backed by a ConcurrentHashMap: the workflow runner thread sets/reads while a
condition evaluator on another thread may read concurrently. Keys are plain strings; values are
arbitrary objects. null keys are ignored (no-op / default) so callers need not null-check.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all entries.Returns the raw value forkey, ornullif absent (orkeyis null).intReturns the value atkeyas a string: aStringis returned as-is, any other non-null value is stringified viaString.valueOf(Object); absent/null returnsdef.booleanTrue ifkeyis present (and non-null).intAddsbyto the int value atkey, creating it at 0 if absent (or if the existing value is non-numeric), stores the result, and returns the new value.voidStoresvalueunderkey.
-
Constructor Details
-
Blackboard
public Blackboard()
-
-
Method Details
-
set
-
get
-
getInt
-
getString
Returns the value atkeyas a string: aStringis returned as-is, any other non-null value is stringified viaString.valueOf(Object); absent/null returnsdef. -
increment
Addsbyto the int value atkey, creating it at 0 if absent (or if the existing value is non-numeric), stores the result, and returns the new value. Anullkey is a no-op that returns 0. -
has
True ifkeyis present (and non-null). -
clear
public void clear()Removes all entries. Called when a run ends.
-