AI Recipe: Bot Using Memory API And Behavior Tree

Short recommendation recipe for reading memory and feeding Behavior Tree automation.

Bot Using Memory API And Behavior Tree

FieldValue
ComplexityMedium
ExamplePOE2 Helper
End GoalRead a small amount of memory, show it to the user, and let Behavior Tree use the same values.
Key TechnologiesMemory API, Behavior Tree, Blazor window, shared script variables

Use When

  • The bot logic already lives in Behavior Tree.
  • A script needs to read memory and expose a few values to that tree.
  • The user also needs a small window showing those values.
  • A full ImGui bot panel would be too much.

Example Illustration

Path of Exile 2 Helper - Auto HP/MP shows this pattern: a small status/config window, memory reads in C#, and Behavior Tree nodes using the values.

Small status and configuration window

Memory values passed to Behavior Tree

Behavior Tree consuming memory-backed values

Shape

  • Read only the memory values the Behavior Tree needs.
  • Store or expose those values in a small shared values object or script variables.
  • Show the same values in a compact Blazor window.
  • Let Behavior Tree nodes read the values and decide what to do.
  • Show process/window loss clearly in the UI.

Choices

  • How the user picks the process/window.
  • Which values must be shared with Behavior Tree.
  • Which values are only for display.
  • Whether the window is normal, topmost, or compact.
  • Whether Behavior Tree reads script variables or calls a script/service.

APIs To Look Up

  • IBlazorWindow
  • BlazorReactiveComponent<T>
  • IDialogWindowUnstableScriptingApi
  • IWindowHandle
  • IWindowSelector
  • IWindowMatcher
  • IBehaviorTreeAccessor
  • ScriptVariable<T>
  • IProcess

Avoid

  • Large control panels.
  • Treating the window as an overlay rendering layer.
  • Hiding process attach/read failures.
  • Persisting raw handles, process ids, or runtime addresses.
  • windows-subsystems/blazor-windows.md
  • windows-subsystems/window-handles.md
  • memory/processes.md
  • auras/overview.md
  • scripting/runtime.md